Socket
Socket
Sign inDemoInstall

@ribajs/shopify

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ribajs/shopify - npm Package Compare versions

Comparing version 2.0.0-rc.3 to 2.0.0-rc.4

68

package.json
{
"name": "@ribajs/shopify",
"description": "Shopify extension for Riba.js",
"version": "2.0.0-rc.3",
"version": "2.0.0-rc.4",
"type": "module",

@@ -50,50 +50,50 @@ "engines": {

"devDependencies": {
"@babel/cli": "^7.22.5",
"@babel/core": "^7.22.5",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/preset-env": "^7.22.5",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.5",
"@babel/runtime-corejs3": "^7.22.5",
"@ribajs/eslint-config": "^2.0.0-rc.3",
"@ribajs/npm-package": "^2.0.0-rc.3",
"@ribajs/tsconfig": "^2.0.0-rc.3",
"@tsconfig/node14": "^1.0.3",
"@babel/runtime": "^7.22.6",
"@babel/runtime-corejs3": "^7.22.6",
"@ribajs/eslint-config": "^2.0.0-rc.4",
"@ribajs/npm-package": "^2.0.0-rc.4",
"@ribajs/tsconfig": "^2.0.0-rc.4",
"@tsconfig/node14": "^14.1.0",
"@types/debug": "^4.1.8",
"@types/jest": "^29.5.2",
"@types/lodash": "^4.14.195",
"@types/node": "^18.16.18",
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"babel-loader": "^9.1.2",
"@types/jest": "^29.5.3",
"@types/lodash": "^4.14.196",
"@types/node": "^18.17.1",
"@types/prettier": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^6.2.1",
"babel-loader": "^9.1.3",
"babel-plugin-array-includes": "^2.0.3",
"core-js": "^3.31.0",
"core-js": "^3.32.0",
"debug": "^4.3.4",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"graceful-fs": "^4.2.11",
"jest": "^29.5.0",
"jest": "^29.6.2",
"jest-extended": "^4.0.0",
"prettier": "^2.8.8",
"terser": "^5.18.1",
"ts-jest": "^29.1.0",
"typescript": "5.1.3"
"prettier": "^3.0.1",
"terser": "^5.19.2",
"ts-jest": "^29.1.1",
"typescript": "5.1.6"
},
"optionalDependencies": {
"@ribajs/shopify-tda": "^2.0.0-rc.3"
"@ribajs/shopify-tda": "^2.0.0-rc.4"
},
"dependencies": {
"@ribajs/cache": "^2.0.0-rc.3",
"@ribajs/core": "^2.0.0-rc.3",
"@ribajs/events": "^2.0.0-rc.3",
"@ribajs/i18n": "^2.0.0-rc.3",
"@ribajs/router": "^2.0.0-rc.3",
"@ribajs/utils": "^2.0.0-rc.3",
"webpack": "^5.88.0",
"@ribajs/cache": "^2.0.0-rc.4",
"@ribajs/core": "^2.0.0-rc.4",
"@ribajs/events": "^2.0.0-rc.4",
"@ribajs/i18n": "^2.0.0-rc.4",
"@ribajs/router": "^2.0.0-rc.4",
"@ribajs/utils": "^2.0.0-rc.4",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}

@@ -30,7 +30,7 @@ import { Binder } from "@ribajs/core";

"ShopifyCart:request:complete",
this.onCartRequestComplete
this.onCartRequestComplete,
);
ShopifyCartService.shopifyCartEventDispatcher.on(
"ShopifyCart:request:changed",
this.onCartRequestChanged
this.onCartRequestChanged,
);

@@ -42,9 +42,9 @@ }

"ShopifyCart:request:complete",
this.onCartRequestComplete
this.onCartRequestComplete,
);
ShopifyCartService.shopifyCartEventDispatcher.off(
"ShopifyCart:request:changed",
this.onCartRequestChanged
this.onCartRequestChanged,
);
}
}

@@ -42,3 +42,3 @@ import { Binder } from "@ribajs/core";

undefined,
this.el
this.el,
);

@@ -45,0 +45,0 @@ if (typeof currentSrcset === "string" && currentSrcset.length > 0) {

@@ -83,3 +83,3 @@ import { Component, HttpService, ScopeBase } from "@ribajs/core";

const form = this.querySelector(
`form[action="/account/addresses/${id}]`
`form[action="/account/addresses/${id}]`,
) as HTMLFormElement;

@@ -135,3 +135,3 @@

this.editAddressForm = this.querySelector(
'form[action^="/account/addresses/"]'
'form[action^="/account/addresses/"]',
) as HTMLFormElement;

@@ -142,3 +142,3 @@ this.editAddressForm.attr("novalidate", "");

this.createAddressForm = this.querySelector(
'form[action="/account/addresses"]'
'form[action="/account/addresses"]',
) as HTMLFormElement;

@@ -145,0 +145,0 @@ this.createAddressForm.attr("novalidate", "");

@@ -71,3 +71,3 @@ import { Component, ScopeBase } from "@ribajs/core";

this.scope.pending = true;
}
},
);

