@elasticpath/js-sdk 24.0.0 → 24.1.0

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/dist/index.cjs.js CHANGED
@@ -530,7 +530,7 @@ if (!globalThis.fetch) {
530
530
  globalThis.Response = fetch$1.Response;
531
531
  }
532
532
 
533
- var version = "24.0.0";
533
+ var version = "24.1.0";
534
534
 
535
535
  var LocalStorageFactory = /*#__PURE__*/function () {
536
536
  function LocalStorageFactory() {
@@ -4791,6 +4791,103 @@ var MultiLocationInventories = /*#__PURE__*/function () {
4791
4791
  this.filter = filter;
4792
4792
  return this;
4793
4793
  }
4794
+
4795
+ // Transactions endpoints
4796
+ }, {
4797
+ key: "IncrementStock",
4798
+ value: function IncrementStock(productId, quantity) {
4799
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4800
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4801
+ attributes: _objectSpread2({
4802
+ type: 'stock-transaction',
4803
+ action: 'increment',
4804
+ quantity: quantity,
4805
+ product_id: productId
4806
+ }, location && {
4807
+ location: location
4808
+ })
4809
+ });
4810
+ }
4811
+ }, {
4812
+ key: "DecrementStock",
4813
+ value: function DecrementStock(productId, quantity) {
4814
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4815
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4816
+ attributes: _objectSpread2({
4817
+ type: 'stock-transaction',
4818
+ action: 'decrement',
4819
+ quantity: quantity,
4820
+ product_id: productId
4821
+ }, location && {
4822
+ location: location
4823
+ })
4824
+ });
4825
+ }
4826
+ }, {
4827
+ key: "AllocateStock",
4828
+ value: function AllocateStock(productId, quantity) {
4829
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4830
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4831
+ attributes: _objectSpread2({
4832
+ type: 'stock-transaction',
4833
+ action: 'allocate',
4834
+ quantity: quantity,
4835
+ product_id: productId
4836
+ }, location && {
4837
+ location: location
4838
+ })
4839
+ });
4840
+ }
4841
+ }, {
4842
+ key: "DeallocateStock",
4843
+ value: function DeallocateStock(productId, quantity) {
4844
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4845
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4846
+ attributes: _objectSpread2({
4847
+ type: 'stock-transaction',
4848
+ action: 'deallocate',
4849
+ quantity: quantity,
4850
+ product_id: productId
4851
+ }, location && {
4852
+ location: location
4853
+ })
4854
+ });
4855
+ }
4856
+ }, {
4857
+ key: "SetStock",
4858
+ value: function SetStock(productId, quantity) {
4859
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4860
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4861
+ attributes: _objectSpread2({
4862
+ type: 'stock-transaction',
4863
+ action: 'set',
4864
+ quantity: quantity,
4865
+ product_id: productId
4866
+ }, location && {
4867
+ location: location
4868
+ })
4869
+ });
4870
+ }
4871
+ }, {
4872
+ key: "GetTransactions",
4873
+ value: function GetTransactions(productId) {
4874
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'GET');
4875
+ }
4876
+ }, {
4877
+ key: "GetTransaction",
4878
+ value: function GetTransaction(productId, transactionId) {
4879
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions/").concat(transactionId), 'GET');
4880
+ }
4881
+ }, {
4882
+ key: "GetMultipleStock",
4883
+ value: function GetMultipleStock(productIds) {
4884
+ var body = productIds.map(function (id) {
4885
+ return {
4886
+ id: id
4887
+ };
4888
+ });
4889
+ return this.request.send("".concat(this.endpoint, "/multiple"), 'POST', body);
4890
+ }
4794
4891
  }]);
4795
4892
  return MultiLocationInventories;
4796
4893
  }();
package/dist/index.d.ts CHANGED
@@ -8760,6 +8760,20 @@ interface MultiLocationInventoryFilter {
8760
8760
  }
8761
8761
  }
8762
8762
 
8763
+ interface MultiLocationInventoryResponse extends Identifiable {
8764
+ type: string
8765
+ attributes: {
8766
+ action: InventoryActionTypes
8767
+ product_id: string
8768
+ quantity: number
8769
+ }
8770
+ meta: {
8771
+ timestamps: {
8772
+ created_at: string
8773
+ }
8774
+ }
8775
+ }
8776
+
8763
8777
  /**
8764
8778
  * Multi Location Inventories Endpoint Interface
8765
8779
  */
