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

node-ninjacat

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ninjacat - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

typings/ninjacat/index.d.ts

17

lib/Client.d.ts

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

/// <reference types="ninjacat" />
import Request from 'request';

@@ -5,3 +6,3 @@ interface NinjacatClientOpts {

client_secret: string;
agency_id: number;
agency_id: number | string;
agency_identifier: string;

@@ -19,17 +20,9 @@ report_secret: string;

report: {
retrieve: (request_id: RequestID) => Promise<any>;
post: (template_id: Ninjacat.TemplateID, advertiser_id: Ninjacat.AdvertiserID, opts?: {
start_date: string;
end_date: string;
}) => Promise<any>;
get: (request_id: RequestID) => Promise<{
status: 0 | 1;
id: number;
} | {
success: true;
status: 2;
id: number;
data: Array<any>;
errors: Array<string>;
}) => Promise<{
request_id: number;
}>;
get: (request_id: RequestID) => Promise<Ninjacat.ReportResponse>;
};

@@ -36,0 +29,0 @@ request: Request.RequestAPI<Request.Request, Request.CoreOptions, Request.RequiredUriUrl>;

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

this.client_secret = opts.client_secret;
this.agency_id = opts.agency_id;
this.agency_id = Number(opts.agency_id);
this.agency_identifier = opts.agency_identifier;

@@ -29,10 +29,2 @@ this.report_secret = opts.report_secret;

this.report = {
retrieve: (request_id) => new Promise(async (resolve) => {
let res = { status: 0 };
while (res.status !== 2) {
console.log(res);
res = await this.report.get(request_id);
}
resolve(res);
}),
get: (request_id) => {

@@ -39,0 +31,0 @@ const path = ['open_api/report', this.agency_id, request_id].join('/');

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

});
const advertisers = await client.advertisers();
advertisers;
console.log(advertisers);
// const advertisers = await client.advertisers();
// advertisers;
// console.log(advertisers);
// const report = await client.report.post(89565, 10114719, {

@@ -29,6 +29,8 @@ // start_date: '05/01/2020',

// });
// const report = await client.report.retrieve(118105);
// console.log(report);
const res = await client.report.get(118105);
if (res.status === 2) {
console.log(res.data[0].dataRows.rows);
}
}
main();
//# sourceMappingURL=test.js.map
{
"name": "node-ninjacat",
"description": "Reporting & Management API Client for https://www.ninjacat.io/",
"version": "0.1.10",
"version": "0.1.11",
"main": "./lib/Client.js",

@@ -6,0 +6,0 @@ "types": "./lib/Client.d.ts",

{
"compilerOptions": {
"allowJs": true,
"typeRoots": ["./node_modules/@types"],
"typeRoots": ["./node_modules/@types", "./typings"],
"moduleResolution": "node",

@@ -15,4 +15,4 @@ "sourceMap": true,

},
"include": ["./src/**/*", "./typings/**/*"],
"include": ["./src/**/*"],
"exclude": ["./node_modules/**/*"]
}

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