@@ -82,3 +82,3 @@

this.scope.pending = false;
}
},
);

@@ -85,0 +85,0 @@ }

@@ -248,3 +248,3 @@ import { Component, ScopeBase } from "@ribajs/core";

this.onCartRequestStart,
this
this,
);

@@ -255,3 +255,3 @@

this.onCartRequestComplete,
this
this,
);

@@ -269,3 +269,3 @@

this.onCartRequestStart,
this
this,
);

@@ -276,3 +276,3 @@

this.onCartRequestComplete,
this
this,
);

@@ -279,0 +279,0 @@ }

@@ -64,7 +64,7 @@ import { Component, ScopeBase } from "@ribajs/core";

(
shippingRates: ShopifyShippingRates | ShopifyShippingRatesNormalized
shippingRates: ShopifyShippingRates | ShopifyShippingRatesNormalized,
) => {
this.scope.shippingRates =
shippingRates as ShopifyShippingRatesNormalized;
}
},
);

@@ -135,3 +135,3 @@ }

scope: Scope,
htmlEl: HTMLInputElement
htmlEl: HTMLInputElement,
) {

@@ -185,3 +185,3 @@ if (!htmlEl) {

this.onCartRequestStart,
this
this,
);

@@ -192,3 +192,3 @@

this.onCartRequestComplete,
this
this,
);

@@ -202,3 +202,3 @@ }

this.onCartRequestStart,
this
this,
);

@@ -209,3 +209,3 @@

this.onCartRequestComplete,
this
this,
);

@@ -212,0 +212,0 @@ }

@@ -107,3 +107,3 @@ import { Component, ScopeBase } from "@ribajs/core";

this.newCommentForm = this.querySelector(
"#comment_form"
"#comment_form",
) as HTMLFormElement;

@@ -110,0 +110,0 @@ this.newCommentForm.setAttribute("novalidate", "");

@@ -37,3 +37,3 @@ import { Component } from "@ribajs/core";

newValue: any,
namespace: string | null
namespace: string | null,
) {

@@ -78,6 +78,6 @@ this.debug("attributeChangedCallback", name, oldValue, newValue, namespace);

this.previewBar = document.getElementById(
"preview-bar-iframe"
"preview-bar-iframe",
) as HTMLIFrameElement | null;
this.adminBar = document.getElementById(
"admin-bar-iframe"
"admin-bar-iframe",
) as HTMLIFrameElement | null;

@@ -84,0 +84,0 @@

@@ -137,3 +137,3 @@ import { Component, ScopeBase } from "@ribajs/core";

newValue: any,
namespace: string | null
namespace: string | null,
) {

@@ -154,3 +154,3 @@ // injects the changed attributes to scope

throw new Error(
`Linklist not found! \nNote: The linklist must be available under "window.model.system.linklists['${newValue}']" to set it using his handle.`
`Linklist not found! \nNote: The linklist must be available under "window.model.system.linklists['${newValue}']" to set it using his handle.`,
);

@@ -200,3 +200,3 @@ }

viewId: string,
currentStatus: State /*, prevStatus: State, container: HTMLElement, newPageRawHTML: string, dataset: any, isFirstPageLoad: boolean */
currentStatus: State /*, prevStatus: State, container: HTMLElement, newPageRawHTML: string, dataset: any, isFirstPageLoad: boolean */,
) {

@@ -203,0 +203,0 @@ const url = currentStatus.url;

@@ -128,3 +128,3 @@ import { Component, ScopeBase } from "@ribajs/core";

this.createCustomerForm,
this.scope.createCustomer.validation
this.scope.createCustomer.validation,
);

@@ -158,3 +158,3 @@

this.recoverCustomerForm,
this.scope.recoverCustomer.validation
this.scope.recoverCustomer.validation,
);

@@ -167,3 +167,3 @@

"hidden",
""
"",
);

@@ -192,7 +192,7 @@ (

(this.loginCustomerForm.parentNode as HTMLElement | null)?.removeAttribute(
"hidden"
"hidden",
);
(this.recoverCustomerForm.parentNode as HTMLElement | null)?.setAttribute(
"hidden",
""
"",
);

@@ -203,3 +203,3 @@ }

