Git Product home page Git Product logo

aio-lib-customer-profile's People

Contributors

amulyakashyap09 avatar dependabot[bot] avatar easingthemes avatar greenkeeper[bot] avatar meryllblanchet avatar michaelgoberling avatar moritzraho avatar purplecabbage avatar sandeep-paliwal avatar shazron avatar snyk-bot avatar

Stargazers

 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

aio-lib-customer-profile's Issues

An in-range update of @adobe/eslint-config-aio-lib-config is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency @adobe/eslint-config-aio-lib-config was updated from 1.1.0 to 1.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@adobe/eslint-config-aio-lib-config is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for add plugin:node/recommended to check for extraneous/missing requires
  • feat: add plugin:node/recommended to check for extraneous/missing requires (#7) 15102de
  • chore(package): update eslint-plugin-jsdoc to version 23.0.0 (#6) 849c15b
  • chore(package): update eslint-plugin-jsdoc to version 22.0.0 (#5) a3788dd
  • Update README.md 7c2e18e
  • Update dependencies to enable Greenkeeper 🌴 (#4) 3a9468d

1.1.0...1.2.0

Commits

The new version differs by 6 commits.

  • f6a0062 1.2.0
  • 15102de feat: add plugin:node/recommended to check for extraneous/missing requires (#7)
  • 849c15b chore(package): update eslint-plugin-jsdoc to version 23.0.0 (#6)
  • a3788dd chore(package): update eslint-plugin-jsdoc to version 22.0.0 (#5)
  • 7c2e18e Update README.md
  • 3a9468d Update dependencies to enable Greenkeeper 🌴 (#4)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

GET calls fail with swagger client because of empty body in calls

Expected Behaviour

perform a call to experience platform to retrieve a profile

Actual Behaviour

Getting following error
error: [CustomerProfileAPISDK:ERROR_ENTITIES] Error TypeError: Request with GET/HEAD method cannot have body at new Request (/nodejsAction/irV4eJAV/index.js:176020:10) at /nodejsAction/irV4eJAV/index.js:176230:19 at new Promise (<anonymous>) at Object.fetch (/nodejsAction/irV4eJAV/index.js:176228:9) at Object.fetch (/nodejsAction/irV4eJAV/index.js:131569:20) at _callee$ (/nodejsAction/irV4eJAV/index.js:38978:86) at tryCatch (/nodejsAction/irV4eJAV/index.js:183746:40) at Generator.invoke [as _invoke] (/nodejsAction/irV4eJAV/index.js:183976:22) at Generator.next (/nodejsAction/irV4eJAV/index.js:183801:21) at asyncGeneratorStep (/nodejsAction/irV4eJAV/index.js:105437:24)

Steps to Reproduce

Run the below code with proper values for parameters and you get the error

Platform and Version

CLI plugins: core: @adobe/aio-cli 7.1.0 @adobe/aio-cli-plugin-app 7.0.2 @adobe/aio-cli-plugin-auth 2.4.1 @adobe/aio-cli-plugin-certificate 0.3.0 @adobe/aio-cli-plugin-config 2.3.0 @adobe/aio-cli-plugin-console 3.3.0 @adobe/aio-cli-plugin-events 1.1.5 @adobe/aio-cli-plugin-info 2.0.0 @adobe/aio-cli-plugin-runtime 4.0.0 @oclif/plugin-autocomplete 0.3.0 @oclif/plugin-help 2.2.3 @oclif/plugin-not-found 1.2.4 @oclif/plugin-plugins 1.10.0 @oclif/plugin-warn-if-update-available 1.7.0

using version 1.0.4

Sample Code that illustrates the problem

// initialize sdk const client = await CustomerProfile.init(params.tenant, params.orgId, params.apiKey, token) // call methods, eg getProfile const profile = await client.getProfile({ entityId: params.entityId, entityIdNS: params.entityIdNS }); const response = { statusCode: 200, body: profile }
Thanks in advance.

Throwing URL parsing error while calling customer profile

Expected Behaviour

Should return a successful response

Actual Behaviour

Throwing Error

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Mac OS used
"@adobe/aio-sdk": "^4.1.0"
Node.js v20.5.1
NPM version 9.8.0

Sample Code that illustrates the problem

const { Core, State, Files, Target, Analytics, CampaignStandard, CustomerProfile, AudienceManagerCD, Events } = require('@adobe/aio-sdk');
async function sdkTest() {
//initialize sdk
const customerProfileClient = await CustomerProfile.init('', '', 'x-api-key', '', '[sandbox]')
// Customer Profile example
const profileParams = {
entityId: 'xyz',
entityIdNS: 'loyaltyId'
}
const customerProfile = await customerProfileClient.getProfile(profileParams)
console.log(customerProfile);

Logs taken while reproducing problem

AioCoreSDKError [CustomerProfileAPIError]: [CustomerProfileAPISDK:ERROR_ENTITIES] Error TypeError: Failed to parse URL from /data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=079157043&entityIdNS=loyaltyId
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async http (/Users/xxxx/node/node_modules/swagger-client/lib/http/index.js:74:11) {
[cause]: TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:405:5)
at new URL (node:internal/url:778:13)
at new Request (node:internal/deps/undici/undici:7132:25)
at fetch2 (node:internal/deps/undici/undici:10715:25)
at Object.fetch (node:internal/deps/undici/undici:11574:18)
at fetch (node:internal/process/pre_execution:271:25)
at http (/Users/xxxx/node/node_modules/swagger-client/lib/http/index.js:74:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=079157043&entityIdNS=loyaltyId',
code: 'ERR_INVALID_URL'
}
}
at new (/Users/xxx/node/node_modules/@adobe/aio-lib-core-errors/src/AioCoreSDKErrorWrapper.js:33:9)
at /Users/xxx/node/node_modules/@adobe/aio-lib-customer-profile/src/openApiSDK.js:102:18
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERROR_ENTITIES',
sdk: 'CustomerProfileAPISDK',
sdkDetails: { parameters: { entityId: 'xyz', entityIdNS: 'loyaltyId' } }
}

e2e tests failing

Error log
FAIL e2e/e2e.js
  βœ“ sdk init test (3 ms)
  βœ• bad access token (56 ms)
  βœ• bad api key (19 ms)
  βœ• getAccessEntities API (2 ms)

  ● bad access token

    expect(received).rejects.toThrow(expected)

    Expected substring: "401"
    Received message:   "[CustomerProfileAPISDK:ERROR_ENTITIES] Error TypeError: Failed to parse URL from /data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email

      at fetch (../node_modules/undici/index.js:110:15)
      at http (../node_modules/swagger-client/lib/http/index.js:74:11) {
        [cause]: TypeError: Invalid URL
      at new Request (../node_modules/undici/lib/fetch/request.js:85:21)
      at fetch (../node_modules/undici/lib/fetch/index.js:136:21)
      at fetch (../node_modules/undici/index.js:107:20)
      at http (../node_modules/swagger-client/lib/http/index.js:74:45) {
          input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email',
          code: 'ERR_INVALID_URL'
        }
      }"
            100 |         })
            101 |         .catch(err => {
          > 102 |           reject(new codes[config.errorCode]({ sdkDetails, messageValues: reduceError(err) }))
                |                  ^
            103 |         })
            104 |     })
            105 |   }
      at fetch (../node_modules/undici/index.js:110:15)
      at http (../node_modules/swagger-client/lib/http/index.js:74:11) {
              [cause]: TypeError: Invalid URL
      at new Request (../node_modules/undici/lib/fetch/request.js:85:21)
      at fetch (../node_modules/undici/lib/fetch/index.js:136:21)
      at fetch (../node_modules/undici/index.js:107:20)
      at http (../node_modules/swagger-client/lib/http/index.js:74:45) {
                input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email',
                code: 'ERR_INVALID_URL'
              }
            }
      at new <anonymous> (../node_modules/@adobe/aio-lib-core-errors/src/AioCoreSDKErrorWrapper.js:33:9)
      at ../src/openApiSDK.js:102:18
      at Object.toThrow (../node_modules/expect/build/index.js:218:22)
      at Object.toThrow (e2e.js:46:34)

  ● bad api key

    expect(received).rejects.toThrow(expected)

    Expected substring: "[CustomerProfileAPISDK:ERROR_ENTITIES] Error 403 - Forbidden ({\"error_code\":\"403003\",\"message\":\"Api Key is invalid\"})"
    Received message:   "[CustomerProfileAPISDK:ERROR_ENTITIES] Error TypeError: Failed to parse URL from /data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email

      at fetch (../node_modules/undici/index.js:110:15)
      at http (../node_modules/swagger-client/lib/http/index.js:74:11) {
        [cause]: TypeError: Invalid URL
      at new Request (../node_modules/undici/lib/fetch/request.js:85:21)
      at fetch (../node_modules/undici/lib/fetch/index.js:136:21)
      at fetch (../node_modules/undici/index.js:107:20)
      at http (../node_modules/swagger-client/lib/http/index.js:74:45) {
          input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email',
          code: 'ERR_INVALID_URL'
        }
      }"
            100 |         })
            101 |         .catch(err => {
          > 102 |           reject(new codes[config.errorCode]({ sdkDetails, messageValues: reduceError(err) }))
                |                  ^
            103 |         })
            104 |     })
            105 |   }
      at fetch (../node_modules/undici/index.js:110:15)
      at http (../node_modules/swagger-client/lib/http/index.js:74:11) {
              [cause]: TypeError: Invalid URL
      at new Request (../node_modules/undici/lib/fetch/request.js:85:21)
      at fetch (../node_modules/undici/lib/fetch/index.js:136:21)
      at fetch (../node_modules/undici/index.js:107:20)
      at http (../node_modules/swagger-client/lib/http/index.js:74:45) {
                input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email',
                code: 'ERR_INVALID_URL'
              }
            }
      at new <anonymous> (../node_modules/@adobe/aio-lib-core-errors/src/AioCoreSDKErrorWrapper.js:33:9)
      at ../src/openApiSDK.js:102:18
      at Object.toThrow (../node_modules/expect/build/index.js:218:22)
      at Object.toThrow (e2e.js:54:34)

  ● getAccessEntities API

    CustomerProfileAPIError: [CustomerProfileAPISDK:ERROR_ENTITIES] Error TypeError: Failed to parse URL from /data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email

      100 |         })
      101 |         .catch(err => {
    > 102 |           reject(new codes[config.errorCode]({ sdkDetails, messageValues: reduceError(err) }))
          |                  ^
      103 |         })
      104 |     })
      105 |   }

      at fetch (../node_modules/undici/index.js:110:15)
      at http (../node_modules/swagger-client/lib/http/index.js:74:11) {
        [cause]: TypeError: Invalid URL
      at new Request (../node_modules/undici/lib/fetch/request.js:85:21)
      at fetch (../node_modules/undici/lib/fetch/index.js:136:21)
      at fetch (../node_modules/undici/index.js:107:20)
      at http (../node_modules/swagger-client/lib/http/index.js:74:45) {
          input: '/data/core/ups/access/entities?schema.name=_xdm.context.profile&entityId=spaliwal%40adobe.com&entityIdNS=email',
          code: 'ERR_INVALID_URL'
        }
      }
      at new <anonymous> (../node_modules/@adobe/aio-lib-core-errors/src/AioCoreSDKErrorWrapper.js:33:9)
      at ../src/openApiSDK.js:102:18

