Skip to content

Commit

Permalink
Fix missing TS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zzarcon committed Apr 3, 2019
1 parent 1c80237 commit a1e73df
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/core/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as builds from './builds.json';
import * as CONSTANTS from '../../constants/constants';
import * as _ from 'lodash';
import { IAppCredentials, IDevicePayload } from './device.interface';
import pruned = require('../../v1/json-pruned');
import pruned from '../../v1/json-pruned';
import hmac = require('crypto-js/hmac-sha256');

export class Device {
Expand Down
2 changes: 1 addition & 1 deletion src/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class Request {
throw new Exceptions.RequestError(json);
}

send(options = {}, attempts = 0): Bluebird<any> {
send(options = {}, attempts = 0): any {
return Bluebird.try(async () => {
const rawResponse = await this.sendAndGetRaw(options);
this.session.requestEnd$.next(rawResponse);
Expand Down
8 changes: 4 additions & 4 deletions src/v1/media.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const request = require('request-promise');
const Promise = require('bluebird');
import * as Bluebird from 'bluebird'
const _ = require('lodash');

import { plainToClass } from 'class-transformer';
Expand Down Expand Up @@ -207,7 +207,7 @@ export class Media extends Resource {
const duration = durationms / 1000;
if (!caption) caption = '';
if (!delay || typeof delay != 'number') delay = 6500;
return Promise.delay(delay)
return Bluebird.delay(delay)
.then(() => session.getAccountId())
.then(accountId => {
const payload = pruned({
Expand Down Expand Up @@ -291,7 +291,7 @@ export class Media extends Resource {
const duration = durationms / 1000;
if (!caption) caption = '';
if (!delay || typeof delay != 'number') delay = 6500;
return Promise.delay(delay).then(() => {
return Bluebird.delay(delay).then(() => {
const payload = {
filter_type: '0',
source_type: '3',
Expand Down Expand Up @@ -325,7 +325,7 @@ export class Media extends Resource {
caption = caption || '';
disableComments = disableComments || false;

return Promise.mapSeries(medias, media => {
return Bluebird.mapSeries<any, any>(medias, (media) => {
if (media.type === 'photo') {
return Media.configurePhotoAlbum(
session,
Expand Down
2 changes: 1 addition & 1 deletion src/v1/resource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const EventEmitter = require('events').EventEmitter;
const _ = require('lodash');
const { Request } = require('../core/request');
import { Request } from '../core/request';

class InstagramResource extends EventEmitter {
constructor (session, params) {
Expand Down
4 changes: 2 additions & 2 deletions src/v1/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Helpers } from '../helpers';

const _ = require('lodash');
import Resource from './resource';
const Promise = require('bluebird');
import * as Bluebird from 'bluebird'
const camelKeys = require('camelcase-keys');
import ThreadItem from './thread-item';
import * as Exceptions from '../core/exceptions';
Expand Down Expand Up @@ -294,7 +294,7 @@ function threadsWrapper (session, promise) {
if (_.isArray(json.threads)) return mapPayload(session, json);
if (_.isEmpty(json.thread_id)) throw new Error('Not sure how to map an thread!');
// You cannot fetch thread id inmedietly after configure / broadcast
return Promise.delay(1000)
return Bluebird.delay(1000)
.then(() => Thread.getById(session, json.thread_id))
.then(thread => [thread]);
});
Expand Down
4 changes: 2 additions & 2 deletions src/v1/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Request } from '../core/request';
import { Helpers } from '../helpers';

import Resource from './resource';
const Promise = require('bluebird');
import * as Bluebird from 'bluebird';
const camelKeys = require('camelcase-keys');

class Upload extends Resource {
Expand Down Expand Up @@ -91,7 +91,7 @@ class Upload extends Resource {
data: buffer.slice(chunkLength, buffer.length),
range: `bytes ${chunkLength}-${buffer.length - 1}/${buffer.length}`,
});
return Promise.mapSeries(chunks, (chunk, i) =>
return Bluebird.mapSeries<any, any>(chunks, (chunk, i) =>
_sendChunkedRequest(
session,
uploadData.params.uploadUrl,
Expand Down

0 comments on commit a1e73df

Please sign in to comment.