@brytdesigns/shopify-utils 1.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.
Files changed (91) hide show
  1. package/dist/effect/Ajax/Sections/index.js +2 -0
  2. package/dist/effect/Ajax/Sections/index.js.map +1 -0
  3. package/dist/effect/Ajax/Sections/schema.js +2 -0
  4. package/dist/effect/Ajax/Sections/schema.js.map +1 -0
  5. package/dist/effect/Ajax/Window/data/ShopifyRoutes.js +2 -0
  6. package/dist/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -0
  7. package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js +2 -0
  8. package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -0
  9. package/dist/effect/Ajax/Window/data/index.js +2 -0
  10. package/dist/effect/Ajax/Window/data/index.js.map +1 -0
  11. package/dist/effect/Ajax/Window/data/types.js +2 -0
  12. package/dist/effect/Ajax/Window/data/types.js.map +1 -0
  13. package/dist/effect/Ajax/Window/index.js +2 -0
  14. package/dist/effect/Ajax/Window/index.js.map +1 -0
  15. package/dist/effect/Ajax/index.js +2 -0
  16. package/dist/effect/Ajax/index.js.map +1 -0
  17. package/dist/effect/Logging/index.js +2 -0
  18. package/dist/effect/Logging/index.js.map +1 -0
  19. package/dist/effect/Resource/data.js +3 -0
  20. package/dist/effect/Resource/data.js.map +1 -0
  21. package/dist/effect/Resource/index.js +2 -0
  22. package/dist/effect/Resource/index.js.map +1 -0
  23. package/dist/effect/Resource/schema.js +3 -0
  24. package/dist/effect/Resource/schema.js.map +1 -0
  25. package/dist/effect/index.d.ts +130 -0
  26. package/dist/effect/index.js +2 -0
  27. package/dist/effect/index.js.map +1 -0
  28. package/dist/index.d.ts +77 -0
  29. package/dist/jsdelivr/effect/Ajax/Sections/index.js +2 -0
  30. package/dist/jsdelivr/effect/Ajax/Sections/index.js.map +1 -0
  31. package/dist/jsdelivr/effect/Ajax/Sections/schema.js +2 -0
  32. package/dist/jsdelivr/effect/Ajax/Sections/schema.js.map +1 -0
  33. package/dist/jsdelivr/effect/Ajax/Window/data/ShopifyRoutes.js +2 -0
  34. package/dist/jsdelivr/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -0
  35. package/dist/jsdelivr/effect/Ajax/Window/data/StorefrontClientConfig.js +2 -0
  36. package/dist/jsdelivr/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -0
  37. package/dist/jsdelivr/effect/Ajax/Window/data/index.js +2 -0
  38. package/dist/jsdelivr/effect/Ajax/Window/data/index.js.map +1 -0
  39. package/dist/jsdelivr/effect/Ajax/Window/data/types.js +2 -0
  40. package/dist/jsdelivr/effect/Ajax/Window/data/types.js.map +1 -0
  41. package/dist/jsdelivr/effect/Ajax/Window/index.js +2 -0
  42. package/dist/jsdelivr/effect/Ajax/Window/index.js.map +1 -0
  43. package/dist/jsdelivr/effect/Ajax/index.js +2 -0
  44. package/dist/jsdelivr/effect/Ajax/index.js.map +1 -0
  45. package/dist/jsdelivr/effect/Logging/index.js +2 -0
  46. package/dist/jsdelivr/effect/Logging/index.js.map +1 -0
  47. package/dist/jsdelivr/effect/Resource/data.js +3 -0
  48. package/dist/jsdelivr/effect/Resource/data.js.map +1 -0
  49. package/dist/jsdelivr/effect/Resource/index.js +2 -0
  50. package/dist/jsdelivr/effect/Resource/index.js.map +1 -0
  51. package/dist/jsdelivr/effect/Resource/schema.js +3 -0
  52. package/dist/jsdelivr/effect/Resource/schema.js.map +1 -0
  53. package/dist/jsdelivr/effect/index.js +2 -0
  54. package/dist/jsdelivr/effect/index.js.map +1 -0
  55. package/dist/jsdelivr/index.d.ts +77 -0
  56. package/dist/jsdelivr/index.js +2 -0
  57. package/dist/jsdelivr/index.js.map +1 -0
  58. package/dist/jsdelivr/resources/index.js +2 -0
  59. package/dist/jsdelivr/resources/index.js.map +1 -0
  60. package/dist/main/effect/Ajax/Sections/index.js +2 -0
  61. package/dist/main/effect/Ajax/Sections/index.js.map +1 -0
  62. package/dist/main/effect/Ajax/Sections/schema.js +2 -0
  63. package/dist/main/effect/Ajax/Sections/schema.js.map +1 -0
  64. package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js +2 -0
  65. package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -0
  66. package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js +2 -0
  67. package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -0
  68. package/dist/main/effect/Ajax/Window/data/index.js +2 -0
  69. package/dist/main/effect/Ajax/Window/data/index.js.map +1 -0
  70. package/dist/main/effect/Ajax/Window/data/types.js +2 -0
  71. package/dist/main/effect/Ajax/Window/data/types.js.map +1 -0
  72. package/dist/main/effect/Ajax/Window/index.js +2 -0
  73. package/dist/main/effect/Ajax/Window/index.js.map +1 -0
  74. package/dist/main/effect/Ajax/index.js +2 -0
  75. package/dist/main/effect/Ajax/index.js.map +1 -0
  76. package/dist/main/effect/Logging/index.js +2 -0
  77. package/dist/main/effect/Logging/index.js.map +1 -0
  78. package/dist/main/effect/Resource/data.js +3 -0
  79. package/dist/main/effect/Resource/data.js.map +1 -0
  80. package/dist/main/effect/Resource/index.js +2 -0
  81. package/dist/main/effect/Resource/index.js.map +1 -0
  82. package/dist/main/effect/Resource/schema.js +3 -0
  83. package/dist/main/effect/Resource/schema.js.map +1 -0
  84. package/dist/main/effect/index.js +2 -0
  85. package/dist/main/effect/index.js.map +1 -0
  86. package/dist/main/index.d.ts +77 -0
  87. package/dist/main/index.js +2 -0
  88. package/dist/main/index.js.map +1 -0
  89. package/dist/main/resources/index.js +2 -0
  90. package/dist/main/resources/index.js.map +1 -0
  91. package/package.json +38 -0
