GithubHelp home page GithubHelp logo

node-marketo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-marketo's Issues

Munchkin ID matching?

Is there a Regex we can use reliably to match against a munchkin ID? It looks like they follow the format

AAA-AAA-AAA

...where "A" can be a letter or number. However is this something we can rely on?

We cant use the generic "string" type because it has input vulnerabilities with how we are allowing our customers to configure the ID.

Thanks.

Issue with statustillcompletedcase

tried to use statustillcomplteted work flow and it not coming out the flow in the till completed case and giving the promise errors can you please help me on this.

Here is the error i am getting:

reason is {"requestId":"79bb#16494e58f06","errors":[{"code":"606"}]}
Possibly unhandled TypeError: Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.
at PromiseResolver$reject (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise_resolver.js:118:15)
at tryCatch1 (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\util.js:45:21)
at Promise$_callHandler [as _callHandler] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise.js:660:13)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise.js:675:18)
at Promise$_settlePromiseAt [as _settlePromiseAt] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise.js:845:14)
at Promise$_settlePromises [as _settlePromises] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise.js:988:14)
at Promise$_rejectPromises [as _rejectPromises] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\promise.js:981:10)
at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\async.js:77:12)
at Async$consumeFunctionBuffer (F:\marketo\node_modules\node-marketo-rest\node_modules\bluebird\js\main\async.js:40:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)

lead.find causes 612 Invalid Content Type

This is not happening all the time.
But it happens occasionally.
Not sure what is really causing this.

I'm not sure if it's related but I've checked the code and found out that "find" is actually implemented with POST. Any reason why it's implemented with POST?
It doesn't set content-type to application/json because the body is sent as form urlencoded I believe.

Transfer Ownership

Greetings!
This is Yuan. I would like to take ownership of this repo. Would you mind transferring the ownership of this repo to me ?

Thanks,
Regards,

Yuan

Project not in npm repository & license

Hello!

Your project seems cool and just what I need, but I couldn't find it on npm: https://www.npmjs.com/search?q=marketo
There are only other (SOAP) projects. As there are no special instructions on installation, this might be some error.

Also, what's the license? Without any, it's "all rights reserved", I believe.

Thank you for resolving this issue!

Query parameters ignored in Lead Post endpoints

The lead.mergeLead endpoint accepts the url parameter but it does not get used in the final request resulting in an error from Marketo { code: '1003', message: 'Losing lead ids not specified' }

Missing WSDL error?

Hi, I'm following the examples, but I get an error about Missing WSDL. I don't see anything in the docs about how to set this. Any guidance on this?

Missing information on how to make a bulkActivityExtract call.

More of a documentation issue.

I see that the repo has an example for using the bulkLeadExtract api, but i could not find an example using the bulk activity extract API.

I´m attempting to get it but I run up against undefined filter errorsl, and am unsure if I am missing other options that I would be able to use.

        {createdAt: {
                startAt: '2018-07-01T23:59:59-00:00',
                endAt:  '2018-07-03T23:59:59-00:00'
            },
            activityTypeIds: [
                1,
                12,
                13
            ]})
        .then(function(data) {
            // export is ready
            let exportId = data.result[0].exportId;
            return marketo.bulkActivityExtract.file(exportId);
        })
        .then(function(file) {
            console.log(file);
        });
});

Error I get sometimes
Possibly unhandled HttpError. Invalid value specified for attribute 'filter'

Stream start pushing before _read is called

I'm pretty certain the implementation of the stream is faulty.

It starts pushing data to the stream possibly before _read is called for the first time, which creates problem with asynchronous invocations.

Feature request: Method Associate Lead

First of all, this module is great (:+1: to publish it on npm).
For a specific use case, I'd like to use the REST method associateLead. If I implement it myself, would you accept my pull request ? Just to be sure if I can use your module or if I better do my own.

Thanks in advance

Assigning lead to list

Code:

 createLead: function(listID,leadObj) {
                marketo.lead.createOrUpdate(
                        [leadObj],
                        {lookupField: 'email'}
                ).then(function(data) {
                                console.log(data,data.result[0].reasons);
                                if (typeof(data.result[0].id) !== undefined)
                                {
                                        console.log(listID,data.result[0].id);
                                        marketo.list.addLeadsToList(listID, [data.result[0].id]).then(function(data){
                                                console.log(data);
                                        });
                                }
                });
        }

Output:

Possibly unhandled Error: [object Object]
at PromiseResolver$reject as reject
at /opt/pepperdata/node_modules/node-marketo-rest/lib/retry.js:73:17
at tryCatch1 (/opt/pepperdata/node_modules/node-marketo-rest/node_modules/bluebird/js/main/util.js:45:21)
at Promise$_callHandler as _callHandler
at Promise$_settlePromiseFromHandler as _settlePromiseFromHandler
at Promise$_settlePromiseAt as _settlePromiseAt
at Promise$_settlePromises as _settlePromises
at Promise$_rejectPromises as _rejectPromises
at Async$_consumeFunctionBuffer as _consumeFunctionBuffer
at Async$consumeFunctionBuffer (/opt/pepperdata/node_modules/node-marketo-rest/node_modules/bluebird/js/main/async.js:40:14)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback (node.js:390:13)

