From 25b9868bd75d83a771c98dc48e41579b3072ee3d Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 15:54:56 -0800 Subject: [PATCH 01/18] feat(esm): moving account data deleter batch delete to esm --- lambdas/account-data-deleter-batch-delete/package.json | 1 + .../src/dyanmoUtils.integration.ts | 6 +++--- .../account-data-deleter-batch-delete/src/dynamoUtils.ts | 2 +- .../src/externalCaller/deleteMutation.spec.ts | 4 ++-- .../src/externalCaller/deleteMutation.ts | 2 +- .../account-data-deleter-batch-delete/src/index.spec.ts | 8 ++++---- lambdas/account-data-deleter-batch-delete/src/index.ts | 6 +++--- .../account-data-deleter-batch-delete/src/test/utils.ts | 2 +- packages/tsconfig/lambda.json | 7 +++++-- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/lambdas/account-data-deleter-batch-delete/package.json b/lambdas/account-data-deleter-batch-delete/package.json index c9671ab32..14e4cfa18 100644 --- a/lambdas/account-data-deleter-batch-delete/package.json +++ b/lambdas/account-data-deleter-batch-delete/package.json @@ -5,6 +5,7 @@ "license": "ISC", "author": "", "main": "dist/index.js", + "type": "module", "files": [ "dist", "package.json" diff --git a/lambdas/account-data-deleter-batch-delete/src/dyanmoUtils.integration.ts b/lambdas/account-data-deleter-batch-delete/src/dyanmoUtils.integration.ts index d8b0c8e03..6542bab60 100644 --- a/lambdas/account-data-deleter-batch-delete/src/dyanmoUtils.integration.ts +++ b/lambdas/account-data-deleter-batch-delete/src/dyanmoUtils.integration.ts @@ -1,9 +1,9 @@ import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; import { BatchGetCommand } from '@aws-sdk/lib-dynamodb'; -import { config } from './config'; -import { BatchDeleteDyanmoClient } from './dynamoUtils'; -import { seedData, truncateTable } from './test/utils'; +import { config } from './config.ts'; +import { BatchDeleteDyanmoClient } from './dynamoUtils.ts'; +import { seedData, truncateTable } from './test/utils.ts'; describe('Data fetcher', () => { const client = new DynamoDBClient({ diff --git a/lambdas/account-data-deleter-batch-delete/src/dynamoUtils.ts b/lambdas/account-data-deleter-batch-delete/src/dynamoUtils.ts index bc9060bdf..9219c5029 100644 --- a/lambdas/account-data-deleter-batch-delete/src/dynamoUtils.ts +++ b/lambdas/account-data-deleter-batch-delete/src/dynamoUtils.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import { BatchWriteCommand, BatchWriteCommandInput, diff --git a/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.spec.ts b/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.spec.ts index ff47648e7..4d1c98e9f 100644 --- a/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.spec.ts +++ b/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.spec.ts @@ -1,5 +1,5 @@ -import { config } from '../config'; -import { deleteUserMutationCaller, userApiCalls } from './deleteMutation'; +import { config } from '../config.ts'; +import { deleteUserMutationCaller, userApiCalls } from './deleteMutation.ts'; import nock from 'nock'; describe('deleteUser mutation test', () => { diff --git a/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.ts b/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.ts index b4f4751cb..d9af74720 100644 --- a/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.ts +++ b/lambdas/account-data-deleter-batch-delete/src/externalCaller/deleteMutation.ts @@ -1,5 +1,5 @@ import { backOff } from 'exponential-backoff'; -import { config } from '../config'; +import { config } from '../config.ts'; /** * Function that establishes the number of back off attempts diff --git a/lambdas/account-data-deleter-batch-delete/src/index.spec.ts b/lambdas/account-data-deleter-batch-delete/src/index.spec.ts index 1bc5cc578..a52bf2bb8 100644 --- a/lambdas/account-data-deleter-batch-delete/src/index.spec.ts +++ b/lambdas/account-data-deleter-batch-delete/src/index.spec.ts @@ -1,8 +1,8 @@ -import { BatchDeleteDyanmoClient } from './dynamoUtils'; +import { BatchDeleteDyanmoClient } from './dynamoUtils.ts'; import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; -import { config } from './config'; -import * as DeleteMutation from './externalCaller/deleteMutation'; -import { deleteUsers } from './index'; +import { config } from './config.ts'; +import * as DeleteMutation from './externalCaller/deleteMutation.ts'; +import { deleteUsers } from './index.ts'; import * as Sentry from '@sentry/aws-serverless'; describe('deleteUsers spec test', () => { diff --git a/lambdas/account-data-deleter-batch-delete/src/index.ts b/lambdas/account-data-deleter-batch-delete/src/index.ts index 1ba48924e..db85e42c8 100644 --- a/lambdas/account-data-deleter-batch-delete/src/index.ts +++ b/lambdas/account-data-deleter-batch-delete/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; import { serverLogger } from '@pocket-tools/ts-logger'; @@ -11,9 +11,9 @@ Sentry.init({ }); import { EventBridgeEvent } from 'aws-lambda'; -import { BatchDeleteDyanmoClient } from './dynamoUtils'; +import { BatchDeleteDyanmoClient } from './dynamoUtils.ts'; import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; -import { deleteUserMutationCaller } from './externalCaller/deleteMutation'; +import { deleteUserMutationCaller } from './externalCaller/deleteMutation.ts'; const dynamoDBClient = new DynamoDBClient({ region: config.aws.region, diff --git a/lambdas/account-data-deleter-batch-delete/src/test/utils.ts b/lambdas/account-data-deleter-batch-delete/src/test/utils.ts index 64a0fa5d5..8241e4cbe 100644 --- a/lambdas/account-data-deleter-batch-delete/src/test/utils.ts +++ b/lambdas/account-data-deleter-batch-delete/src/test/utils.ts @@ -8,7 +8,7 @@ import { } from '@aws-sdk/lib-dynamodb'; import { chunk } from 'lodash'; -import { config } from '../config'; +import { config } from '../config.ts'; /** * Seed data of consecutive stringified integers, hash key only diff --git a/packages/tsconfig/lambda.json b/packages/tsconfig/lambda.json index 4a6353ff2..2426b2d0a 100644 --- a/packages/tsconfig/lambda.json +++ b/packages/tsconfig/lambda.json @@ -1,8 +1,11 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "target": "es2017", - "module": "commonjs", + "target": "ES2024", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, "outDir": "dist", "sourceMap": true, "esModuleInterop": true, From 3224780c9fe4a5fd09f89d2671c4230ae172c78c Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 15:56:37 -0800 Subject: [PATCH 02/18] feat(esm): moving account data deleter events to esm --- lambdas/account-data-deleter-events/package.json | 1 + .../src/handlers/accountDelete/index.spec.ts | 6 +++--- .../src/handlers/accountDelete/index.ts | 6 +++--- lambdas/account-data-deleter-events/src/index.spec.ts | 4 ++-- lambdas/account-data-deleter-events/src/index.ts | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lambdas/account-data-deleter-events/package.json b/lambdas/account-data-deleter-events/package.json index 5522a2dd5..7b5b1e70e 100644 --- a/lambdas/account-data-deleter-events/package.json +++ b/lambdas/account-data-deleter-events/package.json @@ -9,6 +9,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.spec.ts b/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.spec.ts index 0f33f4646..da317273b 100644 --- a/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.spec.ts +++ b/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.spec.ts @@ -1,7 +1,7 @@ -import { config } from '../../config'; +import { config } from '../../config.ts'; import nock from 'nock'; -import { accountDeleteHandler } from './'; -import { callQueueDeleteEndpoint } from './postRequest'; +import { accountDeleteHandler } from './index.ts'; +import { callQueueDeleteEndpoint } from './postRequest.ts'; import { SQSRecord } from 'aws-lambda'; describe('accountDelete handler', () => { diff --git a/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.ts b/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.ts index d6d67b75e..105ea9f34 100644 --- a/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.ts +++ b/lambdas/account-data-deleter-events/src/handlers/accountDelete/index.ts @@ -1,10 +1,10 @@ -import { AccountDeleteEvent } from '../../schemas/accountDeleteEvent'; +import { AccountDeleteEvent } from '../../schemas/accountDeleteEvent.ts'; import { callQueueDeleteEndpoint, callStripeDeleteEndpoint, -} from './postRequest'; +} from './postRequest.ts'; import { SQSRecord } from 'aws-lambda'; -import { AggregateError } from '../../errors/AggregateError'; +import { AggregateError } from '../../errors/AggregateError.ts'; type AccountDeleteBody = { userId: string; diff --git a/lambdas/account-data-deleter-events/src/index.spec.ts b/lambdas/account-data-deleter-events/src/index.spec.ts index 9b90a0d34..04f7796d2 100644 --- a/lambdas/account-data-deleter-events/src/index.spec.ts +++ b/lambdas/account-data-deleter-events/src/index.spec.ts @@ -1,5 +1,5 @@ -import { Event, handlers } from './handlers'; -import { handlerFn } from './index'; +import { Event, handlers } from './handlers/index.ts'; +import { handlerFn } from './index.ts'; import { SQSEvent } from 'aws-lambda'; import * as Sentry from '@sentry/aws-serverless'; diff --git a/lambdas/account-data-deleter-events/src/index.ts b/lambdas/account-data-deleter-events/src/index.ts index 12ae1dfaf..689864aca 100644 --- a/lambdas/account-data-deleter-events/src/index.ts +++ b/lambdas/account-data-deleter-events/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -7,7 +7,7 @@ Sentry.init({ serverName: config.app.name, }); import { SQSBatchItemFailure, SQSEvent } from 'aws-lambda'; -import { handlers } from './handlers'; +import { handlers } from './handlers/index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; export async function handlerFn(event: SQSEvent): Promise { From e82b5c16b035e87ced52aa5d93f059dcc7df76ff Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 15:58:33 -0800 Subject: [PATCH 03/18] feat(esm): moving account delete monitor --- lambdas/account-delete-monitor/package.json | 1 + lambdas/account-delete-monitor/src/dynamodb.ts | 2 +- .../src/externalCaller/deleteMutation.spec.ts | 4 ++-- .../src/externalCaller/deleteMutation.ts | 2 +- .../src/handlers/accountDeleteHandler.integration.ts | 10 +++++----- .../src/handlers/accountDeleteHandler.spec.ts | 4 ++-- .../src/handlers/accountDeleteHandler.ts | 10 +++++----- .../src/handlers/accountMergeHandler.integration.ts | 8 ++++---- .../src/handlers/accountMergeHandler.spec.ts | 4 ++-- .../src/handlers/accountMergeHandler.ts | 6 +++--- lambdas/account-delete-monitor/src/handlers/index.ts | 4 ++-- lambdas/account-delete-monitor/src/index.spec.ts | 4 ++-- lambdas/account-delete-monitor/src/index.ts | 4 ++-- lambdas/account-delete-monitor/src/utils.spec.ts | 2 +- 14 files changed, 33 insertions(+), 32 deletions(-) diff --git a/lambdas/account-delete-monitor/package.json b/lambdas/account-delete-monitor/package.json index 7b2d174c1..47cd40ec9 100644 --- a/lambdas/account-delete-monitor/package.json +++ b/lambdas/account-delete-monitor/package.json @@ -9,6 +9,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-delete-monitor/src/dynamodb.ts b/lambdas/account-delete-monitor/src/dynamodb.ts index 4c0fbe8b6..fb971536a 100644 --- a/lambdas/account-delete-monitor/src/dynamodb.ts +++ b/lambdas/account-delete-monitor/src/dynamodb.ts @@ -1,6 +1,6 @@ import { DynamoDBClient, DynamoDBClientConfig } from '@aws-sdk/client-dynamodb'; import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; -import { config } from './config'; +import { config } from './config.ts'; /** Initialize outside of handler to follow best practices * Note that TCP connection reuse is enabled by default in v3 diff --git a/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.spec.ts b/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.spec.ts index 0500060ff..abf2a01b9 100644 --- a/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.spec.ts +++ b/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.spec.ts @@ -1,5 +1,5 @@ -import { config } from '../config'; -import { deleteUserMutationCaller, userApiCalls } from './deleteMutation'; +import { config } from '../config.ts'; +import { deleteUserMutationCaller, userApiCalls } from './deleteMutation.ts'; import nock from 'nock'; describe('deleteUser mutation test', () => { diff --git a/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.ts b/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.ts index cc46546de..df54f84f4 100644 --- a/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.ts +++ b/lambdas/account-delete-monitor/src/externalCaller/deleteMutation.ts @@ -1,5 +1,5 @@ import { backOff } from 'exponential-backoff'; -import { config } from '../config'; +import { config } from '../config.ts'; /** * Function that establishes the number of back off attempts diff --git a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.integration.ts b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.integration.ts index a55481159..5ea282bc1 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.integration.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.integration.ts @@ -1,10 +1,10 @@ -import { accountDeleteHandler } from './accountDeleteHandler'; +import { accountDeleteHandler } from './accountDeleteHandler.ts'; import { SQSRecord } from 'aws-lambda'; -import { client, dynamo } from '../dynamodb'; +import { client, dynamo } from '../dynamodb.ts'; import { GetCommand, PutCommand } from '@aws-sdk/lib-dynamodb'; -import { config } from '../config'; -import * as deleteMutation from '../externalCaller/deleteMutation'; -import { truncateTable } from '../test/utils'; +import { config } from '../config.ts'; +import * as deleteMutation from '../externalCaller/deleteMutation.ts'; +import { truncateTable } from '../test/utils.ts'; describe('Account delete handler', () => { const record = { diff --git a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.spec.ts b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.spec.ts index 3e3f95051..33119bd1a 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.spec.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.spec.ts @@ -1,5 +1,5 @@ -import { client } from '../dynamodb'; -import { accountDeleteHandler } from './accountDeleteHandler'; +import { client } from '../dynamodb.ts'; +import { accountDeleteHandler } from './accountDeleteHandler.ts'; import { type SQSRecord } from 'aws-lambda'; describe('Account delete handler', () => { diff --git a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.ts b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.ts index 1804b8687..135d15c70 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountDeleteHandler.ts @@ -1,11 +1,11 @@ import { SQSRecord } from 'aws-lambda'; -import { client } from '../dynamodb'; +import { client } from '../dynamodb.ts'; import { GetCommand, PutCommand } from '@aws-sdk/lib-dynamodb'; -import { config } from '../config'; +import { config } from '../config.ts'; // import { expirationTimestamp } from '../utils'; -import { epochMsToIsoDate } from '../utils'; -import { DeleteRequestModel } from '../types'; -import { deleteUserMutationCaller } from '../externalCaller/deleteMutation'; +import { epochMsToIsoDate } from '../utils.ts'; +import { DeleteRequestModel } from '../types.ts'; +import { deleteUserMutationCaller } from '../externalCaller/deleteMutation.ts'; /** * Store the account deletion request in DynamoDB for tracking, and to diff --git a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.integration.ts b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.integration.ts index 079951f48..b459ca816 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.integration.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.integration.ts @@ -1,9 +1,9 @@ import { SQSRecord } from 'aws-lambda'; -import { client, dynamo } from '../dynamodb'; +import { client, dynamo } from '../dynamodb.ts'; import { GetCommand, PutCommand } from '@aws-sdk/lib-dynamodb'; -import { config } from '../config'; -import { accountMergeHandler } from './accountMergeHandler'; -import { truncateTable } from '../test/utils'; +import { config } from '../config.ts'; +import { accountMergeHandler } from './accountMergeHandler.ts'; +import { truncateTable } from '../test/utils.ts'; describe('Account merge handler', () => { beforeEach(async () => { diff --git a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.spec.ts b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.spec.ts index 2c8813f4d..a108dc6cc 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.spec.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.spec.ts @@ -1,5 +1,5 @@ -import { client } from '../dynamodb'; -import { accountMergeHandler } from './accountMergeHandler'; +import { client } from '../dynamodb.ts'; +import { accountMergeHandler } from './accountMergeHandler.ts'; import { type SQSRecord } from 'aws-lambda'; describe('Account merge handler', () => { diff --git a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.ts b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.ts index 066b37318..01240acdb 100644 --- a/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.ts +++ b/lambdas/account-delete-monitor/src/handlers/accountMergeHandler.ts @@ -1,9 +1,9 @@ import { SQSRecord } from 'aws-lambda'; -import { client } from '../dynamodb'; +import { client } from '../dynamodb.ts'; import { UpdateCommand } from '@aws-sdk/lib-dynamodb'; -import { config } from '../config'; +import { config } from '../config.ts'; // import { expirationTimestamp } from '../utils'; -import { UserMergeEvent } from '../types'; +import { UserMergeEvent } from '../types.ts'; /** * Store records to identify history of merged accounts. diff --git a/lambdas/account-delete-monitor/src/handlers/index.ts b/lambdas/account-delete-monitor/src/handlers/index.ts index 952ac987c..cc178d46b 100644 --- a/lambdas/account-delete-monitor/src/handlers/index.ts +++ b/lambdas/account-delete-monitor/src/handlers/index.ts @@ -1,6 +1,6 @@ import { SQSRecord } from 'aws-lambda'; -import { accountDeleteHandler } from './accountDeleteHandler'; -import { accountMergeHandler } from './accountMergeHandler'; +import { accountDeleteHandler } from './accountDeleteHandler.ts'; +import { accountMergeHandler } from './accountMergeHandler.ts'; export enum Event { ACCOUNT_DELETION = 'account-deletion', diff --git a/lambdas/account-delete-monitor/src/index.spec.ts b/lambdas/account-delete-monitor/src/index.spec.ts index adc3fca68..64a9145da 100644 --- a/lambdas/account-delete-monitor/src/index.spec.ts +++ b/lambdas/account-delete-monitor/src/index.spec.ts @@ -1,5 +1,5 @@ -import { Event, handlers } from './handlers'; -import { processor } from './index'; +import { Event, handlers } from './handlers/index.ts'; +import { processor } from './index.ts'; import { type SQSEvent } from 'aws-lambda'; import * as Sentry from '@sentry/aws-serverless'; diff --git a/lambdas/account-delete-monitor/src/index.ts b/lambdas/account-delete-monitor/src/index.ts index 4d38156da..4806d0afe 100644 --- a/lambdas/account-delete-monitor/src/index.ts +++ b/lambdas/account-delete-monitor/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -12,7 +12,7 @@ import type { SQSBatchResponse, SQSBatchItemFailure, } from 'aws-lambda'; -import { handlers } from './handlers'; +import { handlers } from './handlers/index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; /** diff --git a/lambdas/account-delete-monitor/src/utils.spec.ts b/lambdas/account-delete-monitor/src/utils.spec.ts index 5e4b488fb..b522a15ba 100644 --- a/lambdas/account-delete-monitor/src/utils.spec.ts +++ b/lambdas/account-delete-monitor/src/utils.spec.ts @@ -1,4 +1,4 @@ -import * as utils from './utils'; +import * as utils from './utils.ts'; describe('util functions', () => { describe('epochMsToIsoDate', () => { From 53b496fdef646ec2f2f601c2ad8fe6782fff3caa Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:01:44 -0800 Subject: [PATCH 04/18] feat(esm): moving user list search indexing to esm --- .../src/handlers/accountDelete/postRequest.ts | 2 +- .../src/handlers/index.ts | 2 +- .../user-list-search-indexing/package.json | 1 + .../src/helper.spec.ts | 6 +- .../user-list-search-indexing/src/helper.ts | 4 +- .../src/itemDelete.ts | 6 +- .../src/itemUpdate.ts | 6 +- .../src/userListImport.ts | 6 +- .../user-list-search-indexing/tsconfig.json | 1 - .../src/events/generated/schema.json | 5344 ----------------- 10 files changed, 17 insertions(+), 5361 deletions(-) diff --git a/lambdas/account-data-deleter-events/src/handlers/accountDelete/postRequest.ts b/lambdas/account-data-deleter-events/src/handlers/accountDelete/postRequest.ts index 40a28c65e..904edede6 100644 --- a/lambdas/account-data-deleter-events/src/handlers/accountDelete/postRequest.ts +++ b/lambdas/account-data-deleter-events/src/handlers/accountDelete/postRequest.ts @@ -1,5 +1,5 @@ import fetchRetry from 'fetch-retry'; -import { config } from '../../config'; +import { config } from '../../config.ts'; const newFetch = fetchRetry(fetch); diff --git a/lambdas/account-data-deleter-events/src/handlers/index.ts b/lambdas/account-data-deleter-events/src/handlers/index.ts index cf026979a..a1767f902 100644 --- a/lambdas/account-data-deleter-events/src/handlers/index.ts +++ b/lambdas/account-data-deleter-events/src/handlers/index.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { accountDeleteHandler } from './accountDelete'; +import { accountDeleteHandler } from './accountDelete/index.ts'; export enum Event { ACCOUNT_DELETION = 'account-deletion', diff --git a/lambdas/user-list-search-indexing/package.json b/lambdas/user-list-search-indexing/package.json index 80d3a67d0..1f0f259c2 100644 --- a/lambdas/user-list-search-indexing/package.json +++ b/lambdas/user-list-search-indexing/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "", "main": "dist/index.js", + "type": "module", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-indexing/src/helper.spec.ts b/lambdas/user-list-search-indexing/src/helper.spec.ts index ee4cfe22e..b4c805251 100644 --- a/lambdas/user-list-search-indexing/src/helper.spec.ts +++ b/lambdas/user-list-search-indexing/src/helper.spec.ts @@ -1,8 +1,8 @@ -import { config } from './config'; +import { config } from './config/index.ts'; import nock from 'nock'; -import { processUserImport, processUserItem } from './helper'; +import { processUserImport, processUserItem } from './helper.ts'; -import { UserItemsSqsMessage, UserListImportSqsMessage } from './types'; +import { UserItemsSqsMessage, UserListImportSqsMessage } from './types.ts'; describe('Item functions', () => { describe('itemDelete', () => { diff --git a/lambdas/user-list-search-indexing/src/helper.ts b/lambdas/user-list-search-indexing/src/helper.ts index 1ca77439c..65f7ff9d1 100644 --- a/lambdas/user-list-search-indexing/src/helper.ts +++ b/lambdas/user-list-search-indexing/src/helper.ts @@ -1,6 +1,6 @@ -import { UserItemsSqsMessage, UserListImportSqsMessage } from './types'; +import { UserItemsSqsMessage, UserListImportSqsMessage } from './types.ts'; import { nanoid } from 'nanoid'; -import { config } from './config'; +import { config } from './config/index.ts'; /** * Processes messages from the itemDelete queue or the itemUpdate queues. diff --git a/lambdas/user-list-search-indexing/src/itemDelete.ts b/lambdas/user-list-search-indexing/src/itemDelete.ts index 4a4a76553..e7787bfa5 100644 --- a/lambdas/user-list-search-indexing/src/itemDelete.ts +++ b/lambdas/user-list-search-indexing/src/itemDelete.ts @@ -1,11 +1,11 @@ -import { config } from './config'; +import { config } from './config/index.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); import { SQSEvent, SQSRecord } from 'aws-lambda'; -import { processUserItem } from './helper'; -import { UserItemsSqsMessage } from './types'; +import { processUserItem } from './helper.ts'; +import { UserItemsSqsMessage } from './types.ts'; export const processor = async (event: SQSEvent): Promise => { return await Promise.all( diff --git a/lambdas/user-list-search-indexing/src/itemUpdate.ts b/lambdas/user-list-search-indexing/src/itemUpdate.ts index f0ab87947..b5b5c1302 100644 --- a/lambdas/user-list-search-indexing/src/itemUpdate.ts +++ b/lambdas/user-list-search-indexing/src/itemUpdate.ts @@ -1,13 +1,13 @@ -import { config } from './config'; +import { config } from './config/index.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); import type { SQSEvent, SQSRecord } from 'aws-lambda'; -import { processUserItem } from './helper'; +import { processUserItem } from './helper.ts'; -import { UserItemsSqsMessage } from './types'; +import { UserItemsSqsMessage } from './types.ts'; export const processor = async (event: SQSEvent): Promise => { return await Promise.all( diff --git a/lambdas/user-list-search-indexing/src/userListImport.ts b/lambdas/user-list-search-indexing/src/userListImport.ts index 0a4e8a21e..42a49c6de 100644 --- a/lambdas/user-list-search-indexing/src/userListImport.ts +++ b/lambdas/user-list-search-indexing/src/userListImport.ts @@ -1,11 +1,11 @@ -import { config } from './config'; +import { config } from './config/index.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); -import type { UserListImportSqsMessage } from './types'; +import type { UserListImportSqsMessage } from './types.ts'; import type { SQSEvent, SQSRecord } from 'aws-lambda'; -import { processUserImport } from './helper'; +import { processUserImport } from './helper.ts'; export const processor = async (event: SQSEvent): Promise => { return await Promise.all( diff --git a/lambdas/user-list-search-indexing/tsconfig.json b/lambdas/user-list-search-indexing/tsconfig.json index 1ac15d060..34b628a03 100644 --- a/lambdas/user-list-search-indexing/tsconfig.json +++ b/lambdas/user-list-search-indexing/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "tsconfig/lambda.json", "compilerOptions": { - "module": "commonjs", "outDir": "dist", }, "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], diff --git a/packages/event-bridge/src/events/generated/schema.json b/packages/event-bridge/src/events/generated/schema.json index 03ad0d79b..e69de29bb 100644 --- a/packages/event-bridge/src/events/generated/schema.json +++ b/packages/event-bridge/src/events/generated/schema.json @@ -1,5344 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "AccountDelete": { - "properties": { - "detail": { - "$ref": "#/definitions/AccountPayload" - }, - "detail-type": { - "const": "account-deletion", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "AccountEmailUpdated": { - "properties": { - "detail": { - "$ref": "#/definitions/AccountPayload" - }, - "detail-type": { - "const": "account-email-updated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "AccountEvent": { - "anyOf": [ - { - "$ref": "#/definitions/AccountDelete" - }, - { - "$ref": "#/definitions/AccountEmailUpdated" - }, - { - "$ref": "#/definitions/AccountRegistration" - }, - { - "$ref": "#/definitions/AccountPasswordChanged" - } - ] - }, - "AccountPasswordChanged": { - "properties": { - "detail": { - "$ref": "#/definitions/AccountPayload" - }, - "detail-type": { - "const": "account-password-changed", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "AccountPayload": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": [ - "string", - "null" - ] - }, - "email": { - "type": "string" - }, - "eventType": { - "type": "string" - }, - "guid": { - "type": [ - "number", - "null" - ] - }, - "hashedGuid": { - "type": [ - "string", - "null" - ] - }, - "hashedId": { - "type": [ - "string", - "null" - ] - }, - "ipAddress": { - "type": [ - "string", - "null" - ] - }, - "isNative": { - "type": [ - "boolean", - "null" - ] - }, - "isPremium": { - "type": "boolean" - }, - "isTrusted": { - "type": [ - "boolean", - "null" - ] - }, - "language": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "snowplowDomainUserId": { - "type": [ - "string", - "null" - ] - }, - "timestamp": { - "type": "number" - }, - "traceId": { - "type": [ - "string", - "null" - ] - }, - "userAgent": { - "type": [ - "string", - "null" - ] - }, - "userId": { - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "email", - "isPremium", - "userId", - "apiId", - "timestamp", - "version", - "eventType" - ], - "type": "object" - }, - "AccountPocketEventType": { - "anyOf": [ - { - "const": "account-deletion", - "type": "string" - }, - { - "const": "account-email-updated", - "type": "string" - }, - { - "const": "User Registration", - "type": "string" - }, - { - "const": "account-password-changed", - "type": "string" - } - ] - }, - "AccountRegistration": { - "properties": { - "detail": { - "properties": { - "email": { - "type": "string" - }, - "encodedUserId": { - "type": "string" - }, - "locale": { - "type": "string" - }, - "userId": { - "type": "string" - } - }, - "required": [ - "email", - "encodedUserId", - "userId", - "locale" - ], - "type": "object" - }, - "detail-type": { - "const": "User Registration", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "AddItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "ADD_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "AddTags": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "ADD_TAGS", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ArchiveItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "ARCHIVE_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "BaseEvent": { - "properties": { - "detail": {}, - "detail-type": { - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail-type", - "source", - "detail" - ], - "type": "object" - }, - "BasicListItemEventPayloadContext": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - } - }, - "required": [ - "user", - "apiUser" - ], - "type": "object" - }, - "ClearTags": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "CLEAR_TAGS", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CollectionAuthor": { - "properties": { - "active": { - "type": "boolean" - }, - "bio": { - "type": "string" - }, - "collection_author_id": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - } - }, - "required": [ - "collection_author_id", - "name", - "active" - ], - "type": "object" - }, - "CollectionCreated": { - "properties": { - "detail": { - "$ref": "#/definitions/CollectionPayload" - }, - "detail-type": { - "const": "collection-created", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CollectionEvent": { - "anyOf": [ - { - "$ref": "#/definitions/CollectionCreated" - }, - { - "$ref": "#/definitions/CollectionUpdated" - } - ] - }, - "CollectionLanguage": { - "enum": [ - "DE", - "EN" - ], - "type": "string" - }, - "CollectionPartnership": { - "properties": { - "blurb": { - "type": "string" - }, - "collection_partnership_id": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/CollectionPartnershipType" - }, - "url": { - "type": "string" - } - }, - "required": [ - "collection_partnership_id", - "name", - "blurb", - "image_url", - "type", - "url" - ], - "type": "object" - }, - "CollectionPartnershipType": { - "enum": [ - "PARTNERED", - "SPONSORED" - ], - "type": "string" - }, - "CollectionPayload": { - "description": "NOTE: The following is from the Content monorepo", - "properties": { - "collection": { - "properties": { - "IABChildCategory": { - "$ref": "#/definitions/IABChildCategory" - }, - "IABParentCategory": { - "$ref": "#/definitions/IABParentCategory" - }, - "authors": { - "items": { - "$ref": "#/definitions/CollectionAuthor" - }, - "type": "array" - }, - "createdAt": { - "type": "number" - }, - "curationCategory": { - "$ref": "#/definitions/CurationCategory" - }, - "excerpt": { - "type": "string" - }, - "externalId": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "intro": { - "type": "string" - }, - "labels": { - "items": { - "$ref": "#/definitions/Label" - }, - "type": "array" - }, - "language": { - "$ref": "#/definitions/CollectionLanguage" - }, - "partnership": { - "$ref": "#/definitions/CollectionPartnership" - }, - "publishedAt": { - "type": "number" - }, - "slug": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/CollectionStatus" - }, - "stories": { - "items": { - "$ref": "#/definitions/CollectionStory" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "updatedAt": { - "type": "number" - } - }, - "required": [ - "externalId", - "slug", - "title", - "status", - "language", - "authors", - "stories", - "createdAt", - "updatedAt" - ], - "type": "object" - } - }, - "required": [ - "collection" - ], - "type": "object" - }, - "CollectionPocketEventType": { - "anyOf": [ - { - "const": "collection-created", - "type": "string" - }, - { - "const": "collection-updated", - "type": "string" - } - ] - }, - "CollectionStatus": { - "enum": [ - "draft", - "review", - "published", - "archived" - ], - "type": "string" - }, - "CollectionStory": { - "properties": { - "authors": { - "items": { - "$ref": "#/definitions/CollectionStoryAuthor" - }, - "type": "array" - }, - "collection_story_id": { - "type": "string" - }, - "excerpt": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "is_from_partner": { - "type": "boolean" - }, - "publisher": { - "type": "string" - }, - "sort_order": { - "type": "number" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "collection_story_id", - "url", - "title", - "excerpt", - "authors", - "is_from_partner" - ], - "type": "object" - }, - "CollectionStoryAuthor": { - "properties": { - "name": { - "type": "string" - }, - "sort_order": { - "type": "number" - } - }, - "required": [ - "name", - "sort_order" - ], - "type": "object" - }, - "CollectionUpdated": { - "properties": { - "detail": { - "$ref": "#/definitions/CollectionPayload" - }, - "detail-type": { - "const": "collection-updated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CorpusEvent": { - "anyOf": [ - { - "$ref": "#/definitions/CorpusItemAdded" - }, - { - "$ref": "#/definitions/CorpusItemUpdated" - }, - { - "$ref": "#/definitions/CorpusItemRemoved" - } - ] - }, - "CorpusItemAdded": { - "properties": { - "detail": { - "$ref": "#/definitions/CorpusItemPayload" - }, - "detail-type": { - "const": "add-approved-item", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CorpusItemPayload": { - "properties": { - "approvedItemExternalId": { - "type": "string" - }, - "authors": { - "items": { - "properties": { - "name": { - "type": "string" - }, - "sortOrder": { - "type": "number" - } - }, - "required": [ - "name", - "sortOrder" - ], - "type": "object" - }, - "type": "array" - }, - "createdAt": { - "type": [ - "string", - "null" - ] - }, - "createdBy": { - "type": [ - "string", - "null" - ] - }, - "datePublished": { - "type": "string" - }, - "domainName": { - "type": "string" - }, - "eventType": { - "type": "string" - }, - "excerpt": { - "type": [ - "string", - "null" - ] - }, - "grade": { - "type": [ - "string", - "null" - ] - }, - "imageUrl": { - "type": [ - "string", - "null" - ] - }, - "isCollection": { - "type": "boolean" - }, - "isSyndicated": { - "type": "boolean" - }, - "isTimeSensitive": { - "type": "boolean" - }, - "language": { - "type": [ - "string", - "null" - ] - }, - "publisher": { - "type": [ - "string", - "null" - ] - }, - "source": { - "type": [ - "string", - "null" - ] - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "topic": { - "type": [ - "string", - "null" - ] - }, - "updatedAt": { - "type": [ - "string", - "null" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "eventType", - "approvedItemExternalId", - "url" - ], - "type": "object" - }, - "CorpusItemRemoved": { - "properties": { - "detail": { - "$ref": "#/definitions/CorpusItemPayload" - }, - "detail-type": { - "const": "remove-approved-item", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CorpusItemUpdated": { - "properties": { - "detail": { - "$ref": "#/definitions/CorpusItemPayload" - }, - "detail-type": { - "const": "update-approved-item", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "CorpusPocketEventType": { - "anyOf": [ - { - "const": "add-approved-item", - "type": "string" - }, - { - "const": "update-approved-item", - "type": "string" - }, - { - "const": "remove-approved-item", - "type": "string" - } - ] - }, - "CurationCategory": { - "properties": { - "collection_curation_category_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - } - }, - "required": [ - "collection_curation_category_id", - "name", - "slug" - ], - "type": "object" - }, - "DeleteItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "DELETE_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "DeleteTag": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "DELETE_TAG", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ExportReady": { - "properties": { - "detail": { - "properties": { - "archiveUrl": { - "type": [ - "string", - "null" - ] - }, - "encodedId": { - "type": "string" - }, - "requestId": { - "type": "string" - } - }, - "required": [ - "encodedId", - "requestId" - ], - "type": "object" - }, - "detail-type": { - "const": "list-export-ready", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ExportRequested": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "cursor": { - "type": "number" - }, - "encodedId": { - "type": "string" - }, - "part": { - "type": "number" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "requestId": { - "type": "string" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "userId": { - "type": "string" - } - }, - "required": [ - "apiUser", - "cursor", - "encodedId", - "part", - "requestId", - "user", - "userId" - ], - "type": "object" - }, - "detail-type": { - "const": "list-export-requested", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "FavoriteItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "FAVORITE_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "Filter": { - "enum": [ - "domain", - "title", - "tags", - "contentType", - "status", - "isFavorite", - "publishedDateRange", - "topic", - "excludeML", - "excludeCollections", - "addedDateRange", - "publisher", - "author" - ], - "type": "string" - }, - "ForgotPasswordRequest": { - "properties": { - "detail": { - "properties": { - "passwordResetInfo": { - "properties": { - "resetPasswordToken": { - "type": "string" - }, - "resetPasswordUsername": { - "type": "string" - }, - "timestamp": { - "description": "Note this is not a timestamp... its a formatted date string..", - "type": "string" - } - }, - "required": [ - "resetPasswordToken", - "resetPasswordUsername", - "timestamp" - ], - "type": "object" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "encodedId": { - "type": "string" - }, - "id": { - "type": "number" - } - }, - "required": [ - "id", - "encodedId", - "email" - ], - "type": "object" - } - }, - "required": [ - "passwordResetInfo", - "user" - ], - "type": "object" - }, - "detail-type": { - "const": "Forgot Password Request", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "IABChildCategory": { - "properties": { - "collection_iab_child_category_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - } - }, - "required": [ - "collection_iab_child_category_id", - "name", - "slug" - ], - "type": "object" - }, - "IABParentCategory": { - "properties": { - "collection_iab_parent_category_id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - } - }, - "required": [ - "collection_iab_parent_category_id", - "name", - "slug" - ], - "type": "object" - }, - "IncomingBaseEvent": { - "description": "A base event that all events should extend from when they are Received only, not sent.", - "properties": { - "account": { - "type": "string" - }, - "detail": {}, - "detail-type": { - "type": "string" - }, - "id": { - "type": "string" - }, - "region": { - "type": "string" - }, - "source": { - "type": "string" - }, - "time": { - "format": "date-time", - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "account", - "detail", - "detail-type", - "id", - "region", - "source", - "time", - "version" - ], - "type": "object" - }, - "Label": { - "properties": { - "collection_label_id": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "collection_label_id", - "name" - ], - "type": "object" - }, - "ListEvent": { - "anyOf": [ - { - "$ref": "#/definitions/AddItem" - }, - { - "$ref": "#/definitions/DeleteItem" - }, - { - "$ref": "#/definitions/FavoriteItem" - }, - { - "$ref": "#/definitions/UnfavoriteItem" - }, - { - "$ref": "#/definitions/ArchiveItem" - }, - { - "$ref": "#/definitions/UnarchiveItem" - }, - { - "$ref": "#/definitions/AddTags" - }, - { - "$ref": "#/definitions/ReplaceTags" - }, - { - "$ref": "#/definitions/ClearTags" - }, - { - "$ref": "#/definitions/RemoveTags" - }, - { - "$ref": "#/definitions/RenameTag" - }, - { - "$ref": "#/definitions/DeleteTag" - }, - { - "$ref": "#/definitions/UpdateTitle" - } - ] - }, - "ListPocketEventType": { - "anyOf": [ - { - "const": "ADD_ITEM", - "type": "string" - }, - { - "const": "DELETE_ITEM", - "type": "string" - }, - { - "const": "FAVORITE_ITEM", - "type": "string" - }, - { - "const": "UNFAVORITE_ITEM", - "type": "string" - }, - { - "const": "ARCHIVE_ITEM", - "type": "string" - }, - { - "const": "UNARCHIVE_ITEM", - "type": "string" - }, - { - "const": "ADD_TAGS", - "type": "string" - }, - { - "const": "REPLACE_TAGS", - "type": "string" - }, - { - "const": "CLEAR_TAGS", - "type": "string" - }, - { - "const": "REMOVE_TAGS", - "type": "string" - }, - { - "const": "RENAME_TAG", - "type": "string" - }, - { - "const": "DELETE_TAG", - "type": "string" - }, - { - "const": "UPDATE_TITLE", - "type": "string" - } - ] - }, - "PremiumPurchaseEvent": { - "properties": { - "detail": { - "properties": { - "purchase": { - "$ref": "#/definitions/Purchase" - }, - "user": { - "$ref": "#/definitions/PremiumUser" - } - }, - "required": [ - "purchase", - "user" - ], - "type": "object" - }, - "detail-type": { - "const": "Premium Purchase", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "PremiumUser": { - "properties": { - "email": { - "type": "string" - }, - "encodedId": { - "type": "string" - }, - "id": { - "type": "number" - } - }, - "required": [ - "email", - "encodedId", - "id" - ], - "type": "object" - }, - "Prospect": { - "properties": { - "approvedCorpusItem": { - "properties": { - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - }, - "authors": { - "type": "string" - }, - "createdAt": { - "type": "number" - }, - "curated": { - "type": "boolean" - }, - "domain": { - "type": "string" - }, - "excerpt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "imageUrl": { - "type": "string" - }, - "isCollection": { - "type": "boolean" - }, - "isSyndicated": { - "type": "boolean" - }, - "language": { - "type": "string" - }, - "prospectId": { - "type": "string" - }, - "prospectReviewStatus": { - "$ref": "#/definitions/ProspectReviewStatus" - }, - "prospectType": { - "type": "string" - }, - "publisher": { - "type": "string" - }, - "rank": { - "type": "number" - }, - "rejectedCorpusItem": { - "properties": { - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - }, - "reviewedAt": { - "type": "number" - }, - "reviewedBy": { - "type": "string" - }, - "saveCount": { - "type": "number" - }, - "scheduledSurfaceGuid": { - "type": "string" - }, - "title": { - "type": "string" - }, - "topic": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "id", - "prospectId", - "scheduledSurfaceGuid", - "prospectType", - "url", - "saveCount", - "rank", - "prospectReviewStatus" - ], - "type": "object" - }, - "ProspectBaseEvent": { - "properties": { - "detail": { - "$ref": "#/definitions/Prospect" - }, - "detail-type": { - "$ref": "#/definitions/ProspectPocketEventType" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ProspectDismissed": { - "properties": { - "detail": { - "$ref": "#/definitions/Prospect" - }, - "detail-type": { - "const": "prospect-dismiss", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ProspectEvent": { - "$ref": "#/definitions/ProspectDismissed" - }, - "ProspectPocketEventType": { - "const": "prospect-dismiss", - "type": "string" - }, - "ProspectReviewStatus": { - "enum": [ - "created", - "recommendation", - "corpus", - "rejected", - "dismissed" - ], - "type": "string" - }, - "Purchase": { - "properties": { - "amount": { - "type": "string" - }, - "cancelAtPeriodEnd": { - "type": "boolean" - }, - "isFree": { - "type": "boolean" - }, - "isTrial": { - "type": "boolean" - }, - "planInterval": { - "type": "string" - }, - "planType": { - "type": "string" - }, - "receiptId": { - "type": "string" - }, - "renewDate": { - "type": "string" - } - }, - "required": [ - "amount", - "cancelAtPeriodEnd", - "isFree", - "isTrial", - "planInterval", - "planType", - "receiptId", - "renewDate" - ], - "type": "object" - }, - "RemoveTags": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "REMOVE_TAGS", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "RenameTag": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "RENAME_TAG", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ReplaceTags": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "REPLACE_TAGS", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "Scope": { - "description": "Identifies the fields which were searched.", - "enum": [ - "all", - "all_contentful", - "title", - "excerpt", - "content", - "publisher" - ], - "type": "string" - }, - "SearchEvent": { - "$ref": "#/definitions/SearchResponseGenerated" - }, - "SearchPocketEventType": { - "const": "search_response_generated", - "type": "string" - }, - "SearchResponseGenerated": { - "properties": { - "detail": { - "properties": { - "event": { - "properties": { - "apiUser": { - "properties": { - "api_id": { - "type": "number" - }, - "is_native": { - "type": "boolean" - }, - "is_trusted": { - "type": "boolean" - } - }, - "required": [ - "api_id", - "is_native", - "is_trusted" - ], - "type": "object" - }, - "search": { - "description": "Event triggered when SearchResults are returned from Pocket's search api (for saves and corpus). Entities included: api_user; sometimes user, feature_flag.", - "properties": { - "id": { - "description": "A unique ID for this result", - "type": "string" - }, - "result_count_total": { - "description": "Number of results in the result set.", - "type": "number" - }, - "result_urls": { - "description": "Ordered result of urls in the search result connection", - "items": { - "type": "string" - }, - "type": "array" - }, - "returned_at": { - "description": "UNIX time in seconds when the results were sent by the Search API.", - "type": "number" - }, - "search_query": { - "description": "The search query", - "properties": { - "filter": { - "description": "Identifies the filters which were applied to the search, if applicable.", - "items": { - "$ref": "#/definitions/Filter" - }, - "type": "array" - }, - "language": { - "description": "2-5 character language code to indicate the language the search was performed in", - "type": "string" - }, - "query": { - "type": "string" - }, - "scope": { - "$ref": "#/definitions/Scope", - "description": "Identifies the fields which were searched." - } - }, - "required": [ - "filter", - "query", - "scope" - ], - "type": "object" - }, - "search_type": { - "description": "Identifies the corpus that was searched", - "type": "string" - } - }, - "required": [ - "id", - "result_count_total", - "result_urls", - "returned_at", - "search_query", - "search_type" - ], - "type": "object" - }, - "user": { - "properties": { - "guid": { - "type": "number" - }, - "hashed_guid": { - "type": "string" - }, - "hashed_user_id": { - "type": "string" - }, - "user_id": { - "type": "number" - } - }, - "type": "object" - } - }, - "required": [ - "search", - "user", - "apiUser" - ], - "type": "object" - } - }, - "required": [ - "event" - ], - "type": "object" - }, - "detail-type": { - "const": "search_response_generated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareContextUpdated": { - "properties": { - "detail": { - "properties": { - "pocketShare": { - "properties": { - "created_at": { - "type": "number" - }, - "note_length": { - "type": "number" - }, - "quote_count": { - "type": "number" - }, - "slug": { - "type": "string" - }, - "target_url": { - "type": "string" - } - }, - "required": [ - "target_url", - "created_at", - "slug", - "note_length", - "quote_count" - ], - "type": "object" - } - }, - "required": [ - "pocketShare" - ], - "type": "object" - }, - "detail-type": { - "const": "pocket_share_context_updated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareCreated": { - "properties": { - "detail": { - "properties": { - "pocketShare": { - "properties": { - "created_at": { - "type": "number" - }, - "note_length": { - "type": "number" - }, - "quote_count": { - "type": "number" - }, - "slug": { - "type": "string" - }, - "target_url": { - "type": "string" - } - }, - "required": [ - "target_url", - "created_at", - "slug", - "note_length", - "quote_count" - ], - "type": "object" - } - }, - "required": [ - "pocketShare" - ], - "type": "object" - }, - "detail-type": { - "const": "pocket_share_created", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareEvent": { - "anyOf": [ - { - "$ref": "#/definitions/ShareCreated" - }, - { - "$ref": "#/definitions/ShareContextUpdated" - } - ] - }, - "SharePocketEventType": { - "anyOf": [ - { - "const": "pocket_share_created", - "type": "string" - }, - { - "const": "pocket_share_context_updated", - "type": "string" - } - ] - }, - "ShareableList": { - "properties": { - "created_at": { - "description": "The timestamp in seconds when the item was created", - "type": "number" - }, - "description": { - "type": "string" - }, - "list_item_note_visibility": { - "$ref": "#/definitions/ShareableListVisibility" - }, - "moderated_by": { - "type": "string" - }, - "moderation_details": { - "type": "string" - }, - "moderation_reason": { - "type": "string" - }, - "moderation_status": { - "$ref": "#/definitions/ShareableListModerationVisibility" - }, - "restoration_reason": { - "type": "string" - }, - "shareable_list_external_id": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/ShareableListVisibility" - }, - "title": { - "type": "string" - }, - "updated_at": { - "description": "The timestamp in seconds when the item was last updated", - "type": "number" - }, - "user_id": { - "type": [ - "number" - ] - } - }, - "required": [ - "shareable_list_external_id", - "user_id", - "title", - "status", - "list_item_note_visibility", - "moderation_status", - "created_at" - ], - "type": "object" - }, - "ShareableListCreated": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_created", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListDeleted": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_deleted", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListEvent": { - "anyOf": [ - { - "$ref": "#/definitions/ShareableListCreated" - }, - { - "$ref": "#/definitions/ShareableListUpdated" - }, - { - "$ref": "#/definitions/ShareableListDeleted" - }, - { - "$ref": "#/definitions/ShareableListHidden" - }, - { - "$ref": "#/definitions/ShareableListUnhidden" - }, - { - "$ref": "#/definitions/ShareableListPublished" - }, - { - "$ref": "#/definitions/ShareableListUnpublished" - } - ] - }, - "ShareableListHidden": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_hidden", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListItem": { - "properties": { - "authors": { - "items": { - "type": "string" - }, - "type": "array" - }, - "created_at": { - "description": "The timestamp in seconds when the item was created", - "type": "number" - }, - "excerpt": { - "type": "string" - }, - "given_url": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "note": { - "type": "string" - }, - "publisher": { - "type": "string" - }, - "shareable_list_external_id": { - "type": "string" - }, - "shareable_list_item_external_id": { - "type": "string" - }, - "sort_order": { - "type": "number" - }, - "title": { - "type": "string" - }, - "updated_at": { - "description": "The timestamp in seconds when the item was last updated", - "type": "number" - } - }, - "required": [ - "shareable_list_item_external_id", - "shareable_list_external_id", - "given_url", - "sort_order", - "created_at" - ], - "type": "object" - }, - "ShareableListItemCreated": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListItemPocketEventType" - }, - "shareableListItem": { - "$ref": "#/definitions/ShareableListItem" - } - }, - "required": [ - "shareableListItem", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_item_created", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListItemDeleted": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListItemPocketEventType" - }, - "shareableListItem": { - "$ref": "#/definitions/ShareableListItem" - } - }, - "required": [ - "shareableListItem", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_item_deleted", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListItemEvent": { - "anyOf": [ - { - "$ref": "#/definitions/ShareableListItemCreated" - }, - { - "$ref": "#/definitions/ShareableListItemUpdated" - }, - { - "$ref": "#/definitions/ShareableListItemDeleted" - } - ] - }, - "ShareableListItemPocketEventType": { - "anyOf": [ - { - "const": "shareable_list_item_created", - "type": "string" - }, - { - "const": "shareable_list_item_updated", - "type": "string" - }, - { - "const": "shareable_list_item_deleted", - "type": "string" - } - ] - }, - "ShareableListItemUpdated": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListItemPocketEventType" - }, - "shareableListItem": { - "$ref": "#/definitions/ShareableListItem" - } - }, - "required": [ - "shareableListItem", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_item_updated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListModerationVisibility": { - "enum": [ - "VISIBLE", - "HIDDEN" - ], - "type": "string" - }, - "ShareableListPocketEventType": { - "anyOf": [ - { - "const": "shareable_list_created", - "type": "string" - }, - { - "const": "shareable_list_updated", - "type": "string" - }, - { - "const": "shareable_list_deleted", - "type": "string" - }, - { - "const": "shareable_list_hidden", - "type": "string" - }, - { - "const": "shareable_list_unhidden", - "type": "string" - }, - { - "const": "shareable_list_published", - "type": "string" - }, - { - "const": "shareable_list_unpublished", - "type": "string" - } - ] - }, - "ShareableListPublished": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_published", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListUnhidden": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_unhidden", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListUnpublished": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_unpublished", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListUpdated": { - "properties": { - "detail": { - "properties": { - "eventType": { - "$ref": "#/definitions/ShareableListPocketEventType" - }, - "shareableList": { - "$ref": "#/definitions/ShareableList" - } - }, - "required": [ - "shareableList", - "eventType" - ], - "type": "object" - }, - "detail-type": { - "const": "shareable_list_updated", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "ShareableListVisibility": { - "enum": [ - "PRIVATE", - "PUBLIC" - ], - "type": "string" - }, - "UnarchiveItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "UNARCHIVE_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "UnfavoriteItem": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "UNFAVORITE_ITEM", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - }, - "UpdateTitle": { - "properties": { - "detail": { - "properties": { - "apiUser": { - "properties": { - "apiId": { - "type": "string" - }, - "clientVersion": { - "type": "string" - }, - "isNative": { - "type": "boolean" - }, - "isTrusted": { - "type": "boolean" - }, - "name": { - "type": "string" - } - }, - "required": [ - "apiId" - ], - "type": "object" - }, - "eventType": { - "$ref": "#/definitions/ListPocketEventType" - }, - "request": { - "properties": { - "ipAddress": { - "type": "string" - }, - "language": { - "type": "string" - }, - "snowplowDomainSessionId": { - "type": "string" - }, - "snowplowDomainUserId": { - "type": "string" - }, - "userAgent": { - "type": "string" - } - }, - "type": "object" - }, - "savedItem": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "archivedAt": { - "type": "number" - }, - "favoritedAt": { - "type": "number" - }, - "id": { - "type": "string" - }, - "isArchived": { - "type": "boolean" - }, - "isFavorite": { - "type": "boolean" - }, - "item": { - "properties": { - "givenUrl": { - "type": "string" - } - }, - "required": [ - "givenUrl" - ], - "type": "object" - }, - "resolvedId": { - "type": "string" - }, - "status": { - "enum": [ - "UNREAD", - "ARCHIVED", - "DELETED", - "HIDDEN" - ], - "type": "string" - }, - "tags": { - "items": { - "properties": { - "_createdAt": { - "type": "number" - }, - "_deletedAt": { - "type": "number" - }, - "_updatedAt": { - "type": "number" - }, - "_version": { - "type": "number" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "savedItems": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "resolvedId", - "url", - "isFavorite", - "status", - "isArchived", - "item" - ], - "type": "object" - }, - "source": { - "type": "string" - }, - "tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "tagsUpdated": { - "items": { - "type": "string" - }, - "type": "array" - }, - "timestamp": { - "type": "number" - }, - "user": { - "properties": { - "email": { - "type": "string" - }, - "guid": { - "type": "number" - }, - "hashedGuid": { - "type": "string" - }, - "hashedId": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isPremium": { - "type": "boolean" - } - }, - "required": [ - "id", - "hashedId", - "isPremium" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "apiUser", - "eventType", - "savedItem", - "source", - "timestamp", - "user", - "version" - ], - "type": "object" - }, - "detail-type": { - "const": "UPDATE_TITLE", - "type": "string" - }, - "source": { - "type": "string" - } - }, - "required": [ - "detail", - "detail-type", - "source" - ], - "type": "object" - } - } -} From 9579e14c9d431c11edb16d0f31575fbc11764f43 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:02:54 -0800 Subject: [PATCH 05/18] feat(esm): moving annotations api events to esm --- lambdas/annotations-api-events/package.json | 1 + .../annotations-api-events/src/handlers/accountDelete.spec.ts | 4 ++-- lambdas/annotations-api-events/src/handlers/accountDelete.ts | 2 +- lambdas/annotations-api-events/src/handlers/index.ts | 2 +- lambdas/annotations-api-events/src/index.spec.ts | 4 ++-- lambdas/annotations-api-events/src/index.ts | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lambdas/annotations-api-events/package.json b/lambdas/annotations-api-events/package.json index 1c026c96f..1629e3f49 100644 --- a/lambdas/annotations-api-events/package.json +++ b/lambdas/annotations-api-events/package.json @@ -5,6 +5,7 @@ "license": "ISC", "author": "", "main": "dist/index.js", + "type": "module", "files": [ "dist", "package.json" diff --git a/lambdas/annotations-api-events/src/handlers/accountDelete.spec.ts b/lambdas/annotations-api-events/src/handlers/accountDelete.spec.ts index 419e866c6..27c241084 100644 --- a/lambdas/annotations-api-events/src/handlers/accountDelete.spec.ts +++ b/lambdas/annotations-api-events/src/handlers/accountDelete.spec.ts @@ -1,6 +1,6 @@ -import { config } from '../config'; +import { config } from '../config.ts'; import nock from 'nock'; -import { accountDeleteHandler } from './accountDelete'; +import { accountDeleteHandler } from './accountDelete.ts'; import { SQSRecord } from 'aws-lambda'; describe('accountDelete handler', () => { diff --git a/lambdas/annotations-api-events/src/handlers/accountDelete.ts b/lambdas/annotations-api-events/src/handlers/accountDelete.ts index 653902864..ef5001dc8 100644 --- a/lambdas/annotations-api-events/src/handlers/accountDelete.ts +++ b/lambdas/annotations-api-events/src/handlers/accountDelete.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { config } from '../config'; +import { config } from '../config.ts'; /** * Given an account delete event, queue SQS messages to delete chunks of the diff --git a/lambdas/annotations-api-events/src/handlers/index.ts b/lambdas/annotations-api-events/src/handlers/index.ts index cf026979a..982736d98 100644 --- a/lambdas/annotations-api-events/src/handlers/index.ts +++ b/lambdas/annotations-api-events/src/handlers/index.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { accountDeleteHandler } from './accountDelete'; +import { accountDeleteHandler } from './accountDelete.ts'; export enum Event { ACCOUNT_DELETION = 'account-deletion', diff --git a/lambdas/annotations-api-events/src/index.spec.ts b/lambdas/annotations-api-events/src/index.spec.ts index 18ac61397..bf4b7fe6f 100644 --- a/lambdas/annotations-api-events/src/index.spec.ts +++ b/lambdas/annotations-api-events/src/index.spec.ts @@ -1,5 +1,5 @@ -import { Event, handlers } from './handlers'; -import { processor } from './index'; +import { Event, handlers } from './handlers/index.ts'; +import { processor } from './index.ts'; import { SQSEvent } from 'aws-lambda'; import * as Sentry from '@sentry/aws-serverless'; diff --git a/lambdas/annotations-api-events/src/index.ts b/lambdas/annotations-api-events/src/index.ts index b2e875f82..7c2ded9b3 100644 --- a/lambdas/annotations-api-events/src/index.ts +++ b/lambdas/annotations-api-events/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -12,7 +12,7 @@ import type { SQSBatchResponse, SQSBatchItemFailure, } from 'aws-lambda'; -import { handlers } from './handlers'; +import { handlers } from './handlers/index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; /** * The main handler function which will be wrapped by Sentry prior to export. From f05e7e0344c8ba08126675dc7422b4f7fd337084 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:04:07 -0800 Subject: [PATCH 06/18] feat(esm): moving fxa webhook proxy gateway to esm --- lambdas/fxa-webook-proxy-gateway/package.json | 1 + lambdas/fxa-webook-proxy-gateway/src/config.ts | 2 +- .../fxa-webook-proxy-gateway/src/index.functional.ts | 10 +++++----- lambdas/fxa-webook-proxy-gateway/src/index.spec.ts | 4 ++-- lambdas/fxa-webook-proxy-gateway/src/index.ts | 8 ++++---- lambdas/fxa-webook-proxy-gateway/src/jwt.spec.ts | 2 +- lambdas/fxa-webook-proxy-gateway/src/jwt.ts | 4 ++-- lambdas/fxa-webook-proxy-gateway/src/sqs.ts | 2 +- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lambdas/fxa-webook-proxy-gateway/package.json b/lambdas/fxa-webook-proxy-gateway/package.json index a4e90d19f..4a0fdcd7c 100644 --- a/lambdas/fxa-webook-proxy-gateway/package.json +++ b/lambdas/fxa-webook-proxy-gateway/package.json @@ -6,6 +6,7 @@ "license": "ISC", "author": "", "main": "dist/index.js", + "type": "module", "files": [ "dist", "package.json" diff --git a/lambdas/fxa-webook-proxy-gateway/src/config.ts b/lambdas/fxa-webook-proxy-gateway/src/config.ts index 925a2727e..f0384317c 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/config.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/config.ts @@ -1,4 +1,4 @@ -import { EVENT } from './types'; +import { EVENT } from './types.ts'; const environment = process.env.ENVIRONMENT || 'development'; diff --git a/lambdas/fxa-webook-proxy-gateway/src/index.functional.ts b/lambdas/fxa-webook-proxy-gateway/src/index.functional.ts index c3eab345f..a881d30e9 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/index.functional.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/index.functional.ts @@ -1,15 +1,15 @@ -import { FxaJwt } from './jwt'; +import { FxaJwt } from './jwt.ts'; import * as Sentry from '@sentry/aws-serverless'; -import { eventHandler, formatResponse } from './index'; -import config from './config'; +import { eventHandler, formatResponse } from './index.ts'; +import config from './config.ts'; import { PurgeQueueCommand, ReceiveMessageCommand, ReceiveMessageCommandInput, } from '@aws-sdk/client-sqs'; -import { sqsClient } from './sqs'; +import { sqsClient } from './sqs.ts'; import { APIGatewayEvent } from 'aws-lambda'; -import { EVENT } from './types'; +import { EVENT } from './types.ts'; const sampleApiGatewayEvent: APIGatewayEvent = { body: null, diff --git a/lambdas/fxa-webook-proxy-gateway/src/index.spec.ts b/lambdas/fxa-webook-proxy-gateway/src/index.spec.ts index bee63875c..6f23f2095 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/index.spec.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/index.spec.ts @@ -2,8 +2,8 @@ import { createSuccessResponseMessage, formatResponse, generateEvents, -} from './index'; -import { EVENT, SqsEvent } from './types'; +} from './index.ts'; +import { EVENT, SqsEvent } from './types.ts'; describe('Handler functions', () => { describe('Format of API Gateway response', () => { diff --git a/lambdas/fxa-webook-proxy-gateway/src/index.ts b/lambdas/fxa-webook-proxy-gateway/src/index.ts index 633ea5a0e..99edc80a0 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/index.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/index.ts @@ -1,4 +1,4 @@ -import config from './config'; +import config from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -8,9 +8,9 @@ Sentry.init({ }); import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { FxaJwt } from './jwt'; -import { sendMessage } from './sqs'; -import { SqsEvent, FxaPayload } from './types'; +import { FxaJwt } from './jwt.ts'; +import { sendMessage } from './sqs.ts'; +import { SqsEvent, FxaPayload } from './types.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; /** * Format the response data diff --git a/lambdas/fxa-webook-proxy-gateway/src/jwt.spec.ts b/lambdas/fxa-webook-proxy-gateway/src/jwt.spec.ts index 9718b01d4..f6066979f 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/jwt.spec.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/jwt.spec.ts @@ -1,6 +1,6 @@ import jwt from 'jsonwebtoken'; import fs from 'fs'; -import { FxaJwt } from './jwt'; +import { FxaJwt } from './jwt.ts'; describe('jwt', () => { const publicKey = fs.readFileSync(__dirname + '/test/jwtRS256.key.pub', { diff --git a/lambdas/fxa-webook-proxy-gateway/src/jwt.ts b/lambdas/fxa-webook-proxy-gateway/src/jwt.ts index 7b87b36ba..53167b355 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/jwt.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/jwt.ts @@ -1,7 +1,7 @@ import jwt from 'jsonwebtoken'; import jwksClient from 'jwks-rsa'; -import config from './config'; -import { FxaPayload, FxaOpenIdConfigPayload } from './types'; +import config from './config.ts'; +import { FxaPayload, FxaOpenIdConfigPayload } from './types.ts'; export class FxaJwt { public readonly token: jwt.Jwt; diff --git a/lambdas/fxa-webook-proxy-gateway/src/sqs.ts b/lambdas/fxa-webook-proxy-gateway/src/sqs.ts index 5fe7ee4e4..635bf4d5b 100644 --- a/lambdas/fxa-webook-proxy-gateway/src/sqs.ts +++ b/lambdas/fxa-webook-proxy-gateway/src/sqs.ts @@ -3,7 +3,7 @@ import { SendMessageCommandOutput, SQSClient, } from '@aws-sdk/client-sqs'; -import config from './config'; +import config from './config.ts'; export const sqsClient = new SQSClient({ endpoint: config.aws.endpoint, From 7a956aa4290eac3c4d296215d79b3bd667853178 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:04:57 -0800 Subject: [PATCH 07/18] feat(esm): moving fxa webhook proxy sqs to esm --- lambdas/fxa-webook-proxy-sqs/package.json | 1 + lambdas/fxa-webook-proxy-sqs/src/index.spec.ts | 8 ++++---- lambdas/fxa-webook-proxy-sqs/src/index.ts | 4 ++-- lambdas/fxa-webook-proxy-sqs/src/mutations.ts | 6 +++--- lambdas/fxa-webook-proxy-sqs/src/secretManager.ts | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lambdas/fxa-webook-proxy-sqs/package.json b/lambdas/fxa-webook-proxy-sqs/package.json index 8ce4a781d..ec8aeeb4b 100644 --- a/lambdas/fxa-webook-proxy-sqs/package.json +++ b/lambdas/fxa-webook-proxy-sqs/package.json @@ -4,6 +4,7 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", diff --git a/lambdas/fxa-webook-proxy-sqs/src/index.spec.ts b/lambdas/fxa-webook-proxy-sqs/src/index.spec.ts index fcf14ead5..3e2f4a18e 100644 --- a/lambdas/fxa-webook-proxy-sqs/src/index.spec.ts +++ b/lambdas/fxa-webook-proxy-sqs/src/index.spec.ts @@ -1,8 +1,8 @@ -import * as fx from './index'; -import config from './config'; +import * as fx from './index.ts'; +import config from './config.ts'; import nock from 'nock'; -import * as secretManager from './secretManager'; -import * as mutations from './mutations'; +import * as secretManager from './secretManager.ts'; +import * as mutations from './mutations.ts'; describe('SQS Event Handler', () => { let handleMutationErrorsSpy; diff --git a/lambdas/fxa-webook-proxy-sqs/src/index.ts b/lambdas/fxa-webook-proxy-sqs/src/index.ts index b945c0ad7..cb9cdf782 100644 --- a/lambdas/fxa-webook-proxy-sqs/src/index.ts +++ b/lambdas/fxa-webook-proxy-sqs/src/index.ts @@ -1,4 +1,4 @@ -import config from './config'; +import config from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.app.sentry.dsn, @@ -14,7 +14,7 @@ import { passwordChangeMutation, submitDeleteMutation, submitEmailUpdatedMutation, -} from './mutations'; +} from './mutations.ts'; // these events are defined in ./gateway_lambda/config.ts export enum EVENT { diff --git a/lambdas/fxa-webook-proxy-sqs/src/mutations.ts b/lambdas/fxa-webook-proxy-sqs/src/mutations.ts index 8a1b16c18..43aae0119 100644 --- a/lambdas/fxa-webook-proxy-sqs/src/mutations.ts +++ b/lambdas/fxa-webook-proxy-sqs/src/mutations.ts @@ -1,10 +1,10 @@ import { SQSRecord } from 'aws-lambda'; -import config from './config'; -import { getFxaPrivateKey } from './secretManager'; +import config from './config.ts'; +import { getFxaPrivateKey } from './secretManager.ts'; import { generateJwt, PocketJWK } from '@pocket-tools/jwt-utils'; -import { FxaEvent } from '.'; +import { FxaEvent } from './index.ts'; // should match the reasons defined in user-api subgraph schema: // https://github.com/Pocket/user-api/blob/main/schema.graphql#L69 diff --git a/lambdas/fxa-webook-proxy-sqs/src/secretManager.ts b/lambdas/fxa-webook-proxy-sqs/src/secretManager.ts index 1e5364095..6c127919e 100644 --- a/lambdas/fxa-webook-proxy-sqs/src/secretManager.ts +++ b/lambdas/fxa-webook-proxy-sqs/src/secretManager.ts @@ -1,4 +1,4 @@ -import config from './config'; +import config from './config.ts'; import { fetchSecret } from '@pocket-tools/lambda-secrets'; //https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/classes/getsecretvaluecommand.html From f6facd9e2f446b469b9a69fda128833b06bd9167 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:05:49 -0800 Subject: [PATCH 08/18] feat(esm): moving instant sync events to esm --- lambdas/instant-sync-events/package.json | 1 + lambdas/instant-sync-events/src/clients.ts | 2 +- lambdas/instant-sync-events/src/handlerFn.integration.ts | 8 ++++---- lambdas/instant-sync-events/src/handlerFn.spec.ts | 2 +- lambdas/instant-sync-events/src/handlerFn.ts | 6 +++--- lambdas/instant-sync-events/src/index.ts | 4 ++-- lambdas/instant-sync-events/src/sqs.ts | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lambdas/instant-sync-events/package.json b/lambdas/instant-sync-events/package.json index ce8b51e12..a7d84465c 100644 --- a/lambdas/instant-sync-events/package.json +++ b/lambdas/instant-sync-events/package.json @@ -7,6 +7,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/instant-sync-events/src/clients.ts b/lambdas/instant-sync-events/src/clients.ts index 45fe01607..5c4fe333e 100644 --- a/lambdas/instant-sync-events/src/clients.ts +++ b/lambdas/instant-sync-events/src/clients.ts @@ -1,6 +1,6 @@ import knex, { Knex } from 'knex'; import { fetchSecret } from '@pocket-tools/lambda-secrets'; -import { config } from './config'; +import { config } from './config.ts'; import knexServerlessMysql from 'knex-serverless-mysql'; import serverlessMysql from 'serverless-mysql'; import * as mysql2 from 'mysql2'; diff --git a/lambdas/instant-sync-events/src/handlerFn.integration.ts b/lambdas/instant-sync-events/src/handlerFn.integration.ts index 0916a8c71..33c508f10 100644 --- a/lambdas/instant-sync-events/src/handlerFn.integration.ts +++ b/lambdas/instant-sync-events/src/handlerFn.integration.ts @@ -1,11 +1,11 @@ import { Knex } from 'knex'; -import { readClient, writeClient } from './clients'; +import { readClient, writeClient } from './clients.ts'; import * as LambdaSecrets from '@pocket-tools/lambda-secrets'; -import { Message, instantSyncHandler } from './handlerFn'; +import { Message, instantSyncHandler } from './handlerFn.ts'; import { SQSRecord } from 'aws-lambda'; -import { client as sqs } from './sqs'; +import { client as sqs } from './sqs.ts'; import { PurgeQueueCommand, ReceiveMessageCommand } from '@aws-sdk/client-sqs'; -import { config } from './config'; +import { config } from './config.ts'; jest.mock('@pocket-tools/lambda-secrets'); diff --git a/lambdas/instant-sync-events/src/handlerFn.spec.ts b/lambdas/instant-sync-events/src/handlerFn.spec.ts index 5450a437c..a88263a31 100644 --- a/lambdas/instant-sync-events/src/handlerFn.spec.ts +++ b/lambdas/instant-sync-events/src/handlerFn.spec.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { Message, filterUserIds } from './handlerFn'; +import { Message, filterUserIds } from './handlerFn.ts'; describe('filterUserIds', () => { it.each([ diff --git a/lambdas/instant-sync-events/src/handlerFn.ts b/lambdas/instant-sync-events/src/handlerFn.ts index a5dc585c4..f59e199d8 100644 --- a/lambdas/instant-sync-events/src/handlerFn.ts +++ b/lambdas/instant-sync-events/src/handlerFn.ts @@ -1,12 +1,12 @@ import { SQSRecord, SQSBatchResponse, SQSBatchItemFailure } from 'aws-lambda'; -import { readClient, writeClient } from './clients'; -import { client } from './sqs'; +import { readClient, writeClient } from './clients.ts'; +import { client } from './sqs.ts'; import { SendMessageBatchCommand, SendMessageBatchCommandOutput, SendMessageBatchRequestEntry, } from '@aws-sdk/client-sqs'; -import { config } from './config'; +import { config } from './config.ts'; import { nanoid } from 'nanoid'; import { serverLogger } from '@pocket-tools/ts-logger'; import { chunk } from 'lodash'; diff --git a/lambdas/instant-sync-events/src/index.ts b/lambdas/instant-sync-events/src/index.ts index 31916aa8d..08e4272cc 100644 --- a/lambdas/instant-sync-events/src/index.ts +++ b/lambdas/instant-sync-events/src/index.ts @@ -1,10 +1,10 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); import type { SQSEvent } from 'aws-lambda'; -import { instantSyncHandler } from './handlerFn'; +import { instantSyncHandler } from './handlerFn.ts'; /** * Processes messages originating from event bridge. The detail-type field in diff --git a/lambdas/instant-sync-events/src/sqs.ts b/lambdas/instant-sync-events/src/sqs.ts index ddef09208..c7cf7b3a6 100644 --- a/lambdas/instant-sync-events/src/sqs.ts +++ b/lambdas/instant-sync-events/src/sqs.ts @@ -1,5 +1,5 @@ import { SQSClient } from '@aws-sdk/client-sqs'; -import { config } from './config'; +import { config } from './config.ts'; export const client = new SQSClient({ endpoint: config.aws.sqs.endpoint, From c83d3eb8cbd324a22879e020ab1e2f32d432b217 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:07:11 -0800 Subject: [PATCH 09/18] feat(esm): moving sendgrid data to esm --- lambdas/sendgrid-data/package.json | 1 + lambdas/sendgrid-data/src/index.ts | 6 +++--- .../sendgrid-data/src/sendgrid/cloudwatch-metrics.spec.ts | 6 +++--- lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.ts | 8 ++++---- lambdas/sendgrid-data/src/sendgrid/firehose.spec.ts | 4 ++-- lambdas/sendgrid-data/src/sendgrid/firehose.ts | 4 ++-- lambdas/sendgrid-data/src/sendgrid/index.ts | 4 ++-- lambdas/sendgrid-data/src/sendgrid/util.spec.ts | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lambdas/sendgrid-data/package.json b/lambdas/sendgrid-data/package.json index 84e4d0dcb..fa82aa755 100644 --- a/lambdas/sendgrid-data/package.json +++ b/lambdas/sendgrid-data/package.json @@ -7,6 +7,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/sendgrid-data/src/index.ts b/lambdas/sendgrid-data/src/index.ts index 845d026cb..70cb21389 100644 --- a/lambdas/sendgrid-data/src/index.ts +++ b/lambdas/sendgrid-data/src/index.ts @@ -1,12 +1,12 @@ -import config from './config'; +import config from './config/index.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, release: config.sentry.release, environment: config.environment, }); -import { deliverEvents, logEventsError, logEventsReceived } from './sendgrid'; -import { captureException } from './sentry'; +import { deliverEvents, logEventsError, logEventsReceived } from './sendgrid/index.ts'; +import { captureException } from './sentry.ts'; import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda'; /** diff --git a/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.spec.ts b/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.spec.ts index 01858c508..27209b89f 100644 --- a/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.spec.ts +++ b/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.spec.ts @@ -1,4 +1,4 @@ -import { Event, EventType } from './event'; +import { Event, EventType } from './event.ts'; import { decorateEvent, deliver, @@ -6,8 +6,8 @@ import { eventToMetrics, mapEventToMetricName, getMetricWithDimensions, -} from './cloudwatch-metrics'; -import config from '../config'; +} from './cloudwatch-metrics.ts'; +import config from '../config/index.ts'; import { CloudWatchClient, MetricDatum } from '@aws-sdk/client-cloudwatch'; /** diff --git a/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.ts b/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.ts index 80c3fa189..2280de84f 100644 --- a/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.ts +++ b/lambdas/sendgrid-data/src/sendgrid/cloudwatch-metrics.ts @@ -4,10 +4,10 @@ import { CloudWatchClient, PutMetricDataCommand, } from '@aws-sdk/client-cloudwatch'; -import config from '../config'; -import { Event } from './event'; -import { chunkArray } from './util'; -import { addBreadcrumbs, captureException } from '../sentry'; +import config from '../config/index.ts'; +import { Event } from './event.ts'; +import { chunkArray } from './util.ts'; +import { addBreadcrumbs, captureException } from '../sentry.ts'; export type DimensionMapping = { [key: string]: any; diff --git a/lambdas/sendgrid-data/src/sendgrid/firehose.spec.ts b/lambdas/sendgrid-data/src/sendgrid/firehose.spec.ts index 887c46ef8..fdc0d35a5 100644 --- a/lambdas/sendgrid-data/src/sendgrid/firehose.spec.ts +++ b/lambdas/sendgrid-data/src/sendgrid/firehose.spec.ts @@ -1,6 +1,6 @@ import { FirehoseClient } from '@aws-sdk/client-firehose'; -import config from '../config'; -import { deliver, createRecords, encodeRecord } from './firehose'; +import config from '../config/index.ts'; +import { deliver, createRecords, encodeRecord } from './firehose.ts'; describe('firehose', () => { describe('deliver', () => { diff --git a/lambdas/sendgrid-data/src/sendgrid/firehose.ts b/lambdas/sendgrid-data/src/sendgrid/firehose.ts index 44c2d798c..b7bd451ae 100644 --- a/lambdas/sendgrid-data/src/sendgrid/firehose.ts +++ b/lambdas/sendgrid-data/src/sendgrid/firehose.ts @@ -4,8 +4,8 @@ import { PutRecordBatchCommandOutput, _Record, } from '@aws-sdk/client-firehose'; -import config from '../config'; -import { chunkArray } from './util'; +import config from '../config/index.ts'; +import { chunkArray } from './util.ts'; export const encodeRecord = (event: { [key: string]: any }): _Record => { return { diff --git a/lambdas/sendgrid-data/src/sendgrid/index.ts b/lambdas/sendgrid-data/src/sendgrid/index.ts index 83080e303..4b0c0d9b8 100644 --- a/lambdas/sendgrid-data/src/sendgrid/index.ts +++ b/lambdas/sendgrid-data/src/sendgrid/index.ts @@ -1,5 +1,5 @@ -import { deliver as deliverFirehose } from './firehose'; -import { deliver as deliverMetrics } from './cloudwatch-metrics'; +import { deliver as deliverFirehose } from './firehose.ts'; +import { deliver as deliverMetrics } from './cloudwatch-metrics.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; export const logEventsReceived = (events: any) => { diff --git a/lambdas/sendgrid-data/src/sendgrid/util.spec.ts b/lambdas/sendgrid-data/src/sendgrid/util.spec.ts index 18fea4fb0..d2f5ad0b5 100644 --- a/lambdas/sendgrid-data/src/sendgrid/util.spec.ts +++ b/lambdas/sendgrid-data/src/sendgrid/util.spec.ts @@ -1,4 +1,4 @@ -import { chunkArray } from './util'; +import { chunkArray } from './util.ts'; describe('util', () => { describe('chunkArray', () => { From dc25576f3ce2dd868b5931e40bb6d6d50b281a4d Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:08:32 -0800 Subject: [PATCH 10/18] feat(esm): moving shareable lists to esm --- lambdas/instant-sync-events/tsconfig.json | 2 +- lambdas/shareable-lists-api-events/package.json | 1 + .../src/handlers/accountDelete.spec.ts | 4 ++-- .../shareable-lists-api-events/src/handlers/accountDelete.ts | 2 +- lambdas/shareable-lists-api-events/src/handlers/index.ts | 2 +- lambdas/shareable-lists-api-events/src/index.spec.ts | 4 ++-- lambdas/shareable-lists-api-events/src/index.ts | 4 ++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lambdas/instant-sync-events/tsconfig.json b/lambdas/instant-sync-events/tsconfig.json index e95084793..a307e8817 100644 --- a/lambdas/instant-sync-events/tsconfig.json +++ b/lambdas/instant-sync-events/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "tsconfig/lambda.json", "compilerOptions": { - "module": "commonjs", + "rootDir": "src", "outDir": "dist", }, "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], diff --git a/lambdas/shareable-lists-api-events/package.json b/lambdas/shareable-lists-api-events/package.json index 23759affa..b3803ddff 100644 --- a/lambdas/shareable-lists-api-events/package.json +++ b/lambdas/shareable-lists-api-events/package.json @@ -9,6 +9,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/shareable-lists-api-events/src/handlers/accountDelete.spec.ts b/lambdas/shareable-lists-api-events/src/handlers/accountDelete.spec.ts index 8d4b4c1a2..2c08db467 100644 --- a/lambdas/shareable-lists-api-events/src/handlers/accountDelete.spec.ts +++ b/lambdas/shareable-lists-api-events/src/handlers/accountDelete.spec.ts @@ -1,6 +1,6 @@ -import { config } from '../config'; +import { config } from '../config.ts'; import nock from 'nock'; -import { accountDeleteHandler } from './accountDelete'; +import { accountDeleteHandler } from './accountDelete.ts'; import { SQSRecord } from 'aws-lambda'; describe('accountDelete handler', () => { diff --git a/lambdas/shareable-lists-api-events/src/handlers/accountDelete.ts b/lambdas/shareable-lists-api-events/src/handlers/accountDelete.ts index 9ae16f368..842fd5844 100644 --- a/lambdas/shareable-lists-api-events/src/handlers/accountDelete.ts +++ b/lambdas/shareable-lists-api-events/src/handlers/accountDelete.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { config } from '../config'; +import { config } from '../config.ts'; import fetchRetry from 'fetch-retry'; const newFetch = fetchRetry(fetch); diff --git a/lambdas/shareable-lists-api-events/src/handlers/index.ts b/lambdas/shareable-lists-api-events/src/handlers/index.ts index fa32c662d..9554ab25f 100644 --- a/lambdas/shareable-lists-api-events/src/handlers/index.ts +++ b/lambdas/shareable-lists-api-events/src/handlers/index.ts @@ -1,5 +1,5 @@ import { SQSRecord } from 'aws-lambda'; -import { accountDeleteHandler } from './accountDelete'; +import { accountDeleteHandler } from './accountDelete.ts'; // right hand value should map to the respective `detailType` in event bridge export enum Event { diff --git a/lambdas/shareable-lists-api-events/src/index.spec.ts b/lambdas/shareable-lists-api-events/src/index.spec.ts index e52add545..809c1cb97 100644 --- a/lambdas/shareable-lists-api-events/src/index.spec.ts +++ b/lambdas/shareable-lists-api-events/src/index.spec.ts @@ -1,5 +1,5 @@ -import { Event, handlers } from './handlers'; -import { processor } from './index'; +import { Event, handlers } from './handlers/index.ts'; +import { processor } from './index.ts'; import { SQSEvent, SQSRecord } from 'aws-lambda'; import * as Sentry from '@sentry/aws-serverless'; diff --git a/lambdas/shareable-lists-api-events/src/index.ts b/lambdas/shareable-lists-api-events/src/index.ts index befd67de8..66eaab1fc 100644 --- a/lambdas/shareable-lists-api-events/src/index.ts +++ b/lambdas/shareable-lists-api-events/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -11,7 +11,7 @@ import type { SQSBatchItemFailure, } from 'aws-lambda'; -import { handlers } from './handlers'; +import { handlers } from './handlers/index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; /** From 542bb1e4351b9792aed0df5dbf76033bff134aea Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:10:30 -0800 Subject: [PATCH 11/18] feat(esm): moving transactional emails to esm --- lambdas/transactional-emails/package.json | 1 + lambdas/transactional-emails/src/braze.spec.ts | 2 +- lambdas/transactional-emails/src/braze.ts | 4 ++-- .../src/handlers/accountDelete.spec.ts | 8 ++++---- .../transactional-emails/src/handlers/accountDelete.ts | 2 +- .../src/handlers/forgotPassword.spec.ts | 8 ++++---- .../src/handlers/forgotPassword.ts | 2 +- lambdas/transactional-emails/src/handlers/index.ts | 10 +++++----- .../src/handlers/listExportReady.spec.ts | 8 ++++---- .../src/handlers/listExportReady.ts | 2 +- .../src/handlers/premiumPurchaseHandler.spec.ts | 6 +++--- .../src/handlers/premiumPurchaseHandler.ts | 2 +- .../src/handlers/userRegistrationEventHandler.spec.ts | 8 ++++---- .../src/handlers/userRegistrationEventHandler.ts | 4 ++-- lambdas/transactional-emails/src/index.spec.ts | 2 +- lambdas/transactional-emails/src/index.ts | 4 ++-- lambdas/transactional-emails/src/ssm.ts | 2 +- 17 files changed, 38 insertions(+), 37 deletions(-) diff --git a/lambdas/transactional-emails/package.json b/lambdas/transactional-emails/package.json index 47671fc85..b06ab3a2b 100644 --- a/lambdas/transactional-emails/package.json +++ b/lambdas/transactional-emails/package.json @@ -9,6 +9,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "dev": "tsc -w", diff --git a/lambdas/transactional-emails/src/braze.spec.ts b/lambdas/transactional-emails/src/braze.spec.ts index 8db8b020f..8a5a01e1d 100644 --- a/lambdas/transactional-emails/src/braze.spec.ts +++ b/lambdas/transactional-emails/src/braze.spec.ts @@ -1,4 +1,4 @@ -import { generateSubscriptionPayloadForEmail } from './braze'; +import { generateSubscriptionPayloadForEmail } from './braze.ts'; describe('generateSubscriptionRequestBody', () => { it('should map subscription event', () => { diff --git a/lambdas/transactional-emails/src/braze.ts b/lambdas/transactional-emails/src/braze.ts index e2ac5914a..6fcccc907 100644 --- a/lambdas/transactional-emails/src/braze.ts +++ b/lambdas/transactional-emails/src/braze.ts @@ -1,7 +1,7 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; import fetchRetry from 'fetch-retry'; -import { getBrazeApiKey } from './ssm'; +import { getBrazeApiKey } from './ssm.ts'; import type { UsersTrackObject, UsersAliasObject, diff --git a/lambdas/transactional-emails/src/handlers/accountDelete.spec.ts b/lambdas/transactional-emails/src/handlers/accountDelete.spec.ts index e2c32432c..52677ac3d 100644 --- a/lambdas/transactional-emails/src/handlers/accountDelete.spec.ts +++ b/lambdas/transactional-emails/src/handlers/accountDelete.spec.ts @@ -1,10 +1,10 @@ import nock, { cleanAll } from 'nock'; import { SQSEvent, SQSRecord } from 'aws-lambda'; -import { config } from '../config'; -import * as ssm from '../ssm'; -import { sendAccountDeletionEmail } from '../braze'; +import { config } from '../config.ts'; +import * as ssm from '../ssm.ts'; +import { sendAccountDeletionEmail } from '../braze.ts'; import { PocketEventType } from '@pocket-tools/event-bridge'; -import { processor } from '..'; +import { processor } from '../index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; describe('accountDelete handler', () => { diff --git a/lambdas/transactional-emails/src/handlers/accountDelete.ts b/lambdas/transactional-emails/src/handlers/accountDelete.ts index f8c738f1c..eee8b2b18 100644 --- a/lambdas/transactional-emails/src/handlers/accountDelete.ts +++ b/lambdas/transactional-emails/src/handlers/accountDelete.ts @@ -1,4 +1,4 @@ -import { sendAccountDeletionEmail } from '../braze'; +import { sendAccountDeletionEmail } from '../braze.ts'; import { PocketEvent, PocketEventType } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/transactional-emails/src/handlers/forgotPassword.spec.ts b/lambdas/transactional-emails/src/handlers/forgotPassword.spec.ts index 9bbf8f4cb..b9c5edc6b 100644 --- a/lambdas/transactional-emails/src/handlers/forgotPassword.spec.ts +++ b/lambdas/transactional-emails/src/handlers/forgotPassword.spec.ts @@ -1,10 +1,10 @@ import nock, { cleanAll } from 'nock'; import { SQSEvent, SQSRecord } from 'aws-lambda'; -import { config } from '../config'; -import * as ssm from '../ssm'; -import { sendForgotPasswordEmail } from '../braze'; +import { config } from '../config.ts'; +import * as ssm from '../ssm.ts'; +import { sendForgotPasswordEmail } from '../braze.ts'; import { PocketEventType } from '@pocket-tools/event-bridge'; -import { processor } from '..'; +import { processor } from '../index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; describe('forgotPassword handler', () => { diff --git a/lambdas/transactional-emails/src/handlers/forgotPassword.ts b/lambdas/transactional-emails/src/handlers/forgotPassword.ts index 311990260..b6c37cde6 100644 --- a/lambdas/transactional-emails/src/handlers/forgotPassword.ts +++ b/lambdas/transactional-emails/src/handlers/forgotPassword.ts @@ -1,4 +1,4 @@ -import { sendForgotPasswordEmail } from '../braze'; +import { sendForgotPasswordEmail } from '../braze.ts'; import { PocketEventType, PocketEvent } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/transactional-emails/src/handlers/index.ts b/lambdas/transactional-emails/src/handlers/index.ts index 37448b82c..90e3ab63d 100644 --- a/lambdas/transactional-emails/src/handlers/index.ts +++ b/lambdas/transactional-emails/src/handlers/index.ts @@ -1,8 +1,8 @@ -import { accountDeleteHandler } from './accountDelete'; -import { premiumPurchaseHandler } from './premiumPurchaseHandler'; -import { userRegistrationEventHandler } from './userRegistrationEventHandler'; -import { forgotPasswordHandler } from './forgotPassword'; -import { exportReadyHandler } from './listExportReady'; +import { accountDeleteHandler } from './accountDelete.ts'; +import { premiumPurchaseHandler } from './premiumPurchaseHandler.ts'; +import { userRegistrationEventHandler } from './userRegistrationEventHandler.ts'; +import { forgotPasswordHandler } from './forgotPassword.ts'; +import { exportReadyHandler } from './listExportReady.ts'; import { PocketEvent, PocketEventType } from '@pocket-tools/event-bridge'; // Mapping of detail-type (via event bridge message) diff --git a/lambdas/transactional-emails/src/handlers/listExportReady.spec.ts b/lambdas/transactional-emails/src/handlers/listExportReady.spec.ts index 5abfaf8b9..67b98bbbc 100644 --- a/lambdas/transactional-emails/src/handlers/listExportReady.spec.ts +++ b/lambdas/transactional-emails/src/handlers/listExportReady.spec.ts @@ -1,11 +1,11 @@ import nock, { cleanAll } from 'nock'; import { SQSEvent, SQSRecord } from 'aws-lambda'; -import { config } from '../config'; -import * as ssm from '../ssm'; -import { sendListExportReadyEmail } from '../braze'; +import { config } from '../config.ts'; +import * as ssm from '../ssm.ts'; +import { sendListExportReadyEmail } from '../braze.ts'; import { PocketEventType } from '@pocket-tools/event-bridge'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { processor } from '..'; +import { processor } from '../index.ts'; describe('listExportReady handler', () => { let serverLoggerSpy: jest.SpyInstance; diff --git a/lambdas/transactional-emails/src/handlers/listExportReady.ts b/lambdas/transactional-emails/src/handlers/listExportReady.ts index 1728dc372..94029cd61 100644 --- a/lambdas/transactional-emails/src/handlers/listExportReady.ts +++ b/lambdas/transactional-emails/src/handlers/listExportReady.ts @@ -1,4 +1,4 @@ -import { sendListExportReadyEmail } from '../braze'; +import { sendListExportReadyEmail } from '../braze.ts'; import { PocketEvent, PocketEventType } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.spec.ts b/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.spec.ts index 628f1f7ba..a5b91f674 100644 --- a/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.spec.ts +++ b/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.spec.ts @@ -1,6 +1,6 @@ -import * as ssm from '../ssm'; +import * as ssm from '../ssm.ts'; import nock from 'nock'; -import { config } from '../config'; +import { config } from '../config.ts'; import { SQSEvent, SQSRecord } from 'aws-lambda'; import { IncomingBaseEvent, @@ -10,7 +10,7 @@ import { import { cloneDeep } from 'lodash'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { processor } from '..'; +import { processor } from '../index.ts'; function generateRecord(eventPayload: PremiumPurchaseEvent) { return { diff --git a/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.ts b/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.ts index f2ad2bd57..6dac01909 100644 --- a/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.ts +++ b/lambdas/transactional-emails/src/handlers/premiumPurchaseHandler.ts @@ -1,4 +1,4 @@ -import { sendUserTrack } from '../braze'; +import { sendUserTrack } from '../braze.ts'; import { PocketEvent, PocketEventType, diff --git a/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.spec.ts b/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.spec.ts index 171d7d521..28f8c236d 100644 --- a/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.spec.ts +++ b/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.spec.ts @@ -1,11 +1,11 @@ -import * as ssm from '../ssm'; +import * as ssm from '../ssm.ts'; import nock, { cleanAll, disableNetConnect, enableNetConnect } from 'nock'; -import { config } from '../config'; +import { config } from '../config.ts'; import { SQSEvent, SQSRecord } from 'aws-lambda'; import { generateUserAliasRequestBody, generateUserTrackBody, -} from './userRegistrationEventHandler'; +} from './userRegistrationEventHandler.ts'; import { AccountRegistration, IncomingBaseEvent, @@ -13,7 +13,7 @@ import { } from '@pocket-tools/event-bridge'; import { cloneDeep } from 'lodash'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { processor } from '..'; +import { processor } from '../index.ts'; function generateRecord(eventPayload: AccountRegistration) { return { diff --git a/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.ts b/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.ts index 5eece0d78..ad037aac0 100644 --- a/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.ts +++ b/lambdas/transactional-emails/src/handlers/userRegistrationEventHandler.ts @@ -1,11 +1,11 @@ -import { config } from '../config'; +import { config } from '../config.ts'; import * as Sentry from '@sentry/aws-serverless'; import { generateSubscriptionPayloadForEmail, sendCreateUserAlias, sendUserTrack, setSubscription, -} from '../braze'; +} from '../braze.ts'; import type { UsersAliasObject, UsersTrackObject, diff --git a/lambdas/transactional-emails/src/index.spec.ts b/lambdas/transactional-emails/src/index.spec.ts index 4990c6735..dd6bc8280 100644 --- a/lambdas/transactional-emails/src/index.spec.ts +++ b/lambdas/transactional-emails/src/index.spec.ts @@ -2,7 +2,7 @@ import { cleanAll } from 'nock'; import { SQSEvent, SQSRecord } from 'aws-lambda'; import { PocketEventType } from '@pocket-tools/event-bridge'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { processor } from '.'; +import { processor } from './index.ts'; describe('handler', () => { let serverLoggerSpy: jest.SpyInstance; diff --git a/lambdas/transactional-emails/src/index.ts b/lambdas/transactional-emails/src/index.ts index a3e7ff01b..7eb0fe575 100644 --- a/lambdas/transactional-emails/src/index.ts +++ b/lambdas/transactional-emails/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.app.sentry.dsn, @@ -12,7 +12,7 @@ import type { SQSBatchItemFailure, } from 'aws-lambda'; -import { handlers } from './handlers'; +import { handlers } from './handlers/index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; import { sqsLambdaEventBridgeEvent } from '@pocket-tools/event-bridge'; diff --git a/lambdas/transactional-emails/src/ssm.ts b/lambdas/transactional-emails/src/ssm.ts index 64b5f6bb8..9b6325912 100644 --- a/lambdas/transactional-emails/src/ssm.ts +++ b/lambdas/transactional-emails/src/ssm.ts @@ -1,5 +1,5 @@ import { GetParameterCommand, SSM } from '@aws-sdk/client-ssm'; -import { config } from './config'; +import { config } from './config.ts'; const client = new SSM({ region: config.aws.region }); From 141a78feddf18e3410d10a3a5bab39416dde04b2 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:12:21 -0800 Subject: [PATCH 12/18] feat(esm): moving user list search corpus indexing to esm --- .../package.json | 1 + .../src/commands/ApprovedItem.ts | 4 ++-- .../src/commands/ApprovedItemCollection.ts | 6 +++--- .../src/commands/Collection.ts | 4 ++-- .../src/commands/RemoveItem.ts | 4 ++-- .../src/commands/Syndicated.ts | 8 ++++---- .../src/index.integration.ts | 12 ++++++------ .../src/index.ts | 16 ++++++++-------- .../src/queries/collectionId.ts | 6 +++--- .../src/queries/index.ts | 4 ++-- .../src/queries/originalCorpusId.ts | 4 ++-- .../src/utils.spec.ts | 2 +- 12 files changed, 36 insertions(+), 35 deletions(-) diff --git a/lambdas/user-list-search-corpus-indexing/package.json b/lambdas/user-list-search-corpus-indexing/package.json index d3ab5383d..1ad7e47c5 100644 --- a/lambdas/user-list-search-corpus-indexing/package.json +++ b/lambdas/user-list-search-corpus-indexing/package.json @@ -9,6 +9,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItem.ts b/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItem.ts index 3f74d2fd1..f8b2f901f 100644 --- a/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItem.ts +++ b/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItem.ts @@ -1,5 +1,5 @@ -import { ValidLanguageApprovedItemPayload } from '../types'; -import { config } from '../config'; +import { ValidLanguageApprovedItemPayload } from '../types.ts'; +import { config } from '../config.ts'; /** * Index an "Approved Item" in the search cluster. diff --git a/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItemCollection.ts b/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItemCollection.ts index b6db21b16..38788df47 100644 --- a/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItemCollection.ts +++ b/lambdas/user-list-search-corpus-indexing/src/commands/ApprovedItemCollection.ts @@ -1,6 +1,6 @@ -import { CollectionApprovedItemPayload } from '../types'; -import { config } from '../config'; -import { collectionIdFromCorpus } from '../queries'; +import { CollectionApprovedItemPayload } from '../types.ts'; +import { config } from '../config.ts'; +import { collectionIdFromCorpus } from '../queries/index.ts'; /** * Update a Collection entry with additional metadata from diff --git a/lambdas/user-list-search-corpus-indexing/src/commands/Collection.ts b/lambdas/user-list-search-corpus-indexing/src/commands/Collection.ts index 58c4c1748..49c76db55 100644 --- a/lambdas/user-list-search-corpus-indexing/src/commands/Collection.ts +++ b/lambdas/user-list-search-corpus-indexing/src/commands/Collection.ts @@ -1,6 +1,6 @@ import { CollectionPayload } from '@pocket-tools/event-bridge'; -import { config } from '../config'; -import { buildCollectionUrl } from '../utils'; +import { config } from '../config.ts'; +import { buildCollectionUrl } from '../utils.ts'; /** * Index a Collection object in the search cluster. diff --git a/lambdas/user-list-search-corpus-indexing/src/commands/RemoveItem.ts b/lambdas/user-list-search-corpus-indexing/src/commands/RemoveItem.ts index d37c58fd0..fdfe183b0 100644 --- a/lambdas/user-list-search-corpus-indexing/src/commands/RemoveItem.ts +++ b/lambdas/user-list-search-corpus-indexing/src/commands/RemoveItem.ts @@ -1,5 +1,5 @@ -import { ValidLanguageApprovedItemPayload } from '../types'; -import { config } from '../config'; +import { ValidLanguageApprovedItemPayload } from '../types.ts'; +import { config } from '../config.ts'; /** * Remove an "ApprovedItem" from the search cluster. diff --git a/lambdas/user-list-search-corpus-indexing/src/commands/Syndicated.ts b/lambdas/user-list-search-corpus-indexing/src/commands/Syndicated.ts index 6b1006b40..d77c24768 100644 --- a/lambdas/user-list-search-corpus-indexing/src/commands/Syndicated.ts +++ b/lambdas/user-list-search-corpus-indexing/src/commands/Syndicated.ts @@ -1,7 +1,7 @@ -import { SyndicatedItemPayload } from '../types'; -import { config } from '../config'; -import { upsertApprovedItem } from './ApprovedItem'; -import { originalCorpusId } from '../queries'; +import { SyndicatedItemPayload } from '../types.ts'; +import { config } from '../config.ts'; +import { upsertApprovedItem } from './ApprovedItem.ts'; +import { originalCorpusId } from '../queries/index.ts'; /** * Index a Syndicated Item in the search corpus. diff --git a/lambdas/user-list-search-corpus-indexing/src/index.integration.ts b/lambdas/user-list-search-corpus-indexing/src/index.integration.ts index c3fd9e7ea..553229648 100644 --- a/lambdas/user-list-search-corpus-indexing/src/index.integration.ts +++ b/lambdas/user-list-search-corpus-indexing/src/index.integration.ts @@ -1,9 +1,9 @@ -import { bulkIndex, processor } from '.'; -import { EventPayload } from './types'; -import { config } from './config'; -import * as oci from './queries/originalCorpusId'; -import * as ci from './queries/collectionId'; -import * as api from './commands/ApprovedItem'; +import { bulkIndex, processor } from './index.ts'; +import { EventPayload } from './types.ts'; +import { config } from './config.ts'; +import * as oci from './queries/originalCorpusId.ts'; +import * as ci from './queries/collectionId.ts'; +import * as api from './commands/ApprovedItem.ts'; import { PocketEventType } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/user-list-search-corpus-indexing/src/index.ts b/lambdas/user-list-search-corpus-indexing/src/index.ts index b189a6da8..343596860 100644 --- a/lambdas/user-list-search-corpus-indexing/src/index.ts +++ b/lambdas/user-list-search-corpus-indexing/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -16,14 +16,14 @@ import { CollectionApprovedItemPayload, SyndicatedItemPayload, EventPayload, -} from './types'; -import { upsertCollection } from './commands/Collection'; -import { mergeCollection } from './commands/ApprovedItemCollection'; -import { upsertSyndicatedItem } from './commands/Syndicated'; -import { upsertApprovedItem } from './commands/ApprovedItem'; -import { postRetry } from './postRetry'; +} from './types.ts'; +import { upsertCollection } from './commands/Collection.ts'; +import { mergeCollection } from './commands/ApprovedItemCollection.ts'; +import { upsertSyndicatedItem } from './commands/Syndicated.ts'; +import { upsertApprovedItem } from './commands/ApprovedItem.ts'; +import { postRetry } from './postRetry.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { removeApprovedItem } from './commands/RemoveItem'; +import { removeApprovedItem } from './commands/RemoveItem.ts'; import { PocketEventType, sqsLambdaEventBridgeEvent, diff --git a/lambdas/user-list-search-corpus-indexing/src/queries/collectionId.ts b/lambdas/user-list-search-corpus-indexing/src/queries/collectionId.ts index 1fdbd97c2..33230ccf1 100644 --- a/lambdas/user-list-search-corpus-indexing/src/queries/collectionId.ts +++ b/lambdas/user-list-search-corpus-indexing/src/queries/collectionId.ts @@ -1,8 +1,8 @@ import { serverLogger } from '@pocket-tools/ts-logger'; -import { postRetry } from '../postRetry'; +import { postRetry } from '../postRetry.ts'; import * as Sentry from '@sentry/aws-serverless'; -import { config } from '../config'; -import { extractCollectionSlug } from '../utils'; +import { config } from '../config.ts'; +import { extractCollectionSlug } from '../utils.ts'; /** * Fetch the Collection "external ID" representing the diff --git a/lambdas/user-list-search-corpus-indexing/src/queries/index.ts b/lambdas/user-list-search-corpus-indexing/src/queries/index.ts index 573ff423d..21b908086 100644 --- a/lambdas/user-list-search-corpus-indexing/src/queries/index.ts +++ b/lambdas/user-list-search-corpus-indexing/src/queries/index.ts @@ -1,2 +1,2 @@ -export * from './originalCorpusId'; -export * from './collectionId'; +export * from './originalCorpusId.ts'; +export * from './collectionId.ts'; diff --git a/lambdas/user-list-search-corpus-indexing/src/queries/originalCorpusId.ts b/lambdas/user-list-search-corpus-indexing/src/queries/originalCorpusId.ts index cbc55e699..b599e950c 100644 --- a/lambdas/user-list-search-corpus-indexing/src/queries/originalCorpusId.ts +++ b/lambdas/user-list-search-corpus-indexing/src/queries/originalCorpusId.ts @@ -1,7 +1,7 @@ import { serverLogger } from '@pocket-tools/ts-logger'; -import { postRetry } from '../postRetry'; +import { postRetry } from '../postRetry.ts'; import * as Sentry from '@sentry/aws-serverless'; -import { config } from '../config'; +import { config } from '../config.ts'; /** * Fetch the original corpus id for a syndicated article, diff --git a/lambdas/user-list-search-corpus-indexing/src/utils.spec.ts b/lambdas/user-list-search-corpus-indexing/src/utils.spec.ts index f0f4a4980..70d165124 100644 --- a/lambdas/user-list-search-corpus-indexing/src/utils.spec.ts +++ b/lambdas/user-list-search-corpus-indexing/src/utils.spec.ts @@ -1,4 +1,4 @@ -import { buildCollectionUrl, extractCollectionSlug } from './utils'; +import { buildCollectionUrl, extractCollectionSlug } from './utils.ts'; describe('utils', () => { describe('buildCollectionUrl', () => { From 8da7a99c4eb18d190d40fe1a33c229fafa94b209 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:13:27 -0800 Subject: [PATCH 13/18] feat(esm): moving user list search corpus to esm --- .../package.json | 1 + .../src/bulkIndex.ts | 4 ++-- .../src/index.integration.ts | 4 ++-- .../src/index.ts | 12 ++++++------ .../src/parserRequest.ts | 4 ++-- .../src/utils.spec.ts | 4 ++-- .../src/utils.ts | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lambdas/user-list-search-corpus-parser-hydration/package.json b/lambdas/user-list-search-corpus-parser-hydration/package.json index 4a796f9aa..c79040b03 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/package.json +++ b/lambdas/user-list-search-corpus-parser-hydration/package.json @@ -4,6 +4,7 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/bulkIndex.ts b/lambdas/user-list-search-corpus-parser-hydration/src/bulkIndex.ts index 89b87b3fb..9b6dd2341 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/bulkIndex.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/bulkIndex.ts @@ -1,7 +1,7 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; import { serverLogger } from '@pocket-tools/ts-logger'; -import { BulkRequestPayload } from './types'; +import { BulkRequestPayload } from './types.ts'; import fetchRetry from 'fetch-retry'; const newFetch = fetchRetry(fetch); /** diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/index.integration.ts b/lambdas/user-list-search-corpus-parser-hydration/src/index.integration.ts index 33060e041..92d7a94bd 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/index.integration.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/index.integration.ts @@ -1,7 +1,7 @@ import nock from 'nock'; -import { processor } from '.'; -import { config } from './config'; +import { processor } from './index.ts'; +import { config } from './config.ts'; import { SQSEvent } from 'aws-lambda'; /** diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/index.ts b/lambdas/user-list-search-corpus-parser-hydration/src/index.ts index de0091f80..51af02e11 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/index.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/index.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ dsn: config.sentry.dsn, @@ -11,11 +11,11 @@ import { BulkRequestMeta, BulkRequestPayload, ValidLangEventPayload, -} from './types'; -import { parserRequest, parserResultToDoc } from './parserRequest'; -import { bulkIndex } from './bulkIndex'; -import { buildCollectionUrl, hasExcerptOrIsCollection } from './utils'; -import { getEmbeddings } from './embeddingsRequest'; +} from './types.ts'; +import { parserRequest, parserResultToDoc } from './parserRequest.ts'; +import { bulkIndex } from './bulkIndex.ts'; +import { buildCollectionUrl, hasExcerptOrIsCollection } from './utils.ts'; +import { getEmbeddings } from './embeddingsRequest.ts'; import { sqsLambdaEventBridgeEvent } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/parserRequest.ts b/lambdas/user-list-search-corpus-parser-hydration/src/parserRequest.ts index e05956e02..cb07690b0 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/parserRequest.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/parserRequest.ts @@ -1,5 +1,5 @@ -import { ParserDocumentFields, ParserResult } from './types'; -import { config } from './config'; +import { ParserDocumentFields, ParserResult } from './types.ts'; +import { config } from './config.ts'; import fetchRetry from 'fetch-retry'; import * as Sentry from '@sentry/aws-serverless'; import { stripHtml } from 'string-strip-html'; diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/utils.spec.ts b/lambdas/user-list-search-corpus-parser-hydration/src/utils.spec.ts index 1efb12e25..e9288407e 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/utils.spec.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/utils.spec.ts @@ -1,5 +1,5 @@ -import { BulkRequestMeta } from './types'; -import { buildCollectionUrl, hasExcerptOrIsCollection } from './utils'; +import { BulkRequestMeta } from './types.ts'; +import { buildCollectionUrl, hasExcerptOrIsCollection } from './utils.ts'; describe('utils', () => { describe('buildCollectionUrl', () => { diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/utils.ts b/lambdas/user-list-search-corpus-parser-hydration/src/utils.ts index 7143e36d4..68c4b628a 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/utils.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/utils.ts @@ -1,4 +1,4 @@ -import { BulkRequestMeta } from './types'; +import { BulkRequestMeta } from './types.ts'; /** * This method is copied in user-list-search-corpus-indexing From f10da67f63337267cc1bfb04c14a8998d20da01c Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:14:14 -0800 Subject: [PATCH 14/18] feat(esm): moving user list search events to esm --- lambdas/user-list-search-events/handlerFns.spec.ts | 4 ++-- lambdas/user-list-search-events/handlerFns.ts | 2 +- lambdas/user-list-search-events/handlerMap.ts | 2 +- lambdas/user-list-search-events/index.ts | 4 ++-- lambdas/user-list-search-events/package.json | 1 + lambdas/user-list-search-events/tsconfig.json | 1 - 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lambdas/user-list-search-events/handlerFns.spec.ts b/lambdas/user-list-search-events/handlerFns.spec.ts index 9c5665f27..da6f34d53 100644 --- a/lambdas/user-list-search-events/handlerFns.spec.ts +++ b/lambdas/user-list-search-events/handlerFns.spec.ts @@ -1,7 +1,7 @@ -import { config } from './config'; +import { config } from './config.ts'; import nock from 'nock'; import { SQSRecord } from 'aws-lambda'; -import { __handler } from '.'; +import { __handler } from './index.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; import { PocketEventType } from '@pocket-tools/event-bridge'; diff --git a/lambdas/user-list-search-events/handlerFns.ts b/lambdas/user-list-search-events/handlerFns.ts index 61ae6e195..afd48fa00 100644 --- a/lambdas/user-list-search-events/handlerFns.ts +++ b/lambdas/user-list-search-events/handlerFns.ts @@ -1,4 +1,4 @@ -import { config } from './config'; +import { config } from './config.ts'; import { AccountDelete } from '@pocket-tools/event-bridge'; /** diff --git a/lambdas/user-list-search-events/handlerMap.ts b/lambdas/user-list-search-events/handlerMap.ts index e0a0764c4..d4871dc2d 100644 --- a/lambdas/user-list-search-events/handlerMap.ts +++ b/lambdas/user-list-search-events/handlerMap.ts @@ -1,5 +1,5 @@ import { PocketEvent, PocketEventType } from '@pocket-tools/event-bridge'; -import { accountDeleteHandler } from './handlerFns'; +import { accountDeleteHandler } from './handlerFns.ts'; // Mapping of detail-type (via event bridge message) // to function that should be invoked to process the message diff --git a/lambdas/user-list-search-events/index.ts b/lambdas/user-list-search-events/index.ts index 2b162ffb7..024c852df 100644 --- a/lambdas/user-list-search-events/index.ts +++ b/lambdas/user-list-search-events/index.ts @@ -1,10 +1,10 @@ -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); import { SQSEvent } from 'aws-lambda'; -import { handlerMap } from './handlerMap'; +import { handlerMap } from './handlerMap.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; import { sqsLambdaEventBridgeEvent } from '@pocket-tools/event-bridge'; diff --git a/lambdas/user-list-search-events/package.json b/lambdas/user-list-search-events/package.json index cafc8ad0f..3d4a220dc 100644 --- a/lambdas/user-list-search-events/package.json +++ b/lambdas/user-list-search-events/package.json @@ -7,6 +7,7 @@ "dist", "package.json" ], + "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-events/tsconfig.json b/lambdas/user-list-search-events/tsconfig.json index e95084793..0ac23e2db 100644 --- a/lambdas/user-list-search-events/tsconfig.json +++ b/lambdas/user-list-search-events/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "tsconfig/lambda.json", "compilerOptions": { - "module": "commonjs", "outDir": "dist", }, "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], From cb1adc14179fb96bf437673211f86ed0cf9a204c Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:14:55 -0800 Subject: [PATCH 15/18] feat(esm): moving user list search kinesis to esm --- lambdas/user-list-search-kinesis-to-sqs/package.json | 1 + lambdas/user-list-search-kinesis-to-sqs/src/handler.spec.ts | 2 +- lambdas/user-list-search-kinesis-to-sqs/src/handler.ts | 4 ++-- lambdas/user-list-search-kinesis-to-sqs/src/index.ts | 4 ++-- lambdas/user-list-search-kinesis-to-sqs/src/sqs/writeable.ts | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lambdas/user-list-search-kinesis-to-sqs/package.json b/lambdas/user-list-search-kinesis-to-sqs/package.json index 50e9eec3d..6f534f112 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/package.json +++ b/lambdas/user-list-search-kinesis-to-sqs/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "", "main": "dist/index.js", + "type": "module", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-kinesis-to-sqs/src/handler.spec.ts b/lambdas/user-list-search-kinesis-to-sqs/src/handler.spec.ts index ce195bb21..c8359301f 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/src/handler.spec.ts +++ b/lambdas/user-list-search-kinesis-to-sqs/src/handler.spec.ts @@ -1,4 +1,4 @@ -import { getHandler, KinesisEvent } from './handler'; +import { getHandler, KinesisEvent } from './handler.ts'; import { SendMessageBatchCommandOutput, SQSClient } from '@aws-sdk/client-sqs'; const createEvent = (msg: Record): KinesisEvent => { diff --git a/lambdas/user-list-search-kinesis-to-sqs/src/handler.ts b/lambdas/user-list-search-kinesis-to-sqs/src/handler.ts index 8b621015d..2eb44fddf 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/src/handler.ts +++ b/lambdas/user-list-search-kinesis-to-sqs/src/handler.ts @@ -1,11 +1,11 @@ -import SqsWritable from './sqs/writeable'; +import SqsWritable from './sqs/writeable.ts'; import _ from 'highland'; import { SQS } from '@aws-sdk/client-sqs'; import { SqsMessage, UserItemsSqsMessage, UserListImportSqsMessage, -} from './sqs/types'; +} from './sqs/types.ts'; import { serverLogger } from '@pocket-tools/ts-logger'; const MAX_JOBS_PER_MESSAGE = 1000; diff --git a/lambdas/user-list-search-kinesis-to-sqs/src/index.ts b/lambdas/user-list-search-kinesis-to-sqs/src/index.ts index 93bc8d580..52dce89c7 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/src/index.ts +++ b/lambdas/user-list-search-kinesis-to-sqs/src/index.ts @@ -1,10 +1,10 @@ -import { config } from './config'; +import { config } from './config/index.ts'; import * as Sentry from '@sentry/aws-serverless'; Sentry.init({ ...config.sentry, }); -import { getHandler } from './handler'; +import { getHandler } from './handler.ts'; import { SQSClient } from '@aws-sdk/client-sqs'; export const client = new SQSClient({ diff --git a/lambdas/user-list-search-kinesis-to-sqs/src/sqs/writeable.ts b/lambdas/user-list-search-kinesis-to-sqs/src/sqs/writeable.ts index 8f2c812ce..49843d1b5 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/src/sqs/writeable.ts +++ b/lambdas/user-list-search-kinesis-to-sqs/src/sqs/writeable.ts @@ -1,5 +1,5 @@ import { Writable } from 'stream'; -import { generateId, SQSBatchSendError } from './utils'; +import { generateId, SQSBatchSendError } from './utils.ts'; import { SendMessageBatchCommand, SendMessageBatchRequestEntry, From 3648ee750ced246e672080fc8fc7140ed9be8809 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 2 Jan 2025 16:17:47 -0800 Subject: [PATCH 16/18] fix(esm): small lambda esm fixes --- .../src/embeddingsRequest.ts | 4 +- .../user-list-search-indexing/src/index.ts | 6 +- .../tsconfig.json | 1 - .../src/events/generated/schema.json | 5344 +++++++++++++++++ 4 files changed, 5349 insertions(+), 6 deletions(-) diff --git a/lambdas/user-list-search-corpus-parser-hydration/src/embeddingsRequest.ts b/lambdas/user-list-search-corpus-parser-hydration/src/embeddingsRequest.ts index 765bf3d59..046dcdc6a 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/src/embeddingsRequest.ts +++ b/lambdas/user-list-search-corpus-parser-hydration/src/embeddingsRequest.ts @@ -5,9 +5,9 @@ import { } from '@aws-sdk/client-sagemaker-runtime'; // ES Modules import import { Agent } from 'http'; import { NodeHttpHandler } from '@smithy/node-http-handler'; -import { config } from './config'; +import { config } from './config.ts'; import * as Sentry from '@sentry/aws-serverless'; -import { ParserResult } from './types'; +import { ParserResult } from './types.ts'; import { ConfiguredRetryStrategy } from '@smithy/util-retry'; let _sagemakerClient: SageMakerRuntimeClient; diff --git a/lambdas/user-list-search-indexing/src/index.ts b/lambdas/user-list-search-indexing/src/index.ts index 287e6bb80..862a1f5f2 100644 --- a/lambdas/user-list-search-indexing/src/index.ts +++ b/lambdas/user-list-search-indexing/src/index.ts @@ -1,3 +1,3 @@ -export { handler as itemDeleteHandler } from './itemDelete'; -export { handler as itemUpdateHandler } from './itemUpdate'; -export { handler as userListImportHandler } from './userListImport'; +export { handler as itemDeleteHandler } from './itemDelete.ts'; +export { handler as itemUpdateHandler } from './itemUpdate.ts'; +export { handler as userListImportHandler } from './userListImport.ts'; diff --git a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json index 1ac15d060..34b628a03 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json +++ b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "tsconfig/lambda.json", "compilerOptions": { - "module": "commonjs", "outDir": "dist", }, "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], diff --git a/packages/event-bridge/src/events/generated/schema.json b/packages/event-bridge/src/events/generated/schema.json index e69de29bb..03ad0d79b 100644 --- a/packages/event-bridge/src/events/generated/schema.json +++ b/packages/event-bridge/src/events/generated/schema.json @@ -0,0 +1,5344 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "AccountDelete": { + "properties": { + "detail": { + "$ref": "#/definitions/AccountPayload" + }, + "detail-type": { + "const": "account-deletion", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "AccountEmailUpdated": { + "properties": { + "detail": { + "$ref": "#/definitions/AccountPayload" + }, + "detail-type": { + "const": "account-email-updated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "AccountEvent": { + "anyOf": [ + { + "$ref": "#/definitions/AccountDelete" + }, + { + "$ref": "#/definitions/AccountEmailUpdated" + }, + { + "$ref": "#/definitions/AccountRegistration" + }, + { + "$ref": "#/definitions/AccountPasswordChanged" + } + ] + }, + "AccountPasswordChanged": { + "properties": { + "detail": { + "$ref": "#/definitions/AccountPayload" + }, + "detail-type": { + "const": "account-password-changed", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "AccountPayload": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": "string" + }, + "eventType": { + "type": "string" + }, + "guid": { + "type": [ + "number", + "null" + ] + }, + "hashedGuid": { + "type": [ + "string", + "null" + ] + }, + "hashedId": { + "type": [ + "string", + "null" + ] + }, + "ipAddress": { + "type": [ + "string", + "null" + ] + }, + "isNative": { + "type": [ + "boolean", + "null" + ] + }, + "isPremium": { + "type": "boolean" + }, + "isTrusted": { + "type": [ + "boolean", + "null" + ] + }, + "language": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "snowplowDomainUserId": { + "type": [ + "string", + "null" + ] + }, + "timestamp": { + "type": "number" + }, + "traceId": { + "type": [ + "string", + "null" + ] + }, + "userAgent": { + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "email", + "isPremium", + "userId", + "apiId", + "timestamp", + "version", + "eventType" + ], + "type": "object" + }, + "AccountPocketEventType": { + "anyOf": [ + { + "const": "account-deletion", + "type": "string" + }, + { + "const": "account-email-updated", + "type": "string" + }, + { + "const": "User Registration", + "type": "string" + }, + { + "const": "account-password-changed", + "type": "string" + } + ] + }, + "AccountRegistration": { + "properties": { + "detail": { + "properties": { + "email": { + "type": "string" + }, + "encodedUserId": { + "type": "string" + }, + "locale": { + "type": "string" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "email", + "encodedUserId", + "userId", + "locale" + ], + "type": "object" + }, + "detail-type": { + "const": "User Registration", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "AddItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "ADD_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "AddTags": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "ADD_TAGS", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ArchiveItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "ARCHIVE_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "BaseEvent": { + "properties": { + "detail": {}, + "detail-type": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail-type", + "source", + "detail" + ], + "type": "object" + }, + "BasicListItemEventPayloadContext": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + } + }, + "required": [ + "user", + "apiUser" + ], + "type": "object" + }, + "ClearTags": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "CLEAR_TAGS", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CollectionAuthor": { + "properties": { + "active": { + "type": "boolean" + }, + "bio": { + "type": "string" + }, + "collection_author_id": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + } + }, + "required": [ + "collection_author_id", + "name", + "active" + ], + "type": "object" + }, + "CollectionCreated": { + "properties": { + "detail": { + "$ref": "#/definitions/CollectionPayload" + }, + "detail-type": { + "const": "collection-created", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CollectionEvent": { + "anyOf": [ + { + "$ref": "#/definitions/CollectionCreated" + }, + { + "$ref": "#/definitions/CollectionUpdated" + } + ] + }, + "CollectionLanguage": { + "enum": [ + "DE", + "EN" + ], + "type": "string" + }, + "CollectionPartnership": { + "properties": { + "blurb": { + "type": "string" + }, + "collection_partnership_id": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/CollectionPartnershipType" + }, + "url": { + "type": "string" + } + }, + "required": [ + "collection_partnership_id", + "name", + "blurb", + "image_url", + "type", + "url" + ], + "type": "object" + }, + "CollectionPartnershipType": { + "enum": [ + "PARTNERED", + "SPONSORED" + ], + "type": "string" + }, + "CollectionPayload": { + "description": "NOTE: The following is from the Content monorepo", + "properties": { + "collection": { + "properties": { + "IABChildCategory": { + "$ref": "#/definitions/IABChildCategory" + }, + "IABParentCategory": { + "$ref": "#/definitions/IABParentCategory" + }, + "authors": { + "items": { + "$ref": "#/definitions/CollectionAuthor" + }, + "type": "array" + }, + "createdAt": { + "type": "number" + }, + "curationCategory": { + "$ref": "#/definitions/CurationCategory" + }, + "excerpt": { + "type": "string" + }, + "externalId": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "intro": { + "type": "string" + }, + "labels": { + "items": { + "$ref": "#/definitions/Label" + }, + "type": "array" + }, + "language": { + "$ref": "#/definitions/CollectionLanguage" + }, + "partnership": { + "$ref": "#/definitions/CollectionPartnership" + }, + "publishedAt": { + "type": "number" + }, + "slug": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/CollectionStatus" + }, + "stories": { + "items": { + "$ref": "#/definitions/CollectionStory" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "number" + } + }, + "required": [ + "externalId", + "slug", + "title", + "status", + "language", + "authors", + "stories", + "createdAt", + "updatedAt" + ], + "type": "object" + } + }, + "required": [ + "collection" + ], + "type": "object" + }, + "CollectionPocketEventType": { + "anyOf": [ + { + "const": "collection-created", + "type": "string" + }, + { + "const": "collection-updated", + "type": "string" + } + ] + }, + "CollectionStatus": { + "enum": [ + "draft", + "review", + "published", + "archived" + ], + "type": "string" + }, + "CollectionStory": { + "properties": { + "authors": { + "items": { + "$ref": "#/definitions/CollectionStoryAuthor" + }, + "type": "array" + }, + "collection_story_id": { + "type": "string" + }, + "excerpt": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "is_from_partner": { + "type": "boolean" + }, + "publisher": { + "type": "string" + }, + "sort_order": { + "type": "number" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "collection_story_id", + "url", + "title", + "excerpt", + "authors", + "is_from_partner" + ], + "type": "object" + }, + "CollectionStoryAuthor": { + "properties": { + "name": { + "type": "string" + }, + "sort_order": { + "type": "number" + } + }, + "required": [ + "name", + "sort_order" + ], + "type": "object" + }, + "CollectionUpdated": { + "properties": { + "detail": { + "$ref": "#/definitions/CollectionPayload" + }, + "detail-type": { + "const": "collection-updated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CorpusEvent": { + "anyOf": [ + { + "$ref": "#/definitions/CorpusItemAdded" + }, + { + "$ref": "#/definitions/CorpusItemUpdated" + }, + { + "$ref": "#/definitions/CorpusItemRemoved" + } + ] + }, + "CorpusItemAdded": { + "properties": { + "detail": { + "$ref": "#/definitions/CorpusItemPayload" + }, + "detail-type": { + "const": "add-approved-item", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CorpusItemPayload": { + "properties": { + "approvedItemExternalId": { + "type": "string" + }, + "authors": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "sortOrder": { + "type": "number" + } + }, + "required": [ + "name", + "sortOrder" + ], + "type": "object" + }, + "type": "array" + }, + "createdAt": { + "type": [ + "string", + "null" + ] + }, + "createdBy": { + "type": [ + "string", + "null" + ] + }, + "datePublished": { + "type": "string" + }, + "domainName": { + "type": "string" + }, + "eventType": { + "type": "string" + }, + "excerpt": { + "type": [ + "string", + "null" + ] + }, + "grade": { + "type": [ + "string", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "isCollection": { + "type": "boolean" + }, + "isSyndicated": { + "type": "boolean" + }, + "isTimeSensitive": { + "type": "boolean" + }, + "language": { + "type": [ + "string", + "null" + ] + }, + "publisher": { + "type": [ + "string", + "null" + ] + }, + "source": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "topic": { + "type": [ + "string", + "null" + ] + }, + "updatedAt": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string" + } + }, + "required": [ + "eventType", + "approvedItemExternalId", + "url" + ], + "type": "object" + }, + "CorpusItemRemoved": { + "properties": { + "detail": { + "$ref": "#/definitions/CorpusItemPayload" + }, + "detail-type": { + "const": "remove-approved-item", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CorpusItemUpdated": { + "properties": { + "detail": { + "$ref": "#/definitions/CorpusItemPayload" + }, + "detail-type": { + "const": "update-approved-item", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "CorpusPocketEventType": { + "anyOf": [ + { + "const": "add-approved-item", + "type": "string" + }, + { + "const": "update-approved-item", + "type": "string" + }, + { + "const": "remove-approved-item", + "type": "string" + } + ] + }, + "CurationCategory": { + "properties": { + "collection_curation_category_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + } + }, + "required": [ + "collection_curation_category_id", + "name", + "slug" + ], + "type": "object" + }, + "DeleteItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "DELETE_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "DeleteTag": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "DELETE_TAG", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ExportReady": { + "properties": { + "detail": { + "properties": { + "archiveUrl": { + "type": [ + "string", + "null" + ] + }, + "encodedId": { + "type": "string" + }, + "requestId": { + "type": "string" + } + }, + "required": [ + "encodedId", + "requestId" + ], + "type": "object" + }, + "detail-type": { + "const": "list-export-ready", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ExportRequested": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "cursor": { + "type": "number" + }, + "encodedId": { + "type": "string" + }, + "part": { + "type": "number" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "requestId": { + "type": "string" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "apiUser", + "cursor", + "encodedId", + "part", + "requestId", + "user", + "userId" + ], + "type": "object" + }, + "detail-type": { + "const": "list-export-requested", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "FavoriteItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "FAVORITE_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "Filter": { + "enum": [ + "domain", + "title", + "tags", + "contentType", + "status", + "isFavorite", + "publishedDateRange", + "topic", + "excludeML", + "excludeCollections", + "addedDateRange", + "publisher", + "author" + ], + "type": "string" + }, + "ForgotPasswordRequest": { + "properties": { + "detail": { + "properties": { + "passwordResetInfo": { + "properties": { + "resetPasswordToken": { + "type": "string" + }, + "resetPasswordUsername": { + "type": "string" + }, + "timestamp": { + "description": "Note this is not a timestamp... its a formatted date string..", + "type": "string" + } + }, + "required": [ + "resetPasswordToken", + "resetPasswordUsername", + "timestamp" + ], + "type": "object" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "encodedId": { + "type": "string" + }, + "id": { + "type": "number" + } + }, + "required": [ + "id", + "encodedId", + "email" + ], + "type": "object" + } + }, + "required": [ + "passwordResetInfo", + "user" + ], + "type": "object" + }, + "detail-type": { + "const": "Forgot Password Request", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "IABChildCategory": { + "properties": { + "collection_iab_child_category_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + } + }, + "required": [ + "collection_iab_child_category_id", + "name", + "slug" + ], + "type": "object" + }, + "IABParentCategory": { + "properties": { + "collection_iab_parent_category_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + } + }, + "required": [ + "collection_iab_parent_category_id", + "name", + "slug" + ], + "type": "object" + }, + "IncomingBaseEvent": { + "description": "A base event that all events should extend from when they are Received only, not sent.", + "properties": { + "account": { + "type": "string" + }, + "detail": {}, + "detail-type": { + "type": "string" + }, + "id": { + "type": "string" + }, + "region": { + "type": "string" + }, + "source": { + "type": "string" + }, + "time": { + "format": "date-time", + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "account", + "detail", + "detail-type", + "id", + "region", + "source", + "time", + "version" + ], + "type": "object" + }, + "Label": { + "properties": { + "collection_label_id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "collection_label_id", + "name" + ], + "type": "object" + }, + "ListEvent": { + "anyOf": [ + { + "$ref": "#/definitions/AddItem" + }, + { + "$ref": "#/definitions/DeleteItem" + }, + { + "$ref": "#/definitions/FavoriteItem" + }, + { + "$ref": "#/definitions/UnfavoriteItem" + }, + { + "$ref": "#/definitions/ArchiveItem" + }, + { + "$ref": "#/definitions/UnarchiveItem" + }, + { + "$ref": "#/definitions/AddTags" + }, + { + "$ref": "#/definitions/ReplaceTags" + }, + { + "$ref": "#/definitions/ClearTags" + }, + { + "$ref": "#/definitions/RemoveTags" + }, + { + "$ref": "#/definitions/RenameTag" + }, + { + "$ref": "#/definitions/DeleteTag" + }, + { + "$ref": "#/definitions/UpdateTitle" + } + ] + }, + "ListPocketEventType": { + "anyOf": [ + { + "const": "ADD_ITEM", + "type": "string" + }, + { + "const": "DELETE_ITEM", + "type": "string" + }, + { + "const": "FAVORITE_ITEM", + "type": "string" + }, + { + "const": "UNFAVORITE_ITEM", + "type": "string" + }, + { + "const": "ARCHIVE_ITEM", + "type": "string" + }, + { + "const": "UNARCHIVE_ITEM", + "type": "string" + }, + { + "const": "ADD_TAGS", + "type": "string" + }, + { + "const": "REPLACE_TAGS", + "type": "string" + }, + { + "const": "CLEAR_TAGS", + "type": "string" + }, + { + "const": "REMOVE_TAGS", + "type": "string" + }, + { + "const": "RENAME_TAG", + "type": "string" + }, + { + "const": "DELETE_TAG", + "type": "string" + }, + { + "const": "UPDATE_TITLE", + "type": "string" + } + ] + }, + "PremiumPurchaseEvent": { + "properties": { + "detail": { + "properties": { + "purchase": { + "$ref": "#/definitions/Purchase" + }, + "user": { + "$ref": "#/definitions/PremiumUser" + } + }, + "required": [ + "purchase", + "user" + ], + "type": "object" + }, + "detail-type": { + "const": "Premium Purchase", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "PremiumUser": { + "properties": { + "email": { + "type": "string" + }, + "encodedId": { + "type": "string" + }, + "id": { + "type": "number" + } + }, + "required": [ + "email", + "encodedId", + "id" + ], + "type": "object" + }, + "Prospect": { + "properties": { + "approvedCorpusItem": { + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "authors": { + "type": "string" + }, + "createdAt": { + "type": "number" + }, + "curated": { + "type": "boolean" + }, + "domain": { + "type": "string" + }, + "excerpt": { + "type": "string" + }, + "id": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "isCollection": { + "type": "boolean" + }, + "isSyndicated": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "prospectId": { + "type": "string" + }, + "prospectReviewStatus": { + "$ref": "#/definitions/ProspectReviewStatus" + }, + "prospectType": { + "type": "string" + }, + "publisher": { + "type": "string" + }, + "rank": { + "type": "number" + }, + "rejectedCorpusItem": { + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "reviewedAt": { + "type": "number" + }, + "reviewedBy": { + "type": "string" + }, + "saveCount": { + "type": "number" + }, + "scheduledSurfaceGuid": { + "type": "string" + }, + "title": { + "type": "string" + }, + "topic": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "prospectId", + "scheduledSurfaceGuid", + "prospectType", + "url", + "saveCount", + "rank", + "prospectReviewStatus" + ], + "type": "object" + }, + "ProspectBaseEvent": { + "properties": { + "detail": { + "$ref": "#/definitions/Prospect" + }, + "detail-type": { + "$ref": "#/definitions/ProspectPocketEventType" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ProspectDismissed": { + "properties": { + "detail": { + "$ref": "#/definitions/Prospect" + }, + "detail-type": { + "const": "prospect-dismiss", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ProspectEvent": { + "$ref": "#/definitions/ProspectDismissed" + }, + "ProspectPocketEventType": { + "const": "prospect-dismiss", + "type": "string" + }, + "ProspectReviewStatus": { + "enum": [ + "created", + "recommendation", + "corpus", + "rejected", + "dismissed" + ], + "type": "string" + }, + "Purchase": { + "properties": { + "amount": { + "type": "string" + }, + "cancelAtPeriodEnd": { + "type": "boolean" + }, + "isFree": { + "type": "boolean" + }, + "isTrial": { + "type": "boolean" + }, + "planInterval": { + "type": "string" + }, + "planType": { + "type": "string" + }, + "receiptId": { + "type": "string" + }, + "renewDate": { + "type": "string" + } + }, + "required": [ + "amount", + "cancelAtPeriodEnd", + "isFree", + "isTrial", + "planInterval", + "planType", + "receiptId", + "renewDate" + ], + "type": "object" + }, + "RemoveTags": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "REMOVE_TAGS", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "RenameTag": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "RENAME_TAG", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ReplaceTags": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "REPLACE_TAGS", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "Scope": { + "description": "Identifies the fields which were searched.", + "enum": [ + "all", + "all_contentful", + "title", + "excerpt", + "content", + "publisher" + ], + "type": "string" + }, + "SearchEvent": { + "$ref": "#/definitions/SearchResponseGenerated" + }, + "SearchPocketEventType": { + "const": "search_response_generated", + "type": "string" + }, + "SearchResponseGenerated": { + "properties": { + "detail": { + "properties": { + "event": { + "properties": { + "apiUser": { + "properties": { + "api_id": { + "type": "number" + }, + "is_native": { + "type": "boolean" + }, + "is_trusted": { + "type": "boolean" + } + }, + "required": [ + "api_id", + "is_native", + "is_trusted" + ], + "type": "object" + }, + "search": { + "description": "Event triggered when SearchResults are returned from Pocket's search api (for saves and corpus). Entities included: api_user; sometimes user, feature_flag.", + "properties": { + "id": { + "description": "A unique ID for this result", + "type": "string" + }, + "result_count_total": { + "description": "Number of results in the result set.", + "type": "number" + }, + "result_urls": { + "description": "Ordered result of urls in the search result connection", + "items": { + "type": "string" + }, + "type": "array" + }, + "returned_at": { + "description": "UNIX time in seconds when the results were sent by the Search API.", + "type": "number" + }, + "search_query": { + "description": "The search query", + "properties": { + "filter": { + "description": "Identifies the filters which were applied to the search, if applicable.", + "items": { + "$ref": "#/definitions/Filter" + }, + "type": "array" + }, + "language": { + "description": "2-5 character language code to indicate the language the search was performed in", + "type": "string" + }, + "query": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/Scope", + "description": "Identifies the fields which were searched." + } + }, + "required": [ + "filter", + "query", + "scope" + ], + "type": "object" + }, + "search_type": { + "description": "Identifies the corpus that was searched", + "type": "string" + } + }, + "required": [ + "id", + "result_count_total", + "result_urls", + "returned_at", + "search_query", + "search_type" + ], + "type": "object" + }, + "user": { + "properties": { + "guid": { + "type": "number" + }, + "hashed_guid": { + "type": "string" + }, + "hashed_user_id": { + "type": "string" + }, + "user_id": { + "type": "number" + } + }, + "type": "object" + } + }, + "required": [ + "search", + "user", + "apiUser" + ], + "type": "object" + } + }, + "required": [ + "event" + ], + "type": "object" + }, + "detail-type": { + "const": "search_response_generated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareContextUpdated": { + "properties": { + "detail": { + "properties": { + "pocketShare": { + "properties": { + "created_at": { + "type": "number" + }, + "note_length": { + "type": "number" + }, + "quote_count": { + "type": "number" + }, + "slug": { + "type": "string" + }, + "target_url": { + "type": "string" + } + }, + "required": [ + "target_url", + "created_at", + "slug", + "note_length", + "quote_count" + ], + "type": "object" + } + }, + "required": [ + "pocketShare" + ], + "type": "object" + }, + "detail-type": { + "const": "pocket_share_context_updated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareCreated": { + "properties": { + "detail": { + "properties": { + "pocketShare": { + "properties": { + "created_at": { + "type": "number" + }, + "note_length": { + "type": "number" + }, + "quote_count": { + "type": "number" + }, + "slug": { + "type": "string" + }, + "target_url": { + "type": "string" + } + }, + "required": [ + "target_url", + "created_at", + "slug", + "note_length", + "quote_count" + ], + "type": "object" + } + }, + "required": [ + "pocketShare" + ], + "type": "object" + }, + "detail-type": { + "const": "pocket_share_created", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareEvent": { + "anyOf": [ + { + "$ref": "#/definitions/ShareCreated" + }, + { + "$ref": "#/definitions/ShareContextUpdated" + } + ] + }, + "SharePocketEventType": { + "anyOf": [ + { + "const": "pocket_share_created", + "type": "string" + }, + { + "const": "pocket_share_context_updated", + "type": "string" + } + ] + }, + "ShareableList": { + "properties": { + "created_at": { + "description": "The timestamp in seconds when the item was created", + "type": "number" + }, + "description": { + "type": "string" + }, + "list_item_note_visibility": { + "$ref": "#/definitions/ShareableListVisibility" + }, + "moderated_by": { + "type": "string" + }, + "moderation_details": { + "type": "string" + }, + "moderation_reason": { + "type": "string" + }, + "moderation_status": { + "$ref": "#/definitions/ShareableListModerationVisibility" + }, + "restoration_reason": { + "type": "string" + }, + "shareable_list_external_id": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/ShareableListVisibility" + }, + "title": { + "type": "string" + }, + "updated_at": { + "description": "The timestamp in seconds when the item was last updated", + "type": "number" + }, + "user_id": { + "type": [ + "number" + ] + } + }, + "required": [ + "shareable_list_external_id", + "user_id", + "title", + "status", + "list_item_note_visibility", + "moderation_status", + "created_at" + ], + "type": "object" + }, + "ShareableListCreated": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_created", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListDeleted": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_deleted", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListEvent": { + "anyOf": [ + { + "$ref": "#/definitions/ShareableListCreated" + }, + { + "$ref": "#/definitions/ShareableListUpdated" + }, + { + "$ref": "#/definitions/ShareableListDeleted" + }, + { + "$ref": "#/definitions/ShareableListHidden" + }, + { + "$ref": "#/definitions/ShareableListUnhidden" + }, + { + "$ref": "#/definitions/ShareableListPublished" + }, + { + "$ref": "#/definitions/ShareableListUnpublished" + } + ] + }, + "ShareableListHidden": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_hidden", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListItem": { + "properties": { + "authors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "created_at": { + "description": "The timestamp in seconds when the item was created", + "type": "number" + }, + "excerpt": { + "type": "string" + }, + "given_url": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "note": { + "type": "string" + }, + "publisher": { + "type": "string" + }, + "shareable_list_external_id": { + "type": "string" + }, + "shareable_list_item_external_id": { + "type": "string" + }, + "sort_order": { + "type": "number" + }, + "title": { + "type": "string" + }, + "updated_at": { + "description": "The timestamp in seconds when the item was last updated", + "type": "number" + } + }, + "required": [ + "shareable_list_item_external_id", + "shareable_list_external_id", + "given_url", + "sort_order", + "created_at" + ], + "type": "object" + }, + "ShareableListItemCreated": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListItemPocketEventType" + }, + "shareableListItem": { + "$ref": "#/definitions/ShareableListItem" + } + }, + "required": [ + "shareableListItem", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_item_created", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListItemDeleted": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListItemPocketEventType" + }, + "shareableListItem": { + "$ref": "#/definitions/ShareableListItem" + } + }, + "required": [ + "shareableListItem", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_item_deleted", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListItemEvent": { + "anyOf": [ + { + "$ref": "#/definitions/ShareableListItemCreated" + }, + { + "$ref": "#/definitions/ShareableListItemUpdated" + }, + { + "$ref": "#/definitions/ShareableListItemDeleted" + } + ] + }, + "ShareableListItemPocketEventType": { + "anyOf": [ + { + "const": "shareable_list_item_created", + "type": "string" + }, + { + "const": "shareable_list_item_updated", + "type": "string" + }, + { + "const": "shareable_list_item_deleted", + "type": "string" + } + ] + }, + "ShareableListItemUpdated": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListItemPocketEventType" + }, + "shareableListItem": { + "$ref": "#/definitions/ShareableListItem" + } + }, + "required": [ + "shareableListItem", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_item_updated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListModerationVisibility": { + "enum": [ + "VISIBLE", + "HIDDEN" + ], + "type": "string" + }, + "ShareableListPocketEventType": { + "anyOf": [ + { + "const": "shareable_list_created", + "type": "string" + }, + { + "const": "shareable_list_updated", + "type": "string" + }, + { + "const": "shareable_list_deleted", + "type": "string" + }, + { + "const": "shareable_list_hidden", + "type": "string" + }, + { + "const": "shareable_list_unhidden", + "type": "string" + }, + { + "const": "shareable_list_published", + "type": "string" + }, + { + "const": "shareable_list_unpublished", + "type": "string" + } + ] + }, + "ShareableListPublished": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_published", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListUnhidden": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_unhidden", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListUnpublished": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_unpublished", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListUpdated": { + "properties": { + "detail": { + "properties": { + "eventType": { + "$ref": "#/definitions/ShareableListPocketEventType" + }, + "shareableList": { + "$ref": "#/definitions/ShareableList" + } + }, + "required": [ + "shareableList", + "eventType" + ], + "type": "object" + }, + "detail-type": { + "const": "shareable_list_updated", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "ShareableListVisibility": { + "enum": [ + "PRIVATE", + "PUBLIC" + ], + "type": "string" + }, + "UnarchiveItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "UNARCHIVE_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "UnfavoriteItem": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "UNFAVORITE_ITEM", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + }, + "UpdateTitle": { + "properties": { + "detail": { + "properties": { + "apiUser": { + "properties": { + "apiId": { + "type": "string" + }, + "clientVersion": { + "type": "string" + }, + "isNative": { + "type": "boolean" + }, + "isTrusted": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "required": [ + "apiId" + ], + "type": "object" + }, + "eventType": { + "$ref": "#/definitions/ListPocketEventType" + }, + "request": { + "properties": { + "ipAddress": { + "type": "string" + }, + "language": { + "type": "string" + }, + "snowplowDomainSessionId": { + "type": "string" + }, + "snowplowDomainUserId": { + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "type": "object" + }, + "savedItem": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "archivedAt": { + "type": "number" + }, + "favoritedAt": { + "type": "number" + }, + "id": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "item": { + "properties": { + "givenUrl": { + "type": "string" + } + }, + "required": [ + "givenUrl" + ], + "type": "object" + }, + "resolvedId": { + "type": "string" + }, + "status": { + "enum": [ + "UNREAD", + "ARCHIVED", + "DELETED", + "HIDDEN" + ], + "type": "string" + }, + "tags": { + "items": { + "properties": { + "_createdAt": { + "type": "number" + }, + "_deletedAt": { + "type": "number" + }, + "_updatedAt": { + "type": "number" + }, + "_version": { + "type": "number" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "savedItems": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "resolvedId", + "url", + "isFavorite", + "status", + "isArchived", + "item" + ], + "type": "object" + }, + "source": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsUpdated": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "type": "number" + }, + "user": { + "properties": { + "email": { + "type": "string" + }, + "guid": { + "type": "number" + }, + "hashedGuid": { + "type": "string" + }, + "hashedId": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isPremium": { + "type": "boolean" + } + }, + "required": [ + "id", + "hashedId", + "isPremium" + ], + "type": "object" + }, + "version": { + "type": "string" + } + }, + "required": [ + "apiUser", + "eventType", + "savedItem", + "source", + "timestamp", + "user", + "version" + ], + "type": "object" + }, + "detail-type": { + "const": "UPDATE_TITLE", + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "detail", + "detail-type", + "source" + ], + "type": "object" + } + } +} From a1c4f9ea2f6e34c05fce6eec754b9d510f0d7f8d Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Mon, 6 Jan 2025 12:36:48 -0800 Subject: [PATCH 17/18] fix(esm): updating jest to support esm --- .../jest.config.js | 9 --------- .../jest.config.ts | 17 +++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../package.json | 2 +- .../tsconfig.json | 2 +- .../account-data-deleter-events/jest.config.js | 8 -------- .../account-data-deleter-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../account-data-deleter-events/package.json | 2 +- .../account-data-deleter-events/tsconfig.json | 2 +- lambdas/account-delete-monitor/jest.config.js | 8 -------- lambdas/account-delete-monitor/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/account-delete-monitor/package.json | 2 +- lambdas/account-delete-monitor/tsconfig.json | 2 +- lambdas/annotations-api-events/jest.config.js | 8 -------- lambdas/annotations-api-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/annotations-api-events/package.json | 2 +- lambdas/annotations-api-events/tsconfig.json | 2 +- lambdas/fxa-webook-proxy-gateway/jest.config.js | 7 ------- lambdas/fxa-webook-proxy-gateway/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/fxa-webook-proxy-gateway/package.json | 2 +- lambdas/fxa-webook-proxy-sqs/jest.config.js | 7 ------- lambdas/fxa-webook-proxy-sqs/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/instant-sync-events/jest.config.js | 8 -------- lambdas/instant-sync-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/instant-sync-events/package.json | 2 +- lambdas/instant-sync-events/tsconfig.json | 2 +- lambdas/sendgrid-data/jest.config.js | 7 ------- lambdas/sendgrid-data/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/sendgrid-data/package.json | 2 +- lambdas/sendgrid-data/src/index.ts | 6 +++++- .../shareable-lists-api-events/jest.config.js | 8 -------- .../shareable-lists-api-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/shareable-lists-api-events/package.json | 2 +- .../shareable-lists-api-events/tsconfig.json | 2 +- lambdas/transactional-emails/jest.config.js | 6 ------ lambdas/transactional-emails/jest.config.ts | 14 ++++++++++++++ lambdas/transactional-emails/package.json | 2 +- .../jest.config.js | 8 -------- .../jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../package.json | 2 +- .../tsconfig.json | 2 +- lambdas/user-list-search-events/jest.config.js | 7 ------- lambdas/user-list-search-events/jest.config.ts | 15 +++++++++++++++ lambdas/user-list-search-events/package.json | 2 +- lambdas/user-list-search-events/tsconfig.json | 2 +- .../{jest.config.js => jest.config.ts} | 10 +++++++++- lambdas/user-list-search-indexing/package.json | 2 +- lambdas/user-list-search-indexing/tsconfig.json | 4 ++-- .../{jest.config.js => jest.config.ts} | 10 +++++++++- .../package.json | 2 +- .../tsconfig.json | 2 +- servers/notes-api/src/__generated__/db.ts | 9 +++++---- 61 files changed, 239 insertions(+), 122 deletions(-) delete mode 100644 lambdas/account-data-deleter-batch-delete/jest.config.js create mode 100644 lambdas/account-data-deleter-batch-delete/jest.config.ts rename lambdas/account-data-deleter-batch-delete/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/account-data-deleter-events/jest.config.js create mode 100644 lambdas/account-data-deleter-events/jest.config.ts rename lambdas/account-data-deleter-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/account-delete-monitor/jest.config.js create mode 100644 lambdas/account-delete-monitor/jest.config.ts rename lambdas/account-delete-monitor/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/annotations-api-events/jest.config.js create mode 100644 lambdas/annotations-api-events/jest.config.ts rename lambdas/annotations-api-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/fxa-webook-proxy-gateway/jest.config.js create mode 100644 lambdas/fxa-webook-proxy-gateway/jest.config.ts rename lambdas/fxa-webook-proxy-gateway/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/fxa-webook-proxy-sqs/jest.config.js create mode 100644 lambdas/fxa-webook-proxy-sqs/jest.config.ts rename lambdas/fxa-webook-proxy-sqs/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/instant-sync-events/jest.config.js create mode 100644 lambdas/instant-sync-events/jest.config.ts rename lambdas/instant-sync-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/sendgrid-data/jest.config.js create mode 100644 lambdas/sendgrid-data/jest.config.ts rename lambdas/sendgrid-data/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/shareable-lists-api-events/jest.config.js create mode 100644 lambdas/shareable-lists-api-events/jest.config.ts rename lambdas/shareable-lists-api-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/transactional-emails/jest.config.js create mode 100644 lambdas/transactional-emails/jest.config.ts delete mode 100644 lambdas/user-list-search-corpus-indexing/jest.config.js create mode 100644 lambdas/user-list-search-corpus-indexing/jest.config.ts rename lambdas/user-list-search-corpus-indexing/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/user-list-search-events/jest.config.js create mode 100644 lambdas/user-list-search-events/jest.config.ts rename lambdas/user-list-search-indexing/{jest.config.js => jest.config.ts} (57%) rename lambdas/user-list-search-kinesis-to-sqs/{jest.config.js => jest.config.ts} (57%) diff --git a/lambdas/account-data-deleter-batch-delete/jest.config.js b/lambdas/account-data-deleter-batch-delete/jest.config.js deleted file mode 100644 index 3d9ee9b60..000000000 --- a/lambdas/account-data-deleter-batch-delete/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-batchdelete', - testTimeout: 1000000, -}; diff --git a/lambdas/account-data-deleter-batch-delete/jest.config.ts b/lambdas/account-data-deleter-batch-delete/jest.config.ts new file mode 100644 index 000000000..e433d0c6d --- /dev/null +++ b/lambdas/account-data-deleter-batch-delete/jest.config.ts @@ -0,0 +1,17 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-batchdelete', + testTimeout: 1000000, + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-data-deleter-batch-delete/jest.setup.js b/lambdas/account-data-deleter-batch-delete/jest.setup.ts similarity index 100% rename from lambdas/account-data-deleter-batch-delete/jest.setup.js rename to lambdas/account-data-deleter-batch-delete/jest.setup.ts diff --git a/lambdas/account-data-deleter-batch-delete/package.json b/lambdas/account-data-deleter-batch-delete/package.json index 14e4cfa18..a2f852228 100644 --- a/lambdas/account-data-deleter-batch-delete/package.json +++ b/lambdas/account-data-deleter-batch-delete/package.json @@ -4,8 +4,8 @@ "description": "", "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/account-data-deleter-batch-delete/tsconfig.json b/lambdas/account-data-deleter-batch-delete/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-data-deleter-batch-delete/tsconfig.json +++ b/lambdas/account-data-deleter-batch-delete/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/account-data-deleter-events/jest.config.js b/lambdas/account-data-deleter-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/account-data-deleter-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/account-data-deleter-events/jest.config.ts b/lambdas/account-data-deleter-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/account-data-deleter-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-data-deleter-events/jest.setup.js b/lambdas/account-data-deleter-events/jest.setup.ts similarity index 100% rename from lambdas/account-data-deleter-events/jest.setup.js rename to lambdas/account-data-deleter-events/jest.setup.ts diff --git a/lambdas/account-data-deleter-events/package.json b/lambdas/account-data-deleter-events/package.json index 7b5b1e70e..0f4b7f7bc 100644 --- a/lambdas/account-data-deleter-events/package.json +++ b/lambdas/account-data-deleter-events/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-data-deleter-events/tsconfig.json b/lambdas/account-data-deleter-events/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-data-deleter-events/tsconfig.json +++ b/lambdas/account-data-deleter-events/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/account-delete-monitor/jest.config.js b/lambdas/account-delete-monitor/jest.config.js deleted file mode 100644 index e9466d4f1..000000000 --- a/lambdas/account-delete-monitor/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'account-delete-monitor', - setupFiles: ['./jest.setup.js'], -}; diff --git a/lambdas/account-delete-monitor/jest.config.ts b/lambdas/account-delete-monitor/jest.config.ts new file mode 100644 index 000000000..f5f5bf999 --- /dev/null +++ b/lambdas/account-delete-monitor/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'account-delete-monitor', + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-delete-monitor/jest.setup.js b/lambdas/account-delete-monitor/jest.setup.ts similarity index 100% rename from lambdas/account-delete-monitor/jest.setup.js rename to lambdas/account-delete-monitor/jest.setup.ts diff --git a/lambdas/account-delete-monitor/package.json b/lambdas/account-delete-monitor/package.json index 47cd40ec9..743d438a0 100644 --- a/lambdas/account-delete-monitor/package.json +++ b/lambdas/account-delete-monitor/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-delete-monitor/tsconfig.json b/lambdas/account-delete-monitor/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-delete-monitor/tsconfig.json +++ b/lambdas/account-delete-monitor/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/annotations-api-events/jest.config.js b/lambdas/annotations-api-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/annotations-api-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/annotations-api-events/jest.config.ts b/lambdas/annotations-api-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/annotations-api-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/annotations-api-events/jest.setup.js b/lambdas/annotations-api-events/jest.setup.ts similarity index 100% rename from lambdas/annotations-api-events/jest.setup.js rename to lambdas/annotations-api-events/jest.setup.ts diff --git a/lambdas/annotations-api-events/package.json b/lambdas/annotations-api-events/package.json index 1629e3f49..f94f72784 100644 --- a/lambdas/annotations-api-events/package.json +++ b/lambdas/annotations-api-events/package.json @@ -4,8 +4,8 @@ "description": "", "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/annotations-api-events/tsconfig.json b/lambdas/annotations-api-events/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/annotations-api-events/tsconfig.json +++ b/lambdas/annotations-api-events/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/fxa-webook-proxy-gateway/jest.config.js b/lambdas/fxa-webook-proxy-gateway/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/fxa-webook-proxy-gateway/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-gateway/jest.config.ts b/lambdas/fxa-webook-proxy-gateway/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/fxa-webook-proxy-gateway/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-gateway/jest.setup.js b/lambdas/fxa-webook-proxy-gateway/jest.setup.ts similarity index 100% rename from lambdas/fxa-webook-proxy-gateway/jest.setup.js rename to lambdas/fxa-webook-proxy-gateway/jest.setup.ts diff --git a/lambdas/fxa-webook-proxy-gateway/package.json b/lambdas/fxa-webook-proxy-gateway/package.json index 4a0fdcd7c..ac1d768e9 100644 --- a/lambdas/fxa-webook-proxy-gateway/package.json +++ b/lambdas/fxa-webook-proxy-gateway/package.json @@ -5,8 +5,8 @@ "keywords": [], "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/fxa-webook-proxy-sqs/jest.config.js b/lambdas/fxa-webook-proxy-sqs/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/fxa-webook-proxy-sqs/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-sqs/jest.config.ts b/lambdas/fxa-webook-proxy-sqs/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/fxa-webook-proxy-sqs/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-sqs/jest.setup.js b/lambdas/fxa-webook-proxy-sqs/jest.setup.ts similarity index 100% rename from lambdas/fxa-webook-proxy-sqs/jest.setup.js rename to lambdas/fxa-webook-proxy-sqs/jest.setup.ts diff --git a/lambdas/instant-sync-events/jest.config.js b/lambdas/instant-sync-events/jest.config.js deleted file mode 100644 index 47d5660b4..000000000 --- a/lambdas/instant-sync-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'instant-sync-events', - setupFiles: ['./jest.setup.js'], -}; diff --git a/lambdas/instant-sync-events/jest.config.ts b/lambdas/instant-sync-events/jest.config.ts new file mode 100644 index 000000000..e31a29cca --- /dev/null +++ b/lambdas/instant-sync-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'instant-sync-events', + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/instant-sync-events/jest.setup.js b/lambdas/instant-sync-events/jest.setup.ts similarity index 100% rename from lambdas/instant-sync-events/jest.setup.js rename to lambdas/instant-sync-events/jest.setup.ts diff --git a/lambdas/instant-sync-events/package.json b/lambdas/instant-sync-events/package.json index a7d84465c..e6addbcf2 100644 --- a/lambdas/instant-sync-events/package.json +++ b/lambdas/instant-sync-events/package.json @@ -2,12 +2,12 @@ "name": "instant-sync-events", "version": "1.0.0", "description": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/instant-sync-events/tsconfig.json b/lambdas/instant-sync-events/tsconfig.json index a307e8817..7d6da88c9 100644 --- a/lambdas/instant-sync-events/tsconfig.json +++ b/lambdas/instant-sync-events/tsconfig.json @@ -4,6 +4,6 @@ "rootDir": "src", "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["./**/*.ts"] } \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.config.js b/lambdas/sendgrid-data/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/sendgrid-data/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.config.ts b/lambdas/sendgrid-data/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/sendgrid-data/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.setup.js b/lambdas/sendgrid-data/jest.setup.ts similarity index 100% rename from lambdas/sendgrid-data/jest.setup.js rename to lambdas/sendgrid-data/jest.setup.ts diff --git a/lambdas/sendgrid-data/package.json b/lambdas/sendgrid-data/package.json index fa82aa755..f867e6ce8 100644 --- a/lambdas/sendgrid-data/package.json +++ b/lambdas/sendgrid-data/package.json @@ -2,12 +2,12 @@ "name": "sendgrid-data", "version": "1.0.0", "description": "", + "type": "module", "main": "index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/sendgrid-data/src/index.ts b/lambdas/sendgrid-data/src/index.ts index 70cb21389..ac780c34f 100644 --- a/lambdas/sendgrid-data/src/index.ts +++ b/lambdas/sendgrid-data/src/index.ts @@ -5,7 +5,11 @@ Sentry.init({ release: config.sentry.release, environment: config.environment, }); -import { deliverEvents, logEventsError, logEventsReceived } from './sendgrid/index.ts'; +import { + deliverEvents, + logEventsError, + logEventsReceived, +} from './sendgrid/index.ts'; import { captureException } from './sentry.ts'; import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda'; diff --git a/lambdas/shareable-lists-api-events/jest.config.js b/lambdas/shareable-lists-api-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/shareable-lists-api-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/shareable-lists-api-events/jest.config.ts b/lambdas/shareable-lists-api-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/shareable-lists-api-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/shareable-lists-api-events/jest.setup.js b/lambdas/shareable-lists-api-events/jest.setup.ts similarity index 100% rename from lambdas/shareable-lists-api-events/jest.setup.js rename to lambdas/shareable-lists-api-events/jest.setup.ts diff --git a/lambdas/shareable-lists-api-events/package.json b/lambdas/shareable-lists-api-events/package.json index b3803ddff..89216d2bf 100644 --- a/lambdas/shareable-lists-api-events/package.json +++ b/lambdas/shareable-lists-api-events/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/shareable-lists-api-events/tsconfig.json b/lambdas/shareable-lists-api-events/tsconfig.json index 7b34686ba..a61c684ef 100644 --- a/lambdas/shareable-lists-api-events/tsconfig.json +++ b/lambdas/shareable-lists-api-events/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ys", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/lambdas/transactional-emails/jest.config.js b/lambdas/transactional-emails/jest.config.js deleted file mode 100644 index 0db0fc753..000000000 --- a/lambdas/transactional-emails/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], -}; diff --git a/lambdas/transactional-emails/jest.config.ts b/lambdas/transactional-emails/jest.config.ts new file mode 100644 index 000000000..36021fa72 --- /dev/null +++ b/lambdas/transactional-emails/jest.config.ts @@ -0,0 +1,14 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/transactional-emails/package.json b/lambdas/transactional-emails/package.json index b06ab3a2b..941831d36 100644 --- a/lambdas/transactional-emails/package.json +++ b/lambdas/transactional-emails/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/main.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "dev": "tsc -w", diff --git a/lambdas/user-list-search-corpus-indexing/jest.config.js b/lambdas/user-list-search-corpus-indexing/jest.config.js deleted file mode 100644 index 1b6af6d6a..000000000 --- a/lambdas/user-list-search-corpus-indexing/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'corpus-index-lambda', -}; diff --git a/lambdas/user-list-search-corpus-indexing/jest.config.ts b/lambdas/user-list-search-corpus-indexing/jest.config.ts new file mode 100644 index 000000000..9455eec46 --- /dev/null +++ b/lambdas/user-list-search-corpus-indexing/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'corpus-index-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-corpus-indexing/jest.setup.js b/lambdas/user-list-search-corpus-indexing/jest.setup.ts similarity index 100% rename from lambdas/user-list-search-corpus-indexing/jest.setup.js rename to lambdas/user-list-search-corpus-indexing/jest.setup.ts diff --git a/lambdas/user-list-search-corpus-indexing/package.json b/lambdas/user-list-search-corpus-indexing/package.json index 1ad7e47c5..1714b21b8 100644 --- a/lambdas/user-list-search-corpus-indexing/package.json +++ b/lambdas/user-list-search-corpus-indexing/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-corpus-indexing/tsconfig.json b/lambdas/user-list-search-corpus-indexing/tsconfig.json index 7b34686ba..28c15a0e1 100644 --- a/lambdas/user-list-search-corpus-indexing/tsconfig.json +++ b/lambdas/user-list-search-corpus-indexing/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/lambdas/user-list-search-events/jest.config.js b/lambdas/user-list-search-events/jest.config.js deleted file mode 100644 index a25fbdea9..000000000 --- a/lambdas/user-list-search-events/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'events-lambda', -}; diff --git a/lambdas/user-list-search-events/jest.config.ts b/lambdas/user-list-search-events/jest.config.ts new file mode 100644 index 000000000..e4acc4cc4 --- /dev/null +++ b/lambdas/user-list-search-events/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'events-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-events/package.json b/lambdas/user-list-search-events/package.json index 3d4a220dc..c965bab33 100644 --- a/lambdas/user-list-search-events/package.json +++ b/lambdas/user-list-search-events/package.json @@ -2,12 +2,12 @@ "name": "user-list-search-events", "version": "1.0.0", "description": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-events/tsconfig.json b/lambdas/user-list-search-events/tsconfig.json index 0ac23e2db..36de10316 100644 --- a/lambdas/user-list-search-events/tsconfig.json +++ b/lambdas/user-list-search-events/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.cjs", "jest.setup.js"], "include": ["./**/*.ts"] } \ No newline at end of file diff --git a/lambdas/user-list-search-indexing/jest.config.js b/lambdas/user-list-search-indexing/jest.config.ts similarity index 57% rename from lambdas/user-list-search-indexing/jest.config.js rename to lambdas/user-list-search-indexing/jest.config.ts index e3bce1880..70c768064 100644 --- a/lambdas/user-list-search-indexing/jest.config.js +++ b/lambdas/user-list-search-indexing/jest.config.ts @@ -1,8 +1,16 @@ -module.exports = { +import type { Config } from 'jest'; + +const config: Config = { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/?(*.)+(spec|integration).ts'], testPathIgnorePatterns: ['/dist/'], displayName: 'user-list-search-kinesis-to-sqs-lambda', setupFilesAfterEnv: ['jest-extended/all'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, }; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-indexing/package.json b/lambdas/user-list-search-indexing/package.json index 1f0f259c2..1bce8345b 100644 --- a/lambdas/user-list-search-indexing/package.json +++ b/lambdas/user-list-search-indexing/package.json @@ -2,8 +2,8 @@ "name": "user-list-search-indexing", "version": "1.0.0", "description": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-indexing/tsconfig.json b/lambdas/user-list-search-indexing/tsconfig.json index 34b628a03..44893ad3b 100644 --- a/lambdas/user-list-search-indexing/tsconfig.json +++ b/lambdas/user-list-search-indexing/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], - "include": ["./**/*.ts"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.js"], + "include": ["./**/*.ts", "jest.config.ts"], "files": ["node_modules/jest-extended/types/index.d.ts"] } \ No newline at end of file diff --git a/lambdas/user-list-search-kinesis-to-sqs/jest.config.js b/lambdas/user-list-search-kinesis-to-sqs/jest.config.ts similarity index 57% rename from lambdas/user-list-search-kinesis-to-sqs/jest.config.js rename to lambdas/user-list-search-kinesis-to-sqs/jest.config.ts index e3bce1880..70c768064 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/jest.config.js +++ b/lambdas/user-list-search-kinesis-to-sqs/jest.config.ts @@ -1,8 +1,16 @@ -module.exports = { +import type { Config } from 'jest'; + +const config: Config = { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/?(*.)+(spec|integration).ts'], testPathIgnorePatterns: ['/dist/'], displayName: 'user-list-search-kinesis-to-sqs-lambda', setupFilesAfterEnv: ['jest-extended/all'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, }; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-kinesis-to-sqs/package.json b/lambdas/user-list-search-kinesis-to-sqs/package.json index 6f534f112..1d6d0c67a 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/package.json +++ b/lambdas/user-list-search-kinesis-to-sqs/package.json @@ -2,8 +2,8 @@ "name": "user-list-search-kinesis-to-sqs", "version": "1.0.0", "description": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json index 34b628a03..8fae1b426 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json +++ b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.js"], "include": ["./**/*.ts"], "files": ["node_modules/jest-extended/types/index.d.ts"] } \ No newline at end of file diff --git a/servers/notes-api/src/__generated__/db.ts b/servers/notes-api/src/__generated__/db.ts index 914077ebd..9e94750d7 100644 --- a/servers/notes-api/src/__generated__/db.ts +++ b/servers/notes-api/src/__generated__/db.ts @@ -3,11 +3,12 @@ * Please do not edit it manually. */ -import type { ColumnType } from "kysely"; +import type { ColumnType } from 'kysely'; -export type Generated = T extends ColumnType - ? ColumnType - : ColumnType; +export type Generated = + T extends ColumnType + ? ColumnType + : ColumnType; export type Json = JsonValue; From 38795ecdf38848d96cf01127ef4e8e1af2bfcd8d Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Fri, 3 Jan 2025 08:18:08 -0800 Subject: [PATCH 18/18] fix(tests): ensure all tests pass --- .../jest.config.js | 8 -------- .../jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../tsconfig.json | 2 +- packages/ts-logger/jest.config.ts | 1 + packages/ts-logger/jest.setup.ts | 1 + 6 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 lambdas/user-list-search-corpus-parser-hydration/jest.config.js create mode 100644 lambdas/user-list-search-corpus-parser-hydration/jest.config.ts rename lambdas/user-list-search-corpus-parser-hydration/{jest.setup.js => jest.setup.ts} (100%) create mode 100644 packages/ts-logger/jest.setup.ts diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.config.js b/lambdas/user-list-search-corpus-parser-hydration/jest.config.js deleted file mode 100644 index 261c6d146..000000000 --- a/lambdas/user-list-search-corpus-parser-hydration/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'corpus-parser-hyration-lambda', -}; diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts b/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts new file mode 100644 index 000000000..7be2eaefb --- /dev/null +++ b/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'corpus-parser-hyration-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.setup.js b/lambdas/user-list-search-corpus-parser-hydration/jest.setup.ts similarity index 100% rename from lambdas/user-list-search-corpus-parser-hydration/jest.setup.js rename to lambdas/user-list-search-corpus-parser-hydration/jest.setup.ts diff --git a/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json b/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json index 7b34686ba..28c15a0e1 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json +++ b/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/packages/ts-logger/jest.config.ts b/packages/ts-logger/jest.config.ts index 0bc59635e..046ed7d15 100644 --- a/packages/ts-logger/jest.config.ts +++ b/packages/ts-logger/jest.config.ts @@ -5,6 +5,7 @@ const config: Config = { testEnvironment: 'node', testMatch: ['**/?(*.)+(jest|spec).[jt]s?(x)'], testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" }, diff --git a/packages/ts-logger/jest.setup.ts b/packages/ts-logger/jest.setup.ts new file mode 100644 index 000000000..ea691468e --- /dev/null +++ b/packages/ts-logger/jest.setup.ts @@ -0,0 +1 @@ +process.env.NODE_ENV = undefined; \ No newline at end of file