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

@adobe/aio-cli-plugin-aep

v1.0.6

Published

A plugin for CRUD operations on aep resources

Downloads

35

Readme

aio-cli-plugin-aep

A plugin for CRUD operations on aep resources

Follow the steps below to start using this plugin.

1. Set up necessary dependencies for npm to work

  1. Install brew: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

  2. Install npm: $ brew install npm

  3. Install yarn: $ npm install --global yarn

  4. Upgrade yarn: $ npm upgrade --global yarn

2. Set up necessary adobe I/O dependencies

  1. Install aio-cli core libraries$ npm install -g @adobe/aio-cli

  2. Install aep aio plugin$ npm install -g @adobe/aio-cli-plugin-aep

  3. Link aep with aio $ aio plugins:install @adobe/aio-cli-plugin-aep

  4. When you run $ aio aep -h now you should be able to see aep as an available plugin with its available sub-commands.

Image of successfull installation

3. Set up adobe I/O (PROD/STG/INT) integration

For PROD

  1. Go to https://console.adobe.io/integrations and create a production integration for test

  2. Follow the instructions on https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md

    to get the necessary I/O config credentials

  3. Create a config.json file with the following content and replacing the placeholders with actual values. The jwt_payload element in the following json, you can directly copy from your Adobe I/O integrations page mentioned in step 1.


{
  "client_id": "${your_client_id}",
  "client_secret": "${your_client_secret}",
  "jwt_payload": {
    "exp": ${your_expiration_time},
    "iss": "${your_org@AdobeOrg}",
    "sub": "${[email protected]}",
    "https://ims-na1.adobelogin.com/s/ent_dataservices_sdk": true,
    "aud": "https://ims-na1.adobelogin.com/c/${your_client_id}"
  },
  "token_exchange_url": "https://ims-na1.adobelogin.com/ims/exchange/jwt/",
  "jwt_private_key": "${path to your private.key file used in Adobe I/O integration}",
  "x-sandbox-id": "${your_sandbox_id}",
  "x-sandbox-name": "${your_sandbox_name}",
  "env": "prod"
}

Run the following commands now (in the particular order)

  1. $ aio config:set jwt-auth ${path_to_the_above_config.json} --file --json

  2. $ aio jwt-auth:access-token

For STG/INT (This sample is for INT)

  1. Go to https://console-stage.adobe.io/integrations and create a production integration for test

  2. Follow the instructions on https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md

    to get the necessary I/O config credentials

  3. Create a config.json file with the following content and replacing the placeholders with actual values. The jwt_payload element in the following json, you can directly copy from your Adobe I/O integrations page mentioned in step 1.


{
  "client_id": "${your_client_id}",
  "client_secret": "${your_client_secret}",
  "jwt_payload": {
    "exp": ${your_expiration_time},
    "iss": "${your_org@AdobeOrg}",
    "sub": "${[email protected]}",
    "https://ims-na1-stg1.adobelogin.com/s/ent_dataservices_sdk": true,
    "aud": "https://ims-na1-stg1.adobelogin.com/c/${your_client_id}"
  },
  "token_exchange_url": "https://ims-na1-stg1.adobelogin.com/ims/exchange/jwt/",
  "jwt_private_key": "${path to your private.key file used in Adobe I/O integration}",
  "x-sandbox-id": "${your_sandbox_id}",
  "x-sandbox-name": "${your_sandbox_name}",
  "env": "int"
}

Run the following commands now (in the particular order)

  1. $ aio config:set jwt-auth ${path_to_the_above_config.json} --file --json

  2. $ aio jwt-auth:access-token

4. Finally run this simple command to list datasets in your org to make sure the configuration is all correct

$ aio aep:datasets:list

Output would look something like...