this.createCustomerForm = this.querySelector(
'form[action="/account"]'
'form[action="/account"]',
) as HTMLFormElement;

@@ -210,3 +210,3 @@ this.createCustomerForm.setAttribute("novalidate", "");

this.loginCustomerForm = this.querySelector(
'form[action="/account/login"]'
'form[action="/account/login"]',
) as HTMLFormElement;

@@ -217,3 +217,3 @@ this.loginCustomerForm.setAttribute("novalidate", "");

this.recoverCustomerForm = this.querySelector(
'form[action="/account/recover"]'
'form[action="/account/recover"]',
) as HTMLFormElement;

@@ -220,0 +220,0 @@ this.recoverCustomerForm.setAttribute("novalidate", "");

@@ -163,3 +163,3 @@ import { Component, ScopeBase } from "@ribajs/core";

optionName: string,
event: MouseEvent
event: MouseEvent,
) {

@@ -175,3 +175,3 @@ optionValue = optionValue.toString();

this.scope.product,
this.selectedOptions
this.selectedOptions,
);

@@ -224,6 +224,6 @@ if (variant) {

this.querySelector<HTMLElement>(
`.option-${optionName.toLocaleLowerCase()}`
`.option-${optionName.toLocaleLowerCase()}`,
)?.classList.remove("active");
this.querySelector<HTMLElement>(
`.option-${optionName.toLocaleLowerCase()}-${optionValue}`
`.option-${optionName.toLocaleLowerCase()}-${optionValue}`,
)?.classList.add("active");

@@ -277,3 +277,3 @@ }

newValue: any,
namespace: string | null
namespace: string | null,
) {

@@ -284,3 +284,3 @@ super.parsedAttributeChangedCallback(

newValue,
namespace
namespace,
);

@@ -287,0 +287,0 @@ switch (attributeName) {

@@ -118,3 +118,3 @@ import { Component, ScopeBase } from "@ribajs/core";

optionName: string,
event: MouseEvent
event: MouseEvent,
) {

@@ -130,3 +130,3 @@ if (!this.scope.product) {

this.scope.product,
this.selectedOptions
this.selectedOptions,
);

@@ -179,6 +179,6 @@ if (variant) {

this.querySelector<HTMLElement>(
`.option-${optionName.toLocaleLowerCase()}`
`.option-${optionName.toLocaleLowerCase()}`,
)?.classList.remove("active");
this.querySelector<HTMLElement>(
`.option-${optionName.toLocaleLowerCase()}-${optionValue}`
`.option-${optionName.toLocaleLowerCase()}-${optionValue}`,
)?.classList.add("active");

@@ -218,3 +218,3 @@ }

this.product = product;
}
},
);

@@ -302,3 +302,3 @@ }

option: ShopifyProductVariantOption,
optionValue: string
optionValue: string,
) {

@@ -326,3 +326,3 @@ optionValue = optionValue.toLowerCase().replace("#", "_");

/(^\w+:|^)\/\//,
"//"
"//",
); // remove protocol

@@ -380,3 +380,3 @@ return variant.featured_image;

this.colorOption,
variant.options[this.colorOption.position - 1]
variant.options[this.colorOption.position - 1],
);

@@ -383,0 +383,0 @@ } else {

@@ -20,3 +20,3 @@ import { Formatter } from "@ribajs/core";

crop?: string,
extension?: string
extension?: string,
// element?: HTMLImageElement

@@ -23,0 +23,0 @@ ) {

@@ -21,3 +21,3 @@ import { ShopifyModuleOptions } from "../types/index.js";

throw new Error(
`Singleton of ModuleService not defined, please call setSingleton first!`
`Singleton of ModuleService not defined, please call setSingleton first!`,
);

@@ -24,0 +24,0 @@ }

@@ -34,3 +34,3 @@ // https://github.com/sindresorhus/p-queue

},
options
options,
);

@@ -44,3 +44,3 @@

options.concurrency
}\` (${typeof options.concurrency})`
}\` (${typeof options.concurrency})`,
);

@@ -55,3 +55,3 @@ }

options.intervalCap
}\` (${typeof options.intervalCap})`
}\` (${typeof options.intervalCap})`,
);

@@ -70,3 +70,3 @@ }

options.interval
}\` (${typeof options.interval})`
}\` (${typeof options.interval})`,
);

@@ -108,3 +108,3 @@ }

this._next();
}
},
);

@@ -111,0 +111,0 @@ } catch (err) {

@@ -34,3 +34,3 @@ // Port of lower_bound from http://en.cppreference.com/w/cpp/algorithm/lower_bound

},
options
options,
);

@@ -48,3 +48,3 @@