Issue with Marketo.streamify when query returns empty?

It seems that whenever a promise doesn't not return results, Marketo.streamify returns a stream that never ends.

e.g. the stream

Marketo.streamify(marketo.lead.getActivities([], activity_types_ids, nextPageToken))

does not seem to start/end whenever the response to marketo.lead.getActivities([], activity_types_ids, nextPageToken) has no results.

Support For Inbound/trigger api

right now am seeing webhook support for marketo api. is there any plan for implementing it in node-marketo.

I see a stream api,but am not sure is this a trigger or in bound api or is it something related to handling chunks of data

This package depends on a vulnerable version of qs

Snyk is reporting an issue with the qs package that is bundled with this package via:

https://app.snyk.io/vuln/npm:qs:20170213

This packages uses restler, an unmaintained HTTP client that pins it's dependencies.

"restler": "3.4.x"

restler/package.json

  "dependencies": {
    "qs": "1.2.0",
    "xml2js": "0.4.0",
    "yaml": "0.2.3",
    "iconv-lite": "0.2.11"
  },

I would suggest moving to an actively maintained package like node-fetch or request.

Download file bulk lead extract

Awesome work on this Marketo REST client!

I'm hoping you can point me in the right direction so I can download the bulk lead extract file once complete. How can I return the file once the export is ready?

  marketo.bulkLeadExtract.get(
  ['firstName', 'lastName', 'id', 'email'],
  { staticListName: 'g_test_export' })
  .then(function(data) {
    // export is ready
    let exportId = data.result[0].exportId;
    return marketo.bulkLeadExtract.file(exportId);
  })
  .then(function(file) {
    res.download(file);
  }).catch(next);

});

Support leads/describe2.json API endpoint

Currently, node-marketo supports the leads/describe.json endpoint. Marketo has introduced the leads/describe2.json endpoint. According to their developer relations team, developers are encouraged to use describe2 instead of describe, at least because:

  1. describe has "REST API names" and "SOAP API names". describe2 just has a single "API name". The SOAP API isn't encouraged for use anymore, and Marketo is just calling the REST API name the API name now.
  2. describe has a notion of field id that isn't used anywhere else in the Marketo API. describe2 removes this (now useless) notion.
  3. describe2 indicates which fields are searchable (i.e. can be used as query filter types in the "get leads by filter type" API endpoint).

node-marketo should support describe2 as well as describe. It's an easy change, so I'll submit a PR myself.

"Request method 'POST' not supported" error when streaming a large dataset

I was trying to import leads from marketo using streams (it was almost 200K data). After importing (~100K) I got consistent error

code was something like

       ```
       // Only pass to Marketo API a subset of the options passed to this function.
        var opts = {
          listId: options.listId,
          batchSize: options.batchSize || 300,
          fields: options.fields
        };
        // Return a stream.
        return client.list.getLeads(options.listId, opts).then(function(res){
          return M.streamify(Promise.resolve(res));
        });
    ```

Error is:

{"requestId":"1751d#1570622065b","success":false,"errors":[{"code":"605","message":"Request method 'POST' not supported"}],"level":"error","message":"","timestamp":"2016-09-07T19:31:16.033Z"}

as far as I understand stream is stopped after error happens and there is no way to get the remains data. Is there any way to resume the stream to get remain leads from marketo.

Add a push method to push lead in marketo

  • Add push method in lead.js

push: function(input, options) {
if (!.isArray(input) && !.isEmpty(input)) {
var msg = 'input must be an array of leads';
log.error(msg);
return Promise.reject(msg);
}

var data = _.extend({}, options, {
  input: input
});

var path = util.createPath('leads', 'push.json');

return this._connection.postJson(path, data)
  .then(function(data) {
    if (data.success) {
      return data;
    } else {
      log.warn('Cannot push lead: ', data);
      return Promise.reject('Cannot get lead(s) from input: ' + JSON.stringify(input));
    }
  });

},

  • Add documentation in the API doc API.md

lead.push(input, options)

Implements Push Leads

param type description
input Array An array of lead records to push
options object
lookupField: the field used to dedup on
programName : the program name in Marketo
// Push a lead to Marketo program name
marketo.lead.push(
    [{'email': '[email protected]'}, {'email': '[email protected]'}],
    {lookupField: 'email', programName: 'Test program name'}
  )

Error happens when webpack tries to build source when smartlist feature is being used

webpack not able to build because of node-marketo-rest internal code when smartlist api being used.

ERROR in ./node_modules/node-marketo-rest/lib/marketo.js
Module not found: Error: Can't resolve './api/smartlist' in .../marketo-list/node_modules/node-marketo-rest/lib'
@ ./node_modules/node-marketo-rest/lib/marketo.js 11:16-42
@ ./node_modules/node-marketo-rest/index.js
@ ./index.ts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.