@@ -0,0 +1,2 @@
1
+ import*as schema_js from'./schema.js';export{schema_js as Sections };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as e from'effect/Schema';const r=e.Struct({sections:e.optional(e.String),sections_url:e.optional(e.String)}),s=t=>Array.from(new Set(t.split(",").map(n=>n.trim())));function o(t){const n=s(t);return e.Record({key:e.Literal(...n),value:e.NullOr(e.String)})}export{r as Input,o as makeResponseSchema};//# sourceMappingURL=schema.js.map
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Ajax/Sections/schema.ts"],"names":["Input","Schema","parseKeys","keys","key","makeResponseSchema","input"],"mappings":"gCAGaA,MAAAA,CAAAA,CAAQC,CAAO,CAAA,MAAA,CAAO,CACjC,QAAA,CAAUA,CAAO,CAAA,QAAA,CAASA,CAAO,CAAA,MAAM,EACvC,YAAcA,CAAAA,CAAAA,CAAO,QAASA,CAAAA,CAAAA,CAAO,MAAM,CAC7C,CAAC,CAAA,CAOKC,CAAqCC,CAAAA,CAAAA,EACzC,KAAM,CAAA,IAAA,CACJ,IAAI,GAAA,CAAIA,CAAK,CAAA,KAAA,CAAM,GAAG,CAAE,CAAA,GAAA,CAAKC,CAAQA,EAAAA,CAAAA,CAAI,IAAK,EAAC,CAAC,CAClD,EAEK,SAASC,CAA2CC,CAAAA,CAAAA,CAAU,CACnE,MAAMH,CAAOD,CAAAA,CAAAA,CAAUI,CAAK,CAC5B,CAAA,OAAOL,CAAO,CAAA,MAAA,CAAO,CACnB,GAAA,CAAKA,CAAO,CAAA,OAAA,CAAQ,GAAGE,CAAI,CAAA,CAC3B,KAAOF,CAAAA,CAAAA,CAAO,MAAOA,CAAAA,CAAAA,CAAO,MAAM,CACpC,CAAC,CACH","file":"schema.js","sourcesContent":["import * as Schema from \"effect/Schema\";\n\nexport type Input = typeof Input;\nexport const Input = Schema.Struct({\n sections: Schema.optional(Schema.String),\n sections_url: Schema.optional(Schema.String),\n});\n\n// Helper type to convert a string to a tuple of unique literals\ntype UniqueKeys<T extends string> = T extends `${infer K},${infer Rest}`\n ? K | UniqueKeys<Rest>\n : T;\n\nconst parseKeys = <const T extends string>(keys: T) =>\n Array.from(\n new Set(keys.split(\",\").map((key) => key.trim())),\n ) as UniqueKeys<T>[];\n\nexport function makeResponseSchema<const T extends string>(input: T) {\n const keys = parseKeys(input);\n return Schema.Record({\n key: Schema.Literal(...keys),\n value: Schema.NullOr(Schema.String),\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import*as r from'effect/Data';const o={account_addresses_url:"/account/addresses",account_login_url:"/account/login",account_logout_url:"/account/logout",account_recover_url:"/account/recover",account_register_url:"/account/register",account_url:"/account",all_products_collection_url:"/collections/all",cart_add_url:"/cart/add.js",cart_change_url:"/cart/change.js",cart_clear_url:"/cart/clear.js",cart_update_url:"/cart/update.js",cart_url:"/cart.js",collections_url:"/collections",predictive_search_url:"/search/suggest",product_recommendations_url:"/recommendations/products",root_url:"/",search_url:"/search",storefront_login_url:"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"};class c extends r.Class{constructor(){super({...o,...window?.Shopify?.routes||{}});}}const e=()=>r.case()({...o,...window?.Shopify?.routes||{}});export{o as Defaults,c as ShopifyRoutes,e as make};//# sourceMappingURL=ShopifyRoutes.js.map
2
+ //# sourceMappingURL=ShopifyRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":["Defaults","ShopifyRoutes","Data","make"],"mappings":"8BAIO,MAAMA,CAA2B,CAAA,CACtC,sBAAuB,oBACvB,CAAA,iBAAA,CAAmB,gBACnB,CAAA,kBAAA,CAAoB,kBACpB,mBAAqB,CAAA,kBAAA,CACrB,oBAAsB,CAAA,mBAAA,CACtB,YAAa,UACb,CAAA,2BAAA,CAA6B,kBAC7B,CAAA,YAAA,CAAc,eACd,eAAiB,CAAA,iBAAA,CACjB,cAAgB,CAAA,gBAAA,CAChB,gBAAiB,iBACjB,CAAA,QAAA,CAAU,UACV,CAAA,eAAA,CAAiB,eACjB,qBAAuB,CAAA,iBAAA,CACvB,4BAA6B,2BAC7B,CAAA,QAAA,CAAU,IACV,UAAY,CAAA,SAAA,CACZ,oBACE,CAAA,6HACJ,EAEO,MAAMC,CAAAA,SAAsBC,CAAK,CAAA,KAAsB,CAC5D,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAGF,CACH,CAAA,GAAI,MAAQ,EAAA,OAAA,EAAS,QAAU,EACjC,CAAC,EACH,CACF,CAEO,MAAMG,CAAO,CAAA,IAClBD,EAAK,IAAoB,EAAA,CAAE,CACzB,GAAGF,EACH,GAAI,MAAA,EAAQ,SAAS,MAAU,EAAA,EACjC,CAAC","file":"ShopifyRoutes.js","sourcesContent":["import type { IShopifyRoutes } from \"./types.js\";\n\nimport * as Data from \"effect/Data\";\n\nexport const Defaults: IShopifyRoutes = {\n account_addresses_url: \"/account/addresses\",\n account_login_url: \"/account/login\",\n account_logout_url: \"/account/logout\",\n account_recover_url: \"/account/recover\",\n account_register_url: \"/account/register\",\n account_url: \"/account\",\n all_products_collection_url: \"/collections/all\",\n cart_add_url: \"/cart/add.js\",\n cart_change_url: \"/cart/change.js\",\n cart_clear_url: \"/cart/clear.js\",\n cart_update_url: \"/cart/update.js\",\n cart_url: \"/cart.js\",\n collections_url: \"/collections\",\n predictive_search_url: \"/search/suggest\",\n product_recommendations_url: \"/recommendations/products\",\n root_url: \"/\",\n search_url: \"/search\",\n storefront_login_url:\n \"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en\",\n};\n\nexport class ShopifyRoutes extends Data.Class<IShopifyRoutes> {\n constructor() {\n super({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n }\n}\n\nexport const make = () =>\n Data.case<ShopifyRoutes>()({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as o from'effect/Data';class n extends o.Class{constructor(){super({...window.Shopify.storefront.config});}}const r=()=>o.case()({...window.Shopify.storefront.config});export{n as StorefrontClientConfig,r as make};//# sourceMappingURL=StorefrontClientConfig.js.map
2
+ //# sourceMappingURL=StorefrontClientConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":["StorefrontClientConfig","Data","make"],"mappings":"8BAIO,MAAMA,CAAAA,SAA+BC,EAAK,KAA+B,CAC9E,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAG,MAAA,CAAO,QAAQ,UAAW,CAAA,MAC/B,CAAC,EACH,CACF,CAEaC,MAAAA,CAAAA,CAAO,IAClBD,CAAK,CAAA,IAAA,EAA+B,CAAA,CAClC,GAAG,MAAA,CAAO,OAAQ,CAAA,UAAA,CAAW,MAC/B,CAAC","file":"StorefrontClientConfig.js","sourcesContent":["import type { IStorefrontClientConfig } from \"./types.js\";\n\nimport * as Data from \"effect/Data\";\n\nexport class StorefrontClientConfig extends Data.Class<IStorefrontClientConfig> {\n constructor() {\n super({\n ...window.Shopify.storefront.config,\n });\n }\n}\n\nexport const make = () =>\n Data.case<StorefrontClientConfig>()({\n ...window.Shopify.storefront.config,\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as ShopifyRoutes_js from'./ShopifyRoutes.js';export{ShopifyRoutes_js as ShopifyRoutes };import*as StorefrontClientConfig_js from'./StorefrontClientConfig.js';export{StorefrontClientConfig_js as StorefrontClientConfig };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -0,0 +1,2 @@
1
+ import*as index_js from'./data/index.js';export{index_js as Window };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ export*from'./Window';export*from'./Sections';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as o from'effect/Effect';import*as r from'effect/FiberRef';import'effect/LogLevel';const f=(e,t)=>o.gen(function*(){if((yield*r.get(r.currentMinimumLogLevel))._tag!==e._tag)return yield*t}),n=e=>t=>o.withLogSpan(`${e}:${t}`);export{f as filterLevelOrNever,n as makeNamespacedLogSpan};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/effect/Logging/index.ts"],"names":["filterLevelOrNever","level","effect","Effect","FiberRef","makeNamespacedLogSpan","prefix","label"],"mappings":"0FAIaA,MAAAA,CAAAA,CAAqB,CAChCC,CAAAA,CACAC,IAEAC,CAAO,CAAA,GAAA,CAAI,WAAa,CAEtB,GAAA,CADiB,MAAOC,CAAS,CAAA,GAAA,CAAIA,CAAS,CAAA,sBAAsB,GACvD,IAASH,GAAAA,CAAAA,CAAM,KAAM,OAAO,MAAOC,CAClD,CAAC,CAAA,CAEUG,CAAyBC,CAAAA,CAAAA,EAAoBC,GACxDJ,CAAO,CAAA,WAAA,CAAY,GAAGG,CAAM,CAAA,CAAA,EAAIC,CAAK,CAAE,CAAA","file":"index.js","sourcesContent":["import * as Effect from \"effect/Effect\";\nimport * as FiberRef from \"effect/FiberRef\";\nimport * as LogLevel from \"effect/LogLevel\";\n\nexport const filterLevelOrNever = <A, E, R>(\n level: LogLevel.LogLevel,\n effect: Effect.Effect<A, E, R>\n) =>\n Effect.gen(function* () {\n const logLevel = yield* FiberRef.get(FiberRef.currentMinimumLogLevel);\n if (logLevel._tag !== level._tag) return yield* effect;\n });\n\nexport const makeNamespacedLogSpan = (prefix: string) => (label: string) =>\n Effect.withLogSpan(`${prefix}:${label}`);\n"]}
@@ -0,0 +1,3 @@
1
+ import*as s from'effect/Effect';import*as t from'effect/Schema';import {ID,Type,GID}from'./schema.js';const i=({id:e,type:r})=>s.gen(function*(){const o=yield*t.decode(ID)(e);return `gid://shopify/${yield*t.decode(Type)(r)}/${o}`}),d=e=>t.decode(GID)(e);
2
+ export{i as format,d as parse};//# sourceMappingURL=data.js.map
3
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/effect/Resource/data.ts"],"names":["format","id","type","Effect","actualId","Schema","ID","Type","parse","input","GID"],"mappings":"sGAWaA,MAAAA,CAAAA,CAAS,CAA2C,CAC/D,EAAAC,CAAAA,CAAAA,CACA,IAAAC,CAAAA,CACF,CAKEC,GAAAA,CAAAA,CAAO,GAAI,CAAA,WAAa,CACtB,MAAMC,EAAW,MAAOC,CAAAA,CAAO,MAAOC,CAAAA,EAAE,CAAEL,CAAAA,CAAE,CAE5C,CAAA,OAAO,CADY,cAAA,EAAA,MAAOI,CAAO,CAAA,MAAA,CAAOE,IAAI,CAAA,CAAEL,CAAI,CAChB,CAAA,CAAA,EAAIE,CAAQ,CAAA,CAChD,CAAC,CAAA,CAEUI,CACXC,CAAAA,CAAAA,EAC6CJ,CAAO,CAAA,MAAA,CAAOK,GAAG,CAAA,CAAED,CAAK","file":"data.js","sourcesContent":["import type { ParseError } from \"effect/ParseResult\";\n\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\nimport { ID, GID, Type } from \"./schema.js\";\n\ntype FormatOptions<T extends ID, R extends Type> = {\n id: T;\n type: R;\n};\n\nexport const format = <const T extends ID, const R extends Type>({\n id,\n type,\n}: FormatOptions<T, R>): Effect.Effect<\n `gid://shopify/${R}/${T}`,\n ParseError,\n never\n> =>\n Effect.gen(function* () {\n const actualId = yield* Schema.decode(ID)(id);\n const actualType = yield* Schema.decode(Type)(type);\n return `gid://shopify/${actualType}/${actualId}` as `gid://shopify/${R}/${T}`;\n });\n\nexport const parse = (\n input: string\n): Effect.Effect<string, ParseError, never> => Schema.decode(GID)(input);\n"]}
@@ -0,0 +1,2 @@
1
+ export{GID,ID,Type}from'./schema.js';export*from'./data.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,3 @@
1
+ import*as e from'effect/Schema';const t=e.Literal("Cart","Collection","Customer","DeliveryCarrierService","DeliveryLocationGroup","DeliveryProfile","DeliveryZone","DraftOrder","DraftOrderLineItem","Duty","EmailTemplate","Fulfillment","FulfullmentEvent","FullfullmentService","InventoryItem","InventoryLevel","LineItem","Location","MarketingEvent","MediaImage","Metafield","OnlineStoreArticle","OnlineStoreBlog","OnlineStorePage","Order","OrderTransaction","Product","ProductImage","ProductVariant","Refund","Shop","StaffMember","Theme"),r=e.String.pipe(e.startsWith("gid://shopify/")),o=e.Union(e.Number,e.NumberFromString);
2
+ export{r as GID,o as ID,t as Type};//# sourceMappingURL=schema.js.map
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/effect/Resource/schema.ts"],"names":["Type","Schema","GID","ID"],"mappings":"gCAGO,MAAMA,CAAOC,CAAAA,CAAAA,CAAO,QACzB,MACA,CAAA,YAAA,CACA,UACA,CAAA,wBAAA,CACA,uBACA,CAAA,iBAAA,CACA,eACA,YACA,CAAA,oBAAA,CACA,MACA,CAAA,eAAA,CACA,aACA,CAAA,kBAAA,CACA,qBACA,CAAA,eAAA,CACA,gBACA,CAAA,UAAA,CACA,UACA,CAAA,gBAAA,CACA,YACA,CAAA,WAAA,CACA,qBACA,iBACA,CAAA,iBAAA,CACA,OACA,CAAA,kBAAA,CACA,SACA,CAAA,cAAA,CACA,gBACA,CAAA,QAAA,CACA,MACA,CAAA,aAAA,CACA,OACF,CAAA,CAGaC,CAAMD,CAAAA,CAAAA,CAAO,OAAO,IAAKA,CAAAA,CAAAA,CAAO,UAAW,CAAA,gBAAgB,CAAC,CAAA,CAG5DE,CAAKF,CAAAA,CAAAA,CAAO,KAAMA,CAAAA,CAAAA,CAAO,MAAQA,CAAAA,CAAAA,CAAO,gBAAgB","file":"schema.js","sourcesContent":["import * as Schema from \"effect/Schema\";\n\nexport type Type = Schema.Schema.Type<typeof Type>;\nexport const Type = Schema.Literal(\n \"Cart\",\n \"Collection\",\n \"Customer\",\n \"DeliveryCarrierService\",\n \"DeliveryLocationGroup\",\n \"DeliveryProfile\",\n \"DeliveryZone\",\n \"DraftOrder\",\n \"DraftOrderLineItem\",\n \"Duty\",\n \"EmailTemplate\",\n \"Fulfillment\",\n \"FulfullmentEvent\",\n \"FullfullmentService\",\n \"InventoryItem\",\n \"InventoryLevel\",\n \"LineItem\",\n \"Location\",\n \"MarketingEvent\",\n \"MediaImage\",\n \"Metafield\",\n \"OnlineStoreArticle\",\n \"OnlineStoreBlog\",\n \"OnlineStorePage\",\n \"Order\",\n \"OrderTransaction\",\n \"Product\",\n \"ProductImage\",\n \"ProductVariant\",\n \"Refund\",\n \"Shop\",\n \"StaffMember\",\n \"Theme\",\n);\n\nexport type GID = Schema.Schema.Encoded<typeof GID>;\nexport const GID = Schema.String.pipe(Schema.startsWith(\"gid://shopify/\"));\n\nexport type ID = Schema.Schema.Encoded<typeof ID>;\nexport const ID = Schema.Union(Schema.Number, Schema.NumberFromString);\n"]}
@@ -0,0 +1,130 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import * as Data from 'effect/Data';
4
+ import * as Effect from 'effect/Effect';
5
+ import * as LogLevel from 'effect/LogLevel';
6
+ import { ParseError } from 'effect/ParseResult';
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ export type Type = Schema.Schema.Type<typeof Type>;
10
+ declare const Type: Schema.Literal<[
11
+ "Cart",
12
+ "Collection",
13
+ "Customer",
14
+ "DeliveryCarrierService",
15
+ "DeliveryLocationGroup",
16
+ "DeliveryProfile",
17
+ "DeliveryZone",
18
+ "DraftOrder",
19
+ "DraftOrderLineItem",
20
+ "Duty",
21
+ "EmailTemplate",
22
+ "Fulfillment",
23
+ "FulfullmentEvent",
24
+ "FullfullmentService",
25
+ "InventoryItem",
26
+ "InventoryLevel",
27
+ "LineItem",
28
+ "Location",
29
+ "MarketingEvent",
30
+ "MediaImage",
31
+ "Metafield",
32
+ "OnlineStoreArticle",
33
+ "OnlineStoreBlog",
34
+ "OnlineStorePage",
35
+ "Order",
36
+ "OrderTransaction",
37
+ "Product",
38
+ "ProductImage",
39
+ "ProductVariant",
40
+ "Refund",
41
+ "Shop",
42
+ "StaffMember",
43
+ "Theme"
44
+ ]>;
45
+ export type GID = Schema.Schema.Encoded<typeof GID>;
46
+ declare const GID: Schema.filter<typeof Schema.String>;
47
+ export type ID = Schema.Schema.Encoded<typeof ID>;
48
+ declare const ID: Schema.Union<[
49
+ typeof Schema.Number,
50
+ typeof Schema.NumberFromString
51
+ ]>;
52
+ export type FormatOptions<T extends ID, R extends Type> = {
53
+ id: T;
54
+ type: R;
55
+ };
56
+ declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
57
+ declare const parse: (input: string) => Effect.Effect<string, ParseError, never>;
58
+ export interface IShopifyRoutes {
59
+ readonly account_addresses_url: string;
60
+ readonly account_login_url: string;
61
+ readonly account_logout_url: string;
62
+ readonly account_recover_url: string;
63
+ readonly account_register_url: string;
64
+ readonly account_url: string;
65
+ readonly all_products_collection_url: string;
66
+ readonly cart_add_url: string;
67
+ readonly cart_change_url: string;
68
+ readonly cart_clear_url: string;
69
+ readonly cart_update_url: string;
70
+ readonly cart_url: string;
71
+ readonly collections_url: string;
72
+ readonly predictive_search_url: string;
73
+ readonly product_recommendations_url: string;
74
+ readonly root_url: string;
75
+ readonly search_url: string;
76
+ readonly storefront_login_url: string;
77
+ }
78
+ export interface IStorefrontClientConfig {
79
+ readonly accessToken: string;
80
+ readonly shopName: string;
81
+ apiVersion: string;
82
+ }
83
+ declare const Defaults: IShopifyRoutes;
84
+ declare class ShopifyRoutes extends Data.Class<IShopifyRoutes> {
85
+ constructor();
86
+ }
87
+ declare const make: () => ShopifyRoutes;
88
+ declare class StorefrontClientConfig extends Data.Class<IStorefrontClientConfig> {
89
+ constructor();
90
+ }
91
+ declare const make$1: () => StorefrontClientConfig;
92
+ export type Input = typeof Input;
93
+ declare const Input: Schema.Struct<{
94
+ sections: Schema.optional<typeof Schema.String>;
95
+ sections_url: Schema.optional<typeof Schema.String>;
96
+ }>;
97
+ export type UniqueKeys<T extends string> = T extends `${infer K},${infer Rest}` ? K | UniqueKeys<Rest> : T;
98
+ declare function makeResponseSchema<const T extends string>(input: T): Schema.Record$<Schema.SchemaClass<UniqueKeys<T>, UniqueKeys<T>, never>, Schema.NullOr<typeof Schema.String>>;
99
+ declare const filterLevelOrNever: <A, E, R>(level: LogLevel.LogLevel, effect: Effect.Effect<A, E, R>) => Effect.Effect<A | undefined, E, R>;
100
+ declare const makeNamespacedLogSpan: (prefix: string) => (label: string) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
101
+
102
+ declare namespace StorefrontClientConfig$1 {
103
+ export { StorefrontClientConfig, make$1 as make };
104
+ }
105
+ declare namespace ShopifyRoutes$1 {
106
+ export { Defaults, ShopifyRoutes, make };
107
+ }
108
+ declare namespace Window$1 {
109
+ export { ShopifyRoutes$1 as ShopifyRoutes, StorefrontClientConfig$1 as StorefrontClientConfig };
110
+ }
111
+ declare namespace Sections {
112
+ export { Input, makeResponseSchema };
113
+ }
114
+ declare namespace Logging {
115
+ export { filterLevelOrNever, makeNamespacedLogSpan };
116
+ }
117
+ declare namespace Resource {
118
+ export { GID, ID, Type, format, parse };
119
+ }
120
+ declare namespace Ajax {
121
+ export { Sections, Window$1 as Window };
122
+ }
123
+
124
+ export {
125
+ Ajax,
126
+ Logging,
127
+ Resource,
128
+ };
129
+
130
+ export {};
@@ -0,0 +1,2 @@
1
+ import*as index_js$2 from'./Resource/index.js';export{index_js$2 as Resource };import*as index_js from'./Ajax/index.js';export{index_js as Ajax };import*as index_js$1 from'./Logging/index.js';export{index_js$1 as Logging };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,77 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ import * as LogLevel from 'effect/LogLevel';
5
+ import { ParseError } from 'effect/ParseResult';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ export type Type = Schema.Schema.Type<typeof Type>;
9
+ declare const Type: Schema.Literal<[
10
+ "Cart",
11
+ "Collection",
12
+ "Customer",
13
+ "DeliveryCarrierService",
14
+ "DeliveryLocationGroup",
15
+ "DeliveryProfile",
16
+ "DeliveryZone",
17
+ "DraftOrder",
18
+ "DraftOrderLineItem",
19
+ "Duty",
20
+ "EmailTemplate",
21
+ "Fulfillment",
22
+ "FulfullmentEvent",
23
+ "FullfullmentService",
24
+ "InventoryItem",
25
+ "InventoryLevel",
26
+ "LineItem",
27
+ "Location",
28
+ "MarketingEvent",
29
+ "MediaImage",
30
+ "Metafield",
31
+ "OnlineStoreArticle",
32
+ "OnlineStoreBlog",
33
+ "OnlineStorePage",
34
+ "Order",
35
+ "OrderTransaction",
36
+ "Product",
37
+ "ProductImage",
38
+ "ProductVariant",
39
+ "Refund",
40
+ "Shop",
41
+ "StaffMember",
42
+ "Theme"
43
+ ]>;
44
+ export type GID = Schema.Schema.Encoded<typeof GID>;
45
+ declare const GID: Schema.filter<typeof Schema.String>;
46
+ export type ID = Schema.Schema.Encoded<typeof ID>;
47
+ declare const ID: Schema.Union<[
48
+ typeof Schema.Number,
49
+ typeof Schema.NumberFromString
50
+ ]>;
51
+ export type FormatOptions<T extends ID, R extends Type> = {
52
+ id: T;
53
+ type: R;
54
+ };
55
+ declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
56
+ declare const parse: (i: string, overrideOptions?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<string, ParseError, never>;
57
+ export declare const parseResource: (gid: Resource.GID) => string;
58
+ export type FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {
59
+ id: T;
60
+ type: R;
61
+ };
62
+ export declare const formatResource: <const T extends Resource.ID, const R extends Resource.Type>(options: FormatResourceOptions<T, R>) => `gid://shopify/${R}/${T}`;
63
+ type ID$1 = Resource.ID;
64
+ type GID$1 = Resource.GID;
65
+ type Type$1 = Resource.Type;
66
+
67
+ declare namespace Resource {
68
+ export { GID, ID, Type, format, parse };
69
+ }
70
+
71
+ export {
72
+ GID$1 as GID,
73
+ ID$1 as ID,
74
+ Type$1 as Type,
75
+ };
76
+
77
+ export {};
@@ -0,0 +1,2 @@
1
+ import*as schema_js from'./schema.js';export{schema_js as Sections };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as e from'/npm/effect@3.13.4/Schema/+esm';const r=e.Struct({sections:e.optional(e.String),sections_url:e.optional(e.String)}),s=t=>Array.from(new Set(t.split(",").map(n=>n.trim())));function o(t){const n=s(t);return e.Record({key:e.Literal(...n),value:e.NullOr(e.String)})}export{r as Input,o as makeResponseSchema};//# sourceMappingURL=schema.js.map
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/effect/Ajax/Sections/schema.ts"],"names":["Input","Schema","parseKeys","keys","key","makeResponseSchema","input"],"mappings":"iDAGaA,MAAAA,CAAAA,CAAQC,CAAO,CAAA,MAAA,CAAO,CACjC,QAAA,CAAUA,CAAO,CAAA,QAAA,CAASA,CAAO,CAAA,MAAM,EACvC,YAAcA,CAAAA,CAAAA,CAAO,QAASA,CAAAA,CAAAA,CAAO,MAAM,CAC7C,CAAC,CAAA,CAOKC,CAAqCC,CAAAA,CAAAA,EACzC,KAAM,CAAA,IAAA,CACJ,IAAI,GAAA,CAAIA,CAAK,CAAA,KAAA,CAAM,GAAG,CAAE,CAAA,GAAA,CAAKC,CAAQA,EAAAA,CAAAA,CAAI,IAAK,EAAC,CAAC,CAClD,EAEK,SAASC,CAA2CC,CAAAA,CAAAA,CAAU,CACnE,MAAMH,CAAOD,CAAAA,CAAAA,CAAUI,CAAK,CAC5B,CAAA,OAAOL,CAAO,CAAA,MAAA,CAAO,CACnB,GAAA,CAAKA,CAAO,CAAA,OAAA,CAAQ,GAAGE,CAAI,CAAA,CAC3B,KAAOF,CAAAA,CAAAA,CAAO,MAAOA,CAAAA,CAAAA,CAAO,MAAM,CACpC,CAAC,CACH","file":"schema.js","sourcesContent":["import * as Schema from \"/npm/effect@3.13.4/Schema/+esm\";\n\nexport type Input = typeof Input;\nexport const Input = Schema.Struct({\n sections: Schema.optional(Schema.String),\n sections_url: Schema.optional(Schema.String),\n});\n\n// Helper type to convert a string to a tuple of unique literals\ntype UniqueKeys<T extends string> = T extends `${infer K},${infer Rest}`\n ? K | UniqueKeys<Rest>\n : T;\n\nconst parseKeys = <const T extends string>(keys: T) =>\n Array.from(\n new Set(keys.split(\",\").map((key) => key.trim())),\n ) as UniqueKeys<T>[];\n\nexport function makeResponseSchema<const T extends string>(input: T) {\n const keys = parseKeys(input);\n return Schema.Record({\n key: Schema.Literal(...keys),\n value: Schema.NullOr(Schema.String),\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import*as r from'/npm/effect@3.13.4/Data/+esm';const o={account_addresses_url:"/account/addresses",account_login_url:"/account/login",account_logout_url:"/account/logout",account_recover_url:"/account/recover",account_register_url:"/account/register",account_url:"/account",all_products_collection_url:"/collections/all",cart_add_url:"/cart/add.js",cart_change_url:"/cart/change.js",cart_clear_url:"/cart/clear.js",cart_update_url:"/cart/update.js",cart_url:"/cart.js",collections_url:"/collections",predictive_search_url:"/search/suggest",product_recommendations_url:"/recommendations/products",root_url:"/",search_url:"/search",storefront_login_url:"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"};class c extends r.Class{constructor(){super({...o,...window?.Shopify?.routes||{}});}}const e=()=>r.case()({...o,...window?.Shopify?.routes||{}});export{o as Defaults,c as ShopifyRoutes,e as make};//# sourceMappingURL=ShopifyRoutes.js.map
2
+ //# sourceMappingURL=ShopifyRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":["Defaults","ShopifyRoutes","Data","make"],"mappings":"+CAIO,MAAMA,CAA2B,CAAA,CACtC,sBAAuB,oBACvB,CAAA,iBAAA,CAAmB,gBACnB,CAAA,kBAAA,CAAoB,kBACpB,mBAAqB,CAAA,kBAAA,CACrB,oBAAsB,CAAA,mBAAA,CACtB,YAAa,UACb,CAAA,2BAAA,CAA6B,kBAC7B,CAAA,YAAA,CAAc,eACd,eAAiB,CAAA,iBAAA,CACjB,cAAgB,CAAA,gBAAA,CAChB,gBAAiB,iBACjB,CAAA,QAAA,CAAU,UACV,CAAA,eAAA,CAAiB,eACjB,qBAAuB,CAAA,iBAAA,CACvB,4BAA6B,2BAC7B,CAAA,QAAA,CAAU,IACV,UAAY,CAAA,SAAA,CACZ,oBACE,CAAA,6HACJ,EAEO,MAAMC,CAAAA,SAAsBC,CAAK,CAAA,KAAsB,CAC5D,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAGF,CACH,CAAA,GAAI,MAAQ,EAAA,OAAA,EAAS,QAAU,EACjC,CAAC,EACH,CACF,CAEO,MAAMG,CAAO,CAAA,IAClBD,EAAK,IAAoB,EAAA,CAAE,CACzB,GAAGF,EACH,GAAI,MAAA,EAAQ,SAAS,MAAU,EAAA,EACjC,CAAC","file":"ShopifyRoutes.js","sourcesContent":["import type { IShopifyRoutes } from \"./types.js\";\n\nimport * as Data from \"/npm/effect@3.13.4/Data/+esm\";\n\nexport const Defaults: IShopifyRoutes = {\n account_addresses_url: \"/account/addresses\",\n account_login_url: \"/account/login\",\n account_logout_url: \"/account/logout\",\n account_recover_url: \"/account/recover\",\n account_register_url: \"/account/register\",\n account_url: \"/account\",\n all_products_collection_url: \"/collections/all\",\n cart_add_url: \"/cart/add.js\",\n cart_change_url: \"/cart/change.js\",\n cart_clear_url: \"/cart/clear.js\",\n cart_update_url: \"/cart/update.js\",\n cart_url: \"/cart.js\",\n collections_url: \"/collections\",\n predictive_search_url: \"/search/suggest\",\n product_recommendations_url: \"/recommendations/products\",\n root_url: \"/\",\n search_url: \"/search\",\n storefront_login_url:\n \"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en\",\n};\n\nexport class ShopifyRoutes extends Data.Class<IShopifyRoutes> {\n constructor() {\n super({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n }\n}\n\nexport const make = () =>\n Data.case<ShopifyRoutes>()({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as o from'/npm/effect@3.13.4/Data/+esm';class n extends o.Class{constructor(){super({...window.Shopify.storefront.config});}}const r=()=>o.case()({...window.Shopify.storefront.config});export{n as StorefrontClientConfig,r as make};//# sourceMappingURL=StorefrontClientConfig.js.map
2
+ //# sourceMappingURL=StorefrontClientConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":["StorefrontClientConfig","Data","make"],"mappings":"+CAIO,MAAMA,CAAAA,SAA+BC,EAAK,KAA+B,CAC9E,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAG,MAAA,CAAO,QAAQ,UAAW,CAAA,MAC/B,CAAC,EACH,CACF,CAEaC,MAAAA,CAAAA,CAAO,IAClBD,CAAK,CAAA,IAAA,EAA+B,CAAA,CAClC,GAAG,MAAA,CAAO,OAAQ,CAAA,UAAA,CAAW,MAC/B,CAAC","file":"StorefrontClientConfig.js","sourcesContent":["import type { IStorefrontClientConfig } from \"./types.js\";\n\nimport * as Data from \"/npm/effect@3.13.4/Data/+esm\";\n\nexport class StorefrontClientConfig extends Data.Class<IStorefrontClientConfig> {\n constructor() {\n super({\n ...window.Shopify.storefront.config,\n });\n }\n}\n\nexport const make = () =>\n Data.case<StorefrontClientConfig>()({\n ...window.Shopify.storefront.config,\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as ShopifyRoutes_js from'./ShopifyRoutes.js';export{ShopifyRoutes_js as ShopifyRoutes };import*as StorefrontClientConfig_js from'./StorefrontClientConfig.js';export{StorefrontClientConfig_js as StorefrontClientConfig };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -0,0 +1,2 @@
1
+ import*as index_js from'./data/index.js';export{index_js as Window };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ export*from'./Window';export*from'./Sections';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as o from'/npm/effect@3.13.4/Effect/+esm';import*as r from'/npm/effect@3.13.4/FiberRef/+esm';import'/npm/effect@3.13.4/LogLevel/+esm';const f=(e,t)=>o.gen(function*(){if((yield*r.get(r.currentMinimumLogLevel))._tag!==e._tag)return yield*t}),n=e=>t=>o.withLogSpan(`${e}:${t}`);export{f as filterLevelOrNever,n as makeNamespacedLogSpan};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Logging/index.ts"],"names":["filterLevelOrNever","level","effect","Effect","FiberRef","makeNamespacedLogSpan","prefix","label"],"mappings":"6IAIaA,MAAAA,CAAAA,CAAqB,CAChCC,CAAAA,CACAC,IAEAC,CAAO,CAAA,GAAA,CAAI,WAAa,CAEtB,GAAA,CADiB,MAAOC,CAAS,CAAA,GAAA,CAAIA,CAAS,CAAA,sBAAsB,GACvD,IAASH,GAAAA,CAAAA,CAAM,KAAM,OAAO,MAAOC,CAClD,CAAC,CAAA,CAEUG,CAAyBC,CAAAA,CAAAA,EAAoBC,GACxDJ,CAAO,CAAA,WAAA,CAAY,GAAGG,CAAM,CAAA,CAAA,EAAIC,CAAK,CAAE,CAAA","file":"index.js","sourcesContent":["import * as Effect from \"/npm/effect@3.13.4/Effect/+esm\";\nimport * as FiberRef from \"/npm/effect@3.13.4/FiberRef/+esm\";\nimport * as LogLevel from \"/npm/effect@3.13.4/LogLevel/+esm\";\n\nexport const filterLevelOrNever = <A, E, R>(\n level: LogLevel.LogLevel,\n effect: Effect.Effect<A, E, R>\n) =>\n Effect.gen(function* () {\n const logLevel = yield* FiberRef.get(FiberRef.currentMinimumLogLevel);\n if (logLevel._tag !== level._tag) return yield* effect;\n });\n\nexport const makeNamespacedLogSpan = (prefix: string) => (label: string) =>\n Effect.withLogSpan(`${prefix}:${label}`);\n"]}
@@ -0,0 +1,3 @@
1
+ import*as s from'/npm/effect@3.13.4/Effect/+esm';import*as t from'/npm/effect@3.13.4/Schema/+esm';import {ID,Type,GID}from'./schema.js';const i=({id:e,type:r})=>s.gen(function*(){const o=yield*t.decode(ID)(e);return `gid://shopify/${yield*t.decode(Type)(r)}/${o}`}),d=e=>t.decode(GID)(e);
2
+ export{i as format,d as parse};//# sourceMappingURL=data.js.map
3
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Resource/data.ts"],"names":["format","id","type","Effect","actualId","Schema","ID","Type","parse","input","GID"],"mappings":"wIAWaA,MAAAA,CAAAA,CAAS,CAA2C,CAC/D,EAAAC,CAAAA,CAAAA,CACA,IAAAC,CAAAA,CACF,CAKEC,GAAAA,CAAAA,CAAO,GAAI,CAAA,WAAa,CACtB,MAAMC,EAAW,MAAOC,CAAAA,CAAO,MAAOC,CAAAA,EAAE,CAAEL,CAAAA,CAAE,CAE5C,CAAA,OAAO,CADY,cAAA,EAAA,MAAOI,CAAO,CAAA,MAAA,CAAOE,IAAI,CAAA,CAAEL,CAAI,CAChB,CAAA,CAAA,EAAIE,CAAQ,CAAA,CAChD,CAAC,CAAA,CAEUI,CACXC,CAAAA,CAAAA,EAC6CJ,CAAO,CAAA,MAAA,CAAOK,GAAG,CAAA,CAAED,CAAK","file":"data.js","sourcesContent":["import type { ParseError } from \"/npm/effect@3.13.4/ParseResult/+esm\";\n\nimport * as Effect from \"/npm/effect@3.13.4/Effect/+esm\";\nimport * as Schema from \"/npm/effect@3.13.4/Schema/+esm\";\nimport { ID, GID, Type } from \"./schema.js\";\n\ntype FormatOptions<T extends ID, R extends Type> = {\n id: T;\n type: R;\n};\n\nexport const format = <const T extends ID, const R extends Type>({\n id,\n type,\n}: FormatOptions<T, R>): Effect.Effect<\n `gid://shopify/${R}/${T}`,\n ParseError,\n never\n> =>\n Effect.gen(function* () {\n const actualId = yield* Schema.decode(ID)(id);\n const actualType = yield* Schema.decode(Type)(type);\n return `gid://shopify/${actualType}/${actualId}` as `gid://shopify/${R}/${T}`;\n });\n\nexport const parse = (\n input: string\n): Effect.Effect<string, ParseError, never> => Schema.decode(GID)(input);\n"]}
@@ -0,0 +1,2 @@
1
+ export{GID,ID,Type}from'./schema.js';export*from'./data.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,3 @@
1
+ import*as e from'/npm/effect@3.13.4/Schema/+esm';const t=e.Literal("Cart","Collection","Customer","DeliveryCarrierService","DeliveryLocationGroup","DeliveryProfile","DeliveryZone","DraftOrder","DraftOrderLineItem","Duty","EmailTemplate","Fulfillment","FulfullmentEvent","FullfullmentService","InventoryItem","InventoryLevel","LineItem","Location","MarketingEvent","MediaImage","Metafield","OnlineStoreArticle","OnlineStoreBlog","OnlineStorePage","Order","OrderTransaction","Product","ProductImage","ProductVariant","Refund","Shop","StaffMember","Theme"),r=e.String.pipe(e.startsWith("gid://shopify/")),o=e.Union(e.Number,e.NumberFromString);
2
+ export{r as GID,o as ID,t as Type};//# sourceMappingURL=schema.js.map
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Resource/schema.ts"],"names":["Type","Schema","GID","ID"],"mappings":"iDAGO,MAAMA,CAAOC,CAAAA,CAAAA,CAAO,QACzB,MACA,CAAA,YAAA,CACA,UACA,CAAA,wBAAA,CACA,uBACA,CAAA,iBAAA,CACA,eACA,YACA,CAAA,oBAAA,CACA,MACA,CAAA,eAAA,CACA,aACA,CAAA,kBAAA,CACA,qBACA,CAAA,eAAA,CACA,gBACA,CAAA,UAAA,CACA,UACA,CAAA,gBAAA,CACA,YACA,CAAA,WAAA,CACA,qBACA,iBACA,CAAA,iBAAA,CACA,OACA,CAAA,kBAAA,CACA,SACA,CAAA,cAAA,CACA,gBACA,CAAA,QAAA,CACA,MACA,CAAA,aAAA,CACA,OACF,CAAA,CAGaC,CAAMD,CAAAA,CAAAA,CAAO,OAAO,IAAKA,CAAAA,CAAAA,CAAO,UAAW,CAAA,gBAAgB,CAAC,CAAA,CAG5DE,CAAKF,CAAAA,CAAAA,CAAO,KAAMA,CAAAA,CAAAA,CAAO,MAAQA,CAAAA,CAAAA,CAAO,gBAAgB","file":"schema.js","sourcesContent":["import * as Schema from \"/npm/effect@3.13.4/Schema/+esm\";\n\nexport type Type = Schema.Schema.Type<typeof Type>;\nexport const Type = Schema.Literal(\n \"Cart\",\n \"Collection\",\n \"Customer\",\n \"DeliveryCarrierService\",\n \"DeliveryLocationGroup\",\n \"DeliveryProfile\",\n \"DeliveryZone\",\n \"DraftOrder\",\n \"DraftOrderLineItem\",\n \"Duty\",\n \"EmailTemplate\",\n \"Fulfillment\",\n \"FulfullmentEvent\",\n \"FullfullmentService\",\n \"InventoryItem\",\n \"InventoryLevel\",\n \"LineItem\",\n \"Location\",\n \"MarketingEvent\",\n \"MediaImage\",\n \"Metafield\",\n \"OnlineStoreArticle\",\n \"OnlineStoreBlog\",\n \"OnlineStorePage\",\n \"Order\",\n \"OrderTransaction\",\n \"Product\",\n \"ProductImage\",\n \"ProductVariant\",\n \"Refund\",\n \"Shop\",\n \"StaffMember\",\n \"Theme\",\n);\n\nexport type GID = Schema.Schema.Encoded<typeof GID>;\nexport const GID = Schema.String.pipe(Schema.startsWith(\"gid://shopify/\"));\n\nexport type ID = Schema.Schema.Encoded<typeof ID>;\nexport const ID = Schema.Union(Schema.Number, Schema.NumberFromString);\n"]}
@@ -0,0 +1,2 @@
1
+ import*as index_js$2 from'./Resource/index.js';export{index_js$2 as Resource };import*as index_js from'./Ajax/index.js';export{index_js as Ajax };import*as index_js$1 from'./Logging/index.js';export{index_js$1 as Logging };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,77 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ import * as LogLevel from 'effect/LogLevel';
5
+ import { ParseError } from 'effect/ParseResult';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ export type Type = Schema.Schema.Type<typeof Type>;
9
+ declare const Type: Schema.Literal<[
10
+ "Cart",
11
+ "Collection",
12
+ "Customer",
13
+ "DeliveryCarrierService",
14
+ "DeliveryLocationGroup",
15
+ "DeliveryProfile",
16
+ "DeliveryZone",
17
+ "DraftOrder",
18
+ "DraftOrderLineItem",
19
+ "Duty",
20
+ "EmailTemplate",
21
+ "Fulfillment",
22
+ "FulfullmentEvent",
23
+ "FullfullmentService",
24
+ "InventoryItem",
25
+ "InventoryLevel",
26
+ "LineItem",
27
+ "Location",
28
+ "MarketingEvent",
29
+ "MediaImage",
30
+ "Metafield",
31
+ "OnlineStoreArticle",
32
+ "OnlineStoreBlog",
33
+ "OnlineStorePage",
34
+ "Order",
35
+ "OrderTransaction",
36
+ "Product",
37
+ "ProductImage",
38
+ "ProductVariant",
39
+ "Refund",
40
+ "Shop",
41
+ "StaffMember",
42
+ "Theme"
43
+ ]>;
44
+ export type GID = Schema.Schema.Encoded<typeof GID>;
45
+ declare const GID: Schema.filter<typeof Schema.String>;
46
+ export type ID = Schema.Schema.Encoded<typeof ID>;
47
+ declare const ID: Schema.Union<[
48
+ typeof Schema.Number,
49
+ typeof Schema.NumberFromString
50
+ ]>;
51
+ export type FormatOptions<T extends ID, R extends Type> = {
52
+ id: T;
53
+ type: R;
54
+ };
55
+ declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
56
+ declare const parse: (input: string) => Effect.Effect<string, ParseError, never>;
57
+ export declare const parseResource: (gid: Resource.GID) => string;
58
+ export type FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {
59
+ id: T;
60
+ type: R;
61
+ };
62
+ export declare const formatResource: <const T extends Resource.ID, const R extends Resource.Type>(options: FormatResourceOptions<T, R>) => `gid://shopify/${R}/${T}`;
63
+ type ID$1 = Resource.ID;
64
+ type GID$1 = Resource.GID;
65
+ type Type$1 = Resource.Type;
66
+
67
+ declare namespace Resource {
68
+ export { GID, ID, Type, format, parse };
69
+ }
70
+
71
+ export {
72
+ GID$1 as GID,
73
+ ID$1 as ID,
74
+ Type$1 as Type,
75
+ };
76
+
77
+ export {};
@@ -0,0 +1,2 @@
1
+ export{formatResource,parseResource}from'./resources/index.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as o from'/npm/effect@3.13.4/Effect/+esm';import {Resource}from'../effect';const s=e=>o.runSync(Resource.parse(e)),c=e=>o.runSync(Resource.format(e));export{c as formatResource,s as parseResource};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/resources/index.ts"],"names":["parseResource","gid","Effect","Resource","formatResource","options"],"mappings":"kFAGO,MAAMA,CAAiBC,CAAAA,CAAAA,EAC5BC,CAAO,CAAA,OAAA,CAAQC,SAAS,KAAMF,CAAAA,CAAG,CAAC,CAAA,CAOvBG,CAIXC,CAAAA,CAAAA,EACGH,EAAO,OAAQC,CAAAA,QAAAA,CAAS,MAAaE,CAAAA,CAAO,CAAC","file":"index.js","sourcesContent":["import * as Effect from \"/npm/effect@3.13.4/Effect/+esm\";\nimport { Resource } from \"../effect\";\n\nexport const parseResource = (gid: Resource.GID) =>\n Effect.runSync(Resource.parse(gid));\n\ntype FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {\n id: T;\n type: R;\n};\n\nexport const formatResource = <\n const T extends Resource.ID,\n const R extends Resource.Type,\n>(\n options: FormatResourceOptions<T, R>\n) => Effect.runSync(Resource.format<T, R>(options));\n\nexport type ID = Resource.ID;\nexport type GID = Resource.GID;\nexport type Type = Resource.Type;\n"]}
@@ -0,0 +1,2 @@
1
+ import*as schema_js from'./schema.js';export{schema_js as Sections };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as e from'effect/Schema';const r=e.Struct({sections:e.optional(e.String),sections_url:e.optional(e.String)}),s=t=>Array.from(new Set(t.split(",").map(n=>n.trim())));function o(t){const n=s(t);return e.Record({key:e.Literal(...n),value:e.NullOr(e.String)})}export{r as Input,o as makeResponseSchema};//# sourceMappingURL=schema.js.map
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/effect/Ajax/Sections/schema.ts"],"names":["Input","Schema","parseKeys","keys","key","makeResponseSchema","input"],"mappings":"gCAGaA,MAAAA,CAAAA,CAAQC,CAAO,CAAA,MAAA,CAAO,CACjC,QAAA,CAAUA,CAAO,CAAA,QAAA,CAASA,CAAO,CAAA,MAAM,EACvC,YAAcA,CAAAA,CAAAA,CAAO,QAASA,CAAAA,CAAAA,CAAO,MAAM,CAC7C,CAAC,CAAA,CAOKC,CAAqCC,CAAAA,CAAAA,EACzC,KAAM,CAAA,IAAA,CACJ,IAAI,GAAA,CAAIA,CAAK,CAAA,KAAA,CAAM,GAAG,CAAE,CAAA,GAAA,CAAKC,CAAQA,EAAAA,CAAAA,CAAI,IAAK,EAAC,CAAC,CAClD,EAEK,SAASC,CAA2CC,CAAAA,CAAAA,CAAU,CACnE,MAAMH,CAAOD,CAAAA,CAAAA,CAAUI,CAAK,CAC5B,CAAA,OAAOL,CAAO,CAAA,MAAA,CAAO,CACnB,GAAA,CAAKA,CAAO,CAAA,OAAA,CAAQ,GAAGE,CAAI,CAAA,CAC3B,KAAOF,CAAAA,CAAAA,CAAO,MAAOA,CAAAA,CAAAA,CAAO,MAAM,CACpC,CAAC,CACH","file":"schema.js","sourcesContent":["import * as Schema from \"effect/Schema\";\n\nexport type Input = typeof Input;\nexport const Input = Schema.Struct({\n sections: Schema.optional(Schema.String),\n sections_url: Schema.optional(Schema.String),\n});\n\n// Helper type to convert a string to a tuple of unique literals\ntype UniqueKeys<T extends string> = T extends `${infer K},${infer Rest}`\n ? K | UniqueKeys<Rest>\n : T;\n\nconst parseKeys = <const T extends string>(keys: T) =>\n Array.from(\n new Set(keys.split(\",\").map((key) => key.trim())),\n ) as UniqueKeys<T>[];\n\nexport function makeResponseSchema<const T extends string>(input: T) {\n const keys = parseKeys(input);\n return Schema.Record({\n key: Schema.Literal(...keys),\n value: Schema.NullOr(Schema.String),\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import*as r from'effect/Data';const o={account_addresses_url:"/account/addresses",account_login_url:"/account/login",account_logout_url:"/account/logout",account_recover_url:"/account/recover",account_register_url:"/account/register",account_url:"/account",all_products_collection_url:"/collections/all",cart_add_url:"/cart/add.js",cart_change_url:"/cart/change.js",cart_clear_url:"/cart/clear.js",cart_update_url:"/cart/update.js",cart_url:"/cart.js",collections_url:"/collections",predictive_search_url:"/search/suggest",product_recommendations_url:"/recommendations/products",root_url:"/",search_url:"/search",storefront_login_url:"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"};class c extends r.Class{constructor(){super({...o,...window?.Shopify?.routes||{}});}}const e=()=>r.case()({...o,...window?.Shopify?.routes||{}});export{o as Defaults,c as ShopifyRoutes,e as make};//# sourceMappingURL=ShopifyRoutes.js.map
2
+ //# sourceMappingURL=ShopifyRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":["Defaults","ShopifyRoutes","Data","make"],"mappings":"8BAIO,MAAMA,CAA2B,CAAA,CACtC,sBAAuB,oBACvB,CAAA,iBAAA,CAAmB,gBACnB,CAAA,kBAAA,CAAoB,kBACpB,mBAAqB,CAAA,kBAAA,CACrB,oBAAsB,CAAA,mBAAA,CACtB,YAAa,UACb,CAAA,2BAAA,CAA6B,kBAC7B,CAAA,YAAA,CAAc,eACd,eAAiB,CAAA,iBAAA,CACjB,cAAgB,CAAA,gBAAA,CAChB,gBAAiB,iBACjB,CAAA,QAAA,CAAU,UACV,CAAA,eAAA,CAAiB,eACjB,qBAAuB,CAAA,iBAAA,CACvB,4BAA6B,2BAC7B,CAAA,QAAA,CAAU,IACV,UAAY,CAAA,SAAA,CACZ,oBACE,CAAA,6HACJ,EAEO,MAAMC,CAAAA,SAAsBC,CAAK,CAAA,KAAsB,CAC5D,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAGF,CACH,CAAA,GAAI,MAAQ,EAAA,OAAA,EAAS,QAAU,EACjC,CAAC,EACH,CACF,CAEO,MAAMG,CAAO,CAAA,IAClBD,EAAK,IAAoB,EAAA,CAAE,CACzB,GAAGF,EACH,GAAI,MAAA,EAAQ,SAAS,MAAU,EAAA,EACjC,CAAC","file":"ShopifyRoutes.js","sourcesContent":["import type { IShopifyRoutes } from \"./types.js\";\n\nimport * as Data from \"effect/Data\";\n\nexport const Defaults: IShopifyRoutes = {\n account_addresses_url: \"/account/addresses\",\n account_login_url: \"/account/login\",\n account_logout_url: \"/account/logout\",\n account_recover_url: \"/account/recover\",\n account_register_url: \"/account/register\",\n account_url: \"/account\",\n all_products_collection_url: \"/collections/all\",\n cart_add_url: \"/cart/add.js\",\n cart_change_url: \"/cart/change.js\",\n cart_clear_url: \"/cart/clear.js\",\n cart_update_url: \"/cart/update.js\",\n cart_url: \"/cart.js\",\n collections_url: \"/collections\",\n predictive_search_url: \"/search/suggest\",\n product_recommendations_url: \"/recommendations/products\",\n root_url: \"/\",\n search_url: \"/search\",\n storefront_login_url:\n \"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en\",\n};\n\nexport class ShopifyRoutes extends Data.Class<IShopifyRoutes> {\n constructor() {\n super({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n }\n}\n\nexport const make = () =>\n Data.case<ShopifyRoutes>()({\n ...Defaults,\n ...(window?.Shopify?.routes || {}),\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as o from'effect/Data';class n extends o.Class{constructor(){super({...window.Shopify.storefront.config});}}const r=()=>o.case()({...window.Shopify.storefront.config});export{n as StorefrontClientConfig,r as make};//# sourceMappingURL=StorefrontClientConfig.js.map
2
+ //# sourceMappingURL=StorefrontClientConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":["StorefrontClientConfig","Data","make"],"mappings":"8BAIO,MAAMA,CAAAA,SAA+BC,EAAK,KAA+B,CAC9E,WAAc,EAAA,CACZ,KAAM,CAAA,CACJ,GAAG,MAAA,CAAO,QAAQ,UAAW,CAAA,MAC/B,CAAC,EACH,CACF,CAEaC,MAAAA,CAAAA,CAAO,IAClBD,CAAK,CAAA,IAAA,EAA+B,CAAA,CAClC,GAAG,MAAA,CAAO,OAAQ,CAAA,UAAA,CAAW,MAC/B,CAAC","file":"StorefrontClientConfig.js","sourcesContent":["import type { IStorefrontClientConfig } from \"./types.js\";\n\nimport * as Data from \"effect/Data\";\n\nexport class StorefrontClientConfig extends Data.Class<IStorefrontClientConfig> {\n constructor() {\n super({\n ...window.Shopify.storefront.config,\n });\n }\n}\n\nexport const make = () =>\n Data.case<StorefrontClientConfig>()({\n ...window.Shopify.storefront.config,\n });\n"]}
@@ -0,0 +1,2 @@
1
+ import*as ShopifyRoutes_js from'./ShopifyRoutes.js';export{ShopifyRoutes_js as ShopifyRoutes };import*as StorefrontClientConfig_js from'./StorefrontClientConfig.js';export{StorefrontClientConfig_js as StorefrontClientConfig };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -0,0 +1,2 @@
1
+ import*as index_js from'./data/index.js';export{index_js as Window };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ export*from'./Window';export*from'./Sections';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as o from'effect/Effect';import*as r from'effect/FiberRef';import'effect/LogLevel';const f=(e,t)=>o.gen(function*(){if((yield*r.get(r.currentMinimumLogLevel))._tag!==e._tag)return yield*t}),n=e=>t=>o.withLogSpan(`${e}:${t}`);export{f as filterLevelOrNever,n as makeNamespacedLogSpan};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Logging/index.ts"],"names":["filterLevelOrNever","level","effect","Effect","FiberRef","makeNamespacedLogSpan","prefix","label"],"mappings":"0FAIaA,MAAAA,CAAAA,CAAqB,CAChCC,CAAAA,CACAC,IAEAC,CAAO,CAAA,GAAA,CAAI,WAAa,CAEtB,GAAA,CADiB,MAAOC,CAAS,CAAA,GAAA,CAAIA,CAAS,CAAA,sBAAsB,GACvD,IAASH,GAAAA,CAAAA,CAAM,KAAM,OAAO,MAAOC,CAClD,CAAC,CAAA,CAEUG,CAAyBC,CAAAA,CAAAA,EAAoBC,GACxDJ,CAAO,CAAA,WAAA,CAAY,GAAGG,CAAM,CAAA,CAAA,EAAIC,CAAK,CAAE,CAAA","file":"index.js","sourcesContent":["import * as Effect from \"effect/Effect\";\nimport * as FiberRef from \"effect/FiberRef\";\nimport * as LogLevel from \"effect/LogLevel\";\n\nexport const filterLevelOrNever = <A, E, R>(\n level: LogLevel.LogLevel,\n effect: Effect.Effect<A, E, R>\n) =>\n Effect.gen(function* () {\n const logLevel = yield* FiberRef.get(FiberRef.currentMinimumLogLevel);\n if (logLevel._tag !== level._tag) return yield* effect;\n });\n\nexport const makeNamespacedLogSpan = (prefix: string) => (label: string) =>\n Effect.withLogSpan(`${prefix}:${label}`);\n"]}
@@ -0,0 +1,3 @@
1
+ import*as s from'effect/Effect';import*as t from'effect/Schema';import {ID,Type,GID}from'./schema.js';const i=({id:e,type:r})=>s.gen(function*(){const o=yield*t.decode(ID)(e);return `gid://shopify/${yield*t.decode(Type)(r)}/${o}`}),d=e=>t.decode(GID)(e);
2
+ export{i as format,d as parse};//# sourceMappingURL=data.js.map
3
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Resource/data.ts"],"names":["format","id","type","Effect","actualId","Schema","ID","Type","parse","input","GID"],"mappings":"sGAWaA,MAAAA,CAAAA,CAAS,CAA2C,CAC/D,EAAAC,CAAAA,CAAAA,CACA,IAAAC,CAAAA,CACF,CAKEC,GAAAA,CAAAA,CAAO,GAAI,CAAA,WAAa,CACtB,MAAMC,EAAW,MAAOC,CAAAA,CAAO,MAAOC,CAAAA,EAAE,CAAEL,CAAAA,CAAE,CAE5C,CAAA,OAAO,CADY,cAAA,EAAA,MAAOI,CAAO,CAAA,MAAA,CAAOE,IAAI,CAAA,CAAEL,CAAI,CAChB,CAAA,CAAA,EAAIE,CAAQ,CAAA,CAChD,CAAC,CAAA,CAEUI,CACXC,CAAAA,CAAAA,EAC6CJ,CAAO,CAAA,MAAA,CAAOK,GAAG,CAAA,CAAED,CAAK","file":"data.js","sourcesContent":["import type { ParseError } from \"effect/ParseResult\";\n\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\nimport { ID, GID, Type } from \"./schema.js\";\n\ntype FormatOptions<T extends ID, R extends Type> = {\n id: T;\n type: R;\n};\n\nexport const format = <const T extends ID, const R extends Type>({\n id,\n type,\n}: FormatOptions<T, R>): Effect.Effect<\n `gid://shopify/${R}/${T}`,\n ParseError,\n never\n> =>\n Effect.gen(function* () {\n const actualId = yield* Schema.decode(ID)(id);\n const actualType = yield* Schema.decode(Type)(type);\n return `gid://shopify/${actualType}/${actualId}` as `gid://shopify/${R}/${T}`;\n });\n\nexport const parse = (\n input: string\n): Effect.Effect<string, ParseError, never> => Schema.decode(GID)(input);\n"]}
@@ -0,0 +1,2 @@
1
+ export{GID,ID,Type}from'./schema.js';export*from'./data.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,3 @@
1
+ import*as e from'effect/Schema';const t=e.Literal("Cart","Collection","Customer","DeliveryCarrierService","DeliveryLocationGroup","DeliveryProfile","DeliveryZone","DraftOrder","DraftOrderLineItem","Duty","EmailTemplate","Fulfillment","FulfullmentEvent","FullfullmentService","InventoryItem","InventoryLevel","LineItem","Location","MarketingEvent","MediaImage","Metafield","OnlineStoreArticle","OnlineStoreBlog","OnlineStorePage","Order","OrderTransaction","Product","ProductImage","ProductVariant","Refund","Shop","StaffMember","Theme"),r=e.String.pipe(e.startsWith("gid://shopify/")),o=e.Union(e.Number,e.NumberFromString);
2
+ export{r as GID,o as ID,t as Type};//# sourceMappingURL=schema.js.map
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/effect/Resource/schema.ts"],"names":["Type","Schema","GID","ID"],"mappings":"gCAGO,MAAMA,CAAOC,CAAAA,CAAAA,CAAO,QACzB,MACA,CAAA,YAAA,CACA,UACA,CAAA,wBAAA,CACA,uBACA,CAAA,iBAAA,CACA,eACA,YACA,CAAA,oBAAA,CACA,MACA,CAAA,eAAA,CACA,aACA,CAAA,kBAAA,CACA,qBACA,CAAA,eAAA,CACA,gBACA,CAAA,UAAA,CACA,UACA,CAAA,gBAAA,CACA,YACA,CAAA,WAAA,CACA,qBACA,iBACA,CAAA,iBAAA,CACA,OACA,CAAA,kBAAA,CACA,SACA,CAAA,cAAA,CACA,gBACA,CAAA,QAAA,CACA,MACA,CAAA,aAAA,CACA,OACF,CAAA,CAGaC,CAAMD,CAAAA,CAAAA,CAAO,OAAO,IAAKA,CAAAA,CAAAA,CAAO,UAAW,CAAA,gBAAgB,CAAC,CAAA,CAG5DE,CAAKF,CAAAA,CAAAA,CAAO,KAAMA,CAAAA,CAAAA,CAAO,MAAQA,CAAAA,CAAAA,CAAO,gBAAgB","file":"schema.js","sourcesContent":["import * as Schema from \"effect/Schema\";\n\nexport type Type = Schema.Schema.Type<typeof Type>;\nexport const Type = Schema.Literal(\n \"Cart\",\n \"Collection\",\n \"Customer\",\n \"DeliveryCarrierService\",\n \"DeliveryLocationGroup\",\n \"DeliveryProfile\",\n \"DeliveryZone\",\n \"DraftOrder\",\n \"DraftOrderLineItem\",\n \"Duty\",\n \"EmailTemplate\",\n \"Fulfillment\",\n \"FulfullmentEvent\",\n \"FullfullmentService\",\n \"InventoryItem\",\n \"InventoryLevel\",\n \"LineItem\",\n \"Location\",\n \"MarketingEvent\",\n \"MediaImage\",\n \"Metafield\",\n \"OnlineStoreArticle\",\n \"OnlineStoreBlog\",\n \"OnlineStorePage\",\n \"Order\",\n \"OrderTransaction\",\n \"Product\",\n \"ProductImage\",\n \"ProductVariant\",\n \"Refund\",\n \"Shop\",\n \"StaffMember\",\n \"Theme\",\n);\n\nexport type GID = Schema.Schema.Encoded<typeof GID>;\nexport const GID = Schema.String.pipe(Schema.startsWith(\"gid://shopify/\"));\n\nexport type ID = Schema.Schema.Encoded<typeof ID>;\nexport const ID = Schema.Union(Schema.Number, Schema.NumberFromString);\n"]}
@@ -0,0 +1,2 @@
1
+ import*as index_js$2 from'./Resource/index.js';export{index_js$2 as Resource };import*as index_js from'./Ajax/index.js';export{index_js as Ajax };import*as index_js$1 from'./Logging/index.js';export{index_js$1 as Logging };//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,77 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import * as Effect from 'effect/Effect';
4
+ import * as LogLevel from 'effect/LogLevel';
5
+ import { ParseError } from 'effect/ParseResult';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ export type Type = Schema.Schema.Type<typeof Type>;
9
+ declare const Type: Schema.Literal<[
10
+ "Cart",
11
+ "Collection",
12
+ "Customer",
13
+ "DeliveryCarrierService",
14
+ "DeliveryLocationGroup",
15
+ "DeliveryProfile",
16
+ "DeliveryZone",
17
+ "DraftOrder",
18
+ "DraftOrderLineItem",
19
+ "Duty",
20
+ "EmailTemplate",
21
+ "Fulfillment",
22
+ "FulfullmentEvent",
23
+ "FullfullmentService",
24
+ "InventoryItem",
25
+ "InventoryLevel",
26
+ "LineItem",
27
+ "Location",
28
+ "MarketingEvent",
29
+ "MediaImage",
30
+ "Metafield",
31
+ "OnlineStoreArticle",
32
+ "OnlineStoreBlog",
33
+ "OnlineStorePage",
34
+ "Order",
35
+ "OrderTransaction",
36
+ "Product",
37
+ "ProductImage",
38
+ "ProductVariant",
39
+ "Refund",
40
+ "Shop",
41
+ "StaffMember",
42
+ "Theme"
43
+ ]>;
44
+ export type GID = Schema.Schema.Encoded<typeof GID>;
45
+ declare const GID: Schema.filter<typeof Schema.String>;
46
+ export type ID = Schema.Schema.Encoded<typeof ID>;
47
+ declare const ID: Schema.Union<[
48
+ typeof Schema.Number,
49
+ typeof Schema.NumberFromString
50
+ ]>;
51
+ export type FormatOptions<T extends ID, R extends Type> = {
52
+ id: T;
53
+ type: R;
54
+ };
55
+ declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
56
+ declare const parse: (input: string) => Effect.Effect<string, ParseError, never>;
57
+ export declare const parseResource: (gid: Resource.GID) => string;
58
+ export type FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {
59
+ id: T;
60
+ type: R;
61
+ };
62
+ export declare const formatResource: <const T extends Resource.ID, const R extends Resource.Type>(options: FormatResourceOptions<T, R>) => `gid://shopify/${R}/${T}`;
63
+ type ID$1 = Resource.ID;
64
+ type GID$1 = Resource.GID;
65
+ type Type$1 = Resource.Type;
66
+
67
+ declare namespace Resource {
68
+ export { GID, ID, Type, format, parse };
69
+ }
70
+
71
+ export {
72
+ GID$1 as GID,
73
+ ID$1 as ID,
74
+ Type$1 as Type,
75
+ };
76
+
77
+ export {};
@@ -0,0 +1,2 @@
1
+ export{formatResource,parseResource}from'./resources/index.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ import*as o from'effect/Effect';import {Resource}from'../effect';const s=e=>o.runSync(Resource.parse(e)),c=e=>o.runSync(Resource.format(e));export{c as formatResource,s as parseResource};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/resources/index.ts"],"names":["parseResource","gid","Effect","Resource","formatResource","options"],"mappings":"iEAGO,MAAMA,CAAiBC,CAAAA,CAAAA,EAC5BC,CAAO,CAAA,OAAA,CAAQC,SAAS,KAAMF,CAAAA,CAAG,CAAC,CAAA,CAOvBG,CAIXC,CAAAA,CAAAA,EACGH,EAAO,OAAQC,CAAAA,QAAAA,CAAS,MAAaE,CAAAA,CAAO,CAAC","file":"index.js","sourcesContent":["import * as Effect from \"effect/Effect\";\nimport { Resource } from \"../effect\";\n\nexport const parseResource = (gid: Resource.GID) =>\n Effect.runSync(Resource.parse(gid));\n\ntype FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {\n id: T;\n type: R;\n};\n\nexport const formatResource = <\n const T extends Resource.ID,\n const R extends Resource.Type,\n>(\n options: FormatResourceOptions<T, R>\n) => Effect.runSync(Resource.format<T, R>(options));\n\nexport type ID = Resource.ID;\nexport type GID = Resource.GID;\nexport type Type = Resource.Type;\n"]}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@brytdesigns/shopify-utils",
3
+ "version": "1.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/main/index.js",
7
+ "types": "./dist/main/index.d.ts",
8
+ "jsdelivr": "./dist/jsdelivr/index.js",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/main/index.d.ts",
12
+ "import": "./dist/main/index.js"
13
+ },
14
+ "./effect": {
15
+ "types": "./dist/effect/index.d.ts",
16
+ "import": "./dist/effect/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "keywords": [],
23
+ "author": "",
24
+ "license": "ISC",
25
+ "dependencies": {
26
+ "effect": "3.13.4"
27
+ },
28
+ "devDependencies": {
29
+ "dts-bundle-generator": "^9.5.1",
30
+ "tsup": "^8.4.0",
31
+ "@repo/js-delivr-imports-plugin": "1.0.0"
32
+ },
33
+ "scripts": {
34
+ "build": "tsup --clean",
35
+ "typecheck": "tsc --noEmit --emitDeclarationOnly false",
36
+ "clean": "git clean -xdf .cache .turbo dist node_modules"
37
+ }
38
+ }