@brytdesigns/shopify-ajax-cart-api 1.0.37 → 1.0.39
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/effect/api/CartAdd.js.map +1 -1
- package/dist/effect/api/CartChange.js.map +1 -1
- package/dist/effect/api/CartClear.js.map +1 -1
- package/dist/effect/api/CartGet.js.map +1 -1
- package/dist/effect/api/CartUpdate.js.map +1 -1
- package/dist/effect/index.d.ts +247 -247
- package/dist/effect/schema.js +612 -19
- package/dist/effect/schema.js.map +1 -1
- package/dist/esm/index.js +1312 -515
- package/dist/esm/index.js.map +1 -1
- package/dist/main/effect/api/CartAdd.js.map +1 -1
- package/dist/main/effect/api/CartChange.js.map +1 -1
- package/dist/main/effect/api/CartClear.js.map +1 -1
- package/dist/main/effect/api/CartGet.js.map +1 -1
- package/dist/main/effect/api/CartUpdate.js.map +1 -1
- package/dist/main/effect/schema.js +612 -19
- package/dist/main/effect/schema.js.map +1 -1
- package/dist/main/index.d.ts +743 -547
- package/dist/main/index.js +137 -0
- package/dist/main/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/api/CartAdd.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/api/CartAdd.ts"],"names":[],"mappings":";;;AA2Ca,MAAA,IAAA,GAAO,WAAW,WAAY,CAAA;AAAA,EACzC,SAAW,EAAA,cAAA;AAAA,EACX,WAAa,EAAA,YAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAC","file":"CartAdd.js","sourcesContent":["import { CartAddInput, CartAddOutput } from \"../schema.js\";\n\nimport * as AjaxClient from \"@brytdesigns/shopify-ajax-client\";\n\nexport type AddInput = CartAddInput;\n\n/**\n * This function is a factory method for creating a function that adds an item to the cart.\n * It utilizes the provided AjaxClient to make the necessary API request.\n *\n * @param routeName - The name of the route for adding an item to the cart.\n * @param inputSchema - The schema for the input parameters of the cart add API.\n * @param outputSchema - The schema for the output response of the cart add API.\n *\n * @returns A runnable effect that returns a promise which adhears to the CartAddOutput schema.\n *\n * @example\n * ```typescript\n * import * as Effect from \"effect/Effect\"\n * import { make } from \"./CartAdd.js\";\n *\n * const addItemToCart = make({\n * routeName: \"cart_add_url\",\n * inputSchema: CartAddInput,\n * outputSchema: CartAddOutput,\n * });\n *\n * const input: CartAddInput = {\n * items: [\n * { id: 123, quantity: 2 },\n * { id: 456, quantity: 1 },\n * ]\n * };\n *\n * Effect.runPromise(addItemToCart(input))\n * .then((output) => {\n * console.log(\"Item added to cart:\", output?.data);\n * })\n * .catch((error) => {\n * console.error(\"Failed to add item to cart:\", error);\n * });\n * ```\n */\nexport const make = AjaxClient.makeFactory({\n routeName: \"cart_add_url\",\n inputSchema: CartAddInput,\n outputSchema: CartAddOutput,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/api/CartChange.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/api/CartChange.ts"],"names":[],"mappings":";;;AAqDa,MAAA,IAAA,GAAO,WAAW,WAAY,CAAA;AAAA,EACzC,SAAW,EAAA,iBAAA;AAAA,EACX,WAAa,EAAA,eAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAC","file":"CartChange.js","sourcesContent":["import { CartChangeInput, CartChangeOutput } from \"../schema.js\";\n\nimport * as AjaxClient from \"@brytdesigns/shopify-ajax-client\";\n\nexport type ChangeInput = CartChangeInput;\n\n/**\n * Factory function to create a new instance of CartChange API.\n * This function is used to make requests to the Shopify API for changing properties of an individual cart item.\n *\n * @param routeName - The name of the route for the CartChange API.\n * @param inputSchema - The input schema for the CartChange API.\n * @param outputSchema - The output schema for the CartChange API.\n *\n * @returns A runnable effect that returns a promise which adhears to the CartChangeOutput schema.\n *\n * @example\n * ```typescript\n * import * as Effect from \"effect/Effect\"\n * import { make } from \"./CartChange.js\";\n *\n * const cartChangeRequest = make({\n * routeName: \"cart_change_url\",\n * inputSchema: CartChangeInput,\n * outputSchema: CartChangeOutput,\n * });\n *\n * const response = await Effect.runPromise(cartChangeRequest({\n * line: 1,\n * quantity: 2\n * }));\n *\n * const response = await Effect.runPromise(cartChangeRequest({\n * // variant id\n * id: 1230311313,\n * quantity: 2\n * }));\n *\n * const response = await Effect.runPromise(cartChangeRequest({\n * // item key\n * id: \"q23asdl234lk241:1230311313\",\n * quantity: 2\n * }));\n *\n * const response = await Effect.runPromise(cartChangeRequest({\n * // item key\n * id: \"q23asdl234lk241:1230311313\",\n * properties: {\n * size: \"Large\"\n * }\n * }));\n * ```\n */\nexport const make = AjaxClient.makeFactory({\n routeName: \"cart_change_url\",\n inputSchema: CartChangeInput,\n outputSchema: CartChangeOutput,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/api/CartClear.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/api/CartClear.ts"],"names":[],"mappings":";;;AAkCa,MAAA,IAAA,GAAO,WAAW,WAAY,CAAA;AAAA,EACzC,SAAW,EAAA,gBAAA;AAAA,EACX,WAAa,EAAA,cAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAC","file":"CartClear.js","sourcesContent":["import { CartOutput, CartClearInput } from \"../schema.js\";\n\nimport * as AjaxClient from \"@brytdesigns/shopify-ajax-client\";\n\nexport type ClearInput = CartClearInput;\n\n/**\n * A factory function to create a clear cart API request using the provided input schema and output schema.\n * This function utilizes the AjaxClient library to make the API request.\n *\n * @param routeName - The name of the route for the clear cart API request.\n * @param inputSchema - The input schema for the clear cart API request.\n * @param outputSchema - The output schema for the clear cart API request.\n *\n * @returns A runnable effect that returns a promise which adhears to the CartClearOutput schema.\n *\n * @example\n * ```typescript\n * import * as Effect from \"effect/Effect\";\n * import { make } from \"./CartClear\";\n *\n * const clearCart = make({\n * routeName: \"cart_clear_url\",\n * inputSchema: CartClearInput,\n * outputSchema: CartOutput,\n * });\n *\n * Effect.runPromise(clearCart({})).then((response) => {\n * console.log(response); // Handle the response\n * }).catch((error) => {\n * console.error(error); // Handle the error\n * });\n * ```\n */\nexport const make = AjaxClient.makeFactory({\n routeName: \"cart_clear_url\",\n inputSchema: CartClearInput,\n outputSchema: CartOutput,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/api/CartGet.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/api/CartGet.ts"],"names":[],"mappings":";;;AAgCa,MAAA,IAAA,GAAO,WAAW,WAAY,CAAA;AAAA,EACzC,SAAW,EAAA,UAAA;AAAA,EACX,WAAa,EAAA,YAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAC","file":"CartGet.js","sourcesContent":["import { CartOutput, CartGetInput } from \"../schema.js\";\n\nimport * as AjaxClient from \"@brytdesigns/shopify-ajax-client\";\n\nexport type GetInput = CartGetInput;\n\n/**\n * This function is a factory method for creating a function that retrieves the current cart from the Shopify store.\n * It utilizes the provided AjaxClient to make the API request.\n *\n * @param routeName - The name of the route for the cart API endpoint.\n * @param inputSchema - The input schema for the cart retrieval request.\n * @param outputSchema - The output schema for the cart retrieval response.\n *\n * @returns A runnable effect that returns a promise which adhears to the CartGetOutput schema.\n *\n * @example\n * ```typescript\n * import * as Effect from \"effect/Effect\";\n * import { make } from \"./CartGet\";\n *\n * const getCart = make({\n * routeName: \"cart_url\",\n * inputSchema: CartGetInput,\n * outputSchema: CartOutput,\n * });\n *\n * Effect.runPromise(getCart({})).then((response) => {\n * console.log(response.data);\n * });\n * ```\n */\nexport const make = AjaxClient.makeFactory({\n routeName: \"cart_url\",\n inputSchema: CartGetInput,\n outputSchema: CartOutput,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/api/CartUpdate.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/api/CartUpdate.ts"],"names":[],"mappings":";;;AAwCa,MAAA,IAAA,GAAO,WAAW,WAAY,CAAA;AAAA,EACzC,SAAW,EAAA,iBAAA;AAAA,EACX,WAAa,EAAA,eAAA;AAAA,EACb,YAAc,EAAA;AAChB,CAAC","file":"CartUpdate.js","sourcesContent":["import { CartUpdateInput, CartUpdateOutput } from \"../schema.js\";\n\nimport * as AjaxClient from \"@brytdesigns/shopify-ajax-client\";\n\nexport type UpdateInput = CartUpdateInput;\n\n/**\n * Factory function to create a new instance of CartUpdate API.\n * This function is used to update the cart with the provided input data.\n *\n * @param routeName - The name of the route for the CartUpdate API.\n * @param inputSchema - The input schema for the CartUpdate API.\n * @param outputSchema - The output schema for the CartUpdate API.\n *\n * @returns A runnable effect that returns a promise which adhears to the CartUpdateOutput schema.\n *\n * @example\n * ```typescript\n * import * as Effect from \"effect/Effect\";\n * import {make} from \"./CartUpdate.js\";\n *\n * const cartUpdateRequest = make({\n * routeName: \"cart_update_url\",\n * inputSchema: CartUpdateInput,\n * outputSchema: CartUpdateOutput,\n * });\n *\n * const updatedCart = await Effect.runPromise(cartUpdateRequest({\n * updates: {\n * // variant id\n * 123413523: 1\n * },\n * discount: [\"hello\"]\n * note: \"New note for the cart\",\n * attributes: {\n * \"custom_attribute\": \"new value\"\n * }\n * }));\n * ```\n */\nexport const make = AjaxClient.makeFactory({\n routeName: \"cart_update_url\",\n inputSchema: CartUpdateInput,\n outputSchema: CartUpdateOutput,\n});\n"]}
|