@shopify/app-bridge
Advanced tools
Comparing version 3.7.10 to 3.7.11-snapshot-20240220213625
@@ -1,4 +0,4 @@ | ||
import { Action, Data, Payload, Options, AddCustomerAddressPayload, AddLineItemPayload, SetCustomerPayload, UpdateCustomerAddressPayload, SetDiscountPayload, SetPropertiesPayload, RemovePropertiesPayload, UpdateLineItemData, UpdateLineItemPayload, RemoveLineItemPayload, SetLineItemDiscountPayload, RemoveLineItemDiscountPayload, SetLineItemPropertiesPayload, RemoveLineItemPropertiesPayload, Cart, Customer, CustomerWithAddresses, Address, DiscountAmount, DiscountCode, Discount, LineItem, NoteAttributes, Properties, fetch, update, setCustomer, addCustomerAddress, updateCustomerAddress, setDiscount, setProperties, removeProperties, addLineItem, updateLineItem, removeLineItem, setLineItemDiscount, removeLineItemDiscount, setLineItemProperties } from '@shopify/app-bridge-core/actions/Cart'; | ||
import { Action, Data, Payload, Options, AddCustomerAddressPayload, AddLineItemPayload, SetCustomerPayload, UpdateCustomerAddressPayload, SetDiscountPayload, SetCodeDiscountPayload, SetPropertiesPayload, RemovePropertiesPayload, UpdateLineItemData, UpdateLineItemPayload, RemoveLineItemPayload, SetLineItemDiscountPayload, RemoveLineItemDiscountPayload, SetLineItemPropertiesPayload, RemoveLineItemPropertiesPayload, Cart, Customer, CustomerWithAddresses, Address, DiscountAmount, DiscountCode, Discount, LineItem, NoteAttributes, Properties, fetch, update, setCustomer, addCustomerAddress, updateCustomerAddress, setDiscount, setCodeDiscount, setProperties, removeProperties, addLineItem, updateLineItem, removeLineItem, setLineItemDiscount, removeLineItemDiscount, setLineItemProperties } from '@shopify/app-bridge-core/actions/Cart'; | ||
import { ClientApplication } from '../../client'; | ||
export { Action, Data, Payload, Options, AddCustomerAddressPayload, AddLineItemPayload, SetCustomerPayload, UpdateCustomerAddressPayload, SetDiscountPayload, SetPropertiesPayload, RemovePropertiesPayload, UpdateLineItemData, UpdateLineItemPayload, RemoveLineItemPayload, SetLineItemDiscountPayload, RemoveLineItemDiscountPayload, SetLineItemPropertiesPayload, RemoveLineItemPropertiesPayload, Cart, Customer, CustomerWithAddresses, Address, DiscountAmount, DiscountCode, Discount, LineItem, NoteAttributes, Properties, fetch, update, setCustomer, addCustomerAddress, updateCustomerAddress, setDiscount, setProperties, removeProperties, addLineItem, updateLineItem, removeLineItem, setLineItemDiscount, removeLineItemDiscount, setLineItemProperties, }; | ||
export { Action, Data, Payload, Options, AddCustomerAddressPayload, AddLineItemPayload, SetCustomerPayload, UpdateCustomerAddressPayload, SetDiscountPayload, SetCodeDiscountPayload, SetPropertiesPayload, RemovePropertiesPayload, UpdateLineItemData, UpdateLineItemPayload, RemoveLineItemPayload, SetLineItemDiscountPayload, RemoveLineItemDiscountPayload, SetLineItemPropertiesPayload, RemoveLineItemPropertiesPayload, Cart, Customer, CustomerWithAddresses, Address, DiscountAmount, DiscountCode, Discount, LineItem, NoteAttributes, Properties, fetch, update, setCustomer, addCustomerAddress, updateCustomerAddress, setDiscount, setCodeDiscount, setProperties, removeProperties, addLineItem, updateLineItem, removeLineItem, setLineItemDiscount, removeLineItemDiscount, setLineItemProperties, }; | ||
export declare function create(app: ClientApplication, options?: Options): Cart; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.create = exports.setLineItemProperties = exports.removeLineItemDiscount = exports.setLineItemDiscount = exports.removeLineItem = exports.updateLineItem = exports.addLineItem = exports.removeProperties = exports.setProperties = exports.setDiscount = exports.updateCustomerAddress = exports.addCustomerAddress = exports.setCustomer = exports.update = exports.fetch = exports.Cart = exports.Action = void 0; | ||
exports.create = exports.setLineItemProperties = exports.removeLineItemDiscount = exports.setLineItemDiscount = exports.removeLineItem = exports.updateLineItem = exports.addLineItem = exports.removeProperties = exports.setProperties = exports.setCodeDiscount = exports.setDiscount = exports.updateCustomerAddress = exports.addCustomerAddress = exports.setCustomer = exports.update = exports.fetch = exports.Cart = exports.Action = void 0; | ||
var Cart_1 = require("@shopify/app-bridge-core/actions/Cart"); | ||
@@ -13,2 +13,3 @@ Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Cart_1.Action; } }); | ||
Object.defineProperty(exports, "setDiscount", { enumerable: true, get: function () { return Cart_1.setDiscount; } }); | ||
Object.defineProperty(exports, "setCodeDiscount", { enumerable: true, get: function () { return Cart_1.setCodeDiscount; } }); | ||
Object.defineProperty(exports, "setProperties", { enumerable: true, get: function () { return Cart_1.setProperties; } }); | ||
@@ -15,0 +16,0 @@ Object.defineProperty(exports, "removeProperties", { enumerable: true, get: function () { return Cart_1.removeProperties; } }); |
{ | ||
"name": "@shopify/app-bridge", | ||
"version": "3.7.10", | ||
"version": "3.7.11-snapshot-20240220213625", | ||
"types": "index.d.ts", | ||
@@ -54,3 +54,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@shopify/app-bridge-core": "1.1.1", | ||
"@shopify/app-bridge-core": "1.2.0-snapshot-20240220213625", | ||
"base64url": "^3.0.1", | ||
@@ -57,0 +57,0 @@ "web-vitals": "^3.0.1" |
@@ -61,2 +61,3 @@ "use strict"; | ||
cartDiscount: type_validate_1.makeOptional(discountSchema), | ||
cartDiscounts: type_validate_1.makeOptional(type_validate_1.matchesArray(discountSchema)), | ||
customer: type_validate_1.makeOptional(customerSchema), | ||
@@ -89,8 +90,2 @@ grandTotal: type_validate_1.makeOptional(type_validate_1.matchesString()), | ||
} | ||
function getDiscountSchema(data) { | ||
if (data.amount) { | ||
return discountAmount; | ||
} | ||
return discountCode; | ||
} | ||
function validateAction(action) { | ||
@@ -107,3 +102,5 @@ switch (action.type) { | ||
case Cart_1.Action.SET_DISCOUNT: | ||
return type_validate_1.validate(action, createDataValidator(getDiscountSchema(action.payload.data))); | ||
return type_validate_1.validate(action, createDataValidator(discountAmount)); | ||
case Cart_1.Action.SET_CODE_DISCOUNT: | ||
return type_validate_1.validate(action, createDataValidator(discountCode)); | ||
case Cart_1.Action.SET_PROPERTIES: | ||
@@ -110,0 +107,0 @@ return type_validate_1.validate(action, createDataValidator(propertiesSchema)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
897840
15303
1
+ Added@shopify/app-bridge-core@1.2.0-snapshot-20240220213625(transitive)
- Removed@shopify/app-bridge-core@1.1.1(transitive)
Updated@shopify/app-bridge-core@1.2.0-snapshot-20240220213625