@@ -8809,6 +8823,90 @@ interface MultiLocationInventoriesEndpoint {
8809
8823
  Offset(value: number): MultiLocationInventoriesEndpoint
8810
8824
 
8811
8825
  Filter(filter: MultiLocationInventoryFilter): MultiLocationInventoriesEndpoint
8826
+
8827
+ /**
8828
+ * Increment Stock
8829
+ * @param productId The ID for the product you're performing this action on.
8830
+ * @param quantity The amount of stock affected by this transaction.
8831
+ * @param location The slug of the location that the transaction should act on.
8832
+ */
8833
+ IncrementStock(
8834
+ productId: string,
8835
+ quantity: number,
8836
+ location?: string
8837
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8838
+
8839
+ /**
8840
+ * Decrement Stock
8841
+ * @param productId The ID for the product you're performing this action on.
8842
+ * @param quantity The amount of stock affected by this transaction.
8843
+ * @param location The slug of the location that the transaction should act on.
8844
+ */
8845
+ DecrementStock(
8846
+ productId: string,
8847
+ quantity: number,
8848
+ location?: string
8849
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8850
+
8851
+ /**
8852
+ * Allocate Stock
8853
+ * @param productId The ID for the product you're performing this action on.
8854
+ * @param quantity The amount of stock affected by this transaction.
8855
+ * @param location The slug of the location that the transaction should act on.
8856
+ */
8857
+ AllocateStock(
8858
+ productId: string,
8859
+ quantity: number,
8860
+ location?: string
8861
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8862
+
8863
+ /**
8864
+ * Deallocate Stock
8865
+ * @param productId The ID for the product you're performing this action on.
8866
+ * @param quantity The amount of stock affected by this transaction.
8867
+ * @param location The slug of the location that the transaction should act on.
8868
+ */
8869
+ DeallocateStock(
8870
+ productId: string,
8871
+ quantity: number,
8872
+ location?: string
8873
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8874
+
8875
+ /**
8876
+ * Set Stock
8877
+ * @param productId The ID for the product you're performing this action on.
8878
+ * @param quantity The amount of stock affected by this transaction.
8879
+ * @param location The slug of the location that the transaction should act on.
8880
+ */
8881
+ SetStock(
8882
+ productId: string,
8883
+ quantity: number,
8884
+ location?: string
8885
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8886
+
8887
+ /**
8888
+ * Get Transactions
8889
+ * @param productId The ID for the product you're performing this action on.
8890
+ */
8891
+ GetTransactions(
8892
+ productId: string
8893
+ ): Promise<ResourceList<MultiLocationInventoryResponse>>
8894
+
8895
+ /**
8896
+ * Get Transaction
8897
+ * @param productId The ID for the product you're performing this action on.
8898
+ * @param transactionId The ID for the transaction created on the product.
8899
+ */
8900
+ GetTransaction(
8901
+ productId: string,
8902
+ transactionId: string
8903
+ ): Promise<Resource<MultiLocationInventoryResponse>>
8904
+
8905
+ /**
8906
+ * Get Stocks for Multiple Products
8907
+ * @param productIds The array of unique identifier of the products.
8908
+ */
8909
+ GetMultipleStock(productIds: string[]): Promise<ResourceList<StockResponse>>
8812
8910
  }
8813
8911
 
8814
8912
  interface BuiltInRolePolicy {
@@ -8998,4 +9096,4 @@ declare namespace elasticpath {
8998
9096
  }
8999
9097
  }
9000
9098
 
9001
- export { Account, AccountAddress, AccountAddressBase, AccountAddressEdit, AccountAddressesEndpoint, AccountAssociationData, AccountAssociationResponse, AccountAuthenticationSettings, AccountAuthenticationSettingsBase, AccountAuthenticationSettingsEndpoint, AccountBase, AccountEndpoint, AccountFilter, AccountManagementAuthenticationTokenBody, AccountMember, AccountMemberBase, AccountMemberFilter, AccountMembersEndpoint, AccountMembership, AccountMembershipCreateBody, AccountMembershipOnAccountMember, AccountMembershipSettings, AccountMembershipSettingsBase, AccountMembershipSettingsEndpoint, AccountMembershipsEndpoint, AccountMembershipsFilter, AccountMembershipsInclude, AccountMembershipsIncludeAccounts, AccountMembershipsIncluded, AccountMembershipsIncludedAccounts, AccountMembershipsOnAccountMember, AccountMembershipsResponse, AccountTokenBase, AccountUpdateBody, Action, ActionCondition, ActionLimitation, Address, AddressBase, AdyenPayment, AndCondition, AnonymizeOrder, AnonymizeOrderResponse, ApplicationKey, ApplicationKeyBase, ApplicationKeyResponse, ApplicationKeysEndpoint, Attribute, Attributes, AttributesMeta, AuthenticateResponseBody, AuthenticationRealmEndpoint, AuthenticationSettings, AuthenticationSettingsBase, AuthenticationSettingsEndpoint, AuthorizeNetPayment, AuthorizePaymentMethod, BraintreePayment, Brand, BrandBase, BrandEndpoint, BrandFilter, BuildChildProductsJob, BuildRules, BuilderModifier, BuiltInRolePolicy, BulkAddOptions, BulkCustomDiscountOptions, BundleDiscountSchema, BundleGiftSchema, CapturePaymentMethod, CardConnectPayment, Cart, CartAdditionalHeaders, CartCustomDiscount, CartEndpoint, CartInclude, CartIncluded, CartItem, CartItemBase, CartItemObject, CartItemsResponse, CartSettings, CartShippingGroupBase, CartTaxItemObject, Catalog, CatalogBase, CatalogFilter, CatalogReleaseProductFilter, CatalogReleaseProductFilterAttributes, CatalogUpdateBody, CatalogsEndpoint, CatalogsNodesEndpoint, CatalogsProductVariation, CatalogsProductsEndpoint, CatalogsReleasesEndpoint, CatalogsRulesEndpoint, Category, CategoryBase, CategoryEndpoint, CategoryFilter, CheckoutCustomer, CheckoutCustomerObject, Collection, CollectionBase, CollectionEndpoint, CollectionFilter, Condition, Conditions, Config, ConfigOptions, ConfirmPaymentBody, ConfirmPaymentBodyWithOptions, ConfirmPaymentResponse, CreateCartObject, CreateChildrenSortOrderBody, CreateCustomRelationshipBody, CreateLocationBody, CrudQueryableResource, Currency, CurrencyAmount, CurrencyBase, CurrencyEndpoint, CurrencyPercentage, CustomApi, CustomApiBase, CustomApiField, CustomApiFieldBase, CustomApiRolePoliciesEndpoint, CustomApiRolePolicy, CustomApiRolePolicyBase, CustomApiRolePolicyRequestBody, CustomApisEndpoint, CustomAuthenticatorResponseBody, CustomDiscount, CustomDiscountResponse, CustomFieldValidation, CustomInputs, CustomInputsValidationRules, CustomRelationship, CustomRelationshipBase, CustomRelationshipBaseAttributes, CustomRelationshipEntry, CustomRelationshipsEndpoint, CustomRelationshipsFilter, CustomRelationshipsListResponse, Customer, CustomerAddress, CustomerAddressBase, CustomerAddressEdit, CustomerAddressesEndpoint, CustomerBase, CustomerFilter, CustomerInclude, CustomerToken, CustomersEndpoint, CyberSourcePayment, DataEntriesEndpoint, DataEntryRecord, DeletePromotionCodesBodyItem, DeleteRulePromotionCodes, DuplicateHierarchyBody, DuplicateHierarchyJob, ElasticPath, ElasticPathStripePayment, ErasureRequestRecord, ErasureRequestsEndpoint, Exclude$1 as Exclude, Extensions, Field, FieldBase, FieldsEndpoint, File, FileBase, FileEndpoint, FileFilter, FileHref, FixedDiscountSchema, Flow, FlowBase, FlowEndpoint, FlowFilter, FormattedPrice, Gateway, GatewayBase, GatewaysEndpoint, GeolocationDetails, GrantType, HierarchiesEndpoint, HierarchiesShopperCatalogEndpoint, Hierarchy, HierarchyBase, HierarchyFilter, HttpVerbs, Identifiable, Integration, IntegrationBase, IntegrationEndpoint, IntegrationFilter, IntegrationJob, IntegrationLog, IntegrationLogMeta, IntegrationLogsResponse, Inventory, InventoryActionTypes, InventoryBase, InventoryEndpoint, InventoryResourceType, InventoryResponse, InvoicingResult, ItemFixedDiscountSchema, ItemPercentDiscountSchema, ItemTaxObject, ItemTaxObjectResponse, Job, JobBase, JobEndpoint, LocalStorageFactory, Locales, Location, LocationAttributes, LocationBase, LocationCreateQuantity, LocationMeta, LocationQuantities, LocationUpdateQuantity, LocationsEndpoint, LogIntegration, ManualPayment, MatrixObject, MemoryStorageFactory, MerchantRealmMappings, MerchantRealmMappingsEndpoint, MergeCartOptions, MetricsBase, MetricsEndpoint, MetricsQuery, Modifier, ModifierResponse, ModifierType, ModifierTypeObj, MultiLocationInventoriesEndpoint, MultiLocationInventoryFilter, Node, NodeBase, NodeBaseResponse, NodeFilter, NodeProduct, NodeProductResponse, NodeRelationship, NodeRelationshipBase, NodeRelationshipParent, NodeRelationshipsEndpoint, NodesEndpoint, NodesResponse, NodesShopperCatalogEndpoint, NonAssociatedProductEntry, OidcProfileEndpoint, OnboardingLinkResponse, OneTimePasswordTokenRequestBody, OneTimePasswordTokenRequestEndpoint, Option, OptionResponse, Order, OrderAddressBase, OrderBase, OrderBillingAddress, OrderFilter, OrderInclude, OrderIncluded, OrderItem, OrderItemBase, OrderResponse, OrderShippingAddress, OrderSort, OrderSortAscend, OrderSortDescend, OrdersEndpoint, PCMVariation, PCMVariationBase, PCMVariationMetaOption, PCMVariationOption, PCMVariationOptionBase, PCMVariationsEndpoint, PartialPcmProductBase, PasswordProfile, PasswordProfileBody, PasswordProfileEndpoint, PasswordProfileListItem, PasswordProfileResponse, PayPalExpressCheckoutPayment, PaymentMethod, PaymentRequestBody, PcmCustomRelationshipEndpoint, PcmFileRelationship, PcmFileRelationshipEndpoint, PcmJob, PcmJobBase, PcmJobError, PcmJobsEndpoint, PcmMainImageRelationship, PcmMainImageRelationshipEndpoint, PcmProduct, PcmProductAttachmentBody, PcmProductAttachmentResponse, PcmProductBase, PcmProductEntry, PcmProductFilter, PcmProductInclude, PcmProductRelationships, PcmProductResponse, PcmProductUpdateBody, PcmProductsEndpoint, PcmProductsResponse, PcmTemplateRelationship, PcmTemplateRelationshipEndpoint, PcmVariationsRelationshipResource, PcmVariationsRelationships, PcmVariationsRelationshipsEndpoint, PercentDiscountSchema, PersonalDataEndpoint, PersonalDataRecord, Presentation, Price, PriceBook, PriceBookBase, PriceBookFilter, PriceBookPrice, PriceBookPriceBase, PriceBookPriceModifier, PriceBookPriceModifierBase, PriceBookPriceModifierEndpoint, PriceBookPricesCreateBody, PriceBookPricesEndpoint, PriceBookPricesUpdateBody, PriceBooksEndpoint, PriceBooksUpdateBody, PricesFilter, Product, ProductAssociationResponse, ProductBase, ProductComponentOption, ProductComponents, ProductFileRelationshipResource, ProductFilter, ProductResponse, ProductTemplateRelationshipResource, ProductsEndpoint, Profile, ProfileBase, ProfileCreateUpdateBody, ProfileListItem, ProfileResponse, ProfileResponseBody, Promotion, PromotionAttribute, PromotionAttributeValues, PromotionBase, PromotionCode, PromotionCodesJob, PromotionFilter, PromotionJob, PromotionMeta, PromotionSettings, PromotionsEndpoint, PurchasePaymentMethod, QueryableResource, Realm, RealmBase, RealmCreateBody, RealmUpdateBody, RefundPaymentMethod, Relationship, RelationshipToMany, RelationshipToOne, ReleaseBase, ReleaseBodyBase, ReleaseResponse, RequestFactory, Requirements, Resource, ResourceIncluded, ResourceList, ResourcePage, Rule, RuleBase, RuleFilter, RulePromotion, RulePromotionBase, RulePromotionCode, RulePromotionCodesJob, RulePromotionFilter, RulePromotionJob, RulePromotionMeta, RulePromotionsEndpoint, RuleUpdateBody, Settings, SettingsEndpoint, ShippingGroupBase, ShippingGroupResponse, ShippingIncluded, ShopperCatalogEndpoint, ShopperCatalogProductsEndpoint, ShopperCatalogReleaseBase, ShopperCatalogResource, ShopperCatalogResourceList, ShopperCatalogResourcePage, SimpleResourcePageResponse, StockAttributes, StockCreate, StockLocationsMap, StockResponse, StockUpdate, StorageFactory, StripeConnectPayment, StripeIntentsPayment, StripePayment, StripePaymentBase, StripePaymentOptionBase, Subscription, SubscriptionBase, SubscriptionCreate, SubscriptionDunningRules, SubscriptionDunningRulesBase, SubscriptionDunningRulesCreate, SubscriptionDunningRulesEndpoint, SubscriptionDunningRulesUpdate, SubscriptionFilter, SubscriptionInvoice, SubscriptionInvoiceBase, SubscriptionInvoiceFilter, SubscriptionInvoicePayment, SubscriptionInvoicePaymentBase, SubscriptionInvoicesEndpoint, SubscriptionJob, SubscriptionJobBase, SubscriptionJobCreate, SubscriptionJobsEndpoint, SubscriptionOffering, SubscriptionOfferingAttachPlanBody, SubscriptionOfferingAttachProductBody, SubscriptionOfferingAttachProrationPolicyBody, SubscriptionOfferingBase, SubscriptionOfferingBuildBody, SubscriptionOfferingBuildProduct, SubscriptionOfferingCreate, SubscriptionOfferingFilter, SubscriptionOfferingPlan, SubscriptionOfferingProduct, SubscriptionOfferingRelationships, SubscriptionOfferingUpdate, SubscriptionOfferingsEndpoint, SubscriptionPlan, SubscriptionPlanBase, SubscriptionPlanCreate, SubscriptionPlanUpdate, SubscriptionPlansEndpoint, SubscriptionProduct, SubscriptionProductBase, SubscriptionProductCreate, SubscriptionProductUpdate, SubscriptionProductsEndpoint, SubscriptionProrationPoliciesEndpoint, SubscriptionProrationPolicy, SubscriptionProrationPolicyBase, SubscriptionProrationPolicyCreate, SubscriptionProrationPolicyUpdate, SubscriptionSchedule, SubscriptionScheduleBase, SubscriptionScheduleCreate, SubscriptionScheduleUpdate, SubscriptionSchedulesEndpoint, SubscriptionSettings, SubscriptionSubscriber, SubscriptionSubscriberBase, SubscriptionSubscriberCreate, SubscriptionSubscriberUpdate, SubscriptionSubscribersEndpoint, SubscriptionUpdate, SubscriptionsEndpoint, SubscriptionsInclude, SubscriptionsIncluded, SubscriptionsStateAction, Subset, TargetCondition, Timestamps, Transaction, TransactionBase, TransactionEndpoint, TransactionsResponse, TtlSettings, UpdateCustomRelationshipBody, UpdateLocationBody, UpdateNodeBody, UpdateVariationBody, UpdateVariationOptionBody, UserAuthenticationInfo, UserAuthenticationInfoBody, UserAuthenticationInfoEndpoint, UserAuthenticationInfoFilter, UserAuthenticationInfoResponse, UserAuthenticationPasswordProfile, UserAuthenticationPasswordProfileBody, UserAuthenticationPasswordProfileEndpoint, UserAuthenticationPasswordProfileResponse, UserAuthenticationPasswordProfileUpdateBody, Validation, Variation, VariationBase, VariationsBuilderModifier, VariationsEndpoint, VariationsModifier, VariationsModifierResponse, VariationsModifierType, VariationsModifierTypeObj, XforAmountSchema, XforYSchema, createJob, elasticpath, gateway };
9099
+ export { Account, AccountAddress, AccountAddressBase, AccountAddressEdit, AccountAddressesEndpoint, AccountAssociationData, AccountAssociationResponse, AccountAuthenticationSettings, AccountAuthenticationSettingsBase, AccountAuthenticationSettingsEndpoint, AccountBase, AccountEndpoint, AccountFilter, AccountManagementAuthenticationTokenBody, AccountMember, AccountMemberBase, AccountMemberFilter, AccountMembersEndpoint, AccountMembership, AccountMembershipCreateBody, AccountMembershipOnAccountMember, AccountMembershipSettings, AccountMembershipSettingsBase, AccountMembershipSettingsEndpoint, AccountMembershipsEndpoint, AccountMembershipsFilter, AccountMembershipsInclude, AccountMembershipsIncludeAccounts, AccountMembershipsIncluded, AccountMembershipsIncludedAccounts, AccountMembershipsOnAccountMember, AccountMembershipsResponse, AccountTokenBase, AccountUpdateBody, Action, ActionCondition, ActionLimitation, Address, AddressBase, AdyenPayment, AndCondition, AnonymizeOrder, AnonymizeOrderResponse, ApplicationKey, ApplicationKeyBase, ApplicationKeyResponse, ApplicationKeysEndpoint, Attribute, Attributes, AttributesMeta, AuthenticateResponseBody, AuthenticationRealmEndpoint, AuthenticationSettings, AuthenticationSettingsBase, AuthenticationSettingsEndpoint, AuthorizeNetPayment, AuthorizePaymentMethod, BraintreePayment, Brand, BrandBase, BrandEndpoint, BrandFilter, BuildChildProductsJob, BuildRules, BuilderModifier, BuiltInRolePolicy, BulkAddOptions, BulkCustomDiscountOptions, BundleDiscountSchema, BundleGiftSchema, CapturePaymentMethod, CardConnectPayment, Cart, CartAdditionalHeaders, CartCustomDiscount, CartEndpoint, CartInclude, CartIncluded, CartItem, CartItemBase, CartItemObject, CartItemsResponse, CartSettings, CartShippingGroupBase, CartTaxItemObject, Catalog, CatalogBase, CatalogFilter, CatalogReleaseProductFilter, CatalogReleaseProductFilterAttributes, CatalogUpdateBody, CatalogsEndpoint, CatalogsNodesEndpoint, CatalogsProductVariation, CatalogsProductsEndpoint, CatalogsReleasesEndpoint, CatalogsRulesEndpoint, Category, CategoryBase, CategoryEndpoint, CategoryFilter, CheckoutCustomer, CheckoutCustomerObject, Collection, CollectionBase, CollectionEndpoint, CollectionFilter, Condition, Conditions, Config, ConfigOptions, ConfirmPaymentBody, ConfirmPaymentBodyWithOptions, ConfirmPaymentResponse, CreateCartObject, CreateChildrenSortOrderBody, CreateCustomRelationshipBody, CreateLocationBody, CrudQueryableResource, Currency, CurrencyAmount, CurrencyBase, CurrencyEndpoint, CurrencyPercentage, CustomApi, CustomApiBase, CustomApiField, CustomApiFieldBase, CustomApiRolePoliciesEndpoint, CustomApiRolePolicy, CustomApiRolePolicyBase, CustomApiRolePolicyRequestBody, CustomApisEndpoint, CustomAuthenticatorResponseBody, CustomDiscount, CustomDiscountResponse, CustomFieldValidation, CustomInputs, CustomInputsValidationRules, CustomRelationship, CustomRelationshipBase, CustomRelationshipBaseAttributes, CustomRelationshipEntry, CustomRelationshipsEndpoint, CustomRelationshipsFilter, CustomRelationshipsListResponse, Customer, CustomerAddress, CustomerAddressBase, CustomerAddressEdit, CustomerAddressesEndpoint, CustomerBase, CustomerFilter, CustomerInclude, CustomerToken, CustomersEndpoint, CyberSourcePayment, DataEntriesEndpoint, DataEntryRecord, DeletePromotionCodesBodyItem, DeleteRulePromotionCodes, DuplicateHierarchyBody, DuplicateHierarchyJob, ElasticPath, ElasticPathStripePayment, ErasureRequestRecord, ErasureRequestsEndpoint, Exclude$1 as Exclude, Extensions, Field, FieldBase, FieldsEndpoint, File, FileBase, FileEndpoint, FileFilter, FileHref, FixedDiscountSchema, Flow, FlowBase, FlowEndpoint, FlowFilter, FormattedPrice, Gateway, GatewayBase, GatewaysEndpoint, GeolocationDetails, GrantType, HierarchiesEndpoint, HierarchiesShopperCatalogEndpoint, Hierarchy, HierarchyBase, HierarchyFilter, HttpVerbs, Identifiable, Integration, IntegrationBase, IntegrationEndpoint, IntegrationFilter, IntegrationJob, IntegrationLog, IntegrationLogMeta, IntegrationLogsResponse, Inventory, InventoryActionTypes, InventoryBase, InventoryEndpoint, InventoryResourceType, InventoryResponse, InvoicingResult, ItemFixedDiscountSchema, ItemPercentDiscountSchema, ItemTaxObject, ItemTaxObjectResponse, Job, JobBase, JobEndpoint, LocalStorageFactory, Locales, Location, LocationAttributes, LocationBase, LocationCreateQuantity, LocationMeta, LocationQuantities, LocationUpdateQuantity, LocationsEndpoint, LogIntegration, ManualPayment, MatrixObject, MemoryStorageFactory, MerchantRealmMappings, MerchantRealmMappingsEndpoint, MergeCartOptions, MetricsBase, MetricsEndpoint, MetricsQuery, Modifier, ModifierResponse, ModifierType, ModifierTypeObj, MultiLocationInventoriesEndpoint, MultiLocationInventoryFilter, MultiLocationInventoryResponse, Node, NodeBase, NodeBaseResponse, NodeFilter, NodeProduct, NodeProductResponse, NodeRelationship, NodeRelationshipBase, NodeRelationshipParent, NodeRelationshipsEndpoint, NodesEndpoint, NodesResponse, NodesShopperCatalogEndpoint, NonAssociatedProductEntry, OidcProfileEndpoint, OnboardingLinkResponse, OneTimePasswordTokenRequestBody, OneTimePasswordTokenRequestEndpoint, Option, OptionResponse, Order, OrderAddressBase, OrderBase, OrderBillingAddress, OrderFilter, OrderInclude, OrderIncluded, OrderItem, OrderItemBase, OrderResponse, OrderShippingAddress, OrderSort, OrderSortAscend, OrderSortDescend, OrdersEndpoint, PCMVariation, PCMVariationBase, PCMVariationMetaOption, PCMVariationOption, PCMVariationOptionBase, PCMVariationsEndpoint, PartialPcmProductBase, PasswordProfile, PasswordProfileBody, PasswordProfileEndpoint, PasswordProfileListItem, PasswordProfileResponse, PayPalExpressCheckoutPayment, PaymentMethod, PaymentRequestBody, PcmCustomRelationshipEndpoint, PcmFileRelationship, PcmFileRelationshipEndpoint, PcmJob, PcmJobBase, PcmJobError, PcmJobsEndpoint, PcmMainImageRelationship, PcmMainImageRelationshipEndpoint, PcmProduct, PcmProductAttachmentBody, PcmProductAttachmentResponse, PcmProductBase, PcmProductEntry, PcmProductFilter, PcmProductInclude, PcmProductRelationships, PcmProductResponse, PcmProductUpdateBody, PcmProductsEndpoint, PcmProductsResponse, PcmTemplateRelationship, PcmTemplateRelationshipEndpoint, PcmVariationsRelationshipResource, PcmVariationsRelationships, PcmVariationsRelationshipsEndpoint, PercentDiscountSchema, PersonalDataEndpoint, PersonalDataRecord, Presentation, Price, PriceBook, PriceBookBase, PriceBookFilter, PriceBookPrice, PriceBookPriceBase, PriceBookPriceModifier, PriceBookPriceModifierBase, PriceBookPriceModifierEndpoint, PriceBookPricesCreateBody, PriceBookPricesEndpoint, PriceBookPricesUpdateBody, PriceBooksEndpoint, PriceBooksUpdateBody, PricesFilter, Product, ProductAssociationResponse, ProductBase, ProductComponentOption, ProductComponents, ProductFileRelationshipResource, ProductFilter, ProductResponse, ProductTemplateRelationshipResource, ProductsEndpoint, Profile, ProfileBase, ProfileCreateUpdateBody, ProfileListItem, ProfileResponse, ProfileResponseBody, Promotion, PromotionAttribute, PromotionAttributeValues, PromotionBase, PromotionCode, PromotionCodesJob, PromotionFilter, PromotionJob, PromotionMeta, PromotionSettings, PromotionsEndpoint, PurchasePaymentMethod, QueryableResource, Realm, RealmBase, RealmCreateBody, RealmUpdateBody, RefundPaymentMethod, Relationship, RelationshipToMany, RelationshipToOne, ReleaseBase, ReleaseBodyBase, ReleaseResponse, RequestFactory, Requirements, Resource, ResourceIncluded, ResourceList, ResourcePage, Rule, RuleBase, RuleFilter, RulePromotion, RulePromotionBase, RulePromotionCode, RulePromotionCodesJob, RulePromotionFilter, RulePromotionJob, RulePromotionMeta, RulePromotionsEndpoint, RuleUpdateBody, Settings, SettingsEndpoint, ShippingGroupBase, ShippingGroupResponse, ShippingIncluded, ShopperCatalogEndpoint, ShopperCatalogProductsEndpoint, ShopperCatalogReleaseBase, ShopperCatalogResource, ShopperCatalogResourceList, ShopperCatalogResourcePage, SimpleResourcePageResponse, StockAttributes, StockCreate, StockLocationsMap, StockResponse, StockUpdate, StorageFactory, StripeConnectPayment, StripeIntentsPayment, StripePayment, StripePaymentBase, StripePaymentOptionBase, Subscription, SubscriptionBase, SubscriptionCreate, SubscriptionDunningRules, SubscriptionDunningRulesBase, SubscriptionDunningRulesCreate, SubscriptionDunningRulesEndpoint, SubscriptionDunningRulesUpdate, SubscriptionFilter, SubscriptionInvoice, SubscriptionInvoiceBase, SubscriptionInvoiceFilter, SubscriptionInvoicePayment, SubscriptionInvoicePaymentBase, SubscriptionInvoicesEndpoint, SubscriptionJob, SubscriptionJobBase, SubscriptionJobCreate, SubscriptionJobsEndpoint, SubscriptionOffering, SubscriptionOfferingAttachPlanBody, SubscriptionOfferingAttachProductBody, SubscriptionOfferingAttachProrationPolicyBody, SubscriptionOfferingBase, SubscriptionOfferingBuildBody, SubscriptionOfferingBuildProduct, SubscriptionOfferingCreate, SubscriptionOfferingFilter, SubscriptionOfferingPlan, SubscriptionOfferingProduct, SubscriptionOfferingRelationships, SubscriptionOfferingUpdate, SubscriptionOfferingsEndpoint, SubscriptionPlan, SubscriptionPlanBase, SubscriptionPlanCreate, SubscriptionPlanUpdate, SubscriptionPlansEndpoint, SubscriptionProduct, SubscriptionProductBase, SubscriptionProductCreate, SubscriptionProductUpdate, SubscriptionProductsEndpoint, SubscriptionProrationPoliciesEndpoint, SubscriptionProrationPolicy, SubscriptionProrationPolicyBase, SubscriptionProrationPolicyCreate, SubscriptionProrationPolicyUpdate, SubscriptionSchedule, SubscriptionScheduleBase, SubscriptionScheduleCreate, SubscriptionScheduleUpdate, SubscriptionSchedulesEndpoint, SubscriptionSettings, SubscriptionSubscriber, SubscriptionSubscriberBase, SubscriptionSubscriberCreate, SubscriptionSubscriberUpdate, SubscriptionSubscribersEndpoint, SubscriptionUpdate, SubscriptionsEndpoint, SubscriptionsInclude, SubscriptionsIncluded, SubscriptionsStateAction, Subset, TargetCondition, Timestamps, Transaction, TransactionBase, TransactionEndpoint, TransactionsResponse, TtlSettings, UpdateCustomRelationshipBody, UpdateLocationBody, UpdateNodeBody, UpdateVariationBody, UpdateVariationOptionBody, UserAuthenticationInfo, UserAuthenticationInfoBody, UserAuthenticationInfoEndpoint, UserAuthenticationInfoFilter, UserAuthenticationInfoResponse, UserAuthenticationPasswordProfile, UserAuthenticationPasswordProfileBody, UserAuthenticationPasswordProfileEndpoint, UserAuthenticationPasswordProfileResponse, UserAuthenticationPasswordProfileUpdateBody, Validation, Variation, VariationBase, VariationsBuilderModifier, VariationsEndpoint, VariationsModifier, VariationsModifierResponse, VariationsModifierType, VariationsModifierTypeObj, XforAmountSchema, XforYSchema, createJob, elasticpath, gateway };
package/dist/index.esm.js CHANGED
@@ -519,7 +519,7 @@ if (!globalThis.fetch) {
519
519
  globalThis.Response = Response;
520
520
  }
521
521
 
522
- var version = "24.0.0";
522
+ var version = "24.1.0";
523
523
 
524
524
  var LocalStorageFactory = /*#__PURE__*/function () {
525
525
  function LocalStorageFactory() {
@@ -4780,6 +4780,103 @@ var MultiLocationInventories = /*#__PURE__*/function () {
4780
4780
  this.filter = filter;
4781
4781
  return this;
4782
4782
  }
4783
+
4784
+ // Transactions endpoints
4785
+ }, {
4786
+ key: "IncrementStock",
4787
+ value: function IncrementStock(productId, quantity) {
4788
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4789
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4790
+ attributes: _objectSpread2({
4791
+ type: 'stock-transaction',
4792
+ action: 'increment',
4793
+ quantity: quantity,
4794
+ product_id: productId
4795
+ }, location && {
4796
+ location: location
4797
+ })
4798
+ });
4799
+ }
4800
+ }, {
4801
+ key: "DecrementStock",
4802
+ value: function DecrementStock(productId, quantity) {
4803
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4804
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4805
+ attributes: _objectSpread2({
4806
+ type: 'stock-transaction',
4807
+ action: 'decrement',
4808
+ quantity: quantity,
4809
+ product_id: productId
4810
+ }, location && {
4811
+ location: location
4812
+ })
4813
+ });
4814
+ }
4815
+ }, {
4816
+ key: "AllocateStock",
4817
+ value: function AllocateStock(productId, quantity) {
4818
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4819
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4820
+ attributes: _objectSpread2({
4821
+ type: 'stock-transaction',
4822
+ action: 'allocate',
4823
+ quantity: quantity,
4824
+ product_id: productId
4825
+ }, location && {
4826
+ location: location
4827
+ })
4828
+ });
4829
+ }
4830
+ }, {
4831
+ key: "DeallocateStock",
4832
+ value: function DeallocateStock(productId, quantity) {
4833
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4834
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4835
+ attributes: _objectSpread2({
4836
+ type: 'stock-transaction',
4837
+ action: 'deallocate',
4838
+ quantity: quantity,
4839
+ product_id: productId
4840
+ }, location && {
4841
+ location: location
4842
+ })
4843
+ });
4844
+ }
4845
+ }, {
4846
+ key: "SetStock",
4847
+ value: function SetStock(productId, quantity) {
4848
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
4849
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
4850
+ attributes: _objectSpread2({
4851
+ type: 'stock-transaction',
4852
+ action: 'set',
4853
+ quantity: quantity,
4854
+ product_id: productId
4855
+ }, location && {
4856
+ location: location
4857
+ })
4858
+ });
4859
+ }
4860
+ }, {
4861
+ key: "GetTransactions",
4862
+ value: function GetTransactions(productId) {
4863
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'GET');
4864
+ }
4865
+ }, {
4866
+ key: "GetTransaction",
4867
+ value: function GetTransaction(productId, transactionId) {
4868
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions/").concat(transactionId), 'GET');
4869
+ }
4870
+ }, {
4871
+ key: "GetMultipleStock",
4872
+ value: function GetMultipleStock(productIds) {
4873
+ var body = productIds.map(function (id) {
4874
+ return {
4875
+ id: id
4876
+ };
4877
+ });
4878
+ return this.request.send("".concat(this.endpoint, "/multiple"), 'POST', body);
4879
+ }
4783
4880
  }]);
