{"_id":"@aurigma/axios-design-atoms-api-client.ts","_rev":"7-61bbdf8fa85f43bed0c87a78e4347a24","name":"@aurigma/axios-design-atoms-api-client.ts","dist-tags":{"latest":"2.16.1"},"versions":{"2.16.1":{"name":"@aurigma/axios-design-atoms-api-client.ts","version":"2.16.1","keywords":["customer's canvas","web-to-print","api client","design atoms"],"author":{"url":"https://customerscanvas.com","name":"Aurigma Inc","email":"info@aurigma.com"},"license":"SEE LICENSE IN License.md","_id":"@aurigma/axios-design-atoms-api-client.ts@2.16.1","maintainers":[{"name":"asimontsev","email":"a.simontsev@aurigma.com"},{"name":"maxsmaleha","email":"maxsmaleha@gmail.com"},{"name":"stas.gusarov","email":"stas.gusarov@gmail.com"},{"name":"mcsimusic","email":"mcsimusic@gmail.com"},{"name":"t.vybornova","email":"tanya@aurigma.com"}],"homepage":"https://customerscanvas.com","bugs":{"url":"https://customerscanvas.com/account/cases"},"dist":{"shasum":"bfd9910a07121269ed16237af16808bfddb92d2a","tarball":"https://registry.npmjs.org/@aurigma/axios-design-atoms-api-client.ts/-/axios-design-atoms-api-client.ts-2.16.1.tgz","fileCount":9,"integrity":"sha512-InvrPjhGtYw4Ue3UrkqdHuX7EQNgdrhbtU85uwtrIi94CJSzxuXaYnpyCrIyzhFKUM49yhKopgTpsIBBZw9iVQ==","signatures":[{"sig":"MEUCIQCPkPhdSTpFsPvKcyO1tykAZYjqqxu0zH2+LOPrU1bTegIgAOPpXQN/ucZQR6nO9+XwaffXh7GxMroepN22t4xKEDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":742755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6os+CRA9TVsSAnZWagAASHYQAI+/3FzEB5cnsxHW07zl\njTemECLsVWCq4QD/J5PALAx1ATvluRgzYJA6ZwrDsJ0zv8X8HJ2e5yrjDVKI\nM2EbNEI/BPtG7LcxqJbg1/KR6Inmw8IlTUg8bgRNT9bo9K8bv3Ts5/OsbJ23\nu8Rsy0R39Me8dZZBntc8j+mW762oq7WUGjwtHcWYzubwiEa8y1rzHypNar68\noljAWrbQD0yvX0ODdF3p/OACugXIme2dLKUMZQJHRuxnH3ChOMZVJoVDAFIU\nshnyWCk+E8ZTkqnF7NzHP6rSin5yZ/vNCY++stE7c9aiRoFRkC1LmNbIXkhY\nwj96GoRJ5z3VJFPF9lXVmCB7svV87I0/6ZCtrqyg2SSRvQUnC9UaDkN+9SCo\n4FNdkWWOjYCxOcA4Kx6QI9kp2LC7i3HwBVhPo+H2ahOx7VMsB1hSzqz45Irg\nN+PEUXqucuteA/wwja7o3Qn3mwi08geLOVN+yPDSHoExU9xOz06MgtqV9PWA\nsBdSOoCoxqIccZr8qETwyaSwD5yNkDLTjIRhKsLln/xKlXBwirJ+3vysCt5H\n9o3lTuNDH9+SaAotAwfjZgvDQ/sFPcPuh6ddndYhW6aItyFwMpN6TayH/huw\n+XtAOz4Pr0hQPpoIuqu0FpoHn01bIq6qhXAWoWGEkNZpTei01WVbvqgy+58m\nhO3i\r\n=AB93\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cjs/design-atoms-api-client.js","types":"./dist/esm/design-atoms-api-client.d.ts","module":"./dist/esm/design-atoms-api-client.js","exports":{"import":"./dist/esm/design-atoms-api-client.js","require":"./dist/cjs/design-atoms-api-client.js"},"scripts":{},"_npmUser":{"name":"maxsmaleha","email":"maxsmaleha@gmail.com"},"_npmVersion":"6.14.7","description":"Axios API Client for Design Atoms API service of Customer's Canvas web-to-print system.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","dependencies":{"npm":"^6.13.6","axios":"^0.24.0"},"_hasShrinkwrap":false,"devDependencies":{"fs-extra":"^10.0.0","typescript":"^4.5.2","@types/node":"^16.11.10"},"_npmOperationalInternal":{"tmp":"tmp/axios-design-atoms-api-client.ts_2.16.1_1642761022424_0.9916241849576226","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-01-21T10:30:22.368Z","modified":"2026-01-22T08:00:21.228Z","2.16.1":"2022-01-21T10:30:22.553Z"},"bugs":{"url":"https://customerscanvas.com/account/cases"},"author":{"url":"https://customerscanvas.com","name":"Aurigma Inc","email":"info@aurigma.com"},"license":"SEE LICENSE IN License.md","homepage":"https://customerscanvas.com","keywords":["customer's canvas","web-to-print","api client","design atoms"],"description":"Axios API Client for Design Atoms API service of Customer's Canvas web-to-print system.","maintainers":[{"email":"a.simontsev@aurigma.com","name":"asimontsev"},{"email":"tanya@aurigma.com","name":"t.vybornova"},{"email":"v.kozlov@aurigma.com","name":"vitaliykozlov"}],"readme":"# Aurigma Customer's Canvas SDK - Design Atoms API Client\n\nThis module is an Axios API client for Design Atoms API service which is a part of [**Customer's Canvas**](https://customerscanvas.com) web-to-print system. It is supposed that you are familiar with its services and understand how to use its APIs. To learn more about Customer's Canvas and its services, refer the [Getting Started section of its documentation](https://customerscanvas.com/dev/getting-started/intro.html).\n\nThe API client is automatically generated with [NSwag tool](https://github.com/RicoSuter/NSwag). If for any reasons this API client does not work well for you, feel free to generate it yourself using Swagger document published at [Customer's Canvas API Gateway](https://api.customerscanvashub.com/).\n\n## Pre-requisites\n\nTo be able to use this package, you need to meet the following requirements:\n\n- You must have an account at Customer's Canvas.\n- You need to use it in Javascript\\Typescript applications.\n\nFor other platforms, see the [Backend services](https://customerscanvas.com/dev/getting-started/about-backend-services.html) article in Customer's Canvas documentation.\n\n## Usage\n\nInstall it as a regular npm package:\n\n```\nnpm install @aurigma/axios-design-atoms-api-client\n```\n\n### NodeJs\n\nReceive an access token through your backend as explained in the [documentation](https://customerscanvas.com/dev/getting-started/about-backend-services.html#authorization) and deliver it to your app.\n\n```js\nconst designAtomsApiClient = require(\"@aurigma/axios-design-atoms-api-client\").DesignAtomsApiClient;\nconst axios = require(\"axios\").default;\n\n// You need to create external app in BackOffice with required scopes to receive clientId\\clientSecret\n// https://customerscanvas.com/dev/getting-started/about-backend-services.html#authorization\nconst clientId = \"\";\nconst clientSecret = \"\";\nconst apiUrl = \"https://api.customerscanvashub.com/\";\n\nconst getToken = async (clientId, clientSecret) => {\n  const requestConfig = {\n    method: \"post\",\n    url: apiUrl + \"connect/token\",\n    headers: {\n      \"Content-Type\": \"application/x-www-form-urlencoded\",\n    },\n    data: new URLSearchParams({\n      client_id: clientId,\n      client_secret: clientSecret,\n      grant_type: \"client_credentials\",\n    }),\n  };\n\n  const response = await axios(requestConfig);\n  return response.data[\"access_token\"];\n};\n\nconst token = await getToken(clientId, clientSecret);\n```\n\nAnd then you can call ApiClients methods with this token:\n\n```js\nconst config = new designAtomsApiClient.ApiClientConfiguration();\nconfig.apiUrl = apiUrl;\nconfig.setAuthorizationToken(token);\n\nconst buildInfoClient = new designAtomsApiClient.BuildInfoApiClient(config);\nconst buildInfo = await buildInfoClient.getInfo();\n\nconsole.log(token);\nconsole.log(buildInfo);\n```\n\n### Frontend\n\nYou should retrieve access token from your backend, how it's explained above.\n\n```ts\nimport { DesignAtomsApiClient } from \"@aurigma/axios-design-atoms-api-client\";\n\n// get token on backend by clientId\\clientSecret. Never use clientId\\clientSecret on frontend!\n// https://customerscanvas.com/dev/getting-started/about-backend-services.html#authorization\nconst token = \"\";\n\nconst config = new DesignAtomsApiClient.ApiClientConfiguration();\nconfig.apiUrl = \"\";\nconfig.setAuthorizationToken(token);\n\nconst buildInfoClient = new DesignAtomsApiClient.BuildInfoApiClient(config)\nbuildInfoClient.getInfo().then(data => console.log(data));\n```\n\nTo find out what other clients are available in this module, refer [Design Atoms API Reference](https://customerscanvas.com/dev/backend/backend/api/DesignAtoms.OpenApi2.html).\n\n> NOTE: The class name for each client is formed as <i>ClientName</i>ApiClient, e.g. `BuildInfo` -> `BuildInfoApiClient`, etc.\n","readmeFilename":"README.md"}