@brytdesigns/shopify-utils 1.1.0 → 1.1.1
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/Ajax/Sections/index.js +3 -1
- package/dist/effect/Ajax/Sections/schema.js +19 -1
- package/dist/effect/Ajax/Sections/schema.js.map +1 -1
- package/dist/effect/Ajax/Window/data/ShopifyRoutes.js +37 -1
- package/dist/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -1
- package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js +15 -1
- package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -1
- package/dist/effect/Ajax/Window/data/index.js +5 -1
- package/dist/effect/Ajax/Window/data/types.js +1 -0
- package/dist/effect/Ajax/Window/index.js +3 -1
- package/dist/effect/Ajax/index.js +3 -1
- package/dist/effect/Logging/index.js +12 -1
- package/dist/effect/Logging/index.js.map +1 -1
- package/dist/effect/Resource/data.js +16 -2
- package/dist/effect/Resource/data.js.map +1 -1
- package/dist/effect/Resource/index.js +3 -1
- package/dist/effect/Resource/schema.js +42 -2
- package/dist/effect/Resource/schema.js.map +1 -1
- package/dist/effect/index.js +7 -1
- package/dist/main/effect/Ajax/Sections/index.js +3 -1
- package/dist/main/effect/Ajax/Sections/schema.js +19 -1
- package/dist/main/effect/Ajax/Sections/schema.js.map +1 -1
- package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js +37 -1
- package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -1
- package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js +15 -1
- package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -1
- package/dist/main/effect/Ajax/Window/data/index.js +5 -1
- package/dist/main/effect/Ajax/Window/data/types.js +1 -0
- package/dist/main/effect/Ajax/Window/index.js +3 -1
- package/dist/main/effect/Ajax/index.js +3 -1
- package/dist/main/effect/Logging/index.js +12 -1
- package/dist/main/effect/Logging/index.js.map +1 -1
- package/dist/main/effect/Resource/data.js +16 -2
- package/dist/main/effect/Resource/data.js.map +1 -1
- package/dist/main/effect/Resource/index.js +3 -1
- package/dist/main/effect/Resource/schema.js +42 -2
- package/dist/main/effect/Resource/schema.js.map +1 -1
- package/dist/main/effect/index.js +7 -1
- package/dist/main/index.js +2 -1
- package/dist/main/resources/index.js +8 -1
- package/dist/main/resources/index.js.map +1 -1
- package/package.json +1 -2
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
|
|
3
|
+
const Input = Schema.Struct({
|
|
4
|
+
sections: Schema.optional(Schema.String),
|
|
5
|
+
sections_url: Schema.optional(Schema.String)
|
|
6
|
+
});
|
|
7
|
+
const parseKeys = (keys) => Array.from(
|
|
8
|
+
new Set(keys.split(",").map((key) => key.trim()))
|
|
9
|
+
);
|
|
10
|
+
function makeResponseSchema(input) {
|
|
11
|
+
const keys = parseKeys(input);
|
|
12
|
+
return Schema.Record({
|
|
13
|
+
key: Schema.Literal(...keys),
|
|
14
|
+
value: Schema.NullOr(Schema.String)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Input, makeResponseSchema };
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
2
20
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/effect/Ajax/Sections/schema.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../src/effect/Ajax/Sections/schema.ts"],"names":[],"mappings":";;AAGa,MAAA,KAAA,GAAQ,OAAO,MAAO,CAAA;AAAA,EACjC,QAAU,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM,CAAA;AAAA,EACvC,YAAc,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM;AAC7C,CAAC;AAOD,MAAM,SAAA,GAAY,CAAyB,IAAA,KACzC,KAAM,CAAA,IAAA;AAAA,EACJ,IAAI,GAAA,CAAI,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA,CAAE,GAAI,CAAA,CAAC,GAAQ,KAAA,GAAA,CAAI,IAAK,EAAC,CAAC;AAClD,CAAA;AAEK,SAAS,mBAA2C,KAAU,EAAA;AACnE,EAAM,MAAA,IAAA,GAAO,UAAU,KAAK,CAAA;AAC5B,EAAA,OAAO,OAAO,MAAO,CAAA;AAAA,IACnB,GAAK,EAAA,MAAA,CAAO,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,IAC3B,KAAO,EAAA,MAAA,CAAO,MAAO,CAAA,MAAA,CAAO,MAAM;AAAA,GACnC,CAAA;AACH","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"]}
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Data from 'effect/Data';
|
|
2
|
+
|
|
3
|
+
const Defaults = {
|
|
4
|
+
account_addresses_url: "/account/addresses",
|
|
5
|
+
account_login_url: "/account/login",
|
|
6
|
+
account_logout_url: "/account/logout",
|
|
7
|
+
account_recover_url: "/account/recover",
|
|
8
|
+
account_register_url: "/account/register",
|
|
9
|
+
account_url: "/account",
|
|
10
|
+
all_products_collection_url: "/collections/all",
|
|
11
|
+
cart_add_url: "/cart/add.js",
|
|
12
|
+
cart_change_url: "/cart/change.js",
|
|
13
|
+
cart_clear_url: "/cart/clear.js",
|
|
14
|
+
cart_update_url: "/cart/update.js",
|
|
15
|
+
cart_url: "/cart.js",
|
|
16
|
+
collections_url: "/collections",
|
|
17
|
+
predictive_search_url: "/search/suggest",
|
|
18
|
+
product_recommendations_url: "/recommendations/products",
|
|
19
|
+
root_url: "/",
|
|
20
|
+
search_url: "/search",
|
|
21
|
+
storefront_login_url: "/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"
|
|
22
|
+
};
|
|
23
|
+
class ShopifyRoutes extends Data.Class {
|
|
24
|
+
constructor() {
|
|
25
|
+
super({
|
|
26
|
+
...Defaults,
|
|
27
|
+
...window?.Shopify?.routes || {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const make = () => Data.case()({
|
|
32
|
+
...Defaults,
|
|
33
|
+
...window?.Shopify?.routes || {}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { Defaults, ShopifyRoutes, make };
|
|
37
|
+
//# sourceMappingURL=ShopifyRoutes.js.map
|
|
2
38
|
//# sourceMappingURL=ShopifyRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":[],"mappings":";;AAIO,MAAM,QAA2B,GAAA;AAAA,EACtC,qBAAuB,EAAA,oBAAA;AAAA,EACvB,iBAAmB,EAAA,gBAAA;AAAA,EACnB,kBAAoB,EAAA,iBAAA;AAAA,EACpB,mBAAqB,EAAA,kBAAA;AAAA,EACrB,oBAAsB,EAAA,mBAAA;AAAA,EACtB,WAAa,EAAA,UAAA;AAAA,EACb,2BAA6B,EAAA,kBAAA;AAAA,EAC7B,YAAc,EAAA,cAAA;AAAA,EACd,eAAiB,EAAA,iBAAA;AAAA,EACjB,cAAgB,EAAA,gBAAA;AAAA,EAChB,eAAiB,EAAA,iBAAA;AAAA,EACjB,QAAU,EAAA,UAAA;AAAA,EACV,eAAiB,EAAA,cAAA;AAAA,EACjB,qBAAuB,EAAA,iBAAA;AAAA,EACvB,2BAA6B,EAAA,2BAAA;AAAA,EAC7B,QAAU,EAAA,GAAA;AAAA,EACV,UAAY,EAAA,SAAA;AAAA,EACZ,oBACE,EAAA;AACJ;AAEO,MAAM,aAAA,SAAsB,KAAK,KAAsB,CAAA;AAAA,EAC5D,WAAc,GAAA;AACZ,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,QAAA;AAAA,MACH,GAAI,MAAA,EAAQ,OAAS,EAAA,MAAA,IAAU;AAAC,KACjC,CAAA;AAAA;AAEL;AAEO,MAAM,IAAO,GAAA,MAClB,IAAK,CAAA,IAAA,EAAsB,CAAA;AAAA,EACzB,GAAG,QAAA;AAAA,EACH,GAAI,MAAA,EAAQ,OAAS,EAAA,MAAA,IAAU;AACjC,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"]}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Data from 'effect/Data';
|
|
2
|
+
|
|
3
|
+
class StorefrontClientConfig extends Data.Class {
|
|
4
|
+
constructor() {
|
|
5
|
+
super({
|
|
6
|
+
...window.Shopify.storefront.config
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const make = () => Data.case()({
|
|
11
|
+
...window.Shopify.storefront.config
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { StorefrontClientConfig, make };
|
|
15
|
+
//# sourceMappingURL=StorefrontClientConfig.js.map
|
|
2
16
|
//# sourceMappingURL=StorefrontClientConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":[],"mappings":";;AAIO,MAAM,sBAAA,SAA+B,KAAK,KAA+B,CAAA;AAAA,EAC9E,WAAc,GAAA;AACZ,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,MAAO,CAAA,OAAA,CAAQ,UAAW,CAAA;AAAA,KAC9B,CAAA;AAAA;AAEL;AAEO,MAAM,IAAO,GAAA,MAClB,IAAK,CAAA,IAAA,EAA+B,CAAA;AAAA,EAClC,GAAG,MAAO,CAAA,OAAA,CAAQ,UAAW,CAAA;AAC/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"]}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import*as ShopifyRoutes_js from'./ShopifyRoutes.js';
|
|
1
|
+
import * as ShopifyRoutes_js from './ShopifyRoutes.js';
|
|
2
|
+
export { ShopifyRoutes_js as ShopifyRoutes };
|
|
3
|
+
import * as StorefrontClientConfig_js from './StorefrontClientConfig.js';
|
|
4
|
+
export { StorefrontClientConfig_js as StorefrontClientConfig };
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as FiberRef from 'effect/FiberRef';
|
|
3
|
+
import 'effect/LogLevel';
|
|
4
|
+
|
|
5
|
+
const filterLevelOrNever = (level, effect) => Effect.gen(function* () {
|
|
6
|
+
const logLevel = yield* FiberRef.get(FiberRef.currentMinimumLogLevel);
|
|
7
|
+
if (logLevel._tag !== level._tag) return yield* effect;
|
|
8
|
+
});
|
|
9
|
+
const makeNamespacedLogSpan = (prefix) => (label) => Effect.withLogSpan(`${prefix}:${label}`);
|
|
10
|
+
|
|
11
|
+
export { filterLevelOrNever, makeNamespacedLogSpan };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
2
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/Logging/index.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/Logging/index.ts"],"names":[],"mappings":";;;;AAIO,MAAM,qBAAqB,CAChC,KAAA,EACA,MAEA,KAAA,MAAA,CAAO,IAAI,aAAa;AACtB,EAAA,MAAM,QAAW,GAAA,OAAO,QAAS,CAAA,GAAA,CAAI,SAAS,sBAAsB,CAAA;AACpE,EAAA,IAAI,QAAS,CAAA,IAAA,KAAS,KAAM,CAAA,IAAA,SAAa,OAAO,MAAA;AAClD,CAAC;AAEU,MAAA,qBAAA,GAAwB,CAAC,MAAA,KAAmB,CAAC,KAAA,KACxD,MAAO,CAAA,WAAA,CAAY,CAAG,EAAA,MAAM,CAAI,CAAA,EAAA,KAAK,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"]}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { ID, Type, GID } from './schema.js';
|
|
4
|
+
|
|
5
|
+
const format = ({
|
|
6
|
+
id,
|
|
7
|
+
type
|
|
8
|
+
}) => Effect.gen(function* () {
|
|
9
|
+
const actualId = yield* Schema.decode(ID)(id);
|
|
10
|
+
const actualType = yield* Schema.decode(Type)(type);
|
|
11
|
+
return `gid://shopify/${actualType}/${actualId}`;
|
|
12
|
+
});
|
|
13
|
+
const parse = (input) => Schema.decode(GID)(input);
|
|
14
|
+
|
|
15
|
+
export { format, parse };
|
|
16
|
+
//# sourceMappingURL=data.js.map
|
|
3
17
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/Resource/data.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/Resource/data.ts"],"names":[],"mappings":";;;;AAWO,MAAM,SAAS,CAA2C;AAAA,EAC/D,EAAA;AAAA,EACA;AACF,CAKE,KAAA,MAAA,CAAO,IAAI,aAAa;AACtB,EAAA,MAAM,WAAW,OAAO,MAAA,CAAO,MAAO,CAAA,EAAE,EAAE,EAAE,CAAA;AAC5C,EAAA,MAAM,aAAa,OAAO,MAAA,CAAO,MAAO,CAAA,IAAI,EAAE,IAAI,CAAA;AAClD,EAAO,OAAA,CAAA,cAAA,EAAiB,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA;AAChD,CAAC;AAEI,MAAM,QAAQ,CACnB,KAAA,KAC6C,OAAO,MAAO,CAAA,GAAG,EAAE,KAAK","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"]}
|
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
|
|
3
|
+
const Type = Schema.Literal(
|
|
4
|
+
"Cart",
|
|
5
|
+
"Collection",
|
|
6
|
+
"Customer",
|
|
7
|
+
"DeliveryCarrierService",
|
|
8
|
+
"DeliveryLocationGroup",
|
|
9
|
+
"DeliveryProfile",
|
|
10
|
+
"DeliveryZone",
|
|
11
|
+
"DraftOrder",
|
|
12
|
+
"DraftOrderLineItem",
|
|
13
|
+
"Duty",
|
|
14
|
+
"EmailTemplate",
|
|
15
|
+
"Fulfillment",
|
|
16
|
+
"FulfullmentEvent",
|
|
17
|
+
"FullfullmentService",
|
|
18
|
+
"InventoryItem",
|
|
19
|
+
"InventoryLevel",
|
|
20
|
+
"LineItem",
|
|
21
|
+
"Location",
|
|
22
|
+
"MarketingEvent",
|
|
23
|
+
"MediaImage",
|
|
24
|
+
"Metafield",
|
|
25
|
+
"OnlineStoreArticle",
|
|
26
|
+
"OnlineStoreBlog",
|
|
27
|
+
"OnlineStorePage",
|
|
28
|
+
"Order",
|
|
29
|
+
"OrderTransaction",
|
|
30
|
+
"Product",
|
|
31
|
+
"ProductImage",
|
|
32
|
+
"ProductVariant",
|
|
33
|
+
"Refund",
|
|
34
|
+
"Shop",
|
|
35
|
+
"StaffMember",
|
|
36
|
+
"Theme"
|
|
37
|
+
);
|
|
38
|
+
const GID = Schema.String.pipe(Schema.startsWith("gid://shopify/"));
|
|
39
|
+
const ID = Schema.Union(Schema.Number, Schema.NumberFromString);
|
|
40
|
+
|
|
41
|
+
export { GID, ID, Type };
|
|
42
|
+
//# sourceMappingURL=schema.js.map
|
|
3
43
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/effect/Resource/schema.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/Resource/schema.ts"],"names":[],"mappings":";;AAGO,MAAM,OAAO,MAAO,CAAA,OAAA;AAAA,EACzB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA,MAAA;AAAA,EACA,eAAA;AAAA,EACA,aAAA;AAAA,EACA,kBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF;AAGO,MAAM,MAAM,MAAO,CAAA,MAAA,CAAO,KAAK,MAAO,CAAA,UAAA,CAAW,gBAAgB,CAAC;AAGlE,MAAM,KAAK,MAAO,CAAA,KAAA,CAAM,MAAO,CAAA,MAAA,EAAQ,OAAO,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"]}
|
package/dist/effect/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import*as index_js$2 from'./Resource/index.js';
|
|
1
|
+
import * as index_js$2 from './Resource/index.js';
|
|
2
|
+
export { index_js$2 as Resource };
|
|
3
|
+
import * as index_js from './Ajax/index.js';
|
|
4
|
+
export { index_js as Ajax };
|
|
5
|
+
import * as index_js$1 from './Logging/index.js';
|
|
6
|
+
export { index_js$1 as Logging };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
|
|
3
|
+
const Input = Schema.Struct({
|
|
4
|
+
sections: Schema.optional(Schema.String),
|
|
5
|
+
sections_url: Schema.optional(Schema.String)
|
|
6
|
+
});
|
|
7
|
+
const parseKeys = (keys) => Array.from(
|
|
8
|
+
new Set(keys.split(",").map((key) => key.trim()))
|
|
9
|
+
);
|
|
10
|
+
function makeResponseSchema(input) {
|
|
11
|
+
const keys = parseKeys(input);
|
|
12
|
+
return Schema.Record({
|
|
13
|
+
key: Schema.Literal(...keys),
|
|
14
|
+
value: Schema.NullOr(Schema.String)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Input, makeResponseSchema };
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
2
20
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/effect/Ajax/Sections/schema.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../../src/effect/Ajax/Sections/schema.ts"],"names":[],"mappings":";;AAGa,MAAA,KAAA,GAAQ,OAAO,MAAO,CAAA;AAAA,EACjC,QAAU,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM,CAAA;AAAA,EACvC,YAAc,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM;AAC7C,CAAC;AAOD,MAAM,SAAA,GAAY,CAAyB,IAAA,KACzC,KAAM,CAAA,IAAA;AAAA,EACJ,IAAI,GAAA,CAAI,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA,CAAE,GAAI,CAAA,CAAC,GAAQ,KAAA,GAAA,CAAI,IAAK,EAAC,CAAC;AAClD,CAAA;AAEK,SAAS,mBAA2C,KAAU,EAAA;AACnE,EAAM,MAAA,IAAA,GAAO,UAAU,KAAK,CAAA;AAC5B,EAAA,OAAO,OAAO,MAAO,CAAA;AAAA,IACnB,GAAK,EAAA,MAAA,CAAO,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,IAC3B,KAAO,EAAA,MAAA,CAAO,MAAO,CAAA,MAAA,CAAO,MAAM;AAAA,GACnC,CAAA;AACH","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"]}
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Data from 'effect/Data';
|
|
2
|
+
|
|
3
|
+
const Defaults = {
|
|
4
|
+
account_addresses_url: "/account/addresses",
|
|
5
|
+
account_login_url: "/account/login",
|
|
6
|
+
account_logout_url: "/account/logout",
|
|
7
|
+
account_recover_url: "/account/recover",
|
|
8
|
+
account_register_url: "/account/register",
|
|
9
|
+
account_url: "/account",
|
|
10
|
+
all_products_collection_url: "/collections/all",
|
|
11
|
+
cart_add_url: "/cart/add.js",
|
|
12
|
+
cart_change_url: "/cart/change.js",
|
|
13
|
+
cart_clear_url: "/cart/clear.js",
|
|
14
|
+
cart_update_url: "/cart/update.js",
|
|
15
|
+
cart_url: "/cart.js",
|
|
16
|
+
collections_url: "/collections",
|
|
17
|
+
predictive_search_url: "/search/suggest",
|
|
18
|
+
product_recommendations_url: "/recommendations/products",
|
|
19
|
+
root_url: "/",
|
|
20
|
+
search_url: "/search",
|
|
21
|
+
storefront_login_url: "/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"
|
|
22
|
+
};
|
|
23
|
+
class ShopifyRoutes extends Data.Class {
|
|
24
|
+
constructor() {
|
|
25
|
+
super({
|
|
26
|
+
...Defaults,
|
|
27
|
+
...window?.Shopify?.routes || {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const make = () => Data.case()({
|
|
32
|
+
...Defaults,
|
|
33
|
+
...window?.Shopify?.routes || {}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { Defaults, ShopifyRoutes, make };
|
|
37
|
+
//# sourceMappingURL=ShopifyRoutes.js.map
|
|
2
38
|
//# sourceMappingURL=ShopifyRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":[],"mappings":";;AAIO,MAAM,QAA2B,GAAA;AAAA,EACtC,qBAAuB,EAAA,oBAAA;AAAA,EACvB,iBAAmB,EAAA,gBAAA;AAAA,EACnB,kBAAoB,EAAA,iBAAA;AAAA,EACpB,mBAAqB,EAAA,kBAAA;AAAA,EACrB,oBAAsB,EAAA,mBAAA;AAAA,EACtB,WAAa,EAAA,UAAA;AAAA,EACb,2BAA6B,EAAA,kBAAA;AAAA,EAC7B,YAAc,EAAA,cAAA;AAAA,EACd,eAAiB,EAAA,iBAAA;AAAA,EACjB,cAAgB,EAAA,gBAAA;AAAA,EAChB,eAAiB,EAAA,iBAAA;AAAA,EACjB,QAAU,EAAA,UAAA;AAAA,EACV,eAAiB,EAAA,cAAA;AAAA,EACjB,qBAAuB,EAAA,iBAAA;AAAA,EACvB,2BAA6B,EAAA,2BAAA;AAAA,EAC7B,QAAU,EAAA,GAAA;AAAA,EACV,UAAY,EAAA,SAAA;AAAA,EACZ,oBACE,EAAA;AACJ;AAEO,MAAM,aAAA,SAAsB,KAAK,KAAsB,CAAA;AAAA,EAC5D,WAAc,GAAA;AACZ,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,QAAA;AAAA,MACH,GAAI,MAAA,EAAQ,OAAS,EAAA,MAAA,IAAU;AAAC,KACjC,CAAA;AAAA;AAEL;AAEO,MAAM,IAAO,GAAA,MAClB,IAAK,CAAA,IAAA,EAAsB,CAAA;AAAA,EACzB,GAAG,QAAA;AAAA,EACH,GAAI,MAAA,EAAQ,OAAS,EAAA,MAAA,IAAU;AACjC,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"]}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Data from 'effect/Data';
|
|
2
|
+
|
|
3
|
+
class StorefrontClientConfig extends Data.Class {
|
|
4
|
+
constructor() {
|
|
5
|
+
super({
|
|
6
|
+
...window.Shopify.storefront.config
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const make = () => Data.case()({
|
|
11
|
+
...window.Shopify.storefront.config
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { StorefrontClientConfig, make };
|
|
15
|
+
//# sourceMappingURL=StorefrontClientConfig.js.map
|
|
2
16
|
//# sourceMappingURL=StorefrontClientConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/StorefrontClientConfig.ts"],"names":[],"mappings":";;AAIO,MAAM,sBAAA,SAA+B,KAAK,KAA+B,CAAA;AAAA,EAC9E,WAAc,GAAA;AACZ,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,MAAO,CAAA,OAAA,CAAQ,UAAW,CAAA;AAAA,KAC9B,CAAA;AAAA;AAEL;AAEO,MAAM,IAAO,GAAA,MAClB,IAAK,CAAA,IAAA,EAA+B,CAAA;AAAA,EAClC,GAAG,MAAO,CAAA,OAAA,CAAQ,UAAW,CAAA;AAC/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"]}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import*as ShopifyRoutes_js from'./ShopifyRoutes.js';
|
|
1
|
+
import * as ShopifyRoutes_js from './ShopifyRoutes.js';
|
|
2
|
+
export { ShopifyRoutes_js as ShopifyRoutes };
|
|
3
|
+
import * as StorefrontClientConfig_js from './StorefrontClientConfig.js';
|
|
4
|
+
export { StorefrontClientConfig_js as StorefrontClientConfig };
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as FiberRef from 'effect/FiberRef';
|
|
3
|
+
import 'effect/LogLevel';
|
|
4
|
+
|
|
5
|
+
const filterLevelOrNever = (level, effect) => Effect.gen(function* () {
|
|
6
|
+
const logLevel = yield* FiberRef.get(FiberRef.currentMinimumLogLevel);
|
|
7
|
+
if (logLevel._tag !== level._tag) return yield* effect;
|
|
8
|
+
});
|
|
9
|
+
const makeNamespacedLogSpan = (prefix) => (label) => Effect.withLogSpan(`${prefix}:${label}`);
|
|
10
|
+
|
|
11
|
+
export { filterLevelOrNever, makeNamespacedLogSpan };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
2
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/effect/Logging/index.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../src/effect/Logging/index.ts"],"names":[],"mappings":";;;;AAIO,MAAM,qBAAqB,CAChC,KAAA,EACA,MAEA,KAAA,MAAA,CAAO,IAAI,aAAa;AACtB,EAAA,MAAM,QAAW,GAAA,OAAO,QAAS,CAAA,GAAA,CAAI,SAAS,sBAAsB,CAAA;AACpE,EAAA,IAAI,QAAS,CAAA,IAAA,KAAS,KAAM,CAAA,IAAA,SAAa,OAAO,MAAA;AAClD,CAAC;AAEU,MAAA,qBAAA,GAAwB,CAAC,MAAA,KAAmB,CAAC,KAAA,KACxD,MAAO,CAAA,WAAA,CAAY,CAAG,EAAA,MAAM,CAAI,CAAA,EAAA,KAAK,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"]}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { ID, Type, GID } from './schema.js';
|
|
4
|
+
|
|
5
|
+
const format = ({
|
|
6
|
+
id,
|
|
7
|
+
type
|
|
8
|
+
}) => Effect.gen(function* () {
|
|
9
|
+
const actualId = yield* Schema.decode(ID)(id);
|
|
10
|
+
const actualType = yield* Schema.decode(Type)(type);
|
|
11
|
+
return `gid://shopify/${actualType}/${actualId}`;
|
|
12
|
+
});
|
|
13
|
+
const parse = (input) => Schema.decode(GID)(input);
|
|
14
|
+
|
|
15
|
+
export { format, parse };
|
|
16
|
+
//# sourceMappingURL=data.js.map
|
|
3
17
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/effect/Resource/data.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../src/effect/Resource/data.ts"],"names":[],"mappings":";;;;AAWO,MAAM,SAAS,CAA2C;AAAA,EAC/D,EAAA;AAAA,EACA;AACF,CAKE,KAAA,MAAA,CAAO,IAAI,aAAa;AACtB,EAAA,MAAM,WAAW,OAAO,MAAA,CAAO,MAAO,CAAA,EAAE,EAAE,EAAE,CAAA;AAC5C,EAAA,MAAM,aAAa,OAAO,MAAA,CAAO,MAAO,CAAA,IAAI,EAAE,IAAI,CAAA;AAClD,EAAO,OAAA,CAAA,cAAA,EAAiB,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA;AAChD,CAAC;AAEI,MAAM,QAAQ,CACnB,KAAA,KAC6C,OAAO,MAAO,CAAA,GAAG,EAAE,KAAK","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"]}
|
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
|
|
3
|
+
const Type = Schema.Literal(
|
|
4
|
+
"Cart",
|
|
5
|
+
"Collection",
|
|
6
|
+
"Customer",
|
|
7
|
+
"DeliveryCarrierService",
|
|
8
|
+
"DeliveryLocationGroup",
|
|
9
|
+
"DeliveryProfile",
|
|
10
|
+
"DeliveryZone",
|
|
11
|
+
"DraftOrder",
|
|
12
|
+
"DraftOrderLineItem",
|
|
13
|
+
"Duty",
|
|
14
|
+
"EmailTemplate",
|
|
15
|
+
"Fulfillment",
|
|
16
|
+
"FulfullmentEvent",
|
|
17
|
+
"FullfullmentService",
|
|
18
|
+
"InventoryItem",
|
|
19
|
+
"InventoryLevel",
|
|
20
|
+
"LineItem",
|
|
21
|
+
"Location",
|
|
22
|
+
"MarketingEvent",
|
|
23
|
+
"MediaImage",
|
|
24
|
+
"Metafield",
|
|
25
|
+
"OnlineStoreArticle",
|
|
26
|
+
"OnlineStoreBlog",
|
|
27
|
+
"OnlineStorePage",
|
|
28
|
+
"Order",
|
|
29
|
+
"OrderTransaction",
|
|
30
|
+
"Product",
|
|
31
|
+
"ProductImage",
|
|
32
|
+
"ProductVariant",
|
|
33
|
+
"Refund",
|
|
34
|
+
"Shop",
|
|
35
|
+
"StaffMember",
|
|
36
|
+
"Theme"
|
|
37
|
+
);
|
|
38
|
+
const GID = Schema.String.pipe(Schema.startsWith("gid://shopify/"));
|
|
39
|
+
const ID = Schema.Union(Schema.Number, Schema.NumberFromString);
|
|
40
|
+
|
|
41
|
+
export { GID, ID, Type };
|
|
42
|
+
//# sourceMappingURL=schema.js.map
|
|
3
43
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/effect/Resource/schema.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../../src/effect/Resource/schema.ts"],"names":[],"mappings":";;AAGO,MAAM,OAAO,MAAO,CAAA,OAAA;AAAA,EACzB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA,MAAA;AAAA,EACA,eAAA;AAAA,EACA,aAAA;AAAA,EACA,kBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF;AAGO,MAAM,MAAM,MAAO,CAAA,MAAA,CAAO,KAAK,MAAO,CAAA,UAAA,CAAW,gBAAgB,CAAC;AAGlE,MAAM,KAAK,MAAO,CAAA,KAAA,CAAM,MAAO,CAAA,MAAA,EAAQ,OAAO,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"]}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import*as index_js$2 from'./Resource/index.js';
|
|
1
|
+
import * as index_js$2 from './Resource/index.js';
|
|
2
|
+
export { index_js$2 as Resource };
|
|
3
|
+
import * as index_js from './Ajax/index.js';
|
|
4
|
+
export { index_js as Ajax };
|
|
5
|
+
import * as index_js$1 from './Logging/index.js';
|
|
6
|
+
export { index_js$1 as Logging };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
package/dist/main/index.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Resource } from '../effect';
|
|
3
|
+
|
|
4
|
+
const parseResource = (gid) => Effect.runSync(Resource.parse(gid));
|
|
5
|
+
const formatResource = (options) => Effect.runSync(Resource.format(options));
|
|
6
|
+
|
|
7
|
+
export { formatResource, parseResource };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
2
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/resources/index.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../src/resources/index.ts"],"names":[],"mappings":";;;AAGa,MAAA,aAAA,GAAgB,CAAC,GAC5B,KAAA,MAAA,CAAO,QAAQ,QAAS,CAAA,KAAA,CAAM,GAAG,CAAC;AAOvB,MAAA,cAAA,GAAiB,CAI5B,OACG,KAAA,MAAA,CAAO,QAAQ,QAAS,CAAA,MAAA,CAAa,OAAO,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
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brytdesigns/shopify-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main/index.js",
|
|
7
7
|
"types": "./dist/main/index.d.ts",
|
|
8
|
-
"jsdelivr": "./dist/jsdelivr/index.js",
|
|
9
8
|
"exports": {
|
|
10
9
|
".": {
|
|
11
10
|
"types": "./dist/main/index.d.ts",
|