4784
4881
  return MultiLocationInventories;
4785
4882
  }();
package/dist/index.js CHANGED
@@ -1085,7 +1085,7 @@
1085
1085
  globalThis.Response = browserPonyfill.exports.Response;
1086
1086
  }
1087
1087
 
1088
- var version = "24.0.0";
1088
+ var version = "24.1.0";
1089
1089
 
1090
1090
  var LocalStorageFactory = /*#__PURE__*/function () {
1091
1091
  function LocalStorageFactory() {
@@ -5952,6 +5952,103 @@
5952
5952
  this.filter = filter;
5953
5953
  return this;
5954
5954
  }
5955
+
5956
+ // Transactions endpoints
5957
+ }, {
5958
+ key: "IncrementStock",
5959
+ value: function IncrementStock(productId, quantity) {
5960
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
5961
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
5962
+ attributes: _objectSpread2({
5963
+ type: 'stock-transaction',
5964
+ action: 'increment',
5965
+ quantity: quantity,
5966
+ product_id: productId
5967
+ }, location && {
5968
+ location: location
5969
+ })
5970
+ });
5971
+ }
5972
+ }, {
5973
+ key: "DecrementStock",
5974
+ value: function DecrementStock(productId, quantity) {
5975
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
5976
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
5977
+ attributes: _objectSpread2({
5978
+ type: 'stock-transaction',
5979
+ action: 'decrement',
5980
+ quantity: quantity,
5981
+ product_id: productId
5982
+ }, location && {
5983
+ location: location
5984
+ })
5985
+ });
5986
+ }
5987
+ }, {
5988
+ key: "AllocateStock",
5989
+ value: function AllocateStock(productId, quantity) {
5990
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
5991
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
5992
+ attributes: _objectSpread2({
5993
+ type: 'stock-transaction',
5994
+ action: 'allocate',
5995
+ quantity: quantity,
5996
+ product_id: productId
5997
+ }, location && {
5998
+ location: location
5999
+ })
6000
+ });
6001
+ }
6002
+ }, {
6003
+ key: "DeallocateStock",
6004
+ value: function DeallocateStock(productId, quantity) {
6005
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6006
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
6007
+ attributes: _objectSpread2({
6008
+ type: 'stock-transaction',
6009
+ action: 'deallocate',
6010
+ quantity: quantity,
6011
+ product_id: productId
6012
+ }, location && {
6013
+ location: location
6014
+ })
6015
+ });
6016
+ }
6017
+ }, {
6018
+ key: "SetStock",
6019
+ value: function SetStock(productId, quantity) {
6020
+ var location = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6021
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'POST', {
6022
+ attributes: _objectSpread2({
6023
+ type: 'stock-transaction',
6024
+ action: 'set',
6025
+ quantity: quantity,
6026
+ product_id: productId
6027
+ }, location && {
6028
+ location: location
6029
+ })
6030
+ });
6031
+ }
6032
+ }, {
6033
+ key: "GetTransactions",
6034
+ value: function GetTransactions(productId) {
6035
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions"), 'GET');
6036
+ }
6037
+ }, {
6038
+ key: "GetTransaction",
6039
+ value: function GetTransaction(productId, transactionId) {
6040
+ return this.request.send("".concat(this.endpoint, "/").concat(productId, "/transactions/").concat(transactionId), 'GET');
6041
+ }
6042
+ }, {
6043
+ key: "GetMultipleStock",
6044
+ value: function GetMultipleStock(productIds) {
6045
+ var body = productIds.map(function (id) {
6046
+ return {
6047
+ id: id
6048
+ };
6049
+ });
6050
+ return this.request.send("".concat(this.endpoint, "/multiple"), 'POST', body);
6051
+ }
5955
6052
  }]);
5956
6053
  return MultiLocationInventories;
5957
6054
  }();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elasticpath/js-sdk",
3
3
  "description": "SDK for the Elastic Path eCommerce API",
4
- "version": "24.0.0",
4
+ "version": "24.1.0",
5
5
  "homepage": "https://github.com/elasticpath/js-sdk",
6
6
  "author": "Elastic Path (https://elasticpath.com/)",
7
7
  "files": [