Skip to content

PulkitXChadha/aio-lib-segmentation-service

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Version Downloads/week Build Status License Codecov Coverage

Adobe Experience Cloud Segmentation Service Lib

Installing

$ npm install @adobe/aio-lib-segmentation-service

Usage

  1. Initialize the SDK
const sdk = require('@adobe/aio-lib-segmentation-service')

async function sdkTest() {
  //initialize sdk
  const client = await sdk.init('<tenant>', 'x-api-key', '<valid auth token>')
}
  1. Call methods using the initialized SDK
const sdk = require('@adobe/aio-lib-segmentation-service')

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

  // call methods
  try {
    // get... something
    const result = await client.getSomething({})
    console.log(result)

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

Classes

SegmentationServiceAPI

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

Functions

responseBodyToString(response) β‡’ Promise.<string>

Converts a fetch Response object's body contents to a string.

filterUndefinedOrNull(json) β‡’ object

Filters a json object, removing any undefined or null entries. Returns a new object (does not mutate original)

requestToString(request) β‡’ object

Converts a fetch Request object to a string.

Typedefs

MyParameters : object

An example of a typed object.

AnotherThing : object

Another typed object.

SegmentationServiceAPI

This class provides methods to call your SegmentationServiceAPI 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

segmentationServiceAPI.init(tenantId, imsOrgId, apiKey, accessToken, [sandbox]) β‡’ Promise.<SegmentationServiceAPI>

Initializes a SegmentationServiceAPI object and returns it.

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

Param Type Description
tenantId string the tenant id
imsOrgId string the iMSOrgId for your integration
apiKey string the API key for your integration
accessToken string the access token for your integration
[sandbox] string sandbox name

segmentationServiceAPI.getSegmentJobs([options]) β‡’ Promise.<Response>

Get Segment Jobs a segment job evaluates segment definitions on the given models and get all the qualifying XDM Entity Ids.

Kind: instance method of SegmentationServiceAPI
Returns: Promise.<Response> - a Promise resolving to a Response

Param Type Default Description
[options] object to control Segment Jobs search
[options.start] string Specifies the starting offset for the segment jobs returned.
[options.limit] number 100 Specifies the number of segment jobs returned per page.
[options.status] number Filters the results based on status. The supported values are NEW, QUEUED, PROCESSING, SUCCEEDED, FAILED, CANCELLING, CANCELLED
[options.sort] object Orders the segment jobs returned. Is written in the format [attributeName]:[desc
[options.property] object Filters segment jobs and gets exact matches for the filter given. It can be written in either of the following formats:[jsonObjectPath]==[value] - filtering on the object key or[arrayTypeAttributeName]~[objectKey]==[value] - filtering within the array
[options.headers] object headers to pass to API call

responseBodyToString(response) β‡’ Promise.<string>

Converts a fetch Response object's body contents to a string.

Kind: global function
Returns: Promise.<string> - a Promise that resolves to the converted object's body contents

Param Type Description
response Response the response object

filterUndefinedOrNull(json) β‡’ object

Filters a json object, removing any undefined or null entries. Returns a new object (does not mutate original)

Kind: global function
Returns: object - the filtered object (a new object)

Param Type Description
json object the json object to filter

requestToString(request) β‡’ object

Converts a fetch Request object to a string.

Kind: global function
Returns: object - the converted object

Param Type Description
request Request the request object

MyParameters : object

An example of a typed object.

Kind: global typedef
Properties

Name Type Description
optionA string some option
optionB string another option

AnotherThing : object

Another typed object.

Kind: global typedef
Properties

Name Type Description
mayBeSomething boolean an 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.

About

🚧 WORK IN PROGRESS

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Shell 0.3%