0.0.1 • Published 9 months ago

@adobe/aio-lib-magento v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

Version Downloads/week Build Status License Codecov Coverage

Adobe Magento Lib

Installing

$ npm install @adobe/aio-lib-magento

Usage

1) Initialize the SDK

const sdk = require('@adobe/aio-lib-magento')

async function sdkTest() {
  //initialize sdk
  const client = await sdk.init('<tenant>', 'x-api-key', '<valid auth token>')
}

2) Call methods using the initialized SDK

const sdk = require('@adobe/aio-lib-magento')

async function sdkTest() {
  // initialize sdk
  const client = await sdk.init('<tenant>', 'x-api-key', '<valid auth token>')

  // call methods
  try {
    // get profiles by custom filters
    const result = await client.getSomething({})
    console.log(result)

  } catch (e) {
    console.error(e)
  }
}

Classes

Functions

Typedefs

MagentoCoreAPI

This class provides methods to call your MagentoCoreAPI APIs. Before calling any method initialize the instance by calling the init method on it with valid values for tenantId, apiKey and accessToken

Kind: global class

magentoCoreAPI.tenantId : string

The tenant id

Kind: instance property of MagentoCoreAPI

magentoCoreAPI.apiKey : string

The api key from your integration

Kind: instance property of MagentoCoreAPI

magentoCoreAPI.accessToken : string

The access token from your integration

Kind: instance property of MagentoCoreAPI

magentoCoreAPI.init(tenantId, apiKey, accessToken) ⇒ Promise.<MagentoCoreAPI>

Initializes a MagentoCoreAPI object and returns it.

Kind: instance method of MagentoCoreAPI
Returns: Promise.<MagentoCoreAPI> - a MagentoCoreAPI object

ParamTypeDescription
tenantIdstringthe tenant id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration

magentoCoreAPI.getSomething(parameters) ⇒ Promise.<Response>

Get something.

Kind: instance method of MagentoCoreAPI
Returns: Promise.<Response> - the response

ParamTypeDefaultDescription
parametersMyParameters{}parameters to pass

init(tenantId, apiKey, accessToken) ⇒ Promise.<MagentoCoreAPI>

Returns a Promise that resolves with a new MagentoCoreAPI object.

Kind: global function
Returns: Promise.<MagentoCoreAPI> - a Promise with a MagentoCoreAPI object

ParamTypeDescription
tenantIdstringthe tenant id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration

MyParameters : object

An example of a typed object.

Kind: global typedef
Properties

NameTypeDescription
optionAstringsome option
optionBstringanother option

AnotherThing : object

Another typed object.

Kind: global typedef
Properties

NameTypeDescription
mayBeSomethingbooleanan option

Debug Logs

LOG_LEVEL=debug <your_call_here>

Prepend the LOG_LEVEL environment variable and debug value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

Contributing

Contributions are welcome! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.