@ominity/api-typescript 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +24 -4
- package/README.md +9 -9
- package/dist/commonjs/funcs/commerce/cartItemsCreate.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartItemsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsCreate.js +115 -0
- package/dist/commonjs/funcs/commerce/cartItemsCreate.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsDelete.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartItemsDelete.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsDelete.js +109 -0
- package/dist/commonjs/funcs/commerce/cartItemsDelete.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsGet.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartItemsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsGet.js +118 -0
- package/dist/commonjs/funcs/commerce/cartItemsGet.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsList.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartItemsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsList.js +132 -0
- package/dist/commonjs/funcs/commerce/cartItemsList.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsUpdate.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartItemsUpdate.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartItemsUpdate.js +114 -0
- package/dist/commonjs/funcs/commerce/cartItemsUpdate.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsCreate.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsCreate.js +114 -0
- package/dist/commonjs/funcs/commerce/cartsCreate.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsGet.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsGet.js +117 -0
- package/dist/commonjs/funcs/commerce/cartsGet.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsList.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsList.js +131 -0
- package/dist/commonjs/funcs/commerce/cartsList.js.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsUpdate.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/cartsUpdate.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/cartsUpdate.js +113 -0
- package/dist/commonjs/funcs/commerce/cartsUpdate.js.map +1 -0
- package/dist/commonjs/funcs/commerce/categoriesGet.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/categoriesGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/categoriesGet.js +117 -0
- package/dist/commonjs/funcs/commerce/categoriesGet.js.map +1 -0
- package/dist/commonjs/funcs/commerce/categoriesList.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/categoriesList.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/categoriesList.js +131 -0
- package/dist/commonjs/funcs/commerce/categoriesList.js.map +1 -0
- package/dist/commonjs/funcs/commerce/productsGet.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/productsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/productsGet.js +117 -0
- package/dist/commonjs/funcs/commerce/productsGet.js.map +1 -0
- package/dist/commonjs/funcs/commerce/productsList.d.ts +10 -0
- package/dist/commonjs/funcs/commerce/productsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerce/productsList.js +131 -0
- package/dist/commonjs/funcs/commerce/productsList.js.map +1 -0
- package/dist/commonjs/funcs/index.d.ts +14 -0
- package/dist/commonjs/funcs/index.d.ts.map +1 -0
- package/dist/commonjs/funcs/index.js +33 -0
- package/dist/commonjs/funcs/index.js.map +1 -0
- package/dist/commonjs/hooks/ominity-hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/ominity-hooks.js +3 -0
- package/dist/commonjs/hooks/ominity-hooks.js.map +1 -1
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -2
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +4 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/commerce/address.d.ts +15 -0
- package/dist/commonjs/models/commerce/address.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/address.js +53 -0
- package/dist/commonjs/models/commerce/address.js.map +1 -0
- package/dist/commonjs/models/commerce/cart-item.d.ts +30 -0
- package/dist/commonjs/models/commerce/cart-item.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/cart-item.js +86 -0
- package/dist/commonjs/models/commerce/cart-item.js.map +1 -0
- package/dist/commonjs/models/commerce/cart.d.ts +65 -0
- package/dist/commonjs/models/commerce/cart.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/cart.js +109 -0
- package/dist/commonjs/models/commerce/cart.js.map +1 -0
- package/dist/commonjs/models/commerce/category.d.ts +30 -0
- package/dist/commonjs/models/commerce/category.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/category.js +89 -0
- package/dist/commonjs/models/commerce/category.js.map +1 -0
- package/dist/commonjs/models/commerce/index.d.ts +10 -0
- package/dist/commonjs/models/commerce/index.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/index.js +29 -0
- package/dist/commonjs/models/commerce/index.js.map +1 -0
- package/dist/commonjs/models/commerce/money.d.ts +11 -0
- package/dist/commonjs/models/commerce/money.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/money.js +48 -0
- package/dist/commonjs/models/commerce/money.js.map +1 -0
- package/dist/commonjs/models/commerce/product-group.d.ts +12 -0
- package/dist/commonjs/models/commerce/product-group.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/product-group.js +50 -0
- package/dist/commonjs/models/commerce/product-group.js.map +1 -0
- package/dist/commonjs/models/commerce/product-offer.d.ts +16 -0
- package/dist/commonjs/models/commerce/product-offer.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/product-offer.js +55 -0
- package/dist/commonjs/models/commerce/product-offer.js.map +1 -0
- package/dist/commonjs/models/commerce/product.d.ts +62 -0
- package/dist/commonjs/models/commerce/product.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/product.js +121 -0
- package/dist/commonjs/models/commerce/product.js.map +1 -0
- package/dist/commonjs/models/commerce/route.d.ts +13 -0
- package/dist/commonjs/models/commerce/route.d.ts.map +1 -0
- package/dist/commonjs/models/commerce/route.js +51 -0
- package/dist/commonjs/models/commerce/route.js.map +1 -0
- package/dist/commonjs/models/common/amount.d.ts +8 -0
- package/dist/commonjs/models/common/amount.d.ts.map +1 -0
- package/dist/commonjs/models/common/amount.js +46 -0
- package/dist/commonjs/models/common/amount.js.map +1 -0
- package/dist/commonjs/models/common/index.d.ts +3 -0
- package/dist/commonjs/models/common/index.d.ts.map +1 -0
- package/dist/commonjs/models/common/index.js +22 -0
- package/dist/commonjs/models/common/index.js.map +1 -0
- package/dist/commonjs/models/common/tag.d.ts +14 -0
- package/dist/commonjs/models/common/tag.d.ts.map +1 -0
- package/dist/commonjs/models/common/tag.js +53 -0
- package/dist/commonjs/models/common/tag.js.map +1 -0
- package/dist/commonjs/models/hal.d.ts +11 -0
- package/dist/commonjs/models/hal.d.ts.map +1 -0
- package/dist/commonjs/models/hal.js +48 -0
- package/dist/commonjs/models/hal.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +4 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +4 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/commerce-cart-items.d.ts +60 -0
- package/dist/commonjs/models/operations/commerce-cart-items.d.ts.map +1 -0
- package/dist/commonjs/models/operations/commerce-cart-items.js +92 -0
- package/dist/commonjs/models/operations/commerce-cart-items.js.map +1 -0
- package/dist/commonjs/models/operations/commerce-carts.d.ts +75 -0
- package/dist/commonjs/models/operations/commerce-carts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/commerce-carts.js +111 -0
- package/dist/commonjs/models/operations/commerce-carts.js.map +1 -0
- package/dist/commonjs/models/operations/commerce-categories.d.ts +25 -0
- package/dist/commonjs/models/operations/commerce-categories.d.ts.map +1 -0
- package/dist/commonjs/models/operations/commerce-categories.js +60 -0
- package/dist/commonjs/models/operations/commerce-categories.js.map +1 -0
- package/dist/commonjs/models/operations/commerce-products.d.ts +25 -0
- package/dist/commonjs/models/operations/commerce-products.d.ts.map +1 -0
- package/dist/commonjs/models/operations/commerce-products.js +64 -0
- package/dist/commonjs/models/operations/commerce-products.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +4 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +18 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/pagination.d.ts +20 -0
- package/dist/commonjs/models/pagination.d.ts.map +1 -0
- package/dist/commonjs/models/pagination.js +103 -0
- package/dist/commonjs/models/pagination.js.map +1 -0
- package/dist/commonjs/sdk/commerce/cart-items.d.ts +29 -0
- package/dist/commonjs/sdk/commerce/cart-items.d.ts.map +1 -0
- package/dist/commonjs/sdk/commerce/cart-items.js +64 -0
- package/dist/commonjs/sdk/commerce/cart-items.js.map +1 -0
- package/dist/commonjs/sdk/commerce/carts.d.ts +25 -0
- package/dist/commonjs/sdk/commerce/carts.d.ts.map +1 -0
- package/dist/commonjs/sdk/commerce/carts.js +44 -0
- package/dist/commonjs/sdk/commerce/carts.js.map +1 -0
- package/dist/commonjs/sdk/commerce/categories.d.ts +15 -0
- package/dist/commonjs/sdk/commerce/categories.d.ts.map +1 -0
- package/dist/commonjs/sdk/commerce/categories.js +30 -0
- package/dist/commonjs/sdk/commerce/categories.js.map +1 -0
- package/dist/commonjs/sdk/commerce/index.d.ts +9 -0
- package/dist/commonjs/sdk/commerce/index.d.ts.map +1 -1
- package/dist/commonjs/sdk/commerce/index.js +12 -0
- package/dist/commonjs/sdk/commerce/index.js.map +1 -1
- package/dist/commonjs/sdk/commerce/products.d.ts +12 -1
- package/dist/commonjs/sdk/commerce/products.d.ts.map +1 -1
- package/dist/commonjs/sdk/commerce/products.js +19 -0
- package/dist/commonjs/sdk/commerce/products.js.map +1 -1
- package/dist/esm/funcs/commerce/cartItemsCreate.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartItemsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsCreate.js +79 -0
- package/dist/esm/funcs/commerce/cartItemsCreate.js.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsDelete.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartItemsDelete.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsDelete.js +73 -0
- package/dist/esm/funcs/commerce/cartItemsDelete.js.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsGet.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartItemsGet.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsGet.js +82 -0
- package/dist/esm/funcs/commerce/cartItemsGet.js.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsList.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartItemsList.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsList.js +96 -0
- package/dist/esm/funcs/commerce/cartItemsList.js.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsUpdate.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartItemsUpdate.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartItemsUpdate.js +78 -0
- package/dist/esm/funcs/commerce/cartItemsUpdate.js.map +1 -0
- package/dist/esm/funcs/commerce/cartsCreate.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartsCreate.js +78 -0
- package/dist/esm/funcs/commerce/cartsCreate.js.map +1 -0
- package/dist/esm/funcs/commerce/cartsGet.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartsGet.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartsGet.js +81 -0
- package/dist/esm/funcs/commerce/cartsGet.js.map +1 -0
- package/dist/esm/funcs/commerce/cartsList.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartsList.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartsList.js +95 -0
- package/dist/esm/funcs/commerce/cartsList.js.map +1 -0
- package/dist/esm/funcs/commerce/cartsUpdate.d.ts +10 -0
- package/dist/esm/funcs/commerce/cartsUpdate.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/cartsUpdate.js +77 -0
- package/dist/esm/funcs/commerce/cartsUpdate.js.map +1 -0
- package/dist/esm/funcs/commerce/categoriesGet.d.ts +10 -0
- package/dist/esm/funcs/commerce/categoriesGet.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/categoriesGet.js +81 -0
- package/dist/esm/funcs/commerce/categoriesGet.js.map +1 -0
- package/dist/esm/funcs/commerce/categoriesList.d.ts +10 -0
- package/dist/esm/funcs/commerce/categoriesList.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/categoriesList.js +95 -0
- package/dist/esm/funcs/commerce/categoriesList.js.map +1 -0
- package/dist/esm/funcs/commerce/productsGet.d.ts +10 -0
- package/dist/esm/funcs/commerce/productsGet.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/productsGet.js +81 -0
- package/dist/esm/funcs/commerce/productsGet.js.map +1 -0
- package/dist/esm/funcs/commerce/productsList.d.ts +10 -0
- package/dist/esm/funcs/commerce/productsList.d.ts.map +1 -0
- package/dist/esm/funcs/commerce/productsList.js +95 -0
- package/dist/esm/funcs/commerce/productsList.js.map +1 -0
- package/dist/esm/funcs/index.d.ts +14 -0
- package/dist/esm/funcs/index.d.ts.map +1 -0
- package/dist/esm/funcs/index.js +17 -0
- package/dist/esm/funcs/index.js.map +1 -0
- package/dist/esm/hooks/ominity-hooks.d.ts.map +1 -1
- package/dist/esm/hooks/ominity-hooks.js +3 -0
- package/dist/esm/hooks/ominity-hooks.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -2
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +3 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/commerce/address.d.ts +15 -0
- package/dist/esm/models/commerce/address.d.ts.map +1 -0
- package/dist/esm/models/commerce/address.js +17 -0
- package/dist/esm/models/commerce/address.js.map +1 -0
- package/dist/esm/models/commerce/cart-item.d.ts +30 -0
- package/dist/esm/models/commerce/cart-item.d.ts.map +1 -0
- package/dist/esm/models/commerce/cart-item.js +50 -0
- package/dist/esm/models/commerce/cart-item.js.map +1 -0
- package/dist/esm/models/commerce/cart.d.ts +65 -0
- package/dist/esm/models/commerce/cart.d.ts.map +1 -0
- package/dist/esm/models/commerce/cart.js +73 -0
- package/dist/esm/models/commerce/cart.js.map +1 -0
- package/dist/esm/models/commerce/category.d.ts +30 -0
- package/dist/esm/models/commerce/category.d.ts.map +1 -0
- package/dist/esm/models/commerce/category.js +53 -0
- package/dist/esm/models/commerce/category.js.map +1 -0
- package/dist/esm/models/commerce/index.d.ts +10 -0
- package/dist/esm/models/commerce/index.d.ts.map +1 -0
- package/dist/esm/models/commerce/index.js +13 -0
- package/dist/esm/models/commerce/index.js.map +1 -0
- package/dist/esm/models/commerce/money.d.ts +11 -0
- package/dist/esm/models/commerce/money.d.ts.map +1 -0
- package/dist/esm/models/commerce/money.js +12 -0
- package/dist/esm/models/commerce/money.js.map +1 -0
- package/dist/esm/models/commerce/product-group.d.ts +12 -0
- package/dist/esm/models/commerce/product-group.d.ts.map +1 -0
- package/dist/esm/models/commerce/product-group.js +14 -0
- package/dist/esm/models/commerce/product-group.js.map +1 -0
- package/dist/esm/models/commerce/product-offer.d.ts +16 -0
- package/dist/esm/models/commerce/product-offer.d.ts.map +1 -0
- package/dist/esm/models/commerce/product-offer.js +19 -0
- package/dist/esm/models/commerce/product-offer.js.map +1 -0
- package/dist/esm/models/commerce/product.d.ts +62 -0
- package/dist/esm/models/commerce/product.d.ts.map +1 -0
- package/dist/esm/models/commerce/product.js +85 -0
- package/dist/esm/models/commerce/product.js.map +1 -0
- package/dist/esm/models/commerce/route.d.ts +13 -0
- package/dist/esm/models/commerce/route.d.ts.map +1 -0
- package/dist/esm/models/commerce/route.js +15 -0
- package/dist/esm/models/commerce/route.js.map +1 -0
- package/dist/esm/models/common/amount.d.ts +8 -0
- package/dist/esm/models/common/amount.d.ts.map +1 -0
- package/dist/esm/models/common/amount.js +10 -0
- package/dist/esm/models/common/amount.js.map +1 -0
- package/dist/esm/models/common/index.d.ts +3 -0
- package/dist/esm/models/common/index.d.ts.map +1 -0
- package/dist/esm/models/common/index.js +6 -0
- package/dist/esm/models/common/index.js.map +1 -0
- package/dist/esm/models/common/tag.d.ts +14 -0
- package/dist/esm/models/common/tag.d.ts.map +1 -0
- package/dist/esm/models/common/tag.js +17 -0
- package/dist/esm/models/common/tag.js.map +1 -0
- package/dist/esm/models/hal.d.ts +11 -0
- package/dist/esm/models/hal.d.ts.map +1 -0
- package/dist/esm/models/hal.js +12 -0
- package/dist/esm/models/hal.js.map +1 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/commerce-cart-items.d.ts +60 -0
- package/dist/esm/models/operations/commerce-cart-items.d.ts.map +1 -0
- package/dist/esm/models/operations/commerce-cart-items.js +56 -0
- package/dist/esm/models/operations/commerce-cart-items.js.map +1 -0
- package/dist/esm/models/operations/commerce-carts.d.ts +75 -0
- package/dist/esm/models/operations/commerce-carts.d.ts.map +1 -0
- package/dist/esm/models/operations/commerce-carts.js +75 -0
- package/dist/esm/models/operations/commerce-carts.js.map +1 -0
- package/dist/esm/models/operations/commerce-categories.d.ts +25 -0
- package/dist/esm/models/operations/commerce-categories.d.ts.map +1 -0
- package/dist/esm/models/operations/commerce-categories.js +24 -0
- package/dist/esm/models/operations/commerce-categories.js.map +1 -0
- package/dist/esm/models/operations/commerce-products.d.ts +25 -0
- package/dist/esm/models/operations/commerce-products.d.ts.map +1 -0
- package/dist/esm/models/operations/commerce-products.js +28 -0
- package/dist/esm/models/operations/commerce-products.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +4 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/pagination.d.ts +20 -0
- package/dist/esm/models/pagination.d.ts.map +1 -0
- package/dist/esm/models/pagination.js +98 -0
- package/dist/esm/models/pagination.js.map +1 -0
- package/dist/esm/sdk/commerce/cart-items.d.ts +29 -0
- package/dist/esm/sdk/commerce/cart-items.d.ts.map +1 -0
- package/dist/esm/sdk/commerce/cart-items.js +60 -0
- package/dist/esm/sdk/commerce/cart-items.js.map +1 -0
- package/dist/esm/sdk/commerce/carts.d.ts +25 -0
- package/dist/esm/sdk/commerce/carts.d.ts.map +1 -0
- package/dist/esm/sdk/commerce/carts.js +40 -0
- package/dist/esm/sdk/commerce/carts.js.map +1 -0
- package/dist/esm/sdk/commerce/categories.d.ts +15 -0
- package/dist/esm/sdk/commerce/categories.d.ts.map +1 -0
- package/dist/esm/sdk/commerce/categories.js +26 -0
- package/dist/esm/sdk/commerce/categories.js.map +1 -0
- package/dist/esm/sdk/commerce/index.d.ts +9 -0
- package/dist/esm/sdk/commerce/index.d.ts.map +1 -1
- package/dist/esm/sdk/commerce/index.js +12 -0
- package/dist/esm/sdk/commerce/index.js.map +1 -1
- package/dist/esm/sdk/commerce/products.d.ts +12 -1
- package/dist/esm/sdk/commerce/products.d.ts.map +1 -1
- package/dist/esm/sdk/commerce/products.js +19 -0
- package/dist/esm/sdk/commerce/products.js.map +1 -1
- package/jsr.json +5 -7
- package/package.json +4 -2
- package/scripts/sync-version.mjs +38 -0
- package/src/funcs/commerce/cartItemsCreate.ts +162 -0
- package/src/funcs/commerce/cartItemsDelete.ts +156 -0
- package/src/funcs/commerce/cartItemsGet.ts +165 -0
- package/src/funcs/commerce/cartItemsList.ts +187 -0
- package/src/funcs/commerce/cartItemsUpdate.ts +160 -0
- package/src/funcs/commerce/cartsCreate.ts +161 -0
- package/src/funcs/commerce/cartsGet.ts +164 -0
- package/src/funcs/commerce/cartsList.ts +187 -0
- package/src/funcs/commerce/cartsUpdate.ts +159 -0
- package/src/funcs/commerce/categoriesGet.ts +164 -0
- package/src/funcs/commerce/categoriesList.ts +187 -0
- package/src/funcs/commerce/productsGet.ts +164 -0
- package/src/funcs/commerce/productsList.ts +187 -0
- package/src/funcs/index.ts +17 -0
- package/src/hooks/ominity-hooks.ts +4 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +4 -2
- package/src/models/commerce/address.ts +30 -0
- package/src/models/commerce/cart-item.ts +83 -0
- package/src/models/commerce/cart.ts +128 -0
- package/src/models/commerce/category.ts +87 -0
- package/src/models/commerce/index.ts +13 -0
- package/src/models/commerce/money.ts +24 -0
- package/src/models/commerce/product-group.ts +23 -0
- package/src/models/commerce/product-offer.ts +31 -0
- package/src/models/commerce/product.ts +153 -0
- package/src/models/commerce/route.ts +29 -0
- package/src/models/common/amount.ts +16 -0
- package/src/models/common/index.ts +6 -0
- package/src/models/common/tag.ts +28 -0
- package/src/models/hal.ts +24 -0
- package/src/models/index.ts +4 -0
- package/src/models/operations/commerce-cart-items.ts +125 -0
- package/src/models/operations/commerce-carts.ts +158 -0
- package/src/models/operations/commerce-categories.ts +52 -0
- package/src/models/operations/commerce-products.ts +53 -0
- package/src/models/operations/index.ts +4 -2
- package/src/models/pagination.ts +146 -0
- package/src/sdk/commerce/cart-items.ts +113 -0
- package/src/sdk/commerce/carts.ts +81 -0
- package/src/sdk/commerce/categories.ts +48 -0
- package/src/sdk/commerce/index.ts +19 -0
- package/src/sdk/commerce/products.ts +43 -2
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Get cart item.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
|
|
6
|
+
import { encodeFormQuery } from "../../lib/encodings.js";
|
|
7
|
+
import * as M from "../../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
|
|
10
|
+
import * as errors from "../../models/errors/index.js";
|
|
11
|
+
import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
|
|
12
|
+
import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../../models/errors/http-client-errors.js";
|
|
20
|
+
import * as operations from "../../models/operations/index.js";
|
|
21
|
+
import { CartItem$inboundSchema } from "../../models/commerce/cart-item.js";
|
|
22
|
+
import { APICall, APIPromise } from "../../types/async.js";
|
|
23
|
+
import { OK, Result } from "../../types/fp.js";
|
|
24
|
+
|
|
25
|
+
export function cartItemsGet(
|
|
26
|
+
client: ClientSDK,
|
|
27
|
+
request: operations.GetCartItemRequest,
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<
|
|
30
|
+
Result<
|
|
31
|
+
operations.GetCartItemResponse,
|
|
32
|
+
| errors.ErrorResponse
|
|
33
|
+
| errors.OminityDefaultError
|
|
34
|
+
| ResponseValidationError
|
|
35
|
+
| ConnectionError
|
|
36
|
+
| RequestAbortedError
|
|
37
|
+
| RequestTimeoutError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| SDKValidationError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
return new APIPromise($do(
|
|
44
|
+
client,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function $do(
|
|
51
|
+
client: ClientSDK,
|
|
52
|
+
request: operations.GetCartItemRequest,
|
|
53
|
+
options?: RequestOptions,
|
|
54
|
+
): Promise<
|
|
55
|
+
[
|
|
56
|
+
Result<
|
|
57
|
+
operations.GetCartItemResponse,
|
|
58
|
+
| errors.ErrorResponse
|
|
59
|
+
| errors.OminityDefaultError
|
|
60
|
+
| ResponseValidationError
|
|
61
|
+
| ConnectionError
|
|
62
|
+
| RequestAbortedError
|
|
63
|
+
| RequestTimeoutError
|
|
64
|
+
| InvalidRequestError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| SDKValidationError
|
|
67
|
+
>,
|
|
68
|
+
APICall,
|
|
69
|
+
]
|
|
70
|
+
> {
|
|
71
|
+
const parsed = safeParse(
|
|
72
|
+
request,
|
|
73
|
+
(value) => operations.GetCartItemRequest$outboundSchema.parse(value),
|
|
74
|
+
"Input validation failed",
|
|
75
|
+
);
|
|
76
|
+
if (!parsed.ok) {
|
|
77
|
+
return [parsed, { status: "invalid" }];
|
|
78
|
+
}
|
|
79
|
+
const payload = parsed.value;
|
|
80
|
+
const body = null;
|
|
81
|
+
|
|
82
|
+
const safeCartId = encodeURIComponent(String(payload.cartId));
|
|
83
|
+
const safeItemId = encodeURIComponent(String(payload.itemId));
|
|
84
|
+
const path = `/commerce/carts/${safeCartId}/items/${safeItemId}`;
|
|
85
|
+
|
|
86
|
+
const query = encodeFormQuery({
|
|
87
|
+
include: payload.include,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const headers = new Headers();
|
|
91
|
+
|
|
92
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
93
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
94
|
+
|
|
95
|
+
const context = {
|
|
96
|
+
options: client._options,
|
|
97
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
98
|
+
operationID: "commerce.cart-items.get",
|
|
99
|
+
oAuth2Scopes: null,
|
|
100
|
+
resolvedSecurity: requestSecurity,
|
|
101
|
+
securitySource: client._options.security,
|
|
102
|
+
retryConfig: options?.retries
|
|
103
|
+
|| client._options.retryConfig
|
|
104
|
+
|| { strategy: "none" },
|
|
105
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const requestRes = client._createRequest(context, {
|
|
109
|
+
security: requestSecurity,
|
|
110
|
+
method: "GET",
|
|
111
|
+
baseURL: options?.serverURL,
|
|
112
|
+
path,
|
|
113
|
+
headers,
|
|
114
|
+
query,
|
|
115
|
+
body,
|
|
116
|
+
userAgent: client._options.userAgent,
|
|
117
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
118
|
+
}, options);
|
|
119
|
+
if (!requestRes.ok) {
|
|
120
|
+
return [requestRes, { status: "invalid" }];
|
|
121
|
+
}
|
|
122
|
+
const req = requestRes.value;
|
|
123
|
+
|
|
124
|
+
const doResult = await client._do(req, {
|
|
125
|
+
context,
|
|
126
|
+
errorCodes: ["4XX", "5XX"],
|
|
127
|
+
retryConfig: context.retryConfig,
|
|
128
|
+
retryCodes: context.retryCodes,
|
|
129
|
+
});
|
|
130
|
+
if (!doResult.ok) {
|
|
131
|
+
return [doResult, { status: "request-error", request: req }];
|
|
132
|
+
}
|
|
133
|
+
const response = doResult.value;
|
|
134
|
+
|
|
135
|
+
const responseFields = {
|
|
136
|
+
HttpMeta: { Response: response, Request: req },
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const [result] = await M.match<
|
|
140
|
+
operations.GetCartItemResponse,
|
|
141
|
+
| errors.ErrorResponse
|
|
142
|
+
| errors.OminityDefaultError
|
|
143
|
+
| ResponseValidationError
|
|
144
|
+
| ConnectionError
|
|
145
|
+
| RequestAbortedError
|
|
146
|
+
| RequestTimeoutError
|
|
147
|
+
| InvalidRequestError
|
|
148
|
+
| UnexpectedClientError
|
|
149
|
+
| SDKValidationError
|
|
150
|
+
>(
|
|
151
|
+
M.json(200, CartItem$inboundSchema, {
|
|
152
|
+
ctype: "application/hal+json",
|
|
153
|
+
}),
|
|
154
|
+
M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
|
|
155
|
+
ctype: "application/hal+json",
|
|
156
|
+
}),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, req, { extraFields: responseFields });
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [OK(result.value), { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* List cart items.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
|
|
6
|
+
import {
|
|
7
|
+
encodeDeepObjectQuery,
|
|
8
|
+
encodeFormQuery,
|
|
9
|
+
queryJoin,
|
|
10
|
+
} from "../../lib/encodings.js";
|
|
11
|
+
import * as M from "../../lib/matchers.js";
|
|
12
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
|
|
14
|
+
import * as errors from "../../models/errors/index.js";
|
|
15
|
+
import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
|
|
16
|
+
import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../../models/errors/http-client-errors.js";
|
|
24
|
+
import * as operations from "../../models/operations/index.js";
|
|
25
|
+
import { CartItemsListResponse$inboundSchema } from "../../models/commerce/cart-item.js";
|
|
26
|
+
import { applyPaginationParams } from "../../models/pagination.js";
|
|
27
|
+
import { APICall, APIPromise } from "../../types/async.js";
|
|
28
|
+
import { OK, Result } from "../../types/fp.js";
|
|
29
|
+
|
|
30
|
+
export function cartItemsList(
|
|
31
|
+
client: ClientSDK,
|
|
32
|
+
request: operations.ListCartItemsRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.ListCartItemsResponse,
|
|
37
|
+
| errors.ErrorResponse
|
|
38
|
+
| errors.OminityDefaultError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: ClientSDK,
|
|
57
|
+
request: operations.ListCartItemsRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.ListCartItemsResponse,
|
|
63
|
+
| errors.ErrorResponse
|
|
64
|
+
| errors.OminityDefaultError
|
|
65
|
+
| ResponseValidationError
|
|
66
|
+
| ConnectionError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| UnexpectedClientError
|
|
71
|
+
| SDKValidationError
|
|
72
|
+
>,
|
|
73
|
+
APICall,
|
|
74
|
+
]
|
|
75
|
+
> {
|
|
76
|
+
const parsed = safeParse(
|
|
77
|
+
request,
|
|
78
|
+
(value) => operations.ListCartItemsRequest$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = null;
|
|
86
|
+
|
|
87
|
+
const safeCartId = encodeURIComponent(String(payload.cartId));
|
|
88
|
+
const path = `/commerce/carts/${safeCartId}/items`;
|
|
89
|
+
|
|
90
|
+
const baseQuery = encodeFormQuery({
|
|
91
|
+
page: payload.page,
|
|
92
|
+
limit: payload.limit,
|
|
93
|
+
include: payload.include,
|
|
94
|
+
sort: payload.sort,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
let filterQuery: string | undefined;
|
|
98
|
+
if (typeof payload.filter === "string") {
|
|
99
|
+
filterQuery = encodeFormQuery({ filter: payload.filter });
|
|
100
|
+
} else if (
|
|
101
|
+
payload.filter != null
|
|
102
|
+
&& typeof payload.filter === "object"
|
|
103
|
+
&& !Array.isArray(payload.filter)
|
|
104
|
+
) {
|
|
105
|
+
filterQuery = encodeDeepObjectQuery({ filter: payload.filter });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const query = queryJoin(baseQuery, filterQuery);
|
|
109
|
+
|
|
110
|
+
const headers = new Headers();
|
|
111
|
+
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "commerce.cart-items.list",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
securitySource: client._options.security,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "GET",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path,
|
|
133
|
+
headers,
|
|
134
|
+
query,
|
|
135
|
+
body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: ["4XX", "5XX"],
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req }];
|
|
152
|
+
}
|
|
153
|
+
const response = doResult.value;
|
|
154
|
+
|
|
155
|
+
const responseFields = {
|
|
156
|
+
HttpMeta: { Response: response, Request: req },
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const [result] = await M.match<
|
|
160
|
+
operations.ListCartItemsResponse,
|
|
161
|
+
| errors.ErrorResponse
|
|
162
|
+
| errors.OminityDefaultError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, CartItemsListResponse$inboundSchema, {
|
|
172
|
+
ctype: "application/hal+json",
|
|
173
|
+
}),
|
|
174
|
+
M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
|
|
175
|
+
ctype: "application/hal+json",
|
|
176
|
+
}),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const finalValue = applyPaginationParams(result.value, payload);
|
|
185
|
+
|
|
186
|
+
return [OK(finalValue), { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Update cart item.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
|
|
6
|
+
import * as M from "../../lib/matchers.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
|
|
9
|
+
import * as errors from "../../models/errors/index.js";
|
|
10
|
+
import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
|
|
11
|
+
import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../../models/errors/http-client-errors.js";
|
|
19
|
+
import * as operations from "../../models/operations/index.js";
|
|
20
|
+
import { CartItem$inboundSchema } from "../../models/commerce/cart-item.js";
|
|
21
|
+
import { APICall, APIPromise } from "../../types/async.js";
|
|
22
|
+
import { OK, Result } from "../../types/fp.js";
|
|
23
|
+
|
|
24
|
+
export function cartItemsUpdate(
|
|
25
|
+
client: ClientSDK,
|
|
26
|
+
request: operations.UpdateCartItemRequest,
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<
|
|
29
|
+
Result<
|
|
30
|
+
operations.UpdateCartItemResponse,
|
|
31
|
+
| errors.ErrorResponse
|
|
32
|
+
| errors.OminityDefaultError
|
|
33
|
+
| ResponseValidationError
|
|
34
|
+
| ConnectionError
|
|
35
|
+
| RequestAbortedError
|
|
36
|
+
| RequestTimeoutError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
>
|
|
41
|
+
> {
|
|
42
|
+
return new APIPromise($do(
|
|
43
|
+
client,
|
|
44
|
+
request,
|
|
45
|
+
options,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function $do(
|
|
50
|
+
client: ClientSDK,
|
|
51
|
+
request: operations.UpdateCartItemRequest,
|
|
52
|
+
options?: RequestOptions,
|
|
53
|
+
): Promise<
|
|
54
|
+
[
|
|
55
|
+
Result<
|
|
56
|
+
operations.UpdateCartItemResponse,
|
|
57
|
+
| errors.ErrorResponse
|
|
58
|
+
| errors.OminityDefaultError
|
|
59
|
+
| ResponseValidationError
|
|
60
|
+
| ConnectionError
|
|
61
|
+
| RequestAbortedError
|
|
62
|
+
| RequestTimeoutError
|
|
63
|
+
| InvalidRequestError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| SDKValidationError
|
|
66
|
+
>,
|
|
67
|
+
APICall,
|
|
68
|
+
]
|
|
69
|
+
> {
|
|
70
|
+
const parsed = safeParse(
|
|
71
|
+
request,
|
|
72
|
+
(value) => operations.UpdateCartItemRequest$outboundSchema.parse(value),
|
|
73
|
+
"Input validation failed",
|
|
74
|
+
);
|
|
75
|
+
if (!parsed.ok) {
|
|
76
|
+
return [parsed, { status: "invalid" }];
|
|
77
|
+
}
|
|
78
|
+
const payload = parsed.value;
|
|
79
|
+
|
|
80
|
+
const safeCartId = encodeURIComponent(String(payload.cartId));
|
|
81
|
+
const safeItemId = encodeURIComponent(String(payload.itemId));
|
|
82
|
+
const path = `/commerce/carts/${safeCartId}/items/${safeItemId}`;
|
|
83
|
+
|
|
84
|
+
const headers = new Headers({
|
|
85
|
+
"Content-Type": "application/json",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
89
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
90
|
+
|
|
91
|
+
const context = {
|
|
92
|
+
options: client._options,
|
|
93
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
94
|
+
operationID: "commerce.cart-items.update",
|
|
95
|
+
oAuth2Scopes: null,
|
|
96
|
+
resolvedSecurity: requestSecurity,
|
|
97
|
+
securitySource: client._options.security,
|
|
98
|
+
retryConfig: options?.retries
|
|
99
|
+
|| client._options.retryConfig
|
|
100
|
+
|| { strategy: "none" },
|
|
101
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const requestRes = client._createRequest(context, {
|
|
105
|
+
security: requestSecurity,
|
|
106
|
+
method: "PATCH",
|
|
107
|
+
baseURL: options?.serverURL,
|
|
108
|
+
path,
|
|
109
|
+
headers,
|
|
110
|
+
body: JSON.stringify(payload.body ?? {}),
|
|
111
|
+
userAgent: client._options.userAgent,
|
|
112
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
113
|
+
}, options);
|
|
114
|
+
if (!requestRes.ok) {
|
|
115
|
+
return [requestRes, { status: "invalid" }];
|
|
116
|
+
}
|
|
117
|
+
const req = requestRes.value;
|
|
118
|
+
|
|
119
|
+
const doResult = await client._do(req, {
|
|
120
|
+
context,
|
|
121
|
+
errorCodes: ["4XX", "5XX"],
|
|
122
|
+
retryConfig: context.retryConfig,
|
|
123
|
+
retryCodes: context.retryCodes,
|
|
124
|
+
});
|
|
125
|
+
if (!doResult.ok) {
|
|
126
|
+
return [doResult, { status: "request-error", request: req }];
|
|
127
|
+
}
|
|
128
|
+
const response = doResult.value;
|
|
129
|
+
|
|
130
|
+
const responseFields = {
|
|
131
|
+
HttpMeta: { Response: response, Request: req },
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const [result] = await M.match<
|
|
135
|
+
operations.UpdateCartItemResponse,
|
|
136
|
+
| errors.ErrorResponse
|
|
137
|
+
| errors.OminityDefaultError
|
|
138
|
+
| ResponseValidationError
|
|
139
|
+
| ConnectionError
|
|
140
|
+
| RequestAbortedError
|
|
141
|
+
| RequestTimeoutError
|
|
142
|
+
| InvalidRequestError
|
|
143
|
+
| UnexpectedClientError
|
|
144
|
+
| SDKValidationError
|
|
145
|
+
>(
|
|
146
|
+
M.json(200, CartItem$inboundSchema, {
|
|
147
|
+
ctype: "application/hal+json",
|
|
148
|
+
}),
|
|
149
|
+
M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
|
|
150
|
+
ctype: "application/hal+json",
|
|
151
|
+
}),
|
|
152
|
+
M.fail("4XX"),
|
|
153
|
+
M.fail("5XX"),
|
|
154
|
+
)(response, req, { extraFields: responseFields });
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [OK(result.value), { status: "complete", request: req, response }];
|
|
160
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Create cart.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
|
|
6
|
+
import * as M from "../../lib/matchers.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
|
|
9
|
+
import * as errors from "../../models/errors/index.js";
|
|
10
|
+
import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
|
|
11
|
+
import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../../models/errors/http-client-errors.js";
|
|
19
|
+
import * as operations from "../../models/operations/index.js";
|
|
20
|
+
import { Cart$inboundSchema } from "../../models/commerce/cart.js";
|
|
21
|
+
import { APICall, APIPromise } from "../../types/async.js";
|
|
22
|
+
import { OK, Result } from "../../types/fp.js";
|
|
23
|
+
|
|
24
|
+
export function cartsCreate(
|
|
25
|
+
client: ClientSDK,
|
|
26
|
+
request: operations.CreateCartRequest,
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<
|
|
29
|
+
Result<
|
|
30
|
+
operations.CreateCartResponse,
|
|
31
|
+
| errors.ErrorResponse
|
|
32
|
+
| errors.OminityDefaultError
|
|
33
|
+
| ResponseValidationError
|
|
34
|
+
| ConnectionError
|
|
35
|
+
| RequestAbortedError
|
|
36
|
+
| RequestTimeoutError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
>
|
|
41
|
+
> {
|
|
42
|
+
return new APIPromise($do(
|
|
43
|
+
client,
|
|
44
|
+
request,
|
|
45
|
+
options,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function $do(
|
|
50
|
+
client: ClientSDK,
|
|
51
|
+
request: operations.CreateCartRequest,
|
|
52
|
+
options?: RequestOptions,
|
|
53
|
+
): Promise<
|
|
54
|
+
[
|
|
55
|
+
Result<
|
|
56
|
+
operations.CreateCartResponse,
|
|
57
|
+
| errors.ErrorResponse
|
|
58
|
+
| errors.OminityDefaultError
|
|
59
|
+
| ResponseValidationError
|
|
60
|
+
| ConnectionError
|
|
61
|
+
| RequestAbortedError
|
|
62
|
+
| RequestTimeoutError
|
|
63
|
+
| InvalidRequestError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| SDKValidationError
|
|
66
|
+
>,
|
|
67
|
+
APICall,
|
|
68
|
+
]
|
|
69
|
+
> {
|
|
70
|
+
const parsed = safeParse(
|
|
71
|
+
request,
|
|
72
|
+
(value) => operations.CreateCartRequest$outboundSchema.parse(value),
|
|
73
|
+
"Input validation failed",
|
|
74
|
+
);
|
|
75
|
+
if (!parsed.ok) {
|
|
76
|
+
return [parsed, { status: "invalid" }];
|
|
77
|
+
}
|
|
78
|
+
const payload = parsed.value;
|
|
79
|
+
|
|
80
|
+
const path = "/commerce/carts";
|
|
81
|
+
|
|
82
|
+
const headers = new Headers({
|
|
83
|
+
"Content-Type": "application/json",
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
87
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
88
|
+
|
|
89
|
+
const context = {
|
|
90
|
+
options: client._options,
|
|
91
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
92
|
+
operationID: "commerce.carts.create",
|
|
93
|
+
oAuth2Scopes: null,
|
|
94
|
+
resolvedSecurity: requestSecurity,
|
|
95
|
+
securitySource: client._options.security,
|
|
96
|
+
retryConfig: options?.retries
|
|
97
|
+
|| client._options.retryConfig
|
|
98
|
+
|| { strategy: "none" },
|
|
99
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const requestRes = client._createRequest(context, {
|
|
103
|
+
security: requestSecurity,
|
|
104
|
+
method: "POST",
|
|
105
|
+
baseURL: options?.serverURL,
|
|
106
|
+
path,
|
|
107
|
+
headers,
|
|
108
|
+
body: JSON.stringify(payload),
|
|
109
|
+
userAgent: client._options.userAgent,
|
|
110
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
111
|
+
}, options);
|
|
112
|
+
if (!requestRes.ok) {
|
|
113
|
+
return [requestRes, { status: "invalid" }];
|
|
114
|
+
}
|
|
115
|
+
const req = requestRes.value;
|
|
116
|
+
|
|
117
|
+
const doResult = await client._do(req, {
|
|
118
|
+
context,
|
|
119
|
+
errorCodes: ["4XX", "5XX"],
|
|
120
|
+
retryConfig: context.retryConfig,
|
|
121
|
+
retryCodes: context.retryCodes,
|
|
122
|
+
});
|
|
123
|
+
if (!doResult.ok) {
|
|
124
|
+
return [doResult, { status: "request-error", request: req }];
|
|
125
|
+
}
|
|
126
|
+
const response = doResult.value;
|
|
127
|
+
|
|
128
|
+
const responseFields = {
|
|
129
|
+
HttpMeta: { Response: response, Request: req },
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const [result] = await M.match<
|
|
133
|
+
operations.CreateCartResponse,
|
|
134
|
+
| errors.ErrorResponse
|
|
135
|
+
| errors.OminityDefaultError
|
|
136
|
+
| ResponseValidationError
|
|
137
|
+
| ConnectionError
|
|
138
|
+
| RequestAbortedError
|
|
139
|
+
| RequestTimeoutError
|
|
140
|
+
| InvalidRequestError
|
|
141
|
+
| UnexpectedClientError
|
|
142
|
+
| SDKValidationError
|
|
143
|
+
>(
|
|
144
|
+
M.json(200, Cart$inboundSchema, {
|
|
145
|
+
ctype: "application/hal+json",
|
|
146
|
+
}),
|
|
147
|
+
M.json(201, Cart$inboundSchema, {
|
|
148
|
+
ctype: "application/hal+json",
|
|
149
|
+
}),
|
|
150
|
+
M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
|
|
151
|
+
ctype: "application/hal+json",
|
|
152
|
+
}),
|
|
153
|
+
M.fail("4XX"),
|
|
154
|
+
M.fail("5XX"),
|
|
155
|
+
)(response, req, { extraFields: responseFields });
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
return [result, { status: "complete", request: req, response }];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return [OK(result.value), { status: "complete", request: req, response }];
|
|
161
|
+
}
|