{
 'abc': {
 	tags: {
 		targetDataSetId: ['abc'],
 		'aep/siphon/partitions': [],
 		'adobe/pqs/table': ['abc'],
 		sandboxId: ['abc'],
 		mappingId: ['abc'],
 		acp_validationContext: ['enabled']
 	},
 	imsOrg: 'abc@AdobeOrg',
 	name: 'Mapping DataSet_abc',
 	namespace: 'ACP',
 	state: 'DRAFT',
 	lastBatchId: 'abc',
 	lastBatchStatus: 'success',
 	version: '1.0.3',
 	created: 1573866068596,
 	updated: 1573866132606,
 	createdClient: 'acp_foundation_connectors',
 	createdUser: 'abc@AdobeID',
 	updatedUser: 'acp_foundation_dataTracker@AdobeID',
 	lastSuccessfulBatch: 'abc',
 	viewId: 'abc',
 	aspect: 'production',
 	status: 'enabled',
 	fileDescription: {
 		persisted: false
 	},
 	files: '@/dataSets/abc/views/abc/files',
 	schemaMetadata: {
 		primaryKey: [],
 		delta: [],
 		dule: [],
 		gdpr: []
 	},
 	schemaRef: {
 		id: 'https://ns.adobe.com/acponboarding/schemas/abc',
 		contentType: 'application/vnd.adobe.xed-full+json;version=1'
 	},
 	streamingIngestionEnabled: 'false'
 },

...

You can choose not to read the following additional information.

Additional read

The last command would generate a new access_token value and place it in appropriate folder for every command to read. Think of it as the same parameter we pass in the Authorization header on postman/Curl.

You can also get the access_token manually and use the following command to set it. No need to do this if you have done step 2.

Please follow the instructions as suggested in this article, to get the access_token https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md#generate-access-token

$ aio config:set jwt-auth.access_token ${your_access_token_generated_through_adobeI/O_integration}

Additionally if you want to have multiple integrations and want the ability to quickly switch between them, create multiple config.json files and place each one of them in a corresponding folder in your root directory with aprropriate name. For example, if you want to create an integration with name 'abc'. Please place the corresponding config.json file in /Users/${your_user_name}/abc. And then run the command

$ aio aep:switch-config:set -n=abc

5. Run inside a docker container: To run this plugin as a docker image

  1. DockerFile location: https://github.com/adobe/aio-cli-plugin-aep/blob/master/Dockerfile

  2. Build image: From the folder where dockerFile is located$ docker build -t aio-cli-plugin-aep .

  3. Create a config.json file (based on whether you want STG/INT or PROD) integration with the following content and replacing the placeholders with actual values.


{
  "client_id": "${your_client_id}",
  "client_secret": "${your_client_secret}",
  "jwt_payload": {
    "exp": ${your_expiration_time},
    "iss": "${your_org@AdobeOrg}",
    "sub": "${[email protected]}",
    "https://ims-na1.adobelogin.com/s/ent_dataservices_sdk": true,
    "aud": "https://ims-na1.adobelogin.com/c/${your_client_id}"
  },
  "token_exchange_url": "https://ims-na1.adobelogin.com/ims/exchange/jwt/",
  "jwt_private_key": "${path to your private.key file used in Adobe I/O integration}",
  "x-sandbox-id": "${your_sandbox_id}",
  "x-sandbox-name": "${your_sandbox_name}",
  "env": "prod"
}
  1. Run the following commands now (in the particular order): `

$ aio config:set jwt-auth ${path_to_the_above_config.json} --file --json

$ aio jwt-auth:access-token

  1. Mount the 'aio' file under your root .config director (~/.config/aio) and make docker container aware of it

$ docker run -it --rm -v ~/.config:/root/.config --entrypoint /bin/bash aio-cli-plugin-aep -s

  1. Test: $ aio aep:datasets:list

Note: In order to regenerate the access_token (in case of 403 status code), stop the container and rerun step# 4, 5 and 6.

6. (Developers) To run unit tests from the root folder of the project run the commands in following order

$ npm install

$ jest

$ jest --coverage (to see coverage report)