Skip to content

Commit 8f28539

Browse files
author
Uros Marolt
authored
Bugfix/typescript errors (#480)
1 parent 8bc4717 commit 8f28539

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/CI-node.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Check formatting
3838
run: npx prettier --check .
3939

40+
- name: Check typescript
41+
run: npx tsc
42+
4043
tests-main:
4144
needs: lint-format
4245
runs-on: ubuntu-latest

backend/src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@ setImmediate(async () => {
174174
app.use(io.expressErrorHandler())
175175
})
176176

177-
export default server
177+
export default server

backend/src/api/report/reportDestroy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default async (req, res) => {
88

99
await new ReportService(req).destroyAll(req.query.ids)
1010

11-
track('Report Deleted')
11+
track('Report Deleted', { ids: req.query.ids }, { ...req })
1212

1313
const payload = true
1414

backend/src/api/widget/widgetDestroy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async (req, res) => {
1010

1111
const payload = true
1212

13-
track('Widget Deleted')
13+
track('Widget Deleted', { ids: req.query.ids }, { ...req })
1414

1515
await req.responseHandler.success(req, res, payload)
1616
}

backend/src/serverless/integrations/types/iteratorTypes.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { AddActivitiesSingle } from './messageTypes'
2-
import { Channels } from './regularTypes'
32

43
export type IntegrationResponse = {
54
records: Array<object>
@@ -24,11 +23,11 @@ export interface TwitterOutput extends BaseOutput {
2423
export interface TwitterReachOutput extends BaseOutput {}
2524

2625
export interface DiscordOutput extends BaseOutput {
27-
channels: Channels
26+
channels: any[]
2827
}
2928

3029
export interface SlackOutput extends BaseOutput {
31-
channels: Channels
30+
channels: any[]
3231
users: Object
3332
}
3433

backend/src/serverless/integrations/usecases/chat/getChannels.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { SuperfaceClient } from '@superfaceai/one-sdk'
22
import { cleanSuperfaceError } from '../cleanError'
33
import { createServiceChildLogger } from '../../../../utils/logging'
4-
import { Channel, Channels } from '../../types/regularTypes'
54
import isInvalid from '../isInvalid'
65
import { timeout } from '../../../../utils/timing'
76

@@ -17,7 +16,7 @@ async function tryChannel(
1716
client: SuperfaceClient,
1817
source: string,
1918
accessToken: string,
20-
channel: Channel,
19+
channel: any,
2120
): Promise<any> {
2221
try {
2322
const input = {
@@ -61,11 +60,11 @@ async function getChannels(
6160
log.warn({ input, result }, 'Invalid request in getChannels')
6261
}
6362
if (tryChannels) {
64-
const out: Channels = []
63+
const out: any[] = []
6564
for (const channel of result.value.channels) {
6665
const limit = await tryChannel(client, source, accessToken, channel)
6766
if (limit) {
68-
const toOut: Channel = {
67+
const toOut: any = {
6968
name: channel.name,
7069
id: channel.id,
7170
}

backend/src/serverless/integrations/usecases/chat/getThreads.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { SuperfaceClient } from '@superfaceai/one-sdk'
2-
import { Channels } from '../../types/regularTypes'
32
import isInvalid from '../isInvalid'
43
import { PlatformType } from '../../../../types/integrationEnums'
54
import { createServiceChildLogger } from '../../../../utils/logging'
@@ -11,7 +10,7 @@ async function getChannels(
1110
client: SuperfaceClient,
1211
serverId: string,
1312
accessToken: string,
14-
): Promise<Channels> {
13+
): Promise<any[]> {
1514
try {
1615
const input = { server: serverId.toString() }
1716
const profile = await client.getProfile('chat/threads')

0 commit comments

Comments
 (0)