Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@makeflow/cli

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@makeflow/cli - npm Package Compare versions

Comparing version 0.1.0-wip.5 to 0.1.0-wip.6

bld/program/commands/power-app/default.d.ts

4

bld/program/commands/login.js

@@ -62,3 +62,3 @@ "use strict";

async getUserId(username, password) {
let result = await api.call('/account/list-users', {
let result = await api.post('/account/list-users', {
mobile: username,

@@ -90,3 +90,3 @@ password,

let userId = await this.getUserId(username, password);
let accessToken = await api.call('/access-token/create', {
let accessToken = await api.post('/access-token/create', {
mobile: username,

@@ -93,0 +93,0 @@ password,

@@ -38,3 +38,3 @@ "use strict";

}
return api.call('/power-app/publish', {
return api.post('/power-app/publish', {
definition,

@@ -41,0 +41,0 @@ token,

@@ -10,3 +10,3 @@ "use strict";

const DEFAULT_CONFIG = {
api: 'https://makeflow.com/api/v1',
api: 'https://www.makeflow.com/api/v1',
};

@@ -13,0 +13,0 @@ exports.config = { ...DEFAULT_CONFIG };

@@ -0,1 +1,3 @@

/// <reference types="node" />
import { BodyInit } from 'node-fetch';
export declare class API {

@@ -7,3 +9,5 @@ private apiBaseURL;

getURL(path: string): string;
call<T>(path: string, data: unknown, ignoreAccessToken?: boolean): Promise<T>;
post<T>(path: string, data: unknown, ignoreAccessToken?: boolean): Promise<T>;
upload<T>(path: string, data: Buffer, type: string): Promise<T>;
call<T>(method: string, path: string, body: BodyInit, ignoreAccessToken?: boolean, type?: string): Promise<T>;
}

@@ -7,2 +7,3 @@ "use strict";

const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
const JSONContentType = 'application/json';
class API {

@@ -24,9 +25,15 @@ constructor(apiBaseURL, _accessToken) {

}
async call(path, data, ignoreAccessToken = false) {
async post(path, data, ignoreAccessToken = false) {
return this.call('POST', path, JSON.stringify(data), ignoreAccessToken);
}
async upload(path, data, type) {
return this.call('POST', path, data, false, type);
}
async call(method, path, body, ignoreAccessToken = false, type = JSONContentType) {
let url = this.getURL(path);
let response = await node_fetch_1.default(url, {
method: 'POST',
body: JSON.stringify(data),
method,
body,
headers: {
'Content-Type': 'application/json',
'Content-Type': type,
...(ignoreAccessToken

@@ -33,0 +40,0 @@ ? undefined

{
"name": "@makeflow/cli",
"version": "0.1.0-wip.5",
"version": "0.1.0-wip.6",
"description": "Command line interface for Makeflow.",

@@ -23,2 +23,3 @@ "publishConfig": {

"clime": "^0.5.14",
"mime": "^2.4.6",
"node-fetch": "^2.6.0",

@@ -25,0 +26,0 @@ "prompts": "^2.3.2",

@@ -92,3 +92,3 @@ import {Command, Options, command, metadata, option} from 'clime';

private async getUserId(username: string, password: string): Promise<string> {
let result = await api.call<MFUserCandidate[]>(
let result = await api.post<MFUserCandidate[]>(
'/account/list-users',

@@ -135,3 +135,3 @@ {

let accessToken = await api.call<string>(
let accessToken = await api.post<string>(
'/access-token/create',

@@ -138,0 +138,0 @@ {

@@ -60,3 +60,3 @@ import {

return api.call('/power-app/publish', {
return api.post('/power-app/publish', {
definition,

@@ -63,0 +63,0 @@ token,

@@ -13,3 +13,3 @@ import * as FS from 'fs';

const DEFAULT_CONFIG: SDKConfig = {
api: 'https://makeflow.com/api/v1',
api: 'https://www.makeflow.com/api/v1',
};

@@ -16,0 +16,0 @@

import {ExpectedError} from 'clime';
import fetch from 'node-fetch';
import fetch, {BodyInit} from 'node-fetch';
const JSONContentType = 'application/json';
interface APISuccessResult {

@@ -39,3 +41,3 @@ data: any;

async call<T>(
async post<T>(
path: string,

@@ -45,9 +47,23 @@ data: unknown,

): Promise<T> {
return this.call('POST', path, JSON.stringify(data), ignoreAccessToken);
}
async upload<T>(path: string, data: Buffer, type: string): Promise<T> {
return this.call('POST', path, data, false, type);
}
async call<T>(
method: string,
path: string,
body: BodyInit,
ignoreAccessToken = false,
type = JSONContentType,
): Promise<T> {
let url = this.getURL(path);
let response = await fetch(url, {
method: 'POST',
body: JSON.stringify(data),
method,
body,
headers: {
'Content-Type': 'application/json',
'Content-Type': type,
...(ignoreAccessToken

@@ -54,0 +70,0 @@ ? undefined

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc