Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
with:
node-version: 14
- run: npm ci
- run: npm run build # needs to happen until I figure out a way to hotload it
- name: Test
run: npm run test
lint:
Expand Down
16 changes: 8 additions & 8 deletions lib/pubsub/getFilteredSubs-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('collapseKeys', () => {
'b.d': 'hi',
'b.e.f': false,
})
assert.deepEqual(collapseKeys({ a: [1,2,3, { b: 4, c: [], d: null, e: undefined }] }), {
assert.deepEqual(collapseKeys({ a: [1, 2, 3, { b: 4, c: [], d: null, e: undefined }] }), {
'a.0': 1,
'a.1': 2,
'a.2': 3,
Expand Down Expand Up @@ -42,13 +42,13 @@ describe('getFilteredSubs', () => {
const subscription = {
id: '1',
topic,
filter: { },
filter: {},
subscriptionId: '1',
subscription: { } as any,
subscription: {} as any,
connectionId: 'abcd',
connectionInitPayload: {},
requestContext: {} as any,
ttl: Date.now() + 100000,
ttl: Math.floor(Date.now() / 1000) + 100000,
createdAt: Date.now(),
}

Expand All @@ -64,11 +64,11 @@ describe('getFilteredSubs', () => {
topic,
filter: { language: 'en' },
subscriptionId: '2',
subscription: { } as any,
subscription: {} as any,
connectionId: 'abcd',
connectionInitPayload: {},
requestContext: {} as any,
ttl: Date.now() + 100000,
ttl: Math.floor(Date.now() / 1000) + 100000,
createdAt: Date.now(),
}

Expand All @@ -86,11 +86,11 @@ describe('getFilteredSubs', () => {
topic,
filter: { language: 'en ' },
subscriptionId: '12345',
subscription: { } as any,
subscription: {} as any,
connectionId: '1234',
connectionInitPayload: {},
requestContext: {} as any,
ttl: Date.now() + 100000,
ttl: Math.floor(Date.now() / 1000) + 100000,
createdAt: Date.now(),
}

Expand Down
5 changes: 4 additions & 1 deletion lib/utils/defaultTTL.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export const defaultTTL = (): number => Date.now() + 3 * 1000 * 60 * 60
/**
* Three hours from now
*/
export const defaultTTL = (hours = 3): number => Math.floor(Date.now() / 1000) + (hours * 60 * 60)
4 changes: 3 additions & 1 deletion mocks/arc-basic-events/app.arc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ basic-events

@ws

@static
folder dist

@tables
Connection
id *String
Expand All @@ -15,7 +18,6 @@ Subscription

Subscription
connectionId *String
# topicAndKey **String
name ConnectionIndex

Subscription
Expand Down
3 changes: 2 additions & 1 deletion mocks/arc-basic-events/lib/graphql.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-var-requires */
require('esbuild-register')
const { makeExecutableSchema } = require('@graphql-tools/schema')
const { tables: arcTables } = require('@architect/functions')
const { makeServer, subscribe } = require('../../../dist')
const { makeServer, subscribe } = require('../../../lib')
const { ApiGatewayManagementApi } = require('aws-sdk')
const { GraphQLError } = require('graphql')

Expand Down
Loading