Test Suites: 1 failed, 1 total
Tests:       3 failed, 1 passed, 4 total
Snapshots:   0 total
Time:        1.953 s
Ran all test suites.

Investigation

The input url does not begin with a scheme nor a host, thus it is an invalid url. Some sub-dependency is probably doing extra checks where the relative url is not combined with the base url.

Looking at the OpenAPI spec however, gives this "servers" url:

"url": "//platform.adobe.io/data/core/ups"
which will give an Invalid Url error since there is no scheme specified.

Note the url without the scheme, in a web development context usually means it is a "protocol-relative" URL: https://www.paulirish.com/2010/the-protocol-relative-url/ and should be avoided

Fix

Add a https scheme to

"url": "//platform.adobe.io/data/core/ups"
(there is also api-latest.json, check whichever is being used and delete the one that is not)

Visual Studio Code autocomplete does not have the automatic methods

Expected Behaviour

Autocomplete is available for all methods, including the auto generated ones.

Actual Behaviour

Autocomplete is not available for all methods, e.g. listComputedAttributes is missing for example.

Steps to Reproduce

  1. Require the library in your code
  2. init to get the SDK object
  3. Try to autocomplete to list a method, like listComputedAttributes.

Investigation

Visual Studio Code is not using the types.d.ts file for autocomplete, it is using the methods it introspects from the exported module. Find out how Visual Studio Code derives its autocomplete data from, so we can fix it in the library.

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.