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

artsy-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artsy-cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/commands/login.d.ts

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# v0.0.3 (Fri Sep 06 2019)
---
# v0.0.2 (Wed Sep 04 2019)

@@ -2,0 +8,0 @@

@@ -6,2 +6,3 @@ declare class Gravity {

};
getAccessToken(credentials: Credentials): Promise<AccessTokenResponse>;
get(endpoint: string): Promise<import("node-fetch").Response>;

@@ -11,1 +12,9 @@ url(endpoint: string): string;

export default Gravity;
export interface Credentials {
email: string;
password: string;
}
interface AccessTokenResponse {
access_token: string;
expires_in: string;
}

15

lib/lib/gravity/index.js

@@ -5,5 +5,16 @@ "use strict";

class Gravity {
async getAccessToken(credentials) {
const gravityUrl = this.url("oauth2/access_token");
const body = Object.assign({ client_id: process.env.CLIENT_ID, client_secret: process.env.CLIENT_SECRET, grant_type: "credentials" }, credentials);
const response = await node_fetch_1.default(gravityUrl, {
method: "post",
body: JSON.stringify(body),
headers: { "Content-Type": "application/json" },
});
const json = await response.json();
return json;
}
async get(endpoint) {
const token = process.env.TOKEN; // temp until our auth/token plumbing is hooked up
const gravityUrl = this.url(endpoint);
const gravityUrl = this.url(`api/v1/${endpoint}`);
const headers = { "X-Access-Token": token };

@@ -15,3 +26,3 @@ const response = await node_fetch_1.default(gravityUrl, { headers });

const host = Gravity.HOSTS.staging;
return `https://${host}/api/v1/${endpoint}`;
return `https://${host}/${endpoint}`;
}

@@ -18,0 +29,0 @@ }

2

oclif.manifest.json

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

{"version":"0.0.2","commands":{"hello":{"id":"hello","description":"describe the command here","pluginName":"artsy-cli","pluginType":"core","aliases":[],"examples":["$ artsy hello\nhello world from ./src/hello.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"name to print"},"force":{"name":"force","type":"boolean","char":"f","allowNo":false}},"args":[{"name":"file"}]}}}
{"version":"0.0.3","commands":{"hello":{"id":"hello","description":"describe the command here","pluginName":"artsy-cli","pluginType":"core","aliases":[],"examples":["$ artsy hello\nhello world from ./src/hello.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"name to print"},"force":{"name":"force","type":"boolean","char":"f","allowNo":false}},"args":[{"name":"file"}]},"login":{"id":"login","description":"Log into the Artsy API. This is a prerequisite for many other commands.","pluginName":"artsy-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]}}}
{
"name": "artsy-cli",
"description": "The artsy command line tool",
"version": "0.0.2",
"version": "0.0.3",
"author": "Jon Allured @jonallured",

@@ -15,2 +15,4 @@ "bin": {

"@types/node-fetch": "^2.5.0",
"cli-ux": "^5.3.1",
"dotenv": "^8.0.0",
"node-fetch": "^2.6.0",

@@ -17,0 +19,0 @@ "tslib": "^1"

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