Skip to content

Commit

Permalink
feat: update resources to schema v5.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Jun 11, 2024
1 parent a9c44a8 commit a35d9d3
Show file tree
Hide file tree
Showing 19 changed files with 483 additions and 1,313 deletions.
477 changes: 51 additions & 426 deletions gen/openapi.json

Large diffs are not rendered by default.

302 changes: 161 additions & 141 deletions gen/resources.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lodash.isequal": "^4.5.0",
"semantic-release": "^23.1.1",
"tsup": "^8.1.0",
"tsx": "^4.12.0",
"tsx": "^4.15.2",
"typescript": "^5.4.5"
},
"repository": "github:commercelayer/commercelayer-sdk",
Expand Down
670 changes: 217 additions & 453 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

194 changes: 0 additions & 194 deletions specs/resources/order_validation_rules.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export { default as OrderCopies } from './resources/order_copies'
export { default as OrderFactories } from './resources/order_factories'
export { default as OrderSubscriptionItems } from './resources/order_subscription_items'
export { default as OrderSubscriptions } from './resources/order_subscriptions'
export { default as OrderValidationRules } from './resources/order_validation_rules'
export { default as Orders } from './resources/orders'
export { default as Organizations } from './resources/organization'
export { default as Packages } from './resources/packages'
Expand Down Expand Up @@ -202,7 +201,6 @@ export type ResourceTypeLock =
| 'order_factories'
| 'order_subscription_items'
| 'order_subscriptions'
| 'order_validation_rules'
| 'orders'
| 'organization'
| 'packages'
Expand Down Expand Up @@ -330,7 +328,6 @@ export const resourceList = [
'order_factories',
'order_subscription_items',
'order_subscriptions',
'order_validation_rules',
'orders',
'organization',
'packages',
Expand Down Expand Up @@ -850,7 +847,6 @@ export type VersionableResourceType =
| 'merchants'
| 'order_amount_promotion_rules'
| 'order_subscriptions'
| 'order_validation_rules'
| 'orders'
| 'packages'
| 'parcel_line_items'
Expand Down Expand Up @@ -974,7 +970,6 @@ export type ResourceFields = {
order_factories: models.OrderFactory,
order_subscription_items: models.OrderSubscriptionItem,
order_subscriptions: models.OrderSubscription,
order_validation_rules: models.OrderValidationRule,
orders: models.Order,
organization: models.Organization,
packages: models.Package,
Expand Down Expand Up @@ -1103,7 +1098,6 @@ export type ResourceSortFields = {
order_factories: models.OrderFactorySort,
order_subscription_items: models.OrderSubscriptionItemSort,
order_subscriptions: models.OrderSubscriptionSort,
order_validation_rules: models.OrderValidationRuleSort,
orders: models.OrderSort,
organization: models.OrganizationSort,
packages: models.PackageSort,
Expand Down
4 changes: 1 addition & 3 deletions src/commercelayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const debug = Debug('commercelayer')


// Autogenerated schema version number, do not remove this line
const OPEN_API_SCHEMA_VERSION = '5.4.0'
const OPEN_API_SCHEMA_VERSION = '5.4.1'
export { OPEN_API_SCHEMA_VERSION }


Expand Down Expand Up @@ -100,7 +100,6 @@ class CommerceLayerClient {
#order_factories?: api.OrderFactories
#order_subscription_items?: api.OrderSubscriptionItems
#order_subscriptions?: api.OrderSubscriptions
#order_validation_rules?: api.OrderValidationRules
#orders?: api.Orders
#organization?: api.Organizations
#packages?: api.Packages
Expand Down Expand Up @@ -241,7 +240,6 @@ class CommerceLayerClient {
get order_factories(): api.OrderFactories { return this.#order_factories || (this.#order_factories = new api.OrderFactories(this.#adapter)) }
get order_subscription_items(): api.OrderSubscriptionItems { return this.#order_subscription_items || (this.#order_subscription_items = new api.OrderSubscriptionItems(this.#adapter)) }
get order_subscriptions(): api.OrderSubscriptions { return this.#order_subscriptions || (this.#order_subscriptions = new api.OrderSubscriptions(this.#adapter)) }
get order_validation_rules(): api.OrderValidationRules { return this.#order_validation_rules || (this.#order_validation_rules = new api.OrderValidationRules(this.#adapter)) }
get orders(): api.Orders { return this.#orders || (this.#orders = new api.Orders(this.#adapter)) }
get organization(): api.Organizations { return this.#organization || (this.#organization = new api.Organizations(this.#adapter)) }
get packages(): api.Packages { return this.#packages || (this.#packages = new api.Packages(this.#adapter)) }
Expand Down
2 changes: 2 additions & 0 deletions src/jsonapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export type { DocWithData }

const denormalize = <R extends Resource>(response: DocWithData): R | R[] => {

if (!response) return response

let denormalizedResponse

if (response.links) delete response.links
Expand Down
1 change: 0 additions & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export type { OrderCopy, OrderCopyCreate, OrderCopyUpdate, OrderCopySort } from
export type { OrderFactory, OrderFactorySort } from './resources/order_factories'
export type { OrderSubscriptionItem, OrderSubscriptionItemCreate, OrderSubscriptionItemUpdate, OrderSubscriptionItemSort } from './resources/order_subscription_items'
export type { OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate, OrderSubscriptionSort } from './resources/order_subscriptions'
export type { OrderValidationRule, OrderValidationRuleSort } from './resources/order_validation_rules'
export type { Order, OrderCreate, OrderUpdate, OrderSort } from './resources/orders'
export type { Organization, OrganizationSort } from './resources/organization'
export type { Package, PackageCreate, PackageUpdate, PackageSort } from './resources/packages'
Expand Down
15 changes: 15 additions & 0 deletions src/resources/adyen_gateways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ interface AdyenGateway extends Resource {
* @example ```"true"```
*/
async_api?: boolean | null
/**
* Indicates if the gateway will use the native customer payment sources..
* @example ```"true"```
*/
native_customer_payment_sources?: boolean | null
/**
* The gateway webhook endpoint secret, generated by Adyen customer area..
* @example ```"xxxx-yyyy-zzzz"```
Expand Down Expand Up @@ -90,6 +95,11 @@ interface AdyenGatewayCreate extends ResourceCreate {
* @example ```"true"```
*/
async_api?: boolean | null
/**
* Indicates if the gateway will use the native customer payment sources..
* @example ```"true"```
*/
native_customer_payment_sources?: boolean | null
/**
* The gateway webhook endpoint secret, generated by Adyen customer area..
* @example ```"xxxx-yyyy-zzzz"```
Expand Down Expand Up @@ -138,6 +148,11 @@ interface AdyenGatewayUpdate extends ResourceUpdate {
* @example ```"true"```
*/
async_api?: boolean | null
/**
* Indicates if the gateway will use the native customer payment sources..
* @example ```"true"```
*/
native_customer_payment_sources?: boolean | null
/**
* The gateway webhook endpoint secret, generated by Adyen customer area..
* @example ```"xxxx-yyyy-zzzz"```
Expand Down
8 changes: 5 additions & 3 deletions src/resources/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type { SkuOption, SkuOptionType } from './sku_options'
import type { Sku, SkuType } from './skus'
import type { StockItem, StockItemType } from './stock_items'
import type { StockLocation, StockLocationType } from './stock_locations'
import type { StockTransfer, StockTransferType } from './stock_transfers'
import type { TaxCalculator, TaxCalculatorType } from './tax_calculators'
import type { TaxCategory, TaxCategoryType } from './tax_categories'

Expand Down Expand Up @@ -64,6 +65,7 @@ type SkuOptionRel = ResourceRel & { type: SkuOptionType }
type SkuRel = ResourceRel & { type: SkuType }
type StockItemRel = ResourceRel & { type: StockItemType }
type StockLocationRel = ResourceRel & { type: StockLocationType }
type StockTransferRel = ResourceRel & { type: StockTransferType }
type TaxCalculatorRel = ResourceRel & { type: TaxCalculatorType }
type TaxCategoryRel = ResourceRel & { type: TaxCategoryType }

Expand Down Expand Up @@ -92,7 +94,7 @@ interface Attachment extends Resource {
*/
url?: string | null

attachable?: Bundle | CarrierAccount | CustomerGroup | Customer | DeliveryLeadTime | Geocoder | GiftCardRecipient | GiftCard | InventoryModel | Market | Merchant | BillingInfoValidationRule | Order | Package | Parcel | PaymentMethod | PriceList | Price | Promotion | Return | Shipment | ShippingCategory | ShippingMethod | ShippingZone | SkuOption | Sku | StockItem | StockLocation | TaxCalculator | TaxCategory | null
attachable?: Bundle | CarrierAccount | CustomerGroup | Customer | DeliveryLeadTime | Geocoder | GiftCardRecipient | GiftCard | InventoryModel | Market | Merchant | BillingInfoValidationRule | Order | Package | Parcel | PaymentMethod | PriceList | Price | Promotion | Return | Shipment | ShippingCategory | ShippingMethod | ShippingZone | SkuOption | Sku | StockItem | StockLocation | StockTransfer | TaxCalculator | TaxCategory | null

}

Expand All @@ -115,7 +117,7 @@ interface AttachmentCreate extends ResourceCreate {
*/
url?: string | null

attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel
attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | StockTransferRel | TaxCalculatorRel | TaxCategoryRel

}

Expand All @@ -138,7 +140,7 @@ interface AttachmentUpdate extends ResourceUpdate {
*/
url?: string | null

attachable?: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel | null
attachable?: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | StockTransferRel | TaxCalculatorRel | TaxCategoryRel | null

}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/coupon_recipients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type CouponRecipientRel = ResourceRel & { type: CouponRecipientType }
type CustomerRel = ResourceRel & { type: CustomerType }


export type CouponRecipientSort = Pick<CouponRecipient, 'id'> & ResourceSort
export type CouponRecipientSort = Pick<CouponRecipient, 'id' | 'email'> & ResourceSort
// export type CouponRecipientFilter = Pick<CouponRecipient, 'id' | 'email' | 'first_name' | 'last_name'> & ResourceFilter


Expand Down
Loading

0 comments on commit a35d9d3

Please sign in to comment.