@brytdesigns/shopify-ajax-cart-api 1.0.19 → 1.0.21
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/index.d.ts +32 -137
- package/dist/effect/schema.js +4 -57
- package/dist/effect/schema.js.map +1 -1
- package/dist/esm/index.js +130 -219
- package/dist/esm/index.js.map +1 -1
- package/dist/main/effect/schema.js +4 -57
- package/dist/main/effect/schema.js.map +1 -1
- package/dist/main/index.d.ts +70 -301
- package/dist/main/index.js +1 -1
- package/dist/main/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -6858,7 +6858,6 @@ var match7 = (concurrency, sequential4, unbounded4, bounded4) => {
|
|
|
6858
6858
|
// ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Clock.js
|
|
6859
6859
|
var sleep2 = sleep;
|
|
6860
6860
|
var currentTimeMillis2 = currentTimeMillis;
|
|
6861
|
-
var clockWith2 = clockWith;
|
|
6862
6861
|
var Clock = clockTag;
|
|
6863
6862
|
|
|
6864
6863
|
// ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/logSpan.js
|
|
@@ -6922,7 +6921,6 @@ var try_ = (arg) => {
|
|
|
6922
6921
|
}
|
|
6923
6922
|
});
|
|
6924
6923
|
};
|
|
6925
|
-
var clockWith3 = clockWith2;
|
|
6926
6924
|
var diffFiberRefs = (self) => summarized(self, fiberRefs2, diff5);
|
|
6927
6925
|
var diffFiberRefsAndRuntimeFlags = (self) => summarized(self, zip2(fiberRefs2, runtimeFlags), ([refs, flags], [refsNew, flagsNew]) => [diff5(refs, refsNew), diff4(flags, flagsNew)]);
|
|
6928
6926
|
var match8 = /* @__PURE__ */ dual(2, (self, options3) => matchEffect(self, {
|
|
@@ -7194,7 +7192,7 @@ var makeLogger = (log2) => ({
|
|
|
7194
7192
|
});
|
|
7195
7193
|
var textOnly = /^[^\s"=]*$/;
|
|
7196
7194
|
var format3 = (quoteValue, whitespace) => ({
|
|
7197
|
-
annotations:
|
|
7195
|
+
annotations: annotations2,
|
|
7198
7196
|
cause: cause2,
|
|
7199
7197
|
date,
|
|
7200
7198
|
fiberId: fiberId2,
|
|
@@ -7220,7 +7218,7 @@ var format3 = (quoteValue, whitespace) => ({
|
|
|
7220
7218
|
for (const span2 of spans) {
|
|
7221
7219
|
out += " " + render(date.getTime())(span2);
|
|
7222
7220
|
}
|
|
7223
|
-
for (const [label, value2] of
|
|
7221
|
+
for (const [label, value2] of annotations2) {
|
|
7224
7222
|
out += append5(label, toStringUnknown(value2, whitespace));
|
|
7225
7223
|
}
|
|
7226
7224
|
return out;
|
|
@@ -7301,7 +7299,7 @@ var prettyLoggerTty = (options3) => {
|
|
|
7301
7299
|
const processIsBun = typeof process === "object" && "isBun" in process && process.isBun === true;
|
|
7302
7300
|
const color = options3.colors ? withColor : withColorNoop;
|
|
7303
7301
|
return makeLogger(({
|
|
7304
|
-
annotations:
|
|
7302
|
+
annotations: annotations2,
|
|
7305
7303
|
cause: cause2,
|
|
7306
7304
|
context: context5,
|
|
7307
7305
|
date,
|
|
@@ -7343,8 +7341,8 @@ var prettyLoggerTty = (options3) => {
|
|
|
7343
7341
|
log2(redact(message[messageIndex]));
|
|
7344
7342
|
}
|
|
7345
7343
|
}
|
|
7346
|
-
if (size4(
|
|
7347
|
-
for (const [key, value2] of
|
|
7344
|
+
if (size4(annotations2) > 0) {
|
|
7345
|
+
for (const [key, value2] of annotations2) {
|
|
7348
7346
|
log2(color(`${key}:`, colors.bold, colors.white), redact(value2));
|
|
7349
7347
|
}
|
|
7350
7348
|
}
|
|
@@ -7354,7 +7352,7 @@ var prettyLoggerTty = (options3) => {
|
|
|
7354
7352
|
var prettyLoggerBrowser = (options3) => {
|
|
7355
7353
|
const color = options3.colors ? "%c" : "";
|
|
7356
7354
|
return makeLogger(({
|
|
7357
|
-
annotations:
|
|
7355
|
+
annotations: annotations2,
|
|
7358
7356
|
cause: cause2,
|
|
7359
7357
|
context: context5,
|
|
7360
7358
|
date,
|
|
@@ -7405,8 +7403,8 @@ var prettyLoggerBrowser = (options3) => {
|
|
|
7405
7403
|
console2.log(redact(message[messageIndex]));
|
|
7406
7404
|
}
|
|
7407
7405
|
}
|
|
7408
|
-
if (size4(
|
|
7409
|
-
for (const [key, value2] of
|
|
7406
|
+
if (size4(annotations2) > 0) {
|
|
7407
|
+
for (const [key, value2] of annotations2) {
|
|
7410
7408
|
const redacted = redact(value2);
|
|
7411
7409
|
if (options3.colors) {
|
|
7412
7410
|
console2.log(`%c${key}:`, "color:gray", redacted);
|
|
@@ -9094,7 +9092,7 @@ var FiberRuntime = class extends Class2 {
|
|
|
9094
9092
|
return;
|
|
9095
9093
|
}
|
|
9096
9094
|
const spans = this.getFiberRef(currentLogSpan);
|
|
9097
|
-
const
|
|
9095
|
+
const annotations2 = this.getFiberRef(currentLogAnnotations);
|
|
9098
9096
|
const loggers = this.getLoggers();
|
|
9099
9097
|
const contextMap = this.getFiberRefs();
|
|
9100
9098
|
if (size3(loggers) > 0) {
|
|
@@ -9109,7 +9107,7 @@ var FiberRuntime = class extends Class2 {
|
|
|
9109
9107
|
cause: cause2,
|
|
9110
9108
|
context: contextMap,
|
|
9111
9109
|
spans,
|
|
9112
|
-
annotations:
|
|
9110
|
+
annotations: annotations2,
|
|
9113
9111
|
date
|
|
9114
9112
|
});
|
|
9115
9113
|
}
|
|
@@ -9568,7 +9566,7 @@ var loggerWithConsoleLog = (self) => makeLogger((opts) => {
|
|
|
9568
9566
|
var defaultLogger = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Logger/defaultLogger"), () => loggerWithConsoleLog(stringLogger));
|
|
9569
9567
|
var prettyLogger2 = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Logger/prettyLogger"), () => prettyLoggerDefault);
|
|
9570
9568
|
var tracerLogger = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Logger/tracerLogger"), () => makeLogger(({
|
|
9571
|
-
annotations:
|
|
9569
|
+
annotations: annotations2,
|
|
9572
9570
|
cause: cause2,
|
|
9573
9571
|
context: context5,
|
|
9574
9572
|
fiberId: fiberId2,
|
|
@@ -9581,7 +9579,7 @@ var tracerLogger = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effec
|
|
|
9581
9579
|
}
|
|
9582
9580
|
const clockService = unsafeGet4(getOrDefault(context5, currentServices), clockTag);
|
|
9583
9581
|
const attributes = {};
|
|
9584
|
-
for (const [key, value2] of
|
|
9582
|
+
for (const [key, value2] of annotations2) {
|
|
9585
9583
|
attributes[key] = value2;
|
|
9586
9584
|
}
|
|
9587
9585
|
attributes["effect.fiberId"] = threadName2(fiberId2);
|
|
@@ -9599,12 +9597,12 @@ var annotateLogsScoped = function() {
|
|
|
9599
9597
|
return fiberRefLocallyScopedWith(currentLogAnnotations, set3(arguments[0], arguments[1]));
|
|
9600
9598
|
}
|
|
9601
9599
|
const entries2 = Object.entries(arguments[0]);
|
|
9602
|
-
return fiberRefLocallyScopedWith(currentLogAnnotations, mutate3((
|
|
9600
|
+
return fiberRefLocallyScopedWith(currentLogAnnotations, mutate3((annotations2) => {
|
|
9603
9601
|
for (let i = 0; i < entries2.length; i++) {
|
|
9604
9602
|
const [key, value2] = entries2[i];
|
|
9605
|
-
set3(
|
|
9603
|
+
set3(annotations2, key, value2);
|
|
9606
9604
|
}
|
|
9607
|
-
return
|
|
9605
|
+
return annotations2;
|
|
9608
9606
|
}));
|
|
9609
9607
|
};
|
|
9610
9608
|
var acquireRelease = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (acquire, release) => uninterruptible(tap(acquire, (a) => addFinalizer((exit4) => release(a, exit4)))));
|
|
@@ -10636,27 +10634,6 @@ var Latch = class extends Class2 {
|
|
|
10636
10634
|
};
|
|
10637
10635
|
};
|
|
10638
10636
|
var unsafeMakeLatch = (open) => new Latch(open ?? false);
|
|
10639
|
-
var cached2 = /* @__PURE__ */ dual(2, (self, timeToLive) => map11(cachedInvalidateWithTTL(self, timeToLive), (tuple) => tuple[0]));
|
|
10640
|
-
var cachedInvalidateWithTTL = /* @__PURE__ */ dual(2, (self, timeToLive) => {
|
|
10641
|
-
const duration = decode(timeToLive);
|
|
10642
|
-
return flatMap7(context(), (env) => map11(makeSynchronized(none2()), (cache) => [provideContext(getCachedValue(self, duration, cache), env), invalidateCache(cache)]));
|
|
10643
|
-
});
|
|
10644
|
-
var computeCachedValue = (self, timeToLive, start3) => {
|
|
10645
|
-
const timeToLiveMillis = toMillis(decode(timeToLive));
|
|
10646
|
-
return pipe(deferredMake(), tap((deferred) => intoDeferred(self, deferred)), map11((deferred) => some2([start3 + timeToLiveMillis, deferred])));
|
|
10647
|
-
};
|
|
10648
|
-
var getCachedValue = (self, timeToLive, cache) => uninterruptibleMask((restore) => pipe(clockWith3((clock3) => clock3.currentTimeMillis), flatMap7((time) => updateSomeAndGetEffectSynchronized(cache, (option2) => {
|
|
10649
|
-
switch (option2._tag) {
|
|
10650
|
-
case "None": {
|
|
10651
|
-
return some2(computeCachedValue(self, timeToLive, time));
|
|
10652
|
-
}
|
|
10653
|
-
case "Some": {
|
|
10654
|
-
const [end3] = option2.value;
|
|
10655
|
-
return end3 - time <= 0 ? some2(computeCachedValue(self, timeToLive, time)) : none2();
|
|
10656
|
-
}
|
|
10657
|
-
}
|
|
10658
|
-
})), flatMap7((option2) => isNone2(option2) ? dieMessage("BUG: Effect.cachedInvalidate - please report an issue at https://github.com/Effect-TS/effect/issues") : restore(deferredAwait(option2.value[1])))));
|
|
10659
|
-
var invalidateCache = (cache) => set4(cache, none2());
|
|
10660
10637
|
var forkIn = /* @__PURE__ */ dual(2, (self, scope4) => withFiberRuntime((parent, parentStatus) => {
|
|
10661
10638
|
const scopeImpl = scope4;
|
|
10662
10639
|
const fiber = unsafeFork2(self, parent, parentStatus.runtimeFlags, globalScope);
|
|
@@ -10708,17 +10685,6 @@ var unsafeMakeSynchronized = (value2) => {
|
|
|
10708
10685
|
const sem = unsafeMakeSemaphore(1);
|
|
10709
10686
|
return new SynchronizedImpl(ref, sem.withPermits(1));
|
|
10710
10687
|
};
|
|
10711
|
-
var updateSomeAndGetEffectSynchronized = /* @__PURE__ */ dual(2, (self, pf) => self.modifyEffect((value2) => {
|
|
10712
|
-
const result = pf(value2);
|
|
10713
|
-
switch (result._tag) {
|
|
10714
|
-
case "None": {
|
|
10715
|
-
return succeed([value2, value2]);
|
|
10716
|
-
}
|
|
10717
|
-
case "Some": {
|
|
10718
|
-
return map11(result.value, (a) => [a, a]);
|
|
10719
|
-
}
|
|
10720
|
-
}
|
|
10721
|
-
}));
|
|
10722
10688
|
|
|
10723
10689
|
// ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/managedRuntime/circular.js
|
|
10724
10690
|
var TypeId13 = /* @__PURE__ */ Symbol.for("effect/ManagedRuntime");
|
|
@@ -11351,7 +11317,6 @@ var pollUpTo = /* @__PURE__ */ dual(2, (self, n) => {
|
|
|
11351
11317
|
|
|
11352
11318
|
// ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Effect.js
|
|
11353
11319
|
var isEffect2 = isEffect;
|
|
11354
|
-
var cachedWithTTL = cached2;
|
|
11355
11320
|
var cached3 = memoize;
|
|
11356
11321
|
var all4 = all3;
|
|
11357
11322
|
var forEach8 = forEach7;
|
|
@@ -11623,11 +11588,11 @@ var Declaration = class {
|
|
|
11623
11588
|
* @since 3.10.0
|
|
11624
11589
|
*/
|
|
11625
11590
|
_tag = "Declaration";
|
|
11626
|
-
constructor(typeParameters, decodeUnknown3, encodeUnknown2,
|
|
11591
|
+
constructor(typeParameters, decodeUnknown3, encodeUnknown2, annotations2 = {}) {
|
|
11627
11592
|
this.typeParameters = typeParameters;
|
|
11628
11593
|
this.decodeUnknown = decodeUnknown3;
|
|
11629
11594
|
this.encodeUnknown = encodeUnknown2;
|
|
11630
|
-
this.annotations =
|
|
11595
|
+
this.annotations = annotations2;
|
|
11631
11596
|
}
|
|
11632
11597
|
/**
|
|
11633
11598
|
* @since 3.10.0
|
|
@@ -11654,9 +11619,9 @@ var Literal = class {
|
|
|
11654
11619
|
* @since 3.10.0
|
|
11655
11620
|
*/
|
|
11656
11621
|
_tag = "Literal";
|
|
11657
|
-
constructor(literal,
|
|
11622
|
+
constructor(literal, annotations2 = {}) {
|
|
11658
11623
|
this.literal = literal;
|
|
11659
|
-
this.annotations =
|
|
11624
|
+
this.annotations = annotations2;
|
|
11660
11625
|
}
|
|
11661
11626
|
/**
|
|
11662
11627
|
* @since 3.10.0
|
|
@@ -11684,9 +11649,9 @@ var UniqueSymbol = class {
|
|
|
11684
11649
|
* @since 3.10.0
|
|
11685
11650
|
*/
|
|
11686
11651
|
_tag = "UniqueSymbol";
|
|
11687
|
-
constructor(symbol3,
|
|
11652
|
+
constructor(symbol3, annotations2 = {}) {
|
|
11688
11653
|
this.symbol = symbol3;
|
|
11689
|
-
this.annotations =
|
|
11654
|
+
this.annotations = annotations2;
|
|
11690
11655
|
}
|
|
11691
11656
|
/**
|
|
11692
11657
|
* @since 3.10.0
|
|
@@ -11711,8 +11676,8 @@ var UndefinedKeyword = class {
|
|
|
11711
11676
|
* @since 3.10.0
|
|
11712
11677
|
*/
|
|
11713
11678
|
_tag = "UndefinedKeyword";
|
|
11714
|
-
constructor(
|
|
11715
|
-
this.annotations =
|
|
11679
|
+
constructor(annotations2 = {}) {
|
|
11680
|
+
this.annotations = annotations2;
|
|
11716
11681
|
}
|
|
11717
11682
|
/**
|
|
11718
11683
|
* @since 3.10.0
|
|
@@ -11739,8 +11704,8 @@ var NeverKeyword = class {
|
|
|
11739
11704
|
* @since 3.10.0
|
|
11740
11705
|
*/
|
|
11741
11706
|
_tag = "NeverKeyword";
|
|
11742
|
-
constructor(
|
|
11743
|
-
this.annotations =
|
|
11707
|
+
constructor(annotations2 = {}) {
|
|
11708
|
+
this.annotations = annotations2;
|
|
11744
11709
|
}
|
|
11745
11710
|
/**
|
|
11746
11711
|
* @since 3.10.0
|
|
@@ -11767,8 +11732,8 @@ var UnknownKeyword = class {
|
|
|
11767
11732
|
* @since 3.10.0
|
|
11768
11733
|
*/
|
|
11769
11734
|
_tag = "UnknownKeyword";
|
|
11770
|
-
constructor(
|
|
11771
|
-
this.annotations =
|
|
11735
|
+
constructor(annotations2 = {}) {
|
|
11736
|
+
this.annotations = annotations2;
|
|
11772
11737
|
}
|
|
11773
11738
|
/**
|
|
11774
11739
|
* @since 3.10.0
|
|
@@ -11795,8 +11760,8 @@ var AnyKeyword = class {
|
|
|
11795
11760
|
* @since 3.10.0
|
|
11796
11761
|
*/
|
|
11797
11762
|
_tag = "AnyKeyword";
|
|
11798
|
-
constructor(
|
|
11799
|
-
this.annotations =
|
|
11763
|
+
constructor(annotations2 = {}) {
|
|
11764
|
+
this.annotations = annotations2;
|
|
11800
11765
|
}
|
|
11801
11766
|
/**
|
|
11802
11767
|
* @since 3.10.0
|
|
@@ -11823,8 +11788,8 @@ var StringKeyword = class {
|
|
|
11823
11788
|
* @since 3.10.0
|
|
11824
11789
|
*/
|
|
11825
11790
|
_tag = "StringKeyword";
|
|
11826
|
-
constructor(
|
|
11827
|
-
this.annotations =
|
|
11791
|
+
constructor(annotations2 = {}) {
|
|
11792
|
+
this.annotations = annotations2;
|
|
11828
11793
|
}
|
|
11829
11794
|
/**
|
|
11830
11795
|
* @since 3.10.0
|
|
@@ -11853,8 +11818,8 @@ var NumberKeyword = class {
|
|
|
11853
11818
|
* @since 3.10.0
|
|
11854
11819
|
*/
|
|
11855
11820
|
_tag = "NumberKeyword";
|
|
11856
|
-
constructor(
|
|
11857
|
-
this.annotations =
|
|
11821
|
+
constructor(annotations2 = {}) {
|
|
11822
|
+
this.annotations = annotations2;
|
|
11858
11823
|
}
|
|
11859
11824
|
/**
|
|
11860
11825
|
* @since 3.10.0
|
|
@@ -11883,8 +11848,8 @@ var BooleanKeyword = class {
|
|
|
11883
11848
|
* @since 3.10.0
|
|
11884
11849
|
*/
|
|
11885
11850
|
_tag = "BooleanKeyword";
|
|
11886
|
-
constructor(
|
|
11887
|
-
this.annotations =
|
|
11851
|
+
constructor(annotations2 = {}) {
|
|
11852
|
+
this.annotations = annotations2;
|
|
11888
11853
|
}
|
|
11889
11854
|
/**
|
|
11890
11855
|
* @since 3.10.0
|
|
@@ -11911,9 +11876,9 @@ var isSymbolKeyword = /* @__PURE__ */ createASTGuard("SymbolKeyword");
|
|
|
11911
11876
|
var Type = class {
|
|
11912
11877
|
type;
|
|
11913
11878
|
annotations;
|
|
11914
|
-
constructor(type,
|
|
11879
|
+
constructor(type, annotations2 = {}) {
|
|
11915
11880
|
this.type = type;
|
|
11916
|
-
this.annotations =
|
|
11881
|
+
this.annotations = annotations2;
|
|
11917
11882
|
}
|
|
11918
11883
|
/**
|
|
11919
11884
|
* @since 3.10.0
|
|
@@ -11933,8 +11898,8 @@ var Type = class {
|
|
|
11933
11898
|
};
|
|
11934
11899
|
var OptionalType = class extends Type {
|
|
11935
11900
|
isOptional;
|
|
11936
|
-
constructor(type, isOptional,
|
|
11937
|
-
super(type,
|
|
11901
|
+
constructor(type, isOptional, annotations2 = {}) {
|
|
11902
|
+
super(type, annotations2);
|
|
11938
11903
|
this.isOptional = isOptional;
|
|
11939
11904
|
}
|
|
11940
11905
|
/**
|
|
@@ -11964,11 +11929,11 @@ var TupleType = class {
|
|
|
11964
11929
|
* @since 3.10.0
|
|
11965
11930
|
*/
|
|
11966
11931
|
_tag = "TupleType";
|
|
11967
|
-
constructor(elements, rest, isReadonly,
|
|
11932
|
+
constructor(elements, rest, isReadonly, annotations2 = {}) {
|
|
11968
11933
|
this.elements = elements;
|
|
11969
11934
|
this.rest = rest;
|
|
11970
11935
|
this.isReadonly = isReadonly;
|
|
11971
|
-
this.annotations =
|
|
11936
|
+
this.annotations = annotations2;
|
|
11972
11937
|
let hasOptionalElement = false;
|
|
11973
11938
|
let hasIllegalRequiredElement = false;
|
|
11974
11939
|
for (const e of elements) {
|
|
@@ -12029,8 +11994,8 @@ var formatTuple = (ast) => {
|
|
|
12029
11994
|
var PropertySignature = class extends OptionalType {
|
|
12030
11995
|
name;
|
|
12031
11996
|
isReadonly;
|
|
12032
|
-
constructor(name, type, isOptional, isReadonly,
|
|
12033
|
-
super(type, isOptional,
|
|
11997
|
+
constructor(name, type, isOptional, isReadonly, annotations2) {
|
|
11998
|
+
super(type, isOptional, annotations2);
|
|
12034
11999
|
this.name = name;
|
|
12035
12000
|
this.isReadonly = isReadonly;
|
|
12036
12001
|
}
|
|
@@ -12111,8 +12076,8 @@ var TypeLiteral = class {
|
|
|
12111
12076
|
* @since 3.10.0
|
|
12112
12077
|
*/
|
|
12113
12078
|
indexSignatures;
|
|
12114
|
-
constructor(propertySignatures, indexSignatures,
|
|
12115
|
-
this.annotations =
|
|
12079
|
+
constructor(propertySignatures, indexSignatures, annotations2 = {}) {
|
|
12080
|
+
this.annotations = annotations2;
|
|
12116
12081
|
const keys6 = {};
|
|
12117
12082
|
for (let i = 0; i < propertySignatures.length; i++) {
|
|
12118
12083
|
const name = propertySignatures[i].name;
|
|
@@ -12288,20 +12253,20 @@ var unify = (candidates) => {
|
|
|
12288
12253
|
var Union = class _Union {
|
|
12289
12254
|
types;
|
|
12290
12255
|
annotations;
|
|
12291
|
-
static make = (types,
|
|
12292
|
-
return isMembers(types) ? new _Union(types,
|
|
12256
|
+
static make = (types, annotations2) => {
|
|
12257
|
+
return isMembers(types) ? new _Union(types, annotations2) : types.length === 1 ? types[0] : neverKeyword;
|
|
12293
12258
|
};
|
|
12294
12259
|
/** @internal */
|
|
12295
|
-
static unify = (candidates,
|
|
12296
|
-
return _Union.make(unify(flatten7(candidates)),
|
|
12260
|
+
static unify = (candidates, annotations2) => {
|
|
12261
|
+
return _Union.make(unify(flatten7(candidates)), annotations2);
|
|
12297
12262
|
};
|
|
12298
12263
|
/**
|
|
12299
12264
|
* @since 3.10.0
|
|
12300
12265
|
*/
|
|
12301
12266
|
_tag = "Union";
|
|
12302
|
-
constructor(types,
|
|
12267
|
+
constructor(types, annotations2 = {}) {
|
|
12303
12268
|
this.types = types;
|
|
12304
|
-
this.annotations =
|
|
12269
|
+
this.annotations = annotations2;
|
|
12305
12270
|
}
|
|
12306
12271
|
/**
|
|
12307
12272
|
* @since 3.10.0
|
|
@@ -12331,9 +12296,9 @@ var Suspend = class {
|
|
|
12331
12296
|
* @since 3.10.0
|
|
12332
12297
|
*/
|
|
12333
12298
|
_tag = "Suspend";
|
|
12334
|
-
constructor(f,
|
|
12299
|
+
constructor(f, annotations2 = {}) {
|
|
12335
12300
|
this.f = f;
|
|
12336
|
-
this.annotations =
|
|
12301
|
+
this.annotations = annotations2;
|
|
12337
12302
|
this.f = memoizeThunk(f);
|
|
12338
12303
|
}
|
|
12339
12304
|
/**
|
|
@@ -12371,10 +12336,10 @@ var Refinement = class {
|
|
|
12371
12336
|
* @since 3.10.0
|
|
12372
12337
|
*/
|
|
12373
12338
|
_tag = "Refinement";
|
|
12374
|
-
constructor(from, filter12,
|
|
12339
|
+
constructor(from, filter12, annotations2 = {}) {
|
|
12375
12340
|
this.from = from;
|
|
12376
12341
|
this.filter = filter12;
|
|
12377
|
-
this.annotations =
|
|
12342
|
+
this.annotations = annotations2;
|
|
12378
12343
|
}
|
|
12379
12344
|
/**
|
|
12380
12345
|
* @since 3.10.0
|
|
@@ -12407,11 +12372,11 @@ var Transformation = class {
|
|
|
12407
12372
|
* @since 3.10.0
|
|
12408
12373
|
*/
|
|
12409
12374
|
_tag = "Transformation";
|
|
12410
|
-
constructor(from, to, transformation,
|
|
12375
|
+
constructor(from, to, transformation, annotations2 = {}) {
|
|
12411
12376
|
this.from = from;
|
|
12412
12377
|
this.to = to;
|
|
12413
12378
|
this.transformation = transformation;
|
|
12414
|
-
this.annotations =
|
|
12379
|
+
this.annotations = annotations2;
|
|
12415
12380
|
}
|
|
12416
12381
|
/**
|
|
12417
12382
|
* @since 3.10.0
|
|
@@ -12739,10 +12704,10 @@ var encodedAST_ = (ast, isBound) => {
|
|
|
12739
12704
|
return ast;
|
|
12740
12705
|
};
|
|
12741
12706
|
var encodedAST = (ast) => encodedAST_(ast);
|
|
12742
|
-
var toJSONAnnotations = (
|
|
12707
|
+
var toJSONAnnotations = (annotations2) => {
|
|
12743
12708
|
const out = {};
|
|
12744
|
-
for (const k of Object.getOwnPropertySymbols(
|
|
12745
|
-
out[String(k)] =
|
|
12709
|
+
for (const k of Object.getOwnPropertySymbols(annotations2)) {
|
|
12710
|
+
out[String(k)] = annotations2[k];
|
|
12746
12711
|
}
|
|
12747
12712
|
return out;
|
|
12748
12713
|
};
|
|
@@ -13565,8 +13530,8 @@ var go = (ast, isDecoding) => {
|
|
|
13565
13530
|
};
|
|
13566
13531
|
}
|
|
13567
13532
|
case "Suspend": {
|
|
13568
|
-
const
|
|
13569
|
-
return (a, options3) =>
|
|
13533
|
+
const get19 = memoizeThunk(() => goMemo(annotations(ast.f(), ast.annotations), isDecoding));
|
|
13534
|
+
return (a, options3) => get19()(a, options3);
|
|
13570
13535
|
}
|
|
13571
13536
|
}
|
|
13572
13537
|
};
|
|
@@ -13883,8 +13848,8 @@ function make43(ast) {
|
|
|
13883
13848
|
return class SchemaClass {
|
|
13884
13849
|
[TypeId16] = variance5;
|
|
13885
13850
|
static ast = ast;
|
|
13886
|
-
static annotations(
|
|
13887
|
-
return make43(mergeSchemaAnnotations(this.ast,
|
|
13851
|
+
static annotations(annotations2) {
|
|
13852
|
+
return make43(mergeSchemaAnnotations(this.ast, annotations2));
|
|
13888
13853
|
}
|
|
13889
13854
|
static pipe() {
|
|
13890
13855
|
return pipeArguments(this, arguments);
|
|
@@ -13926,23 +13891,23 @@ var builtInAnnotations = {
|
|
|
13926
13891
|
parseOptions: ParseOptionsAnnotationId,
|
|
13927
13892
|
decodingFallback: DecodingFallbackAnnotationId
|
|
13928
13893
|
};
|
|
13929
|
-
var toASTAnnotations = (
|
|
13930
|
-
if (!
|
|
13894
|
+
var toASTAnnotations = (annotations2) => {
|
|
13895
|
+
if (!annotations2) {
|
|
13931
13896
|
return {};
|
|
13932
13897
|
}
|
|
13933
13898
|
const out = {
|
|
13934
|
-
...
|
|
13899
|
+
...annotations2
|
|
13935
13900
|
};
|
|
13936
13901
|
for (const key in builtInAnnotations) {
|
|
13937
|
-
if (key in
|
|
13902
|
+
if (key in annotations2) {
|
|
13938
13903
|
const id2 = builtInAnnotations[key];
|
|
13939
|
-
out[id2] =
|
|
13904
|
+
out[id2] = annotations2[key];
|
|
13940
13905
|
delete out[key];
|
|
13941
13906
|
}
|
|
13942
13907
|
}
|
|
13943
13908
|
return out;
|
|
13944
13909
|
};
|
|
13945
|
-
var mergeSchemaAnnotations = (ast,
|
|
13910
|
+
var mergeSchemaAnnotations = (ast, annotations2) => annotations(ast, toASTAnnotations(annotations2));
|
|
13946
13911
|
var format4 = (schema) => String(schema.ast);
|
|
13947
13912
|
var typeSchema = (schema) => make43(typeAST(schema.ast));
|
|
13948
13913
|
var decodeUnknown2 = (schema, options3) => {
|
|
@@ -13956,8 +13921,8 @@ function getDefaultLiteralAST(literals) {
|
|
|
13956
13921
|
}
|
|
13957
13922
|
function makeLiteralClass(literals, ast = getDefaultLiteralAST(literals)) {
|
|
13958
13923
|
return class LiteralClass extends make43(ast) {
|
|
13959
|
-
static annotations(
|
|
13960
|
-
return makeLiteralClass(this.literals, mergeSchemaAnnotations(this.ast,
|
|
13924
|
+
static annotations(annotations2) {
|
|
13925
|
+
return makeLiteralClass(this.literals, mergeSchemaAnnotations(this.ast, annotations2));
|
|
13961
13926
|
}
|
|
13962
13927
|
static literals = [...literals];
|
|
13963
13928
|
};
|
|
@@ -13965,16 +13930,16 @@ function makeLiteralClass(literals, ast = getDefaultLiteralAST(literals)) {
|
|
|
13965
13930
|
function Literal2(...literals) {
|
|
13966
13931
|
return isNonEmptyReadonlyArray(literals) ? makeLiteralClass(literals) : Never;
|
|
13967
13932
|
}
|
|
13968
|
-
var declareConstructor = (typeParameters, options3,
|
|
13969
|
-
var declarePrimitive = (is2,
|
|
13933
|
+
var declareConstructor = (typeParameters, options3, annotations2) => makeDeclareClass(typeParameters, new Declaration(typeParameters.map((tp) => tp.ast), (...typeParameters2) => options3.decode(...typeParameters2.map(make43)), (...typeParameters2) => options3.encode(...typeParameters2.map(make43)), toASTAnnotations(annotations2)));
|
|
13934
|
+
var declarePrimitive = (is2, annotations2) => {
|
|
13970
13935
|
const decodeUnknown3 = () => (input, _, ast) => is2(input) ? succeed8(input) : fail8(new Type2(ast, input));
|
|
13971
13936
|
const encodeUnknown2 = decodeUnknown3;
|
|
13972
|
-
return makeDeclareClass([], new Declaration([], decodeUnknown3, encodeUnknown2, toASTAnnotations(
|
|
13937
|
+
return makeDeclareClass([], new Declaration([], decodeUnknown3, encodeUnknown2, toASTAnnotations(annotations2)));
|
|
13973
13938
|
};
|
|
13974
13939
|
function makeDeclareClass(typeParameters, ast) {
|
|
13975
13940
|
return class DeclareClass extends make43(ast) {
|
|
13976
|
-
static annotations(
|
|
13977
|
-
return makeDeclareClass(this.typeParameters, mergeSchemaAnnotations(this.ast,
|
|
13941
|
+
static annotations(annotations2) {
|
|
13942
|
+
return makeDeclareClass(this.typeParameters, mergeSchemaAnnotations(this.ast, annotations2));
|
|
13978
13943
|
}
|
|
13979
13944
|
static typeParameters = [...typeParameters];
|
|
13980
13945
|
};
|
|
@@ -13983,12 +13948,12 @@ var declare = function() {
|
|
|
13983
13948
|
if (Array.isArray(arguments[0])) {
|
|
13984
13949
|
const typeParameters = arguments[0];
|
|
13985
13950
|
const options3 = arguments[1];
|
|
13986
|
-
const
|
|
13987
|
-
return declareConstructor(typeParameters, options3,
|
|
13951
|
+
const annotations3 = arguments[2];
|
|
13952
|
+
return declareConstructor(typeParameters, options3, annotations3);
|
|
13988
13953
|
}
|
|
13989
13954
|
const is2 = arguments[0];
|
|
13990
|
-
const
|
|
13991
|
-
return declarePrimitive(is2,
|
|
13955
|
+
const annotations2 = arguments[1];
|
|
13956
|
+
return declarePrimitive(is2, annotations2);
|
|
13992
13957
|
};
|
|
13993
13958
|
var Undefined = class extends (/* @__PURE__ */ make43(undefinedKeyword)) {
|
|
13994
13959
|
};
|
|
@@ -14005,8 +13970,8 @@ var Boolean$ = class extends (/* @__PURE__ */ make43(booleanKeyword)) {
|
|
|
14005
13970
|
var getDefaultUnionAST = (members) => Union.make(members.map((m) => m.ast));
|
|
14006
13971
|
function makeUnionClass(members, ast = getDefaultUnionAST(members)) {
|
|
14007
13972
|
return class UnionClass extends make43(ast) {
|
|
14008
|
-
static annotations(
|
|
14009
|
-
return makeUnionClass(this.members, mergeSchemaAnnotations(this.ast,
|
|
13973
|
+
static annotations(annotations2) {
|
|
13974
|
+
return makeUnionClass(this.members, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14010
13975
|
}
|
|
14011
13976
|
static members = [...members];
|
|
14012
13977
|
};
|
|
@@ -14020,8 +13985,8 @@ var NullishOr = (self) => Union2(self, Null, Undefined);
|
|
|
14020
13985
|
var getDefaultTupleTypeAST = (elements, rest) => new TupleType(elements.map((el) => isSchema(el) ? new OptionalType(el.ast, false) : el.ast), rest.map((el) => isSchema(el) ? new Type(el.ast) : el.ast), true);
|
|
14021
13986
|
function makeTupleTypeClass(elements, rest, ast = getDefaultTupleTypeAST(elements, rest)) {
|
|
14022
13987
|
return class TupleTypeClass extends make43(ast) {
|
|
14023
|
-
static annotations(
|
|
14024
|
-
return makeTupleTypeClass(this.elements, this.rest, mergeSchemaAnnotations(this.ast,
|
|
13988
|
+
static annotations(annotations2) {
|
|
13989
|
+
return makeTupleTypeClass(this.elements, this.rest, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14025
13990
|
}
|
|
14026
13991
|
static elements = [...elements];
|
|
14027
13992
|
static rest = [...rest];
|
|
@@ -14029,8 +13994,8 @@ function makeTupleTypeClass(elements, rest, ast = getDefaultTupleTypeAST(element
|
|
|
14029
13994
|
}
|
|
14030
13995
|
function makeArrayClass(value2, ast) {
|
|
14031
13996
|
return class ArrayClass extends makeTupleTypeClass([], [value2], ast) {
|
|
14032
|
-
static annotations(
|
|
14033
|
-
return makeArrayClass(this.value, mergeSchemaAnnotations(this.ast,
|
|
13997
|
+
static annotations(annotations2) {
|
|
13998
|
+
return makeArrayClass(this.value, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14034
13999
|
}
|
|
14035
14000
|
static value = value2;
|
|
14036
14001
|
};
|
|
@@ -14044,8 +14009,8 @@ var PropertySignatureDeclaration = class extends OptionalType {
|
|
|
14044
14009
|
* @since 3.10.0
|
|
14045
14010
|
*/
|
|
14046
14011
|
_tag = "PropertySignatureDeclaration";
|
|
14047
|
-
constructor(type, isOptional, isReadonly,
|
|
14048
|
-
super(type, isOptional,
|
|
14012
|
+
constructor(type, isOptional, isReadonly, annotations2, defaultValue) {
|
|
14013
|
+
super(type, isOptional, annotations2);
|
|
14049
14014
|
this.isReadonly = isReadonly;
|
|
14050
14015
|
this.defaultValue = defaultValue;
|
|
14051
14016
|
}
|
|
@@ -14061,8 +14026,8 @@ var PropertySignatureDeclaration = class extends OptionalType {
|
|
|
14061
14026
|
var FromPropertySignature = class extends OptionalType {
|
|
14062
14027
|
isReadonly;
|
|
14063
14028
|
fromKey;
|
|
14064
|
-
constructor(type, isOptional, isReadonly,
|
|
14065
|
-
super(type, isOptional,
|
|
14029
|
+
constructor(type, isOptional, isReadonly, annotations2, fromKey) {
|
|
14030
|
+
super(type, isOptional, annotations2);
|
|
14066
14031
|
this.isReadonly = isReadonly;
|
|
14067
14032
|
this.fromKey = fromKey;
|
|
14068
14033
|
}
|
|
@@ -14070,8 +14035,8 @@ var FromPropertySignature = class extends OptionalType {
|
|
|
14070
14035
|
var ToPropertySignature = class extends OptionalType {
|
|
14071
14036
|
isReadonly;
|
|
14072
14037
|
defaultValue;
|
|
14073
|
-
constructor(type, isOptional, isReadonly,
|
|
14074
|
-
super(type, isOptional,
|
|
14038
|
+
constructor(type, isOptional, isReadonly, annotations2, defaultValue) {
|
|
14039
|
+
super(type, isOptional, annotations2);
|
|
14075
14040
|
this.isReadonly = isReadonly;
|
|
14076
14041
|
this.defaultValue = defaultValue;
|
|
14077
14042
|
}
|
|
@@ -14107,18 +14072,18 @@ var PropertySignatureTransformation2 = class {
|
|
|
14107
14072
|
return `PropertySignature<${formatPropertySignatureToken(this.to.isOptional)}, ${this.to.type}, ${formatPropertyKey2(this.from.fromKey)}, ${formatPropertySignatureToken(this.from.isOptional)}, ${this.from.type}>`;
|
|
14108
14073
|
}
|
|
14109
14074
|
};
|
|
14110
|
-
var mergeSignatureAnnotations = (ast,
|
|
14075
|
+
var mergeSignatureAnnotations = (ast, annotations2) => {
|
|
14111
14076
|
switch (ast._tag) {
|
|
14112
14077
|
case "PropertySignatureDeclaration": {
|
|
14113
14078
|
return new PropertySignatureDeclaration(ast.type, ast.isOptional, ast.isReadonly, {
|
|
14114
14079
|
...ast.annotations,
|
|
14115
|
-
...
|
|
14080
|
+
...annotations2
|
|
14116
14081
|
}, ast.defaultValue);
|
|
14117
14082
|
}
|
|
14118
14083
|
case "PropertySignatureTransformation": {
|
|
14119
14084
|
return new PropertySignatureTransformation2(ast.from, new ToPropertySignature(ast.to.type, ast.to.isOptional, ast.to.isReadonly, {
|
|
14120
14085
|
...ast.to.annotations,
|
|
14121
|
-
...
|
|
14086
|
+
...annotations2
|
|
14122
14087
|
}, ast.to.defaultValue), ast.decode, ast.encode);
|
|
14123
14088
|
}
|
|
14124
14089
|
}
|
|
@@ -14139,8 +14104,8 @@ var PropertySignatureImpl = class _PropertySignatureImpl {
|
|
|
14139
14104
|
pipe() {
|
|
14140
14105
|
return pipeArguments(this, arguments);
|
|
14141
14106
|
}
|
|
14142
|
-
annotations(
|
|
14143
|
-
return new _PropertySignatureImpl(mergeSignatureAnnotations(this.ast, toASTAnnotations(
|
|
14107
|
+
annotations(annotations2) {
|
|
14108
|
+
return new _PropertySignatureImpl(mergeSignatureAnnotations(this.ast, toASTAnnotations(annotations2)));
|
|
14144
14109
|
}
|
|
14145
14110
|
toString() {
|
|
14146
14111
|
return String(this.ast);
|
|
@@ -14153,8 +14118,8 @@ var PropertySignatureWithFromImpl = class _PropertySignatureWithFromImpl extends
|
|
|
14153
14118
|
super(ast);
|
|
14154
14119
|
this.from = from;
|
|
14155
14120
|
}
|
|
14156
|
-
annotations(
|
|
14157
|
-
return new _PropertySignatureWithFromImpl(mergeSignatureAnnotations(this.ast, toASTAnnotations(
|
|
14121
|
+
annotations(annotations2) {
|
|
14122
|
+
return new _PropertySignatureWithFromImpl(mergeSignatureAnnotations(this.ast, toASTAnnotations(annotations2)), this.from);
|
|
14158
14123
|
}
|
|
14159
14124
|
};
|
|
14160
14125
|
var withConstructorDefault = /* @__PURE__ */ dual(2, (self, defaultValue) => {
|
|
@@ -14353,8 +14318,8 @@ var lazilyMergeDefaults = (fields, out) => {
|
|
|
14353
14318
|
};
|
|
14354
14319
|
function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fields, records)) {
|
|
14355
14320
|
return class TypeLiteralClass extends make43(ast) {
|
|
14356
|
-
static annotations(
|
|
14357
|
-
return makeTypeLiteralClass(this.fields, this.records, mergeSchemaAnnotations(this.ast,
|
|
14321
|
+
static annotations(annotations2) {
|
|
14322
|
+
return makeTypeLiteralClass(this.fields, this.records, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14358
14323
|
}
|
|
14359
14324
|
static fields = {
|
|
14360
14325
|
...fields
|
|
@@ -14382,8 +14347,8 @@ function makeRecordClass(key, value2, ast) {
|
|
|
14382
14347
|
key,
|
|
14383
14348
|
value: value2
|
|
14384
14349
|
}], ast) {
|
|
14385
|
-
static annotations(
|
|
14386
|
-
return makeRecordClass(key, value2, mergeSchemaAnnotations(this.ast,
|
|
14350
|
+
static annotations(annotations2) {
|
|
14351
|
+
return makeRecordClass(key, value2, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14387
14352
|
}
|
|
14388
14353
|
static key = key;
|
|
14389
14354
|
static value = value2;
|
|
@@ -14514,8 +14479,8 @@ var extend3 = /* @__PURE__ */ dual(2, (self, that) => make43(extendAST(self.ast,
|
|
|
14514
14479
|
var RefineSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/Refine");
|
|
14515
14480
|
function makeRefineClass(from, filter12, ast) {
|
|
14516
14481
|
return class RefineClass extends make43(ast) {
|
|
14517
|
-
static annotations(
|
|
14518
|
-
return makeRefineClass(this.from, this.filter, mergeSchemaAnnotations(this.ast,
|
|
14482
|
+
static annotations(annotations2) {
|
|
14483
|
+
return makeRefineClass(this.from, this.filter, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14519
14484
|
}
|
|
14520
14485
|
static [RefineSchemaId] = from;
|
|
14521
14486
|
static from = from;
|
|
@@ -14553,19 +14518,19 @@ var toFilterParseIssue = (out, ast, input) => {
|
|
|
14553
14518
|
}
|
|
14554
14519
|
return none2();
|
|
14555
14520
|
};
|
|
14556
|
-
function filter9(predicate,
|
|
14521
|
+
function filter9(predicate, annotations2) {
|
|
14557
14522
|
return (self) => {
|
|
14558
14523
|
function filter12(input, options3, ast2) {
|
|
14559
14524
|
return toFilterParseIssue(predicate(input, options3, ast2), ast2, input);
|
|
14560
14525
|
}
|
|
14561
|
-
const ast = new Refinement(self.ast, filter12, toASTAnnotations(
|
|
14526
|
+
const ast = new Refinement(self.ast, filter12, toASTAnnotations(annotations2));
|
|
14562
14527
|
return makeRefineClass(self, filter12, ast);
|
|
14563
14528
|
};
|
|
14564
14529
|
}
|
|
14565
14530
|
function makeTransformationClass(from, to, ast) {
|
|
14566
14531
|
return class TransformationClass extends make43(ast) {
|
|
14567
|
-
static annotations(
|
|
14568
|
-
return makeTransformationClass(this.from, this.to, mergeSchemaAnnotations(this.ast,
|
|
14532
|
+
static annotations(annotations2) {
|
|
14533
|
+
return makeTransformationClass(this.from, this.to, mergeSchemaAnnotations(this.ast, annotations2));
|
|
14569
14534
|
}
|
|
14570
14535
|
static from = from;
|
|
14571
14536
|
static to = to;
|
|
@@ -14577,19 +14542,18 @@ var transform2 = /* @__PURE__ */ dual((args2) => isSchema(args2[0]) && isSchema(
|
|
|
14577
14542
|
decode: (fromA, _options, _ast, toA) => succeed8(options3.decode(fromA, toA)),
|
|
14578
14543
|
encode: (toI, _options, _ast, toA) => succeed8(options3.encode(toI, toA))
|
|
14579
14544
|
}));
|
|
14580
|
-
var annotations2 = /* @__PURE__ */ dual(2, (self, annotations3) => self.annotations(annotations3));
|
|
14581
14545
|
var MinLengthSchemaId2 = MinLengthSchemaId;
|
|
14582
|
-
var minLength = (minLength2,
|
|
14546
|
+
var minLength = (minLength2, annotations2) => (self) => self.pipe(filter9((a) => a.length >= minLength2, {
|
|
14583
14547
|
schemaId: MinLengthSchemaId2,
|
|
14584
14548
|
title: `minLength(${minLength2})`,
|
|
14585
14549
|
description: `a string at least ${minLength2} character(s) long`,
|
|
14586
14550
|
jsonSchema: {
|
|
14587
14551
|
minLength: minLength2
|
|
14588
14552
|
},
|
|
14589
|
-
...
|
|
14553
|
+
...annotations2
|
|
14590
14554
|
}));
|
|
14591
14555
|
var StartsWithSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/StartsWith");
|
|
14592
|
-
var startsWith = (startsWith2,
|
|
14556
|
+
var startsWith = (startsWith2, annotations2) => (self) => {
|
|
14593
14557
|
const formatted = JSON.stringify(startsWith2);
|
|
14594
14558
|
return self.pipe(filter9((a) => a.startsWith(startsWith2), {
|
|
14595
14559
|
schemaId: StartsWithSchemaId,
|
|
@@ -14601,13 +14565,13 @@ var startsWith = (startsWith2, annotations3) => (self) => {
|
|
|
14601
14565
|
jsonSchema: {
|
|
14602
14566
|
pattern: `^${startsWith2}`
|
|
14603
14567
|
},
|
|
14604
|
-
...
|
|
14568
|
+
...annotations2
|
|
14605
14569
|
}));
|
|
14606
14570
|
};
|
|
14607
|
-
var nonEmptyString = (
|
|
14571
|
+
var nonEmptyString = (annotations2) => minLength(1, {
|
|
14608
14572
|
title: "nonEmptyString",
|
|
14609
14573
|
description: "a non empty string",
|
|
14610
|
-
...
|
|
14574
|
+
...annotations2
|
|
14611
14575
|
});
|
|
14612
14576
|
var NonEmptyString = class extends (/* @__PURE__ */ String$.pipe(/* @__PURE__ */ nonEmptyString({
|
|
14613
14577
|
identifier: "NonEmptyString"
|
|
@@ -17081,55 +17045,9 @@ var UnitPriceMeasurement = Struct({
|
|
|
17081
17045
|
reference_unit: String$,
|
|
17082
17046
|
reference_value: Number$
|
|
17083
17047
|
});
|
|
17084
|
-
var VariantQuantityRule = Struct({
|
|
17085
|
-
min: NullOr(Number$),
|
|
17086
|
-
max: NullOr(Number$),
|
|
17087
|
-
increment: Number$
|
|
17088
|
-
});
|
|
17089
17048
|
var VariantOptions = optionalWith(Array$(String$), {
|
|
17090
17049
|
default: () => []
|
|
17091
17050
|
});
|
|
17092
|
-
var BaseVariant = Struct({
|
|
17093
|
-
id: Resource_exports.ID,
|
|
17094
|
-
title: String$,
|
|
17095
|
-
options: VariantOptions,
|
|
17096
|
-
quantity_rule: VariantQuantityRule
|
|
17097
|
-
});
|
|
17098
|
-
var ProductOption = Struct({
|
|
17099
|
-
name: String$,
|
|
17100
|
-
position: Number$,
|
|
17101
|
-
values: Array$(String$)
|
|
17102
|
-
});
|
|
17103
|
-
var BaseProduct = Struct({
|
|
17104
|
-
id: Resource_exports.ID,
|
|
17105
|
-
title: String$,
|
|
17106
|
-
handle: String$,
|
|
17107
|
-
variants: Array$(BaseVariant),
|
|
17108
|
-
options: Array$(ProductOption),
|
|
17109
|
-
tags: Array$(String$)
|
|
17110
|
-
});
|
|
17111
|
-
var get14 = (url) => tryPromise2({
|
|
17112
|
-
try: () => fetch(url).then((res) => {
|
|
17113
|
-
if (res.ok) {
|
|
17114
|
-
return res.json();
|
|
17115
|
-
}
|
|
17116
|
-
throw new Error(String(res.status));
|
|
17117
|
-
}),
|
|
17118
|
-
catch: (e) => new Error(String(e))
|
|
17119
|
-
});
|
|
17120
|
-
var cachedGet = (url) => gen2(function* () {
|
|
17121
|
-
const cache = yield* cachedWithTTL(get14(url), "60 minutes");
|
|
17122
|
-
return yield* cache;
|
|
17123
|
-
});
|
|
17124
|
-
var Product = transformOrFail(String$, BaseProduct, {
|
|
17125
|
-
decode(handle, _, ast) {
|
|
17126
|
-
return mapBoth3(cachedGet(`/products/${handle}.js`), {
|
|
17127
|
-
onFailure: (e) => new Type2(ast, handle, e.message),
|
|
17128
|
-
onSuccess: (product) => product
|
|
17129
|
-
});
|
|
17130
|
-
},
|
|
17131
|
-
encode: (product) => succeed8(product.handle)
|
|
17132
|
-
});
|
|
17133
17051
|
var BaseLineItem = Struct({
|
|
17134
17052
|
id: Resource_exports.ID,
|
|
17135
17053
|
properties: BaseAttributes,
|
|
@@ -17180,7 +17098,6 @@ var LineItem = transform2(
|
|
|
17180
17098
|
extend3(
|
|
17181
17099
|
BaseLineItem,
|
|
17182
17100
|
Struct({
|
|
17183
|
-
product: Product,
|
|
17184
17101
|
properties_array: optionalWith(BaseAttributesArray, {
|
|
17185
17102
|
default: () => []
|
|
17186
17103
|
}),
|
|
@@ -17204,7 +17121,6 @@ var LineItem = transform2(
|
|
|
17204
17121
|
{
|
|
17205
17122
|
decode: (lineItem) => ({
|
|
17206
17123
|
...lineItem,
|
|
17207
|
-
product: lineItem.handle,
|
|
17208
17124
|
properties_array: lineItem.properties,
|
|
17209
17125
|
private_properties: lineItem.properties,
|
|
17210
17126
|
private_properties_array: lineItem.properties,
|
|
@@ -17216,14 +17132,9 @@ var LineItem = transform2(
|
|
|
17216
17132
|
remove("private_properties"),
|
|
17217
17133
|
remove("private_properties_array"),
|
|
17218
17134
|
remove("public_properties"),
|
|
17219
|
-
remove("public_properties_array")
|
|
17220
|
-
remove("product")
|
|
17135
|
+
remove("public_properties_array")
|
|
17221
17136
|
)
|
|
17222
17137
|
}
|
|
17223
|
-
).pipe(
|
|
17224
|
-
annotations2({
|
|
17225
|
-
concurrency: "unbounded"
|
|
17226
|
-
})
|
|
17227
17138
|
);
|
|
17228
17139
|
var BaseCart = Struct({
|
|
17229
17140
|
token: String$,
|
|
@@ -17241,7 +17152,7 @@ var BaseCart = Struct({
|
|
|
17241
17152
|
total_discount: Number$,
|
|
17242
17153
|
total_weight: Number$,
|
|
17243
17154
|
item_count: Number$,
|
|
17244
|
-
items: Array$(LineItem),
|
|
17155
|
+
items: Array$(LineItem).annotations({ concurrency: "unbounded" }),
|
|
17245
17156
|
requires_shipping: Boolean$,
|
|
17246
17157
|
currency: CurrencyCode,
|
|
17247
17158
|
items_subtotal_price: Number$,
|
|
@@ -17905,7 +17816,7 @@ var make50 = (method) => (url, options3) => modify4(empty35, {
|
|
|
17905
17816
|
url,
|
|
17906
17817
|
...options3 ?? void 0
|
|
17907
17818
|
});
|
|
17908
|
-
var
|
|
17819
|
+
var get15 = /* @__PURE__ */ make50("GET");
|
|
17909
17820
|
var post = /* @__PURE__ */ make50("POST");
|
|
17910
17821
|
var put = /* @__PURE__ */ make50("PUT");
|
|
17911
17822
|
var patch9 = /* @__PURE__ */ make50("PATCH");
|
|
@@ -18107,7 +18018,7 @@ var ClientProto = {
|
|
|
18107
18018
|
};
|
|
18108
18019
|
},
|
|
18109
18020
|
get(url, options3) {
|
|
18110
|
-
return this.execute(
|
|
18021
|
+
return this.execute(get15(url, options3));
|
|
18111
18022
|
},
|
|
18112
18023
|
head(url, options3) {
|
|
18113
18024
|
return this.execute(head5(url, options3));
|
|
@@ -18303,7 +18214,7 @@ var {
|
|
|
18303
18214
|
/** @internal */
|
|
18304
18215
|
execute: execute2,
|
|
18305
18216
|
/** @internal */
|
|
18306
|
-
get:
|
|
18217
|
+
get: get16,
|
|
18307
18218
|
/** @internal */
|
|
18308
18219
|
head: head6,
|
|
18309
18220
|
/** @internal */
|
|
@@ -18325,7 +18236,7 @@ var layerMergedContext = (effect3) => effect(tag, flatMap10(context2(), (context
|
|
|
18325
18236
|
var HttpClient = tag;
|
|
18326
18237
|
|
|
18327
18238
|
// ../../../node_modules/.pnpm/@effect+platform@0.82.4_effect@3.15.2/node_modules/@effect/platform/dist/esm/HttpClientRequest.js
|
|
18328
|
-
var
|
|
18239
|
+
var get17 = get15;
|
|
18329
18240
|
var post3 = post;
|
|
18330
18241
|
var setUrlParams2 = setUrlParams;
|
|
18331
18242
|
var bodyJson2 = bodyJson;
|
|
@@ -18333,13 +18244,13 @@ var bodyJson2 = bodyJson;
|
|
|
18333
18244
|
// ../../../node_modules/.pnpm/@effect+platform@0.82.4_effect@3.15.2/node_modules/@effect/platform/dist/esm/internal/fetchHttpClient.js
|
|
18334
18245
|
var fetchTagKey = "@effect/platform/FetchHttpClient/Fetch";
|
|
18335
18246
|
var requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
|
|
18336
|
-
var
|
|
18247
|
+
var fetch = /* @__PURE__ */ make51((request, url, signal, fiber) => {
|
|
18337
18248
|
const context5 = fiber.getFiberRef(currentContext2);
|
|
18338
|
-
const
|
|
18249
|
+
const fetch2 = context5.unsafeMap.get(fetchTagKey) ?? globalThis.fetch;
|
|
18339
18250
|
const options3 = context5.unsafeMap.get(requestInitTagKey) ?? {};
|
|
18340
18251
|
const headers = options3.headers ? merge8(fromInput2(options3.headers), request.headers) : request.headers;
|
|
18341
18252
|
const send = (body) => map17(tryPromise2({
|
|
18342
|
-
try: () =>
|
|
18253
|
+
try: () => fetch2(url, {
|
|
18343
18254
|
...options3,
|
|
18344
18255
|
method: request.method,
|
|
18345
18256
|
headers,
|
|
@@ -18364,7 +18275,7 @@ var fetch2 = /* @__PURE__ */ make51((request, url, signal, fiber) => {
|
|
|
18364
18275
|
}
|
|
18365
18276
|
return send(void 0);
|
|
18366
18277
|
});
|
|
18367
|
-
var layer = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed7(
|
|
18278
|
+
var layer = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed7(fetch));
|
|
18368
18279
|
|
|
18369
18280
|
// ../../../node_modules/.pnpm/@effect+platform@0.82.4_effect@3.15.2/node_modules/@effect/platform/dist/esm/FetchHttpClient.js
|
|
18370
18281
|
var layer2 = layer;
|
|
@@ -18424,7 +18335,7 @@ var makeFactory = ({
|
|
|
18424
18335
|
}
|
|
18425
18336
|
}).pipe(bodyJson2(decodedInput));
|
|
18426
18337
|
} else if (method === "get") {
|
|
18427
|
-
request =
|
|
18338
|
+
request = get17(url, {
|
|
18428
18339
|
acceptJson: true
|
|
18429
18340
|
}).pipe(setUrlParams2(decodedInput));
|
|
18430
18341
|
} else {
|
|
@@ -18532,11 +18443,11 @@ var make57 = makeFactory({
|
|
|
18532
18443
|
var add6 = make53;
|
|
18533
18444
|
var change = make54;
|
|
18534
18445
|
var clear = make55;
|
|
18535
|
-
var
|
|
18446
|
+
var get18 = make56;
|
|
18536
18447
|
var update5 = make57;
|
|
18537
18448
|
|
|
18538
18449
|
// src/index.ts
|
|
18539
|
-
var validateCart = (cart) =>
|
|
18450
|
+
var validateCart = (cart) => runSync(decodeUnknown2(CartOutput)(cart));
|
|
18540
18451
|
var createAjaxCartApi = ({ debug = false }) => {
|
|
18541
18452
|
let baseLayer = empty30;
|
|
18542
18453
|
let minimumLogLevel2 = None3;
|
|
@@ -18644,7 +18555,7 @@ var createAjaxCartApi = ({ debug = false }) => {
|
|
|
18644
18555
|
}
|
|
18645
18556
|
),
|
|
18646
18557
|
get: (input, options3) => runPromise(
|
|
18647
|
-
|
|
18558
|
+
get18(input).pipe(
|
|
18648
18559
|
withMinimumLogLevel2(minimumLogLevel2),
|
|
18649
18560
|
provide2(ajaxLayer),
|
|
18650
18561
|
catchAll2((error) => {
|