npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ac-connector

v0.2.13

Published

Adobe Campaign Classic Connector : tools to connect NodeJS to Adobe Campaign Classic

Downloads

20

Readme

ac-connector

Adobe Campaign Classic Connector for NodeJS

This module provides some classes and multi environments management for Adobe Campaign (ex Neolane) in node JS

Install

$ npm install ac-connector

Connections Manager

First when install, you have to add connection(s) to your plateform localy. In this purpose, launch the command

$ ACCManager # located in node_modules/bin/ACCManager

or

node_modules/.bin/ACCManager(.cmd)

(if it doesn't work, try :)

node node_modules/ac-connector/startUI.js

This will open a Web page (on http://localhost:4545/) that allows to configure severals connections

Those connections are stored in the local user directory (under the ".ac-connector/" folder)

Interface let you define basics and mandatory fields, like server url, user name, password. But you can add your own fields in order to use them in your project.

The field name (Name) is the one to identify a connection (must be unique) and use the connection in your project.

Installing the library

Load the library and the class needed

> var ACC = require('ac-connector');
> var ACCLogManager = ACC.ACCLogManager;
> ACCLogManager.listConnections(); // list connections
[ 'My Connection Name' ]
> var xtkQueryDef = ACC.xtkQueryDef; //Can use xtk:queryDef methods (Execute or SelectAll)

Then you have to get your connection using ACCLogManager class

var login = ACCLogManager.getLogin( 'My Connection Name' );
//'My Connection Name' is the 'name' of one of your connection

When you get your ACCLogin object, you can instanciate standard class, passing an object with your login with 'accLogin' name. Every method return a Promise.

Using the library (with XML-String)

Create a ./index.js file with the following:

var xtkQueryDef = ACC.xtkQueryDef;
var queryDef = new xtkQueryDef({ 'accLogin' : login });
var soap =
  '<query operation="select" schema="nms:recipient">'+
    '<select><node expr="@id"/></select>'+
    '<where><condition expr="@email=\'[email protected]\'"/></where>'+
  '</query>';
var request = queryDef.ExecuteQuery(soap);
request.then( (result) => {
  console.log('result:', result);
  var recipients = result['recipient-collection']['recipient'];
  console.log(recipients.length+' recipients found:', recipients);
})
.catch( (e) => {console.log('Error !', e );});

Using the library (with JXON)

Create a ./index.js file with the following:

var jxon = require('jxon');
var xtkQueryDef = ACC.xtkQueryDef;
var queryDef = new xtkQueryDef({ 'accLogin' : login });
var js = {
  query: {
    select: {
      node: [
        { '$expr': '@namespace' },
        { '$expr': '@name' },
        { '$expr': 'data' }
      ]
    },
    where: {
      condition: { '$expr': '@namespace=\'acx\'' }
    },
    '$operation': 'select',
    '$schema': 'xtk:jssp'
  }
};
var request = queryDef.ExecuteQuery(jxon.jsToString(js));
request.then( (result) => {
  console.log('result:', result);
  var recipients = result['recipient-collection']['recipient'];
  console.log(recipients.length+' recipients found:', recipients);
})
.catch( (e) => {console.log('Error !', e );});

and start it with node index.js:

$ node index.js
7 recipients found: [
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } },
  { attributes: { id: 'xxx' } } ]

Build Delivrery Preview

  var delivery = new nmsDelivery({ accLogin : login });
  delivery.BuildPreviewFromId( 123456 , "<params content='html' filter='@id=1234'/>")
  .then(  ( result ) => { console.log('Preview :' , result[0], result[1]);} );

see Adobe Campaign Classic - API Documentation - nms delivery - BuildPreviewFromId for more info

Generate package

  var specFile = new xtkSpecFile({ accLogin : login });
  specFile.GenerateDoc( specDefinition );
  specFile.then( (doc) => {
    console.log('Here is the package : ', doc );
  } );

see Adobe Campaign Classic - API Documentation - xtk specFile - GenerateDoc for more info