New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dotdev/apparel21-sdk

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotdev/apparel21-sdk

Apparel21 Interface Library

  • 0.0.80
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
301
increased by296.05%
Maintainers
0
Weekly downloads
 
Created
Source

Apparel21 SDK

This SDK wraps AP21 API and returns the response formatted as regular JavaScript objects.

Wrapped endpoints

The following endpoints are wrapped by this SDK:

Core endpoints (All required)

  • GET /ReferenceTypes
  • GET /ReferenceTypes/{id}
  • GET /Products
  • GET /Products/{id}
  • GET /ProductsSimple
  • GET /ProductsSimpleWithPagination
  • GET /ProductsSimple/{id}
  • GET /ProductNotes/{id}
  • GET /ProductColourNotes/{id}
  • GET /Colours
  • GET /Sizes
  • GET /Persons
  • GET /Persons/{id}
  • POST /Persons
  • PUT /Persons/{id}
  • GET /Persons/{id}/Orders
  • GET /Persons/{id/Orders/{id}
  • GET /Persons/{id}/Shipments/{orderId}
  • POST /Persons/{id}/Orders
  • GET /Persons/{id}/RetailTransactions
  • POST /Persons/{id}/Orders/{id}/Returns
  • GET /Persons/{id}/Orders/{id}/Returns/{id}
  • GET /Vouchers/{number}/?pin={pin}
  • GET /Voucher/GVValid/{number}?pin={pin}&amount={amount}
  • GET /Voucher/Lock/{number}?ValidationId={id}&LockSeconds={seconds}
  • GET /Freestock/style/{id}
  • GET /Freestock/clr/{id}
  • GET /Freestock/sku/{id}
  • GET /StockChanged?ChangedSince={date}
  • GET /Stores
  • GET /Stores/{id}
  • GET /Orders?UpdatedAfter={date}

Loyalty (Low priority)

We have implemented these for Tony Bianco loyalty. However, they're the only ones currently using this module. We will need to support it at some point but not a top priority for now.

  • GET /Rewards/Programs
  • GET /Rewards/Accounts/{id}
  • POST /Rewards/Accounts

Loyalty (Extra-low priority)

These ones will be great to support but not currently needed (we don't "change" the loyalty account in any way right now, it's all done internally at AP21).

  • PUT /Rewards/Accounts
  • GET /Rewards/Accounts/{id}/Transactions
  • POST /Rewards/Accounts/{id}/Rewards
  • POST /Rewards/Accounts/{id}/Gifts
  • POST /Rewards/Accounts/{id}/Points
  • POST /Rewards/Accounts/{id}/Rewards/Redemptions
  • POST /Rewards/Accounts/{id}/Gifts/Redemptions
  • POST /Rewards/Accounts/{id}/Points/Redemptions
  • POST /Rewards/Confirmation?requestId={id}
  • POST /Rewards/Reversal?requestId={id}

For more details on these endpoints see the wiki page

Tests

The SDK has automatic tests for each exposed method of the AP21 instance and its modules. There is an integration test file, however, coverage is not full. Most integration tests are commented out since details of the tests are tied to particual AP21 instances (such as person, product etc ids). To run the integration tests you first need to add a secret config (use credentials from 1password), see the example config file.

Each endpoint is mocked in the ./src/__mocks__/axios.ts file. There are mock XML payloads in the ExamplePayloads folder. These are based on a combination of real payloads and AP21 documentation examples

Next steps

This SDK has primarily been developed against the AP21 documentation.

  • Most safe endpoints (GET) have also been verified against a few live instances of AP21.
  • Most non-safe endpoints (POST, PUT) have been tested against the AP21 test instance DotDev has access to (check 1password for credentials).

However, a lot of endpoints listed above are lacking proper setup in the AP21 test instance meaning they have not been verified to work against a live environment (see list below).

The AP21 documentation example payloads are full of errors and are often invalid XML. Meaning some of the covered endpoints may need updates once tested against a live environment and real payloads.

The first step should be to battle test the SDK against various live environments to ensure it reads and remaps the required data from XML to JS.

To test and verify the non-safe endpoints the AP21 test instance should be configured for gift vouchers and rewards.

Unverified

The following have not been possible to verify against a live environment:

EntityReason
RewardsNo rewards set up in test instance
VouchersNo vouchers set up in test instace
ReturnsNot able to create a return. Could be due to order status?
ShipmentsNeed to run against real instance or have status updated in test instance

Keywords

FAQs

Package last updated on 05 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc