diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bd3821a8..91e3862c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,17 +6,17 @@ env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 jobs: analytics-node: - name: "analytics-node QA (Node.js v${{ matrix.node-version }})" + name: 'analytics-node QA (Node.js v${{ matrix.node-version }})' runs-on: ubuntu-latest strategy: matrix: - node-version: [ 14, 16, 18 ] + node-version: [14, 16, 18] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "yarn" + cache: 'yarn' - run: yarn install --immutable - name: Turbo cache uses: actions/cache@v3 @@ -27,6 +27,28 @@ jobs: ${{ runner.os }}-turbo- - run: yarn turbo run --filter='./packages/node*' lint - run: yarn turbo run --filter='./packages/node*' test + - run: yarn turbo run --filter='./packages/node-integration-tests' test:perf-and-durability + analytics-node-cf-workers: + name: 'analytics-node QA (Cloudflare Workers)' + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - run: yarn install --immutable + - name: Turbo cache + uses: actions/cache@v3 + with: + path: node_modules/.cache/turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + - run: yarn turbo run --filter='./packages/node-integration-tests' test:cloudflare-workers consent-intg-tests: name: Consent Integration Tests runs-on: ubuntu-latest @@ -37,7 +59,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: "yarn" + cache: 'yarn' - run: yarn install --immutable - name: Turbo cache uses: actions/cache@v3 @@ -47,6 +69,3 @@ jobs: restore-keys: | ${{ runner.os }}-turbo- - run: yarn turbo run --filter='consent-tools-integration-tests' test:int - - - diff --git a/packages/node-integration-tests/README.md b/packages/node-integration-tests/README.md index 9e6114f77..f5f5b7934 100644 --- a/packages/node-integration-tests/README.md +++ b/packages/node-integration-tests/README.md @@ -1,15 +1,15 @@ # Integration Tests for @segment/analytics-node ## Tests -| Test Path | Description | -| ---- | ----------- | -| [./src/durability-tests](src/durability-tests/) | Test that all the events created by the Analytics SDK end up as HTTP Requests, and that graceful shutdown does not result in events getting lost. | -| [./src/perf-tests](src/perf-tests/) | These tests confirm that performance has not regresssed relative to the old SDK or from the baseline (which a handler _without_ analytics). + +| Test Path | Description | +| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| [./src/durability-tests](src/durability-tests/) | Test that all the events created by the Analytics SDK end up as HTTP Requests, and that graceful shutdown does not result in events getting lost. | +| [./src/perf-tests](src/perf-tests/) | These tests confirm that performance has not regresssed relative to the old SDK or from the baseline (which a handler _without_ analytics). | +| [./src/cloudflare-tests/](src/cloudflare-tests/) | These tests confirm that the SDK runs as expected in cloudflare workers. | Build deps and run tests: + ```sh yarn turbo run --filter=node-integration-tests test # from repo root ``` - - - diff --git a/packages/node-integration-tests/jest.config.js b/packages/node-integration-tests/jest.config.js new file mode 100644 index 000000000..68ccd2e05 --- /dev/null +++ b/packages/node-integration-tests/jest.config.js @@ -0,0 +1,3 @@ +const { createJestTSConfig } = require('@internal/config') + +module.exports = createJestTSConfig(__dirname) diff --git a/packages/node-integration-tests/package.json b/packages/node-integration-tests/package.json index 9c2af2c60..2226e9204 100644 --- a/packages/node-integration-tests/package.json +++ b/packages/node-integration-tests/package.json @@ -10,16 +10,20 @@ "durability": "yarn ts-node src/durability-tests/durability-tests.ts", "concurrently": "yarn run -T concurrently", "ts-node": "yarn run -T ts-node", - "test": "yarn perf && yarn durability" + "test:perf-and-durability": "yarn perf && yarn durability", + "test:cloudflare-workers": "yarn run -T jest src/cloudflare-tests" }, "devDependencies": { + "@cloudflare/workers-types": "^4.20231002.0", + "@internal/config": "workspace:^", "@internal/test-helpers": "workspace:^", "@segment/analytics-node": "workspace:^", "@types/analytics-node": "^3.1.9", "@types/autocannon": "^7", "@types/node": "^16", "analytics-node": "^6.2.0", - "autocannon": "^7.10.0" + "autocannon": "^7.10.0", + "wrangler": "^3.11.0" }, "packageManager": "yarn@3.4.1" } diff --git a/packages/node-integration-tests/src/cloudflare-tests/index.test.ts b/packages/node-integration-tests/src/cloudflare-tests/index.test.ts new file mode 100644 index 000000000..57d56ac45 --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/index.test.ts @@ -0,0 +1,434 @@ +import { join as joinPath } from 'path' +import { unstable_dev } from 'wrangler' +import { MockSegmentServer } from '../server/mock-segment-workers' + +const isoDateRegEx = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/ + +const snapshotMatchers = { + get batchEvent() { + return { + messageId: expect.any(String), + context: { + library: { + name: '@segment/analytics-node', + version: expect.any(String), + }, + }, + _metadata: { + jsRuntime: 'cloudflare-worker', + }, + timestamp: expect.stringMatching(isoDateRegEx), + } + }, + getReqBody(eventCount = 1) { + const batch = [] + for (let i = 0; i < eventCount; i++) { + batch.push(snapshotMatchers.batchEvent) + } + return { + batch, + sentAt: expect.stringMatching(isoDateRegEx), + } + }, +} + +describe('Analytics in Cloudflare workers', () => { + let mockSegmentServer: MockSegmentServer + beforeEach(async () => { + mockSegmentServer = new MockSegmentServer(3000) + await mockSegmentServer.start() + }) + + afterEach(async () => { + await mockSegmentServer.stop() + }) + + it('can send a single event', async () => { + const batches: any[] = [] + mockSegmentServer.on('batch', (batch) => { + batches.push(batch) + }) + + const worker = await unstable_dev( + joinPath(__dirname, 'workers', 'send-single-event.ts'), + { + experimental: { + disableExperimentalWarning: true, + }, + bundle: true, + } + ) + const response = await worker.fetch('http://localhost') + await response.text() + await worker.stop() + + expect(batches).toHaveLength(1) + const events = batches[0].batch + expect(events).toHaveLength(1) + expect(batches).toMatchInlineSnapshot( + batches.map(() => snapshotMatchers.getReqBody(1)), + ` + Array [ + Object { + "batch": Array [ + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object {}, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + ], + "sentAt": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + }, + ] + ` + ) + }) + + it('can send each event type in a batch', async () => { + const batches: any[] = [] + mockSegmentServer.on('batch', (batch) => { + batches.push(batch) + }) + + const worker = await unstable_dev( + joinPath(__dirname, 'workers', 'send-each-event-type.ts'), + { + experimental: { + disableExperimentalWarning: true, + }, + bundle: true, + } + ) + const response = await worker.fetch('http://localhost') + await response.text() + await worker.stop() + + expect(batches).toHaveLength(1) + const events = batches[0].batch + expect(events).toHaveLength(6) + expect(batches).toMatchInlineSnapshot( + batches.map(() => snapshotMatchers.getReqBody(6)), + ` + Array [ + Object { + "batch": Array [ + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "integrations": Object {}, + "messageId": Any, + "previousId": "other-user", + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "alias", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "groupId": "some-group", + "integrations": Object {}, + "messageId": Any, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "traits": Object {}, + "type": "group", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "integrations": Object {}, + "messageId": Any, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "traits": Object { + "favoriteColor": "Seattle Grey", + }, + "type": "identify", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "integrations": Object {}, + "messageId": Any, + "name": "Test Page", + "properties": Object {}, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "page", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object {}, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "integrations": Object {}, + "messageId": Any, + "name": "Test Screen", + "properties": Object {}, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "screen", + "userId": "some-user", + }, + ], + "sentAt": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + }, + ] + ` + ) + }) + + it('can send multiple events in a multiple batches', async () => { + const batches: any[] = [] + mockSegmentServer.on('batch', (batch) => { + batches.push(batch) + }) + + const worker = await unstable_dev( + joinPath(__dirname, 'workers', 'send-multiple-events.ts'), + { + experimental: { + disableExperimentalWarning: true, + }, + bundle: true, + } + ) + const response = await worker.fetch( + 'http://localhost?maxEventsInBatch=2&eventCount=6' + ) + await response.text() + await worker.stop() + + expect(batches).toHaveLength(3) + for (const { batch } of batches) { + expect(batch).toHaveLength(2) + } + expect(batches).toMatchInlineSnapshot( + batches.map(() => snapshotMatchers.getReqBody(2)), + ` + Array [ + Object { + "batch": Array [ + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 0, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 1, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + ], + "sentAt": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + }, + Object { + "batch": Array [ + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 2, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 3, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + ], + "sentAt": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + }, + Object { + "batch": Array [ + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 4, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + Object { + "_metadata": Object { + "jsRuntime": "cloudflare-worker", + }, + "context": Object { + "library": Object { + "name": "@segment/analytics-node", + "version": Any, + }, + }, + "event": "some-event", + "integrations": Object {}, + "messageId": Any, + "properties": Object { + "count": 5, + }, + "timestamp": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + "type": "track", + "userId": "some-user", + }, + ], + "sentAt": StringMatching /\\^\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.\\\\d\\{3\\}Z\\$/, + }, + ] + ` + ) + }) + + it('may exit without sending events if you forget closeAndFlush', async () => { + const batches: any[] = [] + mockSegmentServer.on('batch', (batch) => { + batches.push(batch) + }) + + const worker = await unstable_dev( + joinPath(__dirname, 'workers', 'forgot-close-and-flush.ts'), + { + experimental: { + disableExperimentalWarning: true, + }, + bundle: true, + } + ) + const response = await worker.fetch('http://localhost') + await response.text() + await worker.stop() + + expect(batches).toHaveLength(0) + }) +}) diff --git a/packages/node-integration-tests/src/cloudflare-tests/workers/README.md b/packages/node-integration-tests/src/cloudflare-tests/workers/README.md new file mode 100644 index 000000000..a1ffc1b67 --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/workers/README.md @@ -0,0 +1,7 @@ +These workers can also be ran directly via: + +``` +npx wrangler dev ./src/cloudflare/workers/ +``` + +This can be useful if you need to debug a worker with dev tools. diff --git a/packages/node-integration-tests/src/cloudflare-tests/workers/forgot-close-and-flush.ts b/packages/node-integration-tests/src/cloudflare-tests/workers/forgot-close-and-flush.ts new file mode 100644 index 000000000..4c91062ac --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/workers/forgot-close-and-flush.ts @@ -0,0 +1,14 @@ +/// +import { Analytics } from '@segment/analytics-node' + +export default { + fetch(_request: Request, _env: {}, _ctx: ExecutionContext) { + const analytics = new Analytics({ + writeKey: '__TEST__', + host: 'http://localhost:3000', + }) + + analytics.track({ userId: 'some-user', event: 'some-event' }) + return new Response('ok') + }, +} diff --git a/packages/node-integration-tests/src/cloudflare-tests/workers/send-each-event-type.ts b/packages/node-integration-tests/src/cloudflare-tests/workers/send-each-event-type.ts new file mode 100644 index 000000000..aa6126d0e --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/workers/send-each-event-type.ts @@ -0,0 +1,24 @@ +/// +import { Analytics } from '@segment/analytics-node' + +export default { + async fetch(_request: Request, _env: {}, _ctx: ExecutionContext) { + const analytics = new Analytics({ + writeKey: '__TEST__', + host: 'http://localhost:3000', + }) + + analytics.alias({ userId: 'some-user', previousId: 'other-user' }) + analytics.group({ userId: 'some-user', groupId: 'some-group' }) + analytics.identify({ + userId: 'some-user', + traits: { favoriteColor: 'Seattle Grey' }, + }) + analytics.page({ userId: 'some-user', name: 'Test Page' }) + analytics.track({ userId: 'some-user', event: 'some-event' }) + analytics.screen({ userId: 'some-user', name: 'Test Screen' }) + + await analytics.closeAndFlush() + return new Response('ok') + }, +} diff --git a/packages/node-integration-tests/src/cloudflare-tests/workers/send-multiple-events.ts b/packages/node-integration-tests/src/cloudflare-tests/workers/send-multiple-events.ts new file mode 100644 index 000000000..23a9de976 --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/workers/send-multiple-events.ts @@ -0,0 +1,29 @@ +/// +import { Analytics } from '@segment/analytics-node' + +export default { + async fetch(request: Request, _env: {}, _ctx: ExecutionContext) { + const url = new URL(request.url) + const maxEventsInBatch = parseInt( + url.searchParams.get('maxEventsInBatch') ?? '15', + 10 + ) + const eventCount = parseInt(url.searchParams.get('eventCount') ?? '1', 10) + const analytics = new Analytics({ + writeKey: '__TEST__', + host: 'http://localhost:3000', + maxEventsInBatch, + }) + + for (let i = 0; i < eventCount; i++) { + analytics.track({ + userId: 'some-user', + event: 'some-event', + properties: { count: i }, + }) + } + + await analytics.closeAndFlush() + return new Response('ok') + }, +} diff --git a/packages/node-integration-tests/src/cloudflare-tests/workers/send-single-event.ts b/packages/node-integration-tests/src/cloudflare-tests/workers/send-single-event.ts new file mode 100644 index 000000000..f8d7452cd --- /dev/null +++ b/packages/node-integration-tests/src/cloudflare-tests/workers/send-single-event.ts @@ -0,0 +1,16 @@ +/// +import { Analytics } from '@segment/analytics-node' + +export default { + async fetch(_request: Request, _env: {}, _ctx: ExecutionContext) { + const analytics = new Analytics({ + writeKey: '__TEST__', + host: 'http://localhost:3000', + }) + + analytics.track({ userId: 'some-user', event: 'some-event' }) + + await analytics.closeAndFlush() + return new Response('ok') + }, +} diff --git a/packages/node-integration-tests/src/server/mock-segment-workers.ts b/packages/node-integration-tests/src/server/mock-segment-workers.ts new file mode 100644 index 000000000..0c767c2c0 --- /dev/null +++ b/packages/node-integration-tests/src/server/mock-segment-workers.ts @@ -0,0 +1,78 @@ +import { createServer, IncomingMessage } from 'http' + +async function getRequestText(req: IncomingMessage) { + return new Promise((resolve, reject) => { + const data: Buffer[] = [] + req.on('error', reject) + req.on('data', (chunk) => { + data.push(chunk) + }) + req.on('end', () => { + resolve(Buffer.concat(data).toString()) + }) + }) +} + +function isBatchRequest(req: IncomingMessage) { + if (req.url?.endsWith('/v1/batch')) { + return true + } + return false +} + +type BatchHandler = (batch: any) => void + +export class MockSegmentServer { + private server: ReturnType + private port: number + private onBatchHandlers: Set = new Set() + + constructor(port: number) { + this.port = port + this.server = createServer(async (req, res) => { + if (!isBatchRequest(req)) { + res.writeHead(404, { 'Content-Type': 'application/json' }) + res.end(JSON.stringify({ success: false })) + return + } + + const text = await getRequestText(req) + const batch = JSON.parse(text) + this.onBatchHandlers.forEach((handler) => { + handler(batch) + }) + res.writeHead(200, { 'Content-Type': 'application/json' }) + res.end(JSON.stringify({ success: true })) + }) + } + + start(): Promise { + return new Promise((resolve, reject) => { + this.server.on('error', reject) + this.server.listen(this.port, () => { + resolve() + }) + }) + } + + stop(): Promise { + return new Promise((resolve, reject) => { + this.onBatchHandlers.clear() + this.server.close((err) => { + if (err) { + reject(err) + } else { + resolve() + } + }) + }) + } + + on(_event: 'batch', handler: BatchHandler) { + this.onBatchHandlers.add(handler) + } + + off(_event: 'batch', handler: BatchHandler) { + this.onBatchHandlers.delete(handler) + } +} diff --git a/turbo.json b/turbo.json index 5f6bc7651..35259dee4 100644 --- a/turbo.json +++ b/turbo.json @@ -28,6 +28,12 @@ "dependsOn": ["build"], "inputs": ["**/tsconfig*.json", "**/*.ts", "**/*.tsx", "**/*.js"], "outputs": [] + }, + "test:cloudflare-workers": { + "dependsOn": ["build"] + }, + "test:perf-and-durability": { + "dependsOn": ["build"] } } } diff --git a/yarn.lock b/yarn.lock index a2979c95f..a45dc1b61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2343,6 +2343,57 @@ __metadata: languageName: node linkType: hard +"@cloudflare/kv-asset-handler@npm:^0.2.0": + version: 0.2.0 + resolution: "@cloudflare/kv-asset-handler@npm:0.2.0" + dependencies: + mime: ^3.0.0 + checksum: bc6a02a9c80be6de90e46454ef4de09301e68726eaa4835de0e30216e50fffcc5612274a17dfb455916cf3418f0cb25fefd2b561a9d2282f4cc10d40527f0acb + languageName: node + linkType: hard + +"@cloudflare/workerd-darwin-64@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "@cloudflare/workerd-darwin-64@npm:1.20231002.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@cloudflare/workerd-darwin-arm64@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "@cloudflare/workerd-darwin-arm64@npm:1.20231002.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@cloudflare/workerd-linux-64@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "@cloudflare/workerd-linux-64@npm:1.20231002.0" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@cloudflare/workerd-linux-arm64@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "@cloudflare/workerd-linux-arm64@npm:1.20231002.0" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@cloudflare/workerd-windows-64@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "@cloudflare/workerd-windows-64@npm:1.20231002.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@cloudflare/workers-types@npm:^4.20231002.0": + version: 4.20231002.0 + resolution: "@cloudflare/workers-types@npm:4.20231002.0" + checksum: 066f4ef24286948de0165be9b22b842867330fcbaba520a60bae01a1ce85617364829fe50be7480f12a3fe4dc41463a9a53a8722b473493c61e0fc57dd7b21e9 + languageName: node + linkType: hard + "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" @@ -2366,6 +2417,181 @@ __metadata: languageName: node linkType: hard +"@esbuild-plugins/node-globals-polyfill@npm:^0.2.3": + version: 0.2.3 + resolution: "@esbuild-plugins/node-globals-polyfill@npm:0.2.3" + peerDependencies: + esbuild: "*" + checksum: f83eeaa382680b26a3b1cf6c396450332c41d2dc0f9fd935d3f4bacf5412bef7383d2aeb4246a858781435b7c005a570dadc81051f8a038f1ef2111f17d3d8b0 + languageName: node + linkType: hard + +"@esbuild-plugins/node-modules-polyfill@npm:^0.2.2": + version: 0.2.2 + resolution: "@esbuild-plugins/node-modules-polyfill@npm:0.2.2" + dependencies: + escape-string-regexp: ^4.0.0 + rollup-plugin-node-polyfills: ^0.2.1 + peerDependencies: + esbuild: "*" + checksum: 73c247a7559c68b7df080ab08dd3d0b0ab44b934840a4933df9626357b7183a9a5d8cf4ffa9c744f1bad8d7131bce0fde14a23203f7b262f9f14f7b3485bfdb1 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/android-arm64@npm:0.17.19" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/android-arm@npm:0.17.19" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/android-x64@npm:0.17.19" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/darwin-arm64@npm:0.17.19" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/darwin-x64@npm:0.17.19" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/freebsd-arm64@npm:0.17.19" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/freebsd-x64@npm:0.17.19" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-arm64@npm:0.17.19" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-arm@npm:0.17.19" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-ia32@npm:0.17.19" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-loong64@npm:0.17.19" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@esbuild/linux-mips64el@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-mips64el@npm:0.17.19" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-ppc64@npm:0.17.19" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-riscv64@npm:0.17.19" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-s390x@npm:0.17.19" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/linux-x64@npm:0.17.19" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/netbsd-x64@npm:0.17.19" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/openbsd-x64@npm:0.17.19" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/sunos-x64@npm:0.17.19" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/win32-arm64@npm:0.17.19" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/win32-ia32@npm:0.17.19" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.17.19": + version: 0.17.19 + resolution: "@esbuild/win32-x64@npm:0.17.19" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -2442,6 +2668,13 @@ __metadata: languageName: unknown linkType: soft +"@fastify/busboy@npm:^2.0.0": + version: 2.0.0 + resolution: "@fastify/busboy@npm:2.0.0" + checksum: 41879937ce1dee6421ef9cd4da53239830617e1f0bb7a0e843940772cd72827205d05e518af6adabe6e1ea19301285fff432b9d11bad01a531e698bea95c781b + languageName: node + linkType: hard + "@gar/promisify@npm:^1.1.3": version: 1.1.3 resolution: "@gar/promisify@npm:1.1.3" @@ -2559,6 +2792,8 @@ __metadata: version: 0.0.0-use.local resolution: "@internal/node-integration-tests@workspace:packages/node-integration-tests" dependencies: + "@cloudflare/workers-types": ^4.20231002.0 + "@internal/config": "workspace:^" "@internal/test-helpers": "workspace:^" "@segment/analytics-node": "workspace:^" "@types/analytics-node": ^3.1.9 @@ -2566,6 +2801,7 @@ __metadata: "@types/node": ^16 analytics-node: ^6.2.0 autocannon: ^7.10.0 + wrangler: ^3.11.0 languageName: unknown linkType: soft @@ -6602,7 +6838,7 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.1.1": +"acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0": version: 8.2.0 resolution: "acorn-walk@npm:8.2.0" checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 @@ -6645,7 +6881,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.8.2": +"acorn@npm:^8.8.0, acorn@npm:^8.8.2": version: 8.10.0 resolution: "acorn@npm:8.10.0" bin: @@ -7245,6 +7481,15 @@ __metadata: languageName: node linkType: hard +"as-table@npm:^1.0.36": + version: 1.0.55 + resolution: "as-table@npm:1.0.55" + dependencies: + printable-characters: ^1.0.42 + checksum: 341c99d9e99a702c315b3f0744d49b4764b26ef7ddd32bafb9e1706626560c0e599100521fc1b17f640e804bd0503ce70b2ba519c023da6edf06bdd9086dccd9 + languageName: node + linkType: hard + "ast-types-flow@npm:^0.0.7": version: 0.0.7 resolution: "ast-types-flow@npm:0.0.7" @@ -7674,6 +7919,13 @@ __metadata: languageName: node linkType: hard +"blake3-wasm@npm:^2.1.5": + version: 2.1.5 + resolution: "blake3-wasm@npm:2.1.5" + checksum: 5088e929c722b52b9c28701c1760ab850a963692056a417b894c943030e3267f12138ae6409e79069b8d7d0401a411426147e8d812b65a49e303fa432af18871 + languageName: node + linkType: hard + "bluebird@npm:~3.4.1": version: 3.4.7 resolution: "bluebird@npm:3.4.7" @@ -8118,6 +8370,16 @@ __metadata: languageName: node linkType: hard +"capnp-ts@npm:^0.7.0": + version: 0.7.0 + resolution: "capnp-ts@npm:0.7.0" + dependencies: + debug: ^4.3.1 + tslib: ^2.2.0 + checksum: 9ab495a887c5d5fd56afa3cc930733cd8c6c0743c52c2e79c46675eb5c7753e5578f71348628a4b3d9f03e5269bc71f811e58af18d0b0557607c4ee56189cfbb + languageName: node + linkType: hard + "chainsaw@npm:~0.1.0": version: 0.1.0 resolution: "chainsaw@npm:0.1.0" @@ -8853,7 +9115,7 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.5.0": +"cookie@npm:0.5.0, cookie@npm:^0.5.0": version: 0.5.0 resolution: "cookie@npm:0.5.0" checksum: 1f4bd2ca5765f8c9689a7e8954183f5332139eb72b6ff783d8947032ec1fdf43109852c178e21a953a30c0dd42257828185be01b49d1eb1a67fd054ca588a180 @@ -9141,6 +9403,13 @@ __metadata: languageName: node linkType: hard +"data-uri-to-buffer@npm:^2.0.0": + version: 2.0.2 + resolution: "data-uri-to-buffer@npm:2.0.2" + checksum: 152bec5e77513ee253a7c686700a1723246f582dad8b614e8eaaaba7fa45a15c8671ae4b8f4843f4f3a002dae1d3e7a20f852f7d7bdc8b4c15cfe7adfdfb07f8 + languageName: node + linkType: hard + "data-uri-to-buffer@npm:^4.0.0": version: 4.0.1 resolution: "data-uri-to-buffer@npm:4.0.1" @@ -9208,7 +9477,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4.3.4, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4.3.4, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -10176,6 +10445,83 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:0.17.19": + version: 0.17.19 + resolution: "esbuild@npm:0.17.19" + dependencies: + "@esbuild/android-arm": 0.17.19 + "@esbuild/android-arm64": 0.17.19 + "@esbuild/android-x64": 0.17.19 + "@esbuild/darwin-arm64": 0.17.19 + "@esbuild/darwin-x64": 0.17.19 + "@esbuild/freebsd-arm64": 0.17.19 + "@esbuild/freebsd-x64": 0.17.19 + "@esbuild/linux-arm": 0.17.19 + "@esbuild/linux-arm64": 0.17.19 + "@esbuild/linux-ia32": 0.17.19 + "@esbuild/linux-loong64": 0.17.19 + "@esbuild/linux-mips64el": 0.17.19 + "@esbuild/linux-ppc64": 0.17.19 + "@esbuild/linux-riscv64": 0.17.19 + "@esbuild/linux-s390x": 0.17.19 + "@esbuild/linux-x64": 0.17.19 + "@esbuild/netbsd-x64": 0.17.19 + "@esbuild/openbsd-x64": 0.17.19 + "@esbuild/sunos-x64": 0.17.19 + "@esbuild/win32-arm64": 0.17.19 + "@esbuild/win32-ia32": 0.17.19 + "@esbuild/win32-x64": 0.17.19 + dependenciesMeta: + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: ac11b1a5a6008e4e37ccffbd6c2c054746fc58d0ed4a2f9ee643bd030cfcea9a33a235087bc777def8420f2eaafb3486e76adb7bdb7241a9143b43a69a10afd8 + languageName: node + linkType: hard + "esbuild@npm:^0.14.27": version: 0.14.47 resolution: "esbuild@npm:0.14.47" @@ -10728,6 +11074,13 @@ __metadata: languageName: node linkType: hard +"estree-walker@npm:^0.6.1": + version: 0.6.1 + resolution: "estree-walker@npm:0.6.1" + checksum: 9d6f82a4921f11eec18f8089fb3cce6e53bcf45a8e545c42a2674d02d055fb30f25f90495f8be60803df6c39680c80dcee7f944526867eb7aa1fc9254883b23d + languageName: node + linkType: hard + "estree-walker@npm:^2.0.1": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" @@ -10845,6 +11198,13 @@ __metadata: languageName: node linkType: hard +"exit-hook@npm:^2.2.1": + version: 2.2.1 + resolution: "exit-hook@npm:2.2.1" + checksum: 1aa8359b6c5590a012d6cadf9cd337d227291bfcaa8970dc585d73dffef0582af34ed8ac56f6164f8979979fb417cff1eb49f03cdfd782f9332a30c773f0ada0 + languageName: node + linkType: hard + "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -11645,6 +12005,16 @@ __metadata: languageName: node linkType: hard +"get-source@npm:^2.0.12": + version: 2.0.12 + resolution: "get-source@npm:2.0.12" + dependencies: + data-uri-to-buffer: ^2.0.0 + source-map: ^0.6.1 + checksum: c73368fee709594ba38682ec1a96872aac6f7d766396019611d3d2358b68186a7847765a773ea0db088c42781126cc6bc09e4b87f263951c74dae5dcea50ad42 + languageName: node + linkType: hard + "get-stdin@npm:^4.0.1": version: 4.0.1 resolution: "get-stdin@npm:4.0.1" @@ -14940,6 +15310,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.25.3": + version: 0.25.9 + resolution: "magic-string@npm:0.25.9" + dependencies: + sourcemap-codec: ^1.4.8 + checksum: 9a0e55a15c7303fc360f9572a71cffba1f61451bc92c5602b1206c9d17f492403bf96f946dfce7483e66822d6b74607262e24392e87b0ac27b786e69a40e9b1a + languageName: node + linkType: hard + "make-dir@npm:^2.1.0": version: 2.1.0 resolution: "make-dir@npm:2.1.0" @@ -15261,6 +15640,15 @@ __metadata: languageName: node linkType: hard +"mime@npm:^3.0.0": + version: 3.0.0 + resolution: "mime@npm:3.0.0" + bin: + mime: cli.js + checksum: f43f9b7bfa64534e6b05bd6062961681aeb406a5b53673b53b683f27fcc4e739989941836a355eef831f4478923651ecc739f4a5f6e20a76487b432bfd4db928 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -15303,6 +15691,26 @@ __metadata: languageName: node linkType: hard +"miniflare@npm:3.20231002.1": + version: 3.20231002.1 + resolution: "miniflare@npm:3.20231002.1" + dependencies: + acorn: ^8.8.0 + acorn-walk: ^8.2.0 + capnp-ts: ^0.7.0 + exit-hook: ^2.2.1 + glob-to-regexp: ^0.4.1 + source-map-support: 0.5.21 + stoppable: ^1.1.0 + undici: ^5.22.1 + workerd: 1.20231002.0 + ws: ^8.11.0 + youch: ^3.2.2 + zod: ^3.20.6 + checksum: 96105f99fc0e34f248c301279dc955fca1b12c0c2808a15954552b75df558c9d9964454cd295d37eeb92a4b564239e4912fa6b0e84359a86a62ab5f1e3399aea + languageName: node + linkType: hard + "minimalistic-assert@npm:^1.0.0": version: 1.0.1 resolution: "minimalistic-assert@npm:1.0.1" @@ -15592,6 +16000,15 @@ __metadata: languageName: node linkType: hard +"mustache@npm:^4.2.0": + version: 4.2.0 + resolution: "mustache@npm:4.2.0" + bin: + mustache: bin/mustache + checksum: 928fcb63e3aa44a562bfe9b59ba202cccbe40a46da50be6f0dd831b495be1dd7e38ca4657f0ecab2c1a89dc7bccba0885eab7ee7c1b215830da765758c7e0506 + languageName: node + linkType: hard + "mute-stream@npm:1.0.0": version: 1.0.0 resolution: "mute-stream@npm:1.0.0" @@ -15624,6 +16041,15 @@ __metadata: languageName: node linkType: hard +"nanoid@npm:^3.3.3": + version: 3.3.6 + resolution: "nanoid@npm:3.3.6" + bin: + nanoid: bin/nanoid.cjs + checksum: 7d0eda657002738aa5206107bd0580aead6c95c460ef1bdd0b1a87a9c7ae6277ac2e9b945306aaa5b32c6dcb7feaf462d0f552e7f8b5718abfc6ead5c94a71b3 + languageName: node + linkType: hard + "nanospinner@npm:^1.0.0": version: 1.1.0 resolution: "nanospinner@npm:1.1.0" @@ -16623,6 +17049,13 @@ __metadata: languageName: node linkType: hard +"path-to-regexp@npm:^6.2.0": + version: 6.2.1 + resolution: "path-to-regexp@npm:6.2.1" + checksum: f0227af8284ea13300f4293ba111e3635142f976d4197f14d5ad1f124aebd9118783dd2e5f1fe16f7273743cc3dbeddfb7493f237bb27c10fdae07020cc9b698 + languageName: node + linkType: hard + "path-type@npm:^1.0.0": version: 1.1.0 resolution: "path-type@npm:1.1.0" @@ -16903,6 +17336,13 @@ __metadata: languageName: node linkType: hard +"printable-characters@npm:^1.0.42": + version: 1.0.42 + resolution: "printable-characters@npm:1.0.42" + checksum: 2724aa02919d7085933af0f8f904bd0de67a6b53834f2e5b98fc7aa3650e20755c805e8c85bcf96c09f678cb16a58b55640dd3a2da843195fce06b1ccb0c8ce4 + languageName: node + linkType: hard + "prismjs@npm:^1.27.0": version: 1.28.0 resolution: "prismjs@npm:1.28.0" @@ -18041,6 +18481,35 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-inject@npm:^3.0.0": + version: 3.0.2 + resolution: "rollup-plugin-inject@npm:3.0.2" + dependencies: + estree-walker: ^0.6.1 + magic-string: ^0.25.3 + rollup-pluginutils: ^2.8.1 + checksum: a014972c80fe34b8c8154056fa2533a8440066a31de831e3793fc21b15d108d92c22d8f7f472397bd5783d7c5e04d8cbf112fb72c5a26e997726e4eb090edad1 + languageName: node + linkType: hard + +"rollup-plugin-node-polyfills@npm:^0.2.1": + version: 0.2.1 + resolution: "rollup-plugin-node-polyfills@npm:0.2.1" + dependencies: + rollup-plugin-inject: ^3.0.0 + checksum: e84645212c443aca3cfae2ba69f01c6d8c5c250f0bf651416b69a4572b60aae9da7cdd687de3ab9b903f7a1ab96b06b71f0c4927d1b02a37485360d2b563937b + languageName: node + linkType: hard + +"rollup-pluginutils@npm:^2.8.1": + version: 2.8.2 + resolution: "rollup-pluginutils@npm:2.8.2" + dependencies: + estree-walker: ^0.6.1 + checksum: 339fdf866d8f4ff6e408fa274c0525412f7edb01dc46b5ccda51f575b7e0d20ad72965773376fb5db95a77a7fcfcab97bf841ec08dbadf5d6b08af02b7a2cf5e + languageName: node + linkType: hard + "rollup@npm:>=2.59.0 <2.78.0": version: 2.77.3 resolution: "rollup@npm:2.77.3" @@ -18272,7 +18741,7 @@ __metadata: languageName: node linkType: hard -"selfsigned@npm:^2.1.1": +"selfsigned@npm:^2.0.1, selfsigned@npm:^2.1.1": version: 2.1.1 resolution: "selfsigned@npm:2.1.1" dependencies: @@ -18765,7 +19234,7 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:~0.5.20": +"source-map-support@npm:0.5.21, source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -18775,13 +19244,20 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": +"source-map@npm:0.6.1, source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": version: 0.6.1 resolution: "source-map@npm:0.6.1" checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2 languageName: node linkType: hard +"sourcemap-codec@npm:^1.4.8": + version: 1.4.8 + resolution: "sourcemap-codec@npm:1.4.8" + checksum: b57981c05611afef31605732b598ccf65124a9fcb03b833532659ac4d29ac0f7bfacbc0d6c5a28a03e84c7510e7e556d758d0bb57786e214660016fb94279316 + languageName: node + linkType: hard + "spark-md5@npm:^3.0.1": version: 3.0.1 resolution: "spark-md5@npm:3.0.1" @@ -18951,6 +19427,16 @@ __metadata: languageName: node linkType: hard +"stacktracey@npm:^2.1.8": + version: 2.1.8 + resolution: "stacktracey@npm:2.1.8" + dependencies: + as-table: ^1.0.36 + get-source: ^2.0.12 + checksum: abd8316b4e120884108f5a47b2f61abdcaeaa118afd95f3c48317cb057fff43d697450ba00de3f9fe7fee61ee72644ccda4db990a8e4553706644f7c17522eab + languageName: node + linkType: hard + "statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -18965,6 +19451,13 @@ __metadata: languageName: node linkType: hard +"stoppable@npm:^1.1.0": + version: 1.1.0 + resolution: "stoppable@npm:1.1.0" + checksum: 63104fcbdece130bc4906fd982061e763d2ef48065ed1ab29895e5ad00552c625f8a4c50c9cd2e3bfa805c8a2c3bfdda0f07c5ae39694bd2d5cb0bee1618d1e9 + languageName: node + linkType: hard + "stream-buffers@npm:^3.0.2": version: 3.0.2 resolution: "stream-buffers@npm:3.0.2" @@ -19828,7 +20321,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.1": +"tslib@npm:^2.0.1, tslib@npm:^2.2.0": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad @@ -20129,6 +20622,15 @@ __metadata: languageName: node linkType: hard +"undici@npm:^5.22.1": + version: 5.25.4 + resolution: "undici@npm:5.25.4" + dependencies: + "@fastify/busboy": ^2.0.0 + checksum: 654da161687de893127a685be61a19cb5bae42f4595c316ebf633929d871ac3bcd33edcb74156cea90655dfcd100bfe9b53a4f4749d52fc6ad2232f49a6ca8ab + languageName: node + linkType: hard + "unfetch@npm:^3.1.1": version: 3.1.2 resolution: "unfetch@npm:3.1.2" @@ -21127,6 +21629,32 @@ __metadata: languageName: node linkType: hard +"workerd@npm:1.20231002.0": + version: 1.20231002.0 + resolution: "workerd@npm:1.20231002.0" + dependencies: + "@cloudflare/workerd-darwin-64": 1.20231002.0 + "@cloudflare/workerd-darwin-arm64": 1.20231002.0 + "@cloudflare/workerd-linux-64": 1.20231002.0 + "@cloudflare/workerd-linux-arm64": 1.20231002.0 + "@cloudflare/workerd-windows-64": 1.20231002.0 + dependenciesMeta: + "@cloudflare/workerd-darwin-64": + optional: true + "@cloudflare/workerd-darwin-arm64": + optional: true + "@cloudflare/workerd-linux-64": + optional: true + "@cloudflare/workerd-linux-arm64": + optional: true + "@cloudflare/workerd-windows-64": + optional: true + bin: + workerd: bin/workerd + checksum: e51c2e33a12f742ba8c04810ff309e65f9cb739fd5701f5502e50deb4c82ad85052d0e0bf3679956272013c5b024ae9165d35149730e7cbbcbfb28aea6cdafa0 + languageName: node + linkType: hard + "workerpool@npm:6.2.1": version: 6.2.1 resolution: "workerpool@npm:6.2.1" @@ -21134,6 +21662,34 @@ __metadata: languageName: node linkType: hard +"wrangler@npm:^3.11.0": + version: 3.11.0 + resolution: "wrangler@npm:3.11.0" + dependencies: + "@cloudflare/kv-asset-handler": ^0.2.0 + "@esbuild-plugins/node-globals-polyfill": ^0.2.3 + "@esbuild-plugins/node-modules-polyfill": ^0.2.2 + blake3-wasm: ^2.1.5 + chokidar: ^3.5.3 + esbuild: 0.17.19 + fsevents: ~2.3.2 + miniflare: 3.20231002.1 + nanoid: ^3.3.3 + path-to-regexp: ^6.2.0 + selfsigned: ^2.0.1 + source-map: 0.6.1 + source-map-support: 0.5.21 + xxhash-wasm: ^1.0.1 + dependenciesMeta: + fsevents: + optional: true + bin: + wrangler: bin/wrangler.js + wrangler2: bin/wrangler.js + checksum: 0799ab07640ada55adad1b45e5f2ebd04717c8701b2888d0e27fc21d9140680b256e676b5bef247964799ff392449e2ec2b387635ca968c1f97b8da928231385 + languageName: node + linkType: hard + "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" @@ -21241,6 +21797,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^8.11.0": + version: 8.14.2 + resolution: "ws@npm:8.14.2" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 3ca0dad26e8cc6515ff392b622a1467430814c463b3368b0258e33696b1d4bed7510bc7030f7b72838b9fdeb8dbd8839cbf808367d6aae2e1d668ce741d4308b + languageName: node + linkType: hard + "xdg-basedir@npm:^4.0.0": version: 4.0.0 resolution: "xdg-basedir@npm:4.0.0" @@ -21279,6 +21850,13 @@ __metadata: languageName: node linkType: hard +"xxhash-wasm@npm:^1.0.1": + version: 1.0.2 + resolution: "xxhash-wasm@npm:1.0.2" + checksum: 11fec6e6196e37ad96cc958b7a4477dc30caf5b4da889a02a84f6f663ab8cd3c9be6ae405e66f0af0404301f27c39375191c5254f0409a793020e2093afd1409 + languageName: node + linkType: hard + "y18n@npm:^4.0.0": version: 4.0.3 resolution: "y18n@npm:4.0.3" @@ -21510,6 +22088,17 @@ __metadata: languageName: node linkType: hard +"youch@npm:^3.2.2": + version: 3.3.2 + resolution: "youch@npm:3.3.2" + dependencies: + cookie: ^0.5.0 + mustache: ^4.2.0 + stacktracey: ^2.1.8 + checksum: ffe1370279972401c5c3b296fe24c319e2a43370737ae46058bbbd6739a1efb3bdd2e52dbebb28e9049ac21fd570f7934033bc8dd98cb11019bffba6ab8df3c9 + languageName: node + linkType: hard + "zip-stream@npm:^4.1.0": version: 4.1.0 resolution: "zip-stream@npm:4.1.0" @@ -21531,3 +22120,10 @@ __metadata: checksum: 116cee5a2c1ecce7aa440b665470653f58ef56670c6aafa1b5491c9f9335992352145502af5fa865ac82f46336905e37fb7cbc649c2be72e2152c6b91802995c languageName: node linkType: hard + +"zod@npm:^3.20.6": + version: 3.22.4 + resolution: "zod@npm:3.22.4" + checksum: 80bfd7f8039b24fddeb0718a2ec7c02aa9856e4838d6aa4864335a047b6b37a3273b191ef335bf0b2002e5c514ef261ffcda5a589fb084a48c336ffc4cdbab7f + languageName: node + linkType: hard