1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-05 03:30:05 +00:00

fix: createReadStream import where needed

It's node specific util and othervise adapter was failing on browser environment
This commit is contained in:
2023-01-09 13:07:51 +01:00
parent 72ddd424a5
commit e7ceac1b78
3 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
import * as NodeFormData from 'form-data'
import { createReadStream } from '@sasjs/utils/file'
import { AuthConfig, ServerType, ServicePackSASjs } from '@sasjs/utils/types'
import { ExecutionQuery } from './types'
import { RequestClient } from './request/RequestClient'
@@ -62,6 +61,7 @@ export class SASjsApiClient {
* @param authConfig - (optional) a valid client, secret, refresh and access tokens that are authorised to execute compute jobs.
*/
public async deployZipFile(zipFilePath: string, authConfig?: AuthConfig) {
const { createReadStream } = require('@sasjs/utils/file')
const access_token = await this.getAccessTokenForRequest(authConfig)
const file = await createReadStream(zipFilePath)