Skip to content

Commit

Permalink
Update generated SDKs (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: Auto Mation <automation@commercetools.com>
Co-authored-by: Jens Schulze <jens.schulze@commercetools.com>
  • Loading branch information
3 people authored Jan 19, 2022
1 parent fb9be81 commit 1b305a1
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .changeset/rich-mayflies-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@commercetools/history-sdk": patch
"@commercetools/importapi-sdk": patch
"@commercetools/ml-sdk": patch
"@commercetools/platform-sdk": minor
---

Update generated SDKs
2 changes: 1 addition & 1 deletion packages/history-sdk/src/generated/client/api-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ApiRoot {
constructor(args: { executeRequest: executeRequest; baseUri?: string }) {
this.executeRequest = args.executeRequest
this.baseUri =
args.baseUri ?? 'https://history.europe-west1.gcp.commercetools.com'
args.baseUri || 'https://history.europe-west1.gcp.commercetools.com'
}

public withProjectKeyValue(childPathArgs: {
Expand Down
2 changes: 1 addition & 1 deletion packages/importapi-sdk/src/generated/client/api-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ApiRoot {
constructor(args: { executeRequest: executeRequest; baseUri?: string }) {
this.executeRequest = args.executeRequest
this.baseUri =
args.baseUri ?? 'https://import.europe-west1.gcp.commercetools.com'
args.baseUri || 'https://import.europe-west1.gcp.commercetools.com'
}

public withProjectKeyValue(childPathArgs: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ml-sdk/src/generated/client/api-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ApiRoot {
constructor(args: { executeRequest: executeRequest; baseUri?: string }) {
this.executeRequest = args.executeRequest
this.baseUri =
args.baseUri ?? 'https://ml-eu.europe-west1.gcp.commercetools.com'
args.baseUri || 'https://ml-eu.europe-west1.gcp.commercetools.com'
}

public withProjectKey(childPathArgs: {
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-sdk/src/generated/client/api-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class ApiRoot {
constructor(args: { executeRequest: executeRequest; baseUri?: string }) {
this.executeRequest = args.executeRequest
this.baseUri =
args.baseUri ?? 'https://api.europe-west1.gcp.commercetools.com'
args.baseUri || 'https://api.europe-west1.gcp.commercetools.com'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class ByProjectKeyCartsRequestBuilder {

public get(methodArgs?: {
queryArgs?: {
customerId?: string
expand?: string | string[]
sort?: string | string[]
limit?: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
*/
import { Cart, CartDraft } from '../../models/cart'
import { Cart, CartDraft, CartPagedQueryResponse } from '../../models/cart'
import { executeRequest, QueryParam } from '../../shared/utils/common-types'
import { ApiRequest } from '../../shared/utils/requests-utils'
import { ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestBuilder } from '../replicate/by-project-key-in-store-key-by-store-key-carts-replicate-request-builder'
Expand Down Expand Up @@ -75,7 +75,6 @@ export class ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder {
*/
public get(methodArgs?: {
queryArgs?: {
customerId?: string
expand?: string | string[]
sort?: string | string[]
limit?: number
Expand All @@ -87,8 +86,8 @@ export class ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder {
headers?: {
[key: string]: string | string[]
}
}): ApiRequest<any> {
return new ApiRequest<any>(
}): ApiRequest<CartPagedQueryResponse> {
return new ApiRequest<CartPagedQueryResponse>(
{
baseUri: this.args.baseUri,
method: 'GET',
Expand Down
66 changes: 66 additions & 0 deletions packages/platform-sdk/src/generated/models/order-edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,39 @@ export interface StagedOrderSetOrderTotalTaxAction {
*/
readonly externalTaxPortions?: TaxPortionDraft[]
}
export interface StagedOrderSetParcelCustomFieldAction {
readonly action: 'setParcelCustomField'
/**
*
*/
readonly parcelId: string
/**
*
*/
readonly name: string
/**
*
*/
readonly value?: any
}
export interface StagedOrderSetParcelCustomTypeAction {
readonly action: 'setParcelCustomType'
/**
*
*/
readonly parcelId: string
/**
* If set, the custom type is set to this new value.
* If absent, the custom type and any existing custom fields are removed.
*
*/
readonly type?: TypeResourceIdentifier
/**
* If set, the custom fields are set to this new value.
*
*/
readonly fields?: any
}
export interface StagedOrderSetParcelItemsAction {
readonly action: 'setParcelItems'
/**
Expand Down Expand Up @@ -1123,6 +1156,39 @@ export interface StagedOrderSetReturnInfoAction {
*/
readonly items?: ReturnInfoDraft[]
}
export interface StagedOrderSetReturnItemCustomFieldAction {
readonly action: 'setReturnItemCustomField'
/**
*
*/
readonly returnItemId: string
/**
*
*/
readonly name: string
/**
*
*/
readonly value?: any
}
export interface StagedOrderSetReturnItemCustomTypeAction {
readonly action: 'setReturnItemCustomType'
/**
*
*/
readonly returnItemId: string
/**
* If set, the custom type is set to this new value.
* If absent, the custom type and any existing custom fields are removed.
*
*/
readonly type?: TypeResourceIdentifier
/**
* If set, the custom fields are set to this new value.
*
*/
readonly fields?: any
}
export interface StagedOrderSetReturnPaymentStateAction {
readonly action: 'setReturnPaymentState'
/**
Expand Down
97 changes: 97 additions & 0 deletions packages/platform-sdk/src/generated/models/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ import {
StagedOrderSetLocaleAction,
StagedOrderSetOrderNumberAction,
StagedOrderSetOrderTotalTaxAction,
StagedOrderSetParcelCustomFieldAction,
StagedOrderSetParcelCustomTypeAction,
StagedOrderSetParcelItemsAction,
StagedOrderSetParcelMeasurementsAction,
StagedOrderSetParcelTrackingDataAction,
StagedOrderSetReturnInfoAction,
StagedOrderSetReturnItemCustomFieldAction,
StagedOrderSetReturnItemCustomTypeAction,
StagedOrderSetReturnPaymentStateAction,
StagedOrderSetReturnShipmentStateAction,
StagedOrderSetShippingAddressAction,
Expand Down Expand Up @@ -203,10 +207,14 @@ export type StagedOrderUpdateAction =
| StagedOrderSetLocaleAction
| StagedOrderSetOrderNumberAction
| StagedOrderSetOrderTotalTaxAction
| StagedOrderSetParcelCustomFieldAction
| StagedOrderSetParcelCustomTypeAction
| StagedOrderSetParcelItemsAction
| StagedOrderSetParcelMeasurementsAction
| StagedOrderSetParcelTrackingDataAction
| StagedOrderSetReturnInfoAction
| StagedOrderSetReturnItemCustomFieldAction
| StagedOrderSetReturnItemCustomTypeAction
| StagedOrderSetReturnPaymentStateAction
| StagedOrderSetReturnShipmentStateAction
| StagedOrderSetShippingAddressAction
Expand Down Expand Up @@ -843,10 +851,14 @@ export type OrderUpdateAction =
| OrderSetLineItemShippingDetailsAction
| OrderSetLocaleAction
| OrderSetOrderNumberAction
| OrderSetParcelCustomFieldAction
| OrderSetParcelCustomTypeAction
| OrderSetParcelItemsAction
| OrderSetParcelMeasurementsAction
| OrderSetParcelTrackingDataAction
| OrderSetReturnInfoAction
| OrderSetReturnItemCustomFieldAction
| OrderSetReturnItemCustomTypeAction
| OrderSetReturnPaymentStateAction
| OrderSetReturnShipmentStateAction
| OrderSetShippingAddressAction
Expand Down Expand Up @@ -880,6 +892,11 @@ export interface Parcel {
*
*/
readonly items?: DeliveryItem[]
/**
* Custom Fields of this parcel.
*
*/
readonly custom?: CustomFields
}
export interface ParcelDraft {
/**
Expand All @@ -895,6 +912,11 @@ export interface ParcelDraft {
*
*/
readonly items?: DeliveryItem[]
/**
* Custom Fields of this parcel.
*
*/
readonly custom?: CustomFieldsDraft
}
export interface ParcelMeasurements {
/**
Expand Down Expand Up @@ -1012,6 +1034,11 @@ export interface CustomLineItemReturnItem {
*
*/
readonly paymentState: ReturnPaymentState
/**
* Custom Fields of this return item.
*
*/
readonly custom?: CustomFields
/**
*
*/
Expand Down Expand Up @@ -1047,6 +1074,11 @@ export interface LineItemReturnItem {
*
*/
readonly paymentState: ReturnPaymentState
/**
* Custom Fields of this return item.
*
*/
readonly custom?: CustomFields
/**
*
*/
Expand Down Expand Up @@ -1081,6 +1113,11 @@ export interface ReturnItemDraft {
*
*/
readonly shipmentState: ReturnShipmentState
/**
* Custom Fields of this return item.
*
*/
readonly custom?: CustomFields
}
export type ReturnPaymentState =
| 'Initial'
Expand Down Expand Up @@ -1596,6 +1633,36 @@ export interface OrderSetOrderNumberAction {
*/
readonly orderNumber?: string
}
export interface OrderSetParcelCustomFieldAction {
readonly action: 'setParcelCustomField'
/**
*
*/
readonly parcelId: string
/**
*
*/
readonly name: string
/**
*
*/
readonly value?: any
}
export interface OrderSetParcelCustomTypeAction {
readonly action: 'setParcelCustomType'
/**
*
*/
readonly parcelId: string
/**
*
*/
readonly type?: TypeResourceIdentifier
/**
*
*/
readonly fields?: FieldContainer
}
export interface OrderSetParcelItemsAction {
readonly action: 'setParcelItems'
/**
Expand Down Expand Up @@ -1636,6 +1703,36 @@ export interface OrderSetReturnInfoAction {
*/
readonly items?: ReturnInfoDraft[]
}
export interface OrderSetReturnItemCustomFieldAction {
readonly action: 'setReturnItemCustomField'
/**
*
*/
readonly returnItemId: string
/**
*
*/
readonly name: string
/**
*
*/
readonly value?: any
}
export interface OrderSetReturnItemCustomTypeAction {
readonly action: 'setReturnItemCustomType'
/**
*
*/
readonly returnItemId: string
/**
*
*/
readonly type?: TypeResourceIdentifier
/**
*
*/
readonly fields?: FieldContainer
}
export interface OrderSetReturnPaymentStateAction {
readonly action: 'setReturnPaymentState'
/**
Expand Down
8 changes: 8 additions & 0 deletions packages/platform-sdk/src/generated/models/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ export interface PaymentSetStatusInterfaceTextAction {
}
export interface PaymentSetTransactionCustomFieldAction {
readonly action: 'setTransactionCustomField'
/**
*
*/
readonly transactionId: string
/**
*
*/
Expand All @@ -611,6 +615,10 @@ export interface PaymentSetTransactionCustomFieldAction {
}
export interface PaymentSetTransactionCustomTypeAction {
readonly action: 'setTransactionCustomType'
/**
*
*/
readonly transactionId: string
/**
* If set, the custom type is set to this new value.
* If absent, the custom type and any existing custom fields are removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null })

export function getRequestsWithMethodParameters(): RequestWithMethod[] {
return [
{
method: 'get',
uri: '/test_projectKey/carts?customerId=customerId',
request: apiRoot
.withProjectKey({ projectKey: 'test_projectKey' })
.carts()
.get({ queryArgs: { customerId: 'customerId' } }),
},
{
method: 'get',
uri: '/test_projectKey/carts?expand=expand',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null })

export function getRequestsWithMethodParameters(): RequestWithMethod[] {
return [
{
method: 'get',
uri: '/test_projectKey/in-store/key=test_storeKey/carts?customerId=customerId',
request: apiRoot
.withProjectKey({ projectKey: 'test_projectKey' })
.inStoreKeyWithStoreKeyValue({ storeKey: 'test_storeKey' })
.carts()
.get({ queryArgs: { customerId: 'customerId' } }),
},
{
method: 'get',
uri: '/test_projectKey/in-store/key=test_storeKey/carts?expand=expand',
Expand Down

0 comments on commit 1b305a1

Please sign in to comment.