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

google-ad-manager-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-ad-manager-api - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

build/src/utils.d.ts

4

build/src/dfp.d.ts

@@ -12,5 +12,5 @@ import { Client } from 'soap';

constructor(options: DFPOptions);
getService(service: string): Promise<DFPClient>;
static parse(res: any[]): any;
getService(service: string, token?: string): Promise<DFPClient>;
static parse(res: any): any;
private getSoapHeaders;
}

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

const soap_1 = require("soap");
const utils_1 = require("./utils");
class DFP {

@@ -17,7 +18,7 @@ constructor(options) {

}
getService(service) {
getService(service, token) {
return __awaiter(this, void 0, void 0, function* () {
const { apiVersion } = this.options;
const serviceUrl = `https://ads.google.com/apis/ads/publisher/${apiVersion}/${service}?wsdl`;
const client = yield soap_1.createClientAsync(serviceUrl);
const client = yield utils_1.promiseFromCallback((cb) => soap_1.createClient(serviceUrl, cb));
client.addSoapHeader(this.getSoapHeaders());

@@ -27,2 +28,5 @@ client.setToken = function setToken(token) {

};
if (token) {
client.setToken(token);
}
return new Proxy(client, {

@@ -34,4 +38,3 @@ get: function get(target, propertyKey) {

return __awaiter(this, void 0, void 0, function* () {
// @ts-ignore
const res = yield client[method + 'Async'](dto);
const res = yield utils_1.promiseFromCallback((cb) => client[method](dto, cb));
return DFP.parse(res);

@@ -49,3 +52,3 @@ });

static parse(res) {
return res[0].rval;
return res.rval;
}

@@ -52,0 +55,0 @@ getSoapHeaders() {

{
"name": "google-ad-manager-api",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "scripts": {

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

![Langauge](https://badge.langauge.io/thewizarodofoz/google-ad-manager-api)
# Google Ad Manager Node.js API

@@ -42,2 +44,3 @@ A modern wrapper around Google's [Ad Manager API](https://developers.google.com/ad-manager/docs/start).

```ts
import {DFP} from 'google-ad-manager-api';
const dfp = new DFP({networkCode: '...', apiVersion: 'v201805'});

@@ -52,2 +55,6 @@ ```

```
Or even shorter (pass the token directly to `getService`:
```ts
const lineItemService = await dfp.getService('LineItemService', client.credentials.access_token);
```

@@ -54,0 +61,0 @@ ### Step #4

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