Skip to content

Commit

Permalink
Bugfix/typescript errors (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uros Marolt authored Feb 2, 2023
1 parent 8bc4717 commit 8f28539
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Check formatting
run: npx prettier --check .

- name: Check typescript
run: npx tsc

tests-main:
needs: lint-format
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion backend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ setImmediate(async () => {
app.use(io.expressErrorHandler())
})

export default server
export default server
2 changes: 1 addition & 1 deletion backend/src/api/report/reportDestroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async (req, res) => {

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

track('Report Deleted')
track('Report Deleted', { ids: req.query.ids }, { ...req })

const payload = true

Expand Down
2 changes: 1 addition & 1 deletion backend/src/api/widget/widgetDestroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async (req, res) => {

const payload = true

track('Widget Deleted')
track('Widget Deleted', { ids: req.query.ids }, { ...req })

await req.responseHandler.success(req, res, payload)
}
5 changes: 2 additions & 3 deletions backend/src/serverless/integrations/types/iteratorTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AddActivitiesSingle } from './messageTypes'
import { Channels } from './regularTypes'

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

export interface DiscordOutput extends BaseOutput {
channels: Channels
channels: any[]
}

export interface SlackOutput extends BaseOutput {
channels: Channels
channels: any[]
users: Object
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SuperfaceClient } from '@superfaceai/one-sdk'
import { cleanSuperfaceError } from '../cleanError'
import { createServiceChildLogger } from '../../../../utils/logging'
import { Channel, Channels } from '../../types/regularTypes'
import isInvalid from '../isInvalid'
import { timeout } from '../../../../utils/timing'

Expand All @@ -17,7 +16,7 @@ async function tryChannel(
client: SuperfaceClient,
source: string,
accessToken: string,
channel: Channel,
channel: any,
): Promise<any> {
try {
const input = {
Expand Down Expand Up @@ -61,11 +60,11 @@ async function getChannels(
log.warn({ input, result }, 'Invalid request in getChannels')
}
if (tryChannels) {
const out: Channels = []
const out: any[] = []
for (const channel of result.value.channels) {
const limit = await tryChannel(client, source, accessToken, channel)
if (limit) {
const toOut: Channel = {
const toOut: any = {
name: channel.name,
id: channel.id,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SuperfaceClient } from '@superfaceai/one-sdk'
import { Channels } from '../../types/regularTypes'
import isInvalid from '../isInvalid'
import { PlatformType } from '../../../../types/integrationEnums'
import { createServiceChildLogger } from '../../../../utils/logging'
Expand All @@ -11,7 +10,7 @@ async function getChannels(
client: SuperfaceClient,
serverId: string,
accessToken: string,
): Promise<Channels> {
): Promise<any[]> {
try {
const input = { server: serverId.toString() }
const profile = await client.getProfile('chat/threads')
Expand Down

0 comments on commit 8f28539

Please sign in to comment.