Skip to content

Commit

Permalink
Release v3.1.0 (@W-15945047@) (#404)
Browse files Browse the repository at this point in the history
* Update to latest raml-toolkit

* Update APIs

* Update CHANGELOG.md

* Generate docs

* Increment version

* Update .gitattributes

* Revert "Update .gitattributes"

This reverts commit 2af825b.

* Revert "Update APIs"

This reverts commit e140c37.

* Reapply "Update APIs"

This reverts commit e3b17bb.

* Fix the version of future potentially breaking change

* Fix CI tests

* Now publishing with Node 16

Since we're supporting Node 16, 18, and 20.

* Update docs with the new commerce-sdk version

* CI: create unique cache for each Node version tested

* CI caching: hash the correct file
  • Loading branch information
vmarta authored Jun 20, 2024
1 parent 01ae667 commit cf5c041
Show file tree
Hide file tree
Showing 1,633 changed files with 43,624 additions and 18,296 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install snyk --legacy-peer-deps
- run: npm run snyk:auth ${{ secrets.SNYK_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: ${{ matrix.node }}
cache: npm
- name: Cache node modules
id: cache-nodemodules
Expand All @@ -25,7 +25,7 @@ jobs:
cache-name: cache-node-modules
with:
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-node${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm install snyk --legacy-peer-deps
- run: npm run snyk:auth ${{ secrets.SNYK_TOKEN }}
- run: npm install --legacy-peer-deps
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ only use JavaScript, or if you use TypeScript but only import the client classes
then your usage **will not change**. You will likely only need to make changes if
you import the type definitions directly.

## v3.1.0

### API Changes
*Shopper Baskets*

| **Endpoint Name** | **Description** |
| ------------- |-----------------------------------|
| updateItemsInBasket | Updates multiple items in a basket. |

## v3.0.0

#### API Changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Visit the [Commerce Cloud Developer Center](https://developer.salesforce.com/dev
## :warning: Planned future release will contain breaking changes :warning:
Due to an issue with the generation of the type definitions, an upcoming release
of the SDK will change type definitions to include namespaces. As this is a
breaking change, a new major version will be released (v3.0.0). Only the names of
breaking change, a new major version will be released (v4.0.0). Only the names of
the types will change, not their contents or any of the exported code. If you
only use JavaScript, or if you use TypeScript but only import the client classes,
then your usage **will not change**. You will likely only need to make changes if
Expand Down
4 changes: 2 additions & 2 deletions apis/checkout/orders/.metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/orders/1.4.2",
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/orders/1.4.4",
"name": "Orders",
"description": "Manage order and order payment status.",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "orders",
"version": "1.4.2",
"version": "1.4.4",
"categories": {
"API layer": [
"Process"
Expand Down
4 changes: 1 addition & 3 deletions apis/checkout/orders/data-types.raml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
usage: This library provides all order relevant data types

uses:
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/1.0.27/commerce-cloud-standards.raml
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/2.0.1/commerce-cloud-standards.raml

types:
OrderUpdateRequest:
Expand Down Expand Up @@ -1331,7 +1331,6 @@ types:
quantity?:
description: |-
The ordered quantity of the products represented by this item.
maximum: 999
minimum: 0
type: number
format: double
Expand Down Expand Up @@ -2148,7 +2147,6 @@ types:
green umbrella
quantity:
description: The ordered quantity of the products represented by this item.
maximum: 999
minimum: 0
type: number
format: double
Expand Down
4 changes: 2 additions & 2 deletions apis/checkout/orders/exchange.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
},
{
"version": "1.0.27",
"version": "2.0.1",
"assetId": "commerce-cloud-standards",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
}
],
"version": "1.4.2",
"version": "1.4.4",
"originalFormatVersion": "1.0",
"apiVersion": "v1",
"descriptorVersion": "0.1.0",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
A shopper token allows you to access the Shopper API endpoints of both OCAPI and the B2C Commerce API. These endpoints can be used to build headless storefronts and other applications.
The `ShopperToken` security scheme is a parent of other security schemes, such as `ShopperTokenTsob`. A Shopper API endpoint can require a specific child scheme (`ShopperTokenTsob`, for example) that cannot be accessed with a regular shopper token.
type: x-custom
type: OAuth 2.0
displayName: ShopperToken

uses:
Expand Down Expand Up @@ -43,4 +43,8 @@ describedBy:
example:
type: "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden"
title: Forbidden
detail: Your token is valid, but you have no permissions to access the resource.
detail: Your access token is valid, but you don’t have the required permissions to access the resource.
settings:
authorizationUri: https://{short-code}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/authorize
accessTokenUri: https://{short-code}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token
authorizationGrants: [authorization_code,client_credentials]
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"tags": [],
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "commerce-cloud-standards",
"version": "2.0.0",
"version": "2.0.1",
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
}
2 changes: 2 additions & 0 deletions apis/checkout/orders/orders-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Use the Orders API to update order status and order payment status, edit shippin

The client requesting the order information must have access to the Orders resource. The API requests pass a system-to-system bearer token in the header of the request. The `POST /orders` endpoint uses the [ShopperTokenTsob](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-login?meta=security%3AShopperTokenTsob) security scheme.

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)

## Update Order Statuses

An order uses several status properties to define its workflow state. Some of them are used to trigger internal processes, such as inventory allocation. Others have no default function, but are available for use with customizations.
Expand Down
16 changes: 2 additions & 14 deletions apis/checkout/orders/orders.raml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ baseUriParameters:
uses:
StatusCodes: status-codes.raml
DataTypes: data-types.raml
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/1.0.27/commerce-cloud-standards.raml
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/2.0.1/commerce-cloud-standards.raml
ApiStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/api-standards/1.1.15/api-standards.raml

types:
Expand All @@ -25,7 +25,7 @@ types:
type: CommerceCloudStandards.Organization
get:
description: |-
Returns the details of orders that match the query filters. By default, calling this API with no filter returns the 100 most recently created orders. To return up to 200 orders, use the limit parameter. To return a page of results past the first page, use a resource offset.
Returns the details of orders that match the query filters. By default, calling this API with no filter returns the 100 most recently created orders. To return up to 200 orders, use the limit parameter. To return a page of results past the first page, use a resource offset. *Note* : The sum of the offset and limit parameters cannot be greater than 10000.
displayName: getOrders
queryParameters:
sortBy?:
Expand Down Expand Up @@ -92,7 +92,6 @@ types:
maxLimit: 200
defaultSize: 100
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders", "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders", "sfcc.orders.rw" ] }
post:
description: !include create-order-description.md
Expand Down Expand Up @@ -135,7 +134,6 @@ types:
- CommerceCloudStandards.SiteSpecific
displayName: getOrder
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders", "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders", "sfcc.orders.rw" ] }
patch:
description: |-
Expand All @@ -152,7 +150,6 @@ types:
examples:
DataTypes.OrderUpdateRequest: !include examples/order-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.ShopperTokenTsob: { scopes: [ "sfcc.orders.rw" ] }
/confirmation-status:
Expand All @@ -172,7 +169,6 @@ types:
examples:
DataTypes.OrderConfirmationStatusUpdateRequest: !include examples/order-confirmation-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/export-status:
type: CommerceCloudStandards.Organization
Expand All @@ -191,7 +187,6 @@ types:
examples:
DataTypes.OrderExportStatusUpdateRequest: !include examples/order-export-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/external-status:
type: CommerceCloudStandards.Organization
Expand All @@ -210,7 +205,6 @@ types:
examples:
DataTypes.OrderExternalStatusUpdateRequest: !include examples/order-external-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/payment-status:
type: CommerceCloudStandards.Organization
Expand All @@ -229,7 +223,6 @@ types:
examples:
DataTypes.OrderPaymentStatusUpdateRequest: !include examples/order-payment-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/shipping-status:
type: CommerceCloudStandards.Organization
Expand All @@ -248,7 +241,6 @@ types:
examples:
DataTypes.OrderShippingStatusUpdateRequest: !include examples/order-shipping-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/status:
type: CommerceCloudStandards.Organization
Expand Down Expand Up @@ -286,7 +278,6 @@ types:
examples:
DataTypes.OrderStatusUpdateRequest: !include examples/order-status-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
'/payment-instruments/{paymentInstrumentId}':
type: CommerceCloudStandards.Organization
Expand All @@ -313,7 +304,6 @@ types:
examples:
DataTypes.PaymentInstrumentUpdateRequest: !include examples/order-payment-instrument-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
/transaction:
type: CommerceCloudStandards.Organization
Expand All @@ -333,7 +323,6 @@ types:
examples:
DataTypes.PaymentTransactionUpdateRequest: !include examples/order-payment-transaction-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
'/shipments/{shipmentId}':
type: CommerceCloudStandards.Organization
Expand Down Expand Up @@ -362,5 +351,4 @@ types:
examples:
DataTypes.ShippingAddressUpdateRequest: !include examples/order-shipping-address-request.raml
securedBy:
- CommerceCloudStandards.BearerToken: { scopes: [ "sfcc.orders.rw" ] }
- CommerceCloudStandards.AmOAuth2: { scopes: [ "sfcc.orders.rw" ] }
4 changes: 2 additions & 2 deletions apis/checkout/shopper-baskets/.metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-baskets/2.0.3",
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-baskets/2.0.9",
"name": "Shopper Baskets",
"description": "Build a checkout experience.",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "shopper-baskets",
"version": "2.0.3",
"version": "2.0.9",
"categories": {
"API layer": [
"Process"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%RAML 1.0 NamedExample
value:
[{
"itemId": "051e908cca031ebf8ee80cbb0a",
"productId": "green-bag",
"quantity": 1
},{
"itemId": "078a492cca031ebf8ee80739ab",
"optionItems" : [{
"optionId":"Option1",
"optionValueId":"ValueA"
}],
"quantity": 1
}]
Loading

0 comments on commit cf5c041

Please sign in to comment.