element,
(a: any, b: any) => b.priority - a.priority
(a: any, b: any) => b.priority - a.priority,
);

@@ -51,0 +51,0 @@ this._queue.splice(index, 0, element);

@@ -35,3 +35,3 @@ import { HttpService } from "@ribajs/core";

public static async updateExtern(
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
) {

@@ -72,3 +72,3 @@ if (options.triggerOnStart) {

properties = {},
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartLineItem | ShopifyCartAddError> {

@@ -97,3 +97,3 @@ if (options.triggerOnStart) {

{},
"json"
"json",
);

@@ -122,3 +122,3 @@

{},
"json"
"json",
);

@@ -159,3 +159,3 @@

public static get(
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -186,3 +186,3 @@ if (options.triggerOnStart) {

properties = {},
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -226,3 +226,3 @@ if (options.triggerOnStart) {

updates: ShopifyCartUpdateProperty | Array<number>,
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -239,3 +239,3 @@ if (options.triggerOnStart) {

},
"form"
"form",
);

@@ -283,3 +283,3 @@ })

properties = {},
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -298,3 +298,3 @@ if (options.triggerOnStart) {

body,
"form"
"form",
);

@@ -336,3 +336,3 @@

properties = {},
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -350,3 +350,3 @@ if (options.triggerOnStart) {

body,
"form"
"form",
);

@@ -382,3 +382,3 @@

public static async clear(
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyCartObject> {

@@ -392,3 +392,3 @@ if (options.triggerOnStart) {

{},
"form"
"form",
);

@@ -418,3 +418,3 @@ let cart: ShopifyCartObject;

shippingAddress: ShopifyCustomerAddress,
normalize = true
normalize = true,
): Promise<ShopifyShippingRates | ShopifyShippingRatesNormalized> {

@@ -424,3 +424,3 @@ const res = await HttpService.get<{ shipping_rates: ShopifyShippingRates }>(

{ shipping_address: shippingAddress },
"json"
"json",
);

@@ -437,3 +437,3 @@

throw new Error(
"shipping_rates property not found: " + JSON.stringify(shippingRates)
"shipping_rates property not found: " + JSON.stringify(shippingRates),
);

@@ -451,3 +451,3 @@ }

normalize = true,
options: ShopifyCartRequestOptions = this.requestOptionDefaults
options: ShopifyCartRequestOptions = this.requestOptionDefaults,
): Promise<ShopifyShippingRates | ShopifyShippingRatesNormalized> {

@@ -495,3 +495,3 @@ if (options.triggerOnStart) {

"ShopifyCart:request:complete",
this.cart
this.cart,
);

@@ -511,3 +511,3 @@ this.waitForComplete = false;

"ShopifyCart:request:changed",
this.cart
this.cart,
);

@@ -524,3 +524,3 @@ }

ShopifyCartService.shopifyCartEventDispatcher.trigger(
"ShopifyCart:request:start"
"ShopifyCart:request:start",
);

@@ -541,3 +541,3 @@ }

protected static normalizeShippingRates(
shippingRates: ShopifyShippingRates
shippingRates: ShopifyShippingRates,
): ShopifyShippingRatesNormalized {

@@ -544,0 +544,0 @@ const normalized = new Array<any>(shippingRates.length);

@@ -25,3 +25,3 @@ import { HttpService } from "@ribajs/core";

return this.cache[handle];
}
},
);

@@ -39,3 +39,3 @@ }

variant: ShopifyProductVariant,
optionValues: string[]
optionValues: string[],
) {

@@ -59,3 +59,3 @@ let fit = true;

product: ShopifyProduct,
optionValues: string[]
optionValues: string[],
) {

@@ -96,3 +96,3 @@ let result: ShopifyProductVariant | null = null;

const result = product.options.find(
(option) => option.name.toLowerCase() === name.toLowerCase()
(option) => option.name.toLowerCase() === name.toLowerCase(),
);

@@ -109,6 +109,6 @@ return result;

product: ShopifyProduct,
searchSubstr: string
searchSubstr: string,
) {
const result = product.options.find((option) =>
option.name.includes(searchSubstr)
option.name.includes(searchSubstr),
);

@@ -115,0 +115,0 @@ return result;

@@ -12,3 +12,3 @@ import { isNumber } from "@ribajs/utils/src/type.js";

thousands = ",",
decimal = "."
decimal = ".",
): string {

@@ -24,3 +24,3 @@ if (!isNumber(num) || num === null) {

/(\d)(?=(\d\d\d)+(?!\d))/g,
"$1" + thousands
"$1" + thousands,
);

@@ -27,0 +27,0 @@ const cents = parts[1] ? decimal + parts[1] : "";

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc