Skip to content

Commit

Permalink
Release v2.0.0 - @W-15675100@ (#153)
Browse files Browse the repository at this point in the history
* add updated APIs

* revert shopper basket changes

* update docs

* Update for v1.14.0

* update changelog

* update docs

* remove authorizeCustomer from unit tests

* bump major version
  • Loading branch information
joeluong-sfcc authored May 10, 2024
1 parent d336d21 commit 7783054
Show file tree
Hide file tree
Showing 430 changed files with 8,758 additions and 2,559 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# CHANGELOG

## v1.14.0-dev
## v2.0.0

#### API Changes

*Shopper Stores*

* API Added

*Shopper Orders*

* New endpoint added

| **Endpoint Name** | **Description** |
| ------------- |-------------|
| guestOrderLookup | Lookup a guest order |

*Shopper Customers*

- Removal of deprecated endpoints:
- `invalidateCustomerAuth`
- `authorizeCustomer`
- `authorizeTrustedSystem`

#### Enchancements

Expand Down
4 changes: 2 additions & 2 deletions apis/shopper-context/.metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-context/0.0.23",
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-context/0.0.26",
"name": "Shopper Context",
"description": "The Shopper Context API enables developers to build highly contextualized shopping experiences for shoppers.",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "shopper-context",
"version": "0.0.23",
"version": "0.0.26",
"categories": {
"API layer": [
"System"
Expand Down
27 changes: 14 additions & 13 deletions apis/shopper-context/exchange.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"main": "shopper-context.raml",
"name": "Shopper Context",
"classifier": "raml",
"tags": [],
"dependencies": [
{
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"version": "1.1.15",
"assetId": "api-standards",
"version": "1.1.15"
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
},
{
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"version": "2.0.0",
"assetId": "commerce-cloud-standards",
"version": "1.0.24"
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
}
],
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "shopper-context",
"version": "0.0.23",
"apiVersion": "v1",
"version": "0.0.26",
"originalFormatVersion": "1.0",
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
"apiVersion": "v1",
"descriptorVersion": "0.1.0",
"classifier": "raml",
"main": "shopper-context.raml",
"assetId": "shopper-context",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"name": "Shopper Context",
"tags": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#%RAML 1.0 Library
usage: |-
The Commerce Cloud API Standards is a collection of types, traits, security schemes, and more that follows the standards that are defined for the B2C Commerce APIs. Use this standard library in conjunction with the Salesforce API Standards library, via the `uses` property. See the main RAML file for any of the B2C Commerce APIs for example usage.
The goal of this library is to expose only the importable objects and keep other, internal details as private. If you have suggestions for adding to the standard, contact the C4E team with your proposal.
# Security Schemes
This library provides the following reusable security schemes. Except in rare circumstances, avoid defining a custom security scheme for a single API. The security schemes provided here or in the Salesforce API Standards are designed to meet the needs of most applications.
Security schemes included in Commerce Cloud Standards:
- `AmOAuth2`: for endpoints authenticated against [Account Manager](https://account.demandware.com/dw/account/Home#/) OAuth 2.0.
- `ShopperToken`: for endpoints authenticated via Shopper JWTs.
## Types
This library provides the following reusable types. These types are referenced in a plurality of APIs, to the point where it makes sense to have a common definition where the documentation, validation, and usage of them can be well documented.
- `SiteId`: a type that describes the storefront context for requests by a Shopper. If you need to have a siteId queryParam, use the trait `SiteSpecific`.
## Search Specific
- `SearchRequest`: a type commonly used for searching that takes a query in a body.
- `PaginatedSearchResult`: a type commonly used for a search response that took a query in a body.
- `SimpleSearchResult`: a type used for a search response that takes a query in a body, but does not return a paginated result.
## Standards Followed
- `CurrencyCode`: ISO 4217 compliant currency code.
- `Money`: A combination of a CurrencyCode and a number.
- `LanguageCode`: ISO 639-1 compliant language code.
- `CountryCode`: ISO 3166-1 compliant country code.
- `LocaleCode`: A combination of LanguageCode and CountryCode.
## Resource Types
This project provides the following reusable resource types. These resource types are referenced in a plurality of APIs, to the point where it makes sense to have a common definition where the documentation, validation, and usage of them can be well documented.
- `Organization`: a type that describes the `organizationId` URI parameter that the majority of Commerce Cloud APIs require in the resource path after the `version`. The beginning of all API resource paths is expected to be `/organizations/{organizationId}`. This resource type provides the documentation and validation of the `organizationId`.
## Traits
This project provides the following reusable traits. These traits are referenced in a plurality of APIs, to the point where it makes sense to have a common definition where the documentation, validation, and usage of them can be well documented.
- `Selectable`: adds a query parameter called `select` of type `Select` to the request.
- `SiteSpecific`: adds a query parameter called `siteId` of type `SiteId` to the request.
- `QueryParamsLimit`: adds an offset query parameter without the limit query parameter. Some Commerce Cloud use cases do not currently require both. Prefer the use of `ApiStandards.OffsetPaginated` because this trait will be deprecated in the future if there is no use case for it.
- `QueryParamsOffset`: adds a limit query parameter without the offset query parameter. Some Commerce Cloud use cases do not currently require both. Prefer the use of `ApiStandards.OffsetPaginated` because this trait will be deprecated in the future if there is no use case for it.
uses:
AdditionalProperties: Types/additional-properties.raml
Search: Types/search-types.raml
Pagination: Types/pagination-types.raml
ISO: Types/ISO-standards.raml
AttributeDefinitions: Types/attribute-definition-types.raml

securitySchemes:
AmOAuth2: !include SecuritySchemes/am-oauth-2.raml
ShopperToken: !include SecuritySchemes/shopper-token.raml
ShopperTokenTsob: !include SecuritySchemes/shopper-token-tsob.raml
ShopperTokenTaob: !include SecuritySchemes/shopper-token-taob.raml

types:
SiteId:
description: The identifer of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites
example:
SiteGenesis
type: string
minLength: 1
Select:
description: The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
example:
(name,id,variationAttributes.(**))
type: string
minLength: 1
SearchRequest: Search.SearchRequestBase
PaginatedSearchResult: Search.PaginatedSearchResultBase
SimpleSearchResult: Search.SimpleSearchResultBase

CurrencyCode: ISO.Currency
Money: ISO.MoneyMnemonic
LanguageCode: ISO.Language
CountryCode: ISO.Country
LocaleCode: ISO.Locale
LocalizedString: ISO.L10nString

PropertyDefinition: AttributeDefinitions.AttributeDefinition

ClosedObject: AdditionalProperties.NoPropertiesAllowed
OpenObject: AdditionalProperties.SpecifiedPropertiesAllowed

resourceTypes:
Organization:
uriParameters:
organizationId:
description: An identifier for the organization the request is being made by.
example:
f_ecom_zzxy_prd

traits:
QueryParamsLimit:
usage: This trait should not be used unless there is no requirement for QueryParamsOffset. Prefer the usage of ApiStandards.OffsetPaginated.
queryParameters:
limit?: Pagination.Limit
QueryParamsOffset:
usage: This trait should not be used unless there is no requirement for QueryParamsLimit. Prefer the usage of ApiStandards.OffsetPaginated.
queryParameters:
offset?: Pagination.Offset
SiteSpecific:
usage: This trait should be used whenever a resource has the context of a site assoicated with its request. This will add a siteId query parameter
queryParameters:
siteId: SiteId
Selectable:
usage: This trait should be used whenever a resource supports generic property selection. This will add a select query parameter.
queryParameters:
select?: Select
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ uses:
description: Example get Method
securedBy:
- CommerceCloudStandards.AmOAuth2: { scopes: [example]}
- CommerceCloudStandards.BearerToken: { scopes: [example]}

is:
- CommerceCloudStandards.QueryParamsOffset:
- CommerceCloudStandards.QueryParamsLimit:
- CommerceCloudStandards.SiteSpecific:
objectType: SiteId
objectId: SiteGenesis
- CommerceCloudStandards.Selectable
responses:
200:
description: an example response
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"main": "commerce-cloud-standards.raml",
"name": "Commerce Cloud Standards",
"classifier": "raml-fragment",
"tags": [],
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "commerce-cloud-standards",
"version": "2.0.0",
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
}
6 changes: 4 additions & 2 deletions apis/shopper-context/shopper-context-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ As part of this, when creating a new public client in SLAS for a tenant, if addi

**Note**: The context is valid for 1 day for guest shoppers and 7 days for registered shoppers. To extend the context set, create a new context. As a best practice, refresh your contexts periodically to ensure that the right personalized experience is rendered for your shoppers.

**Important:** For detailed usage information, see the [Shopper Context guides](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html).

To use the Shopper Context API, you must:

- Get a JSON Web Token (JWT) for the Shopper Login and API Access Service (SLAS).
Expand All @@ -24,3 +22,7 @@ To use the Shopper Context API, you must:
For more information, see [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html) in the Get Started guides.

**Warning**: As with all APIs, never store access tokens in the browser because this creates a security vulnerability.

## Use Cases

For detailed usage information, see the [Shopper Context guides](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html).
6 changes: 5 additions & 1 deletion apis/shopper-context/shopper-context.raml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ baseUriParameters:
traits:
uses:
ApiStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/api-standards/1.1.15/api-standards.raml
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/1.0.24/commerce-cloud-standards.raml
CommerceCloudStandards: exchange_modules/893f605e-10e2-423a-bdb4-f952f56eb6d8/commerce-cloud-standards/2.0.0/commerce-cloud-standards.raml
types:
ShopperContext:
description: A shoppers' context represented as key-value string pairs.
Expand Down Expand Up @@ -48,6 +48,10 @@ types:
//:
type: string | nil
required: false
clientIp:
type: string
description: The IP Address of the client. If the client IP is not a valid IPv4 address, a Bad Request (400) error is thrown. This property is available from version 24.7.
required: false
example: !include Examples/shopper-context-example.raml


Expand Down
4 changes: 2 additions & 2 deletions apis/shopper-customers/.metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-customers/0.0.43",
"id": "893f605e-10e2-423a-bdb4-f952f56eb6d8/shopper-customers/0.0.48",
"name": "Shopper Customers",
"description": "Allow customers to manage their own profiles and product lists.",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"assetId": "shopper-customers",
"version": "0.0.43",
"version": "0.0.48",
"categories": {
"API layer": [
"Process"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ value:
},
"giftCertificateCode": "gift_code7",
"paymentMethodId": "OCAPI_Payment_Simple",
"bankRoutingNumber":"bankrouting3776"
"bankRoutingNumber": "bankrouting3776"
}
26 changes: 25 additions & 1 deletion apis/shopper-customers/exchange.json
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
{"main":"shopper-customers.raml","name":"Shopper Customers","classifier":"raml","tags":[],"dependencies":[{"groupId":"893f605e-10e2-423a-bdb4-f952f56eb6d8","assetId":"api-standards","version":"1.1.15"},{"groupId":"893f605e-10e2-423a-bdb4-f952f56eb6d8","assetId":"commerce-cloud-standards","version":"1.0.24"}],"groupId":"893f605e-10e2-423a-bdb4-f952f56eb6d8","assetId":"shopper-customers","version":"0.0.43","apiVersion":"v1","originalFormatVersion":"1.0","organizationId":"893f605e-10e2-423a-bdb4-f952f56eb6d8"}
{
"dependencies": [
{
"version": "1.1.15",
"assetId": "api-standards",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
},
{
"version": "2.0.0",
"assetId": "commerce-cloud-standards",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8"
}
],
"version": "0.0.48",
"originalFormatVersion": "1.0",
"apiVersion": "v1",
"descriptorVersion": "0.1.0",
"classifier": "raml",
"main": "shopper-customers.raml",
"assetId": "shopper-customers",
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
"name": "Shopper Customers",
"tags": []
}
Loading

0 comments on commit 7783054

Please sign in to comment.