@effect-app/infra 0.16.1 → 0.17.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/_cjs/api/defaultErrorHandler.cjs +1 -1
  3. package/_cjs/api/defaultErrorHandler.cjs.map +1 -1
  4. package/_cjs/api/setupRequest.cjs +22 -4
  5. package/_cjs/api/setupRequest.cjs.map +1 -1
  6. package/_cjs/rateLimit.cjs +6 -6
  7. package/_cjs/rateLimit.cjs.map +1 -1
  8. package/_cjs/services/Operations/live.cjs +9 -8
  9. package/_cjs/services/Operations/live.cjs.map +1 -1
  10. package/_cjs/services/QueueMaker/errors.cjs +54 -0
  11. package/_cjs/services/QueueMaker/errors.cjs.map +1 -0
  12. package/_cjs/services/QueueMaker/memQueue.cjs +79 -0
  13. package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -0
  14. package/_cjs/services/QueueMaker/sbqueue.cjs +80 -0
  15. package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -0
  16. package/_cjs/services/QueueMaker/service.cjs +9 -0
  17. package/_cjs/services/QueueMaker/service.cjs.map +1 -0
  18. package/_cjs/services/Store/Cosmos.test.cjs +3 -4
  19. package/_cjs/services/Store/Cosmos.test.cjs.map +1 -1
  20. package/_cjs/services/Store/codeFilter.test.cjs +6 -7
  21. package/_cjs/services/Store/codeFilter.test.cjs.map +1 -1
  22. package/_src/_global.ext.ts +4 -0
  23. package/_src/api/setupRequest.ts +19 -0
  24. package/_src/services/QueueMaker/errors.ts +48 -0
  25. package/_src/services/QueueMaker/memQueue.ts +102 -0
  26. package/_src/services/QueueMaker/sbqueue.ts +118 -0
  27. package/_src/services/QueueMaker/service.ts +14 -0
  28. package/_src/services/Store/Cosmos.test.ts +0 -1
  29. package/_src/services/Store/codeFilter.test.ts +0 -1
  30. package/dist/_global.ext.d.ts +4 -0
  31. package/dist/_global.ext.d.ts.map +1 -1
  32. package/dist/api/defaultErrorHandler.js +2 -3
  33. package/dist/api/setupRequest.d.ts +5 -0
  34. package/dist/api/setupRequest.d.ts.map +1 -1
  35. package/dist/api/setupRequest.js +20 -3
  36. package/dist/rateLimit.js +7 -7
  37. package/dist/services/Operations/live.js +10 -9
  38. package/dist/services/QueueMaker/errors.d.ts +24 -0
  39. package/dist/services/QueueMaker/errors.d.ts.map +1 -0
  40. package/dist/services/QueueMaker/errors.js +37 -0
  41. package/dist/services/QueueMaker/memQueue.d.ts +25 -0
  42. package/dist/services/QueueMaker/memQueue.d.ts.map +1 -0
  43. package/dist/services/QueueMaker/memQueue.js +60 -0
  44. package/dist/services/QueueMaker/sbqueue.d.ts +31 -0
  45. package/dist/services/QueueMaker/sbqueue.d.ts.map +1 -0
  46. package/dist/services/QueueMaker/sbqueue.js +61 -0
  47. package/dist/services/QueueMaker/service.d.ts +15 -0
  48. package/dist/services/QueueMaker/service.d.ts.map +1 -0
  49. package/dist/services/QueueMaker/service.js +2 -0
  50. package/dist/services/Store/Cosmos.test.d.ts.map +1 -1
  51. package/dist/services/Store/codeFilter.test.d.ts.map +1 -1
  52. package/package.json +48 -7
  53. package/tsconfig.json +5 -3
  54. package/tsconfig.json.bak +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 0.17.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e5c6a5fb: Add QueueMaker
8
+
9
+ ## 0.17.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 67716050: Update to TS5 beta
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [67716050]
18
+ - @effect-app/infra-adapters@0.14.0
19
+ - @effect-app/prelude@0.16.0
20
+ - @effect-app/schema@0.14.0
21
+ - @effect-app/core@0.16.0
22
+
3
23
  ## 0.16.1
4
24
 
5
25
  ### Patch Changes
@@ -19,7 +19,7 @@ function defaultBasicErrorHandler(_req, res, _requestContext, r2) {
19
19
  // final catch all; expecting never so that unhandled known errors will show up
20
20
  , err => tsplus_module_1.flatMap(tsplus_module_1.map(tsplus_module_1.logError("Program error, compiler probably silenced, got an unsupported Error in Error Channel of Effect" + err), () => err), tsplus_module_1.die));
21
21
  }
22
- const optimisticConcurrencySchedule = tsplus_module_4.once() && tsplus_module_4.recurWhile(a => a._tag === "OptimisticConcurrencyException");
22
+ const optimisticConcurrencySchedule = tsplus_module_4.intersect(tsplus_module_4.recurWhile(a => a._tag === "OptimisticConcurrencyException"))(tsplus_module_4.once());
23
23
  function defaultErrorHandler(req, res, _, r2) {
24
24
  const r3 = req.method === "PATCH" ? tsplus_module_1.retry(r2, optimisticConcurrencySchedule) : r2;
25
25
  return tsplus_module_1.catchAll(tsplus_module_1.catchTag(tsplus_module_1.catchTag(tsplus_module_1.catchTag(tsplus_module_1.catchTag(tsplus_module_1.catchTag(tsplus_module_1.catchTag(tsplus_module_1.tapErrorCause(r3, cause => tsplus_module_2.isFailure(cause) ? (0, _reportError.logRequestError)(cause) : tsplus_module_3.unit), "ValidationError", err => tsplus_module_1.sync(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"defaultErrorHandler.cjs","mappings":";;;;;;;;;;;AAUA;AAAkD;AAAA;AAE5C,SAAUA,wBAAwB,CACtCC,IAAqB,EACrBC,GAAqB,EACrBC,eAA+B,EAC/BC,EAAoC;EAEpC,OAAOC,kFAAE,EACQC,KAAK,IAAIC,+BAAK,CAAY,GAAG,gCAAe,EAACD,KAAK,CAAC,GAAEE,oBAAY,CAAC,EACvE,iBAAiB,EAAEC,GAAG,IAC9BJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAACG,MAAM,CAAC;EAClC,CAAC,CAAC;EACJ;EAAA,EACWH,GAAU,IACnBJ,qEACE,gGAAgG,GAAGI,GAAG,CACvG,EACM,MAAMA,GAAc,CAAC,sBACN,CACvB;AACL;AAEA,MAAMI,6BAA6B,GAAGC,sBAAe,IACnDA,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;EAC3B,CAAC,CAAC;EACJ;EAAA,EACWA,GAAU,IACnBJ,qEACE,gGAAgG,GAAGI,GAAG,CACvG,EACM,MAAMA,GAAc,CAAC,sBACN,CACvB;AACL","names":["defaultBasicErrorHandler","_req","res","_requestContext","r2","tsplus_module_1","cause","tsplus_module_2","tsplus_module_3","err","status","send","errors","optimisticConcurrencySchedule","tsplus_module_4","a","_tag","defaultErrorHandler","req","_","r3","method"],"sourceRoot":"","sources":["../../_src/api/defaultErrorHandler.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"defaultErrorHandler.cjs","mappings":";;;;;;;;;;;AAUA;AAAkD;AAAA;AAE5C,SAAUA,wBAAwB,CACtCC,IAAqB,EACrBC,GAAqB,EACrBC,eAA+B,EAC/BC,EAAoC;EAEpC,OAAOC,kFAAE,EACQC,KAAK,IAAIC,+BAAK,CAAY,GAAG,gCAAe,EAACD,KAAK,CAAC,GAAEE,oBAAY,CAAC,EACvE,iBAAiB,EAAEC,GAAG,IAC9BJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAACG,MAAM,CAAC;EAClC,CAAC,CAAC;EACJ;EAAA,EACWH,GAAU,IACnBJ,qEACE,gGAAgG,GAAGI,GAAG,CACvG,EACM,MAAMA,GAAc,CAAC,sBACN,CACvB;AACL;AAEA,MAAMI,6BAA6B,6BACjCC,2BAAqCC,CAAC,IAAIA,CAAC,CAACC,IAAI,KAAK,gCAAgC,CAAC,EADlDF,sBAAe,CACmC;AAElF,SAAUG,mBAAmB,CACjCC,GAAoB,EACpBhB,GAAqB,EACrBiB,CAAiB,EACjBf,EAAoC;EAEpC,MAAMgB,EAAE,GAAGF,GAAG,CAACG,MAAM,KAAK,OAAO,GAC7BhB,wBAAE,EAAOQ,6BAA6B,CAAC,GACvCT,EAAE;EACN,OAAOC,+MAAE,EACQC,KAAK,IAAIC,+BAAK,CAAY,GAAG,gCAAe,EAACD,KAAK,CAAC,GAAEE,oBAAY,CAAC,EACvE,iBAAiB,EAAEC,GAAG,IAC9BJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAACG,MAAM,CAAC;EAClC,CAAC,CAAC,CAAC,EACK,eAAe,EAAEH,GAAG,IAC5BJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAAC;EAC3B,CAAC,CAAC,CAAC,EACK,kBAAkB,EAAEA,GAAG,IAC/BJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAAC;EAC3B,CAAC,CAAC,CAAC,EACK,mBAAmB,EAAEA,GAAG,IAChCJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAAC;EAC3B,CAAC,CAAC,CAAC,EACK,mBAAmB,EAAEA,GAAG,IAChCJ,qBAAO,MAAK;IACVH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAAC;EAC3B,CAAC,CAAC,CAAC,EACK,gCAAgC,EAAEA,GAAG,IAC7CJ,qBAAO,MAAK;IACV;IACAH,GAAG,CAACQ,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACF,GAAG,CAAC;EAC3B,CAAC,CAAC;EACJ;EAAA,EACWA,GAAU,IACnBJ,qEACE,gGAAgG,GAAGI,GAAG,CACvG,EACM,MAAMA,GAAc,CAAC,sBACN,CACvB;AACL","names":["defaultBasicErrorHandler","_req","res","_requestContext","r2","tsplus_module_1","cause","tsplus_module_2","tsplus_module_3","err","status","send","errors","optimisticConcurrencySchedule","tsplus_module_4","a","_tag","defaultErrorHandler","req","_","r3","method"],"sourceRoot":"","sources":["../../_src/api/defaultErrorHandler.ts"],"sourcesContent":[null]}
@@ -3,17 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setupRequest = void 0;
7
- exports.setupRequestFrom = setupRequestFrom;
6
+ exports.setupReq3 = setupReq3;
7
+ exports.setupRequestFrom = exports.setupRequest = void 0;
8
8
  var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
9
9
  var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/_ext/misc"));
10
10
  var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Function"));
11
11
  var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/infra/RequestContext"));
12
- require("../RequestContext.cjs");
12
+ var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
13
+ var _RequestContext2 = require("../RequestContext.cjs");
13
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
16
  const setupRequest = setupRequest_1;
16
17
  exports.setupRequest = setupRequest;
18
+ const setupRequestFrom = setupRequestFrom_1;
19
+ exports.setupRequestFrom = setupRequestFrom;
17
20
  /**
18
21
  * @tsplus fluent effect/io/Effect setupRequest
19
22
  */
@@ -27,7 +30,22 @@ function setupRequest_1(self, requestContext) {
27
30
  /**
28
31
  * @tsplus getter effect/io/Effect setupRequestFrom
29
32
  */
30
- function setupRequestFrom(self) {
33
+ function setupRequestFrom_1(self) {
31
34
  return tsplus_module_1.serviceWithEffect(tsplus_module_4.tag, requestContext => setupRequest_1(self, requestContext));
32
35
  }
36
+ /**
37
+ * @tsplus fluent effect/io/Effect setupRequestFromWith
38
+ */
39
+ function setupReq3(self, name) {
40
+ return tsplus_module_1.provideService(setupRequestFrom_1(self), tsplus_module_4.tag, makeInternalRequestContext(name));
41
+ }
42
+ function makeInternalRequestContext(name) {
43
+ const id = tsplus_module_5.StringId.make();
44
+ return new _RequestContext2.RequestContext({
45
+ id,
46
+ rootId: id,
47
+ locale: "en",
48
+ name: tsplus_module_5.ReasonableString(name)
49
+ });
50
+ }
33
51
  //# sourceMappingURL=setupRequest.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"setupRequest.cjs","mappings":";;;;;;;;;;;AAAA;AAAqD;AAAA;MAKrCA,YAAY;AAAA;AAH5B;;;AAGA,wBAAsCC,IAAqB,EAAEC,cAA8B;EACzF,OAAOC,oBAAI,CACTC,4BAAI,EAAS,SAAS,CAAC,EACvBC,6BAAoB;IAClBC,aAAa,EAAEJ,cAAc,CAACK,MAAM;IACpCC,SAAS,EAAEN,cAAc,CAACO,EAAE;IAC5BC,WAAW,EAAER,cAAc,CAACS;GAC7B,CAAC,CACH;AACH;AAEA;;;AAGM,SAAUC,gBAAgB,CAAUX,IAAqB;EAC7D,OAAOG,uDAAoCF,cAAc,IAAIW,mBAAI,EAAcX,cAAc,CAAC,CAAC;AACjG","names":["setupRequest","self","requestContext","tsplus_module_3","tsplus_module_1","tsplus_module_2","requestRootId","rootId","requestId","id","requestName","name","setupRequestFrom","setupRequest_1"],"sourceRoot":"","sources":["../../_src/api/setupRequest.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"setupRequest.cjs","mappings":";;;;;;;;;;;;AAAA;AAAqD;AAAA;MAKrCA,YAAY;AAAA;MAcZC,gBAAgB;AAAA;AAjBhC;;;AAGA,wBAAsCC,IAAqB,EAAEC,cAA8B;EACzF,OAAOC,oBAAI,CACTC,4BAAI,EAAS,SAAS,CAAC,EACvBC,6BAAoB;IAClBC,aAAa,EAAEJ,cAAc,CAACK,MAAM;IACpCC,SAAS,EAAEN,cAAc,CAACO,EAAE;IAC5BC,WAAW,EAAER,cAAc,CAACS;GAC7B,CAAC,CACH;AACH;AAEA;;;AAGA,4BAA0CV,IAAqB;EAC7D,OAAOG,uDAAoCF,cAAc,IAAIU,mBAAI,EAAcV,cAAc,CAAC,CAAC;AACjG;AAEA;;;AAGM,SAAUW,SAAS,CAAUZ,IAAqB,EAAEU,IAAY;EACpE,OAAOP,sDAAI,wBAE2BU,0BAA0B,CAACH,IAAI,CAAC,CAAC;AACzE;AAEA,SAASG,0BAA0B,CAACH,IAAY;EAC9C,MAAMF,EAAE,GAAGM,wBAAQ,CAACC,IAAI,EAAE;EAC1B,OAAO,IAAIC,+BAAc,CAAC;IACxBR,EAAE;IACFF,MAAM,EAAEE,EAAE;IACVS,MAAM,EAAE,IAAI;IACZP,IAAI,EAAEI,gCAAgB,CAACJ,IAAI;GAC5B,CAAC;AACJ","names":["setupRequest","setupRequestFrom","self","requestContext","tsplus_module_3","tsplus_module_1","tsplus_module_2","requestRootId","rootId","requestId","id","requestName","name","setupRequest_1","setupReq3","makeInternalRequestContext","tsplus_module_5","make","RequestContext","locale"],"sourceRoot":"","sources":["../../_src/api/setupRequest.ts"],"sourcesContent":[null]}
@@ -8,8 +8,8 @@ exports.batch = batch;
8
8
  exports.batchNPar = batchNPar;
9
9
  exports.naiveRateLimit = naiveRateLimit;
10
10
  var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
11
- var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Effect"));
12
- var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Array"));
11
+ var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Array"));
12
+ var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Effect"));
13
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
  // /**
@@ -47,7 +47,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
47
47
  */
48
48
  function SEM_withPermitsDuration(permits, duration) {
49
49
  return self => {
50
- return effect => tsplus_module_1.uninterruptibleMask(restore => tsplus_module_2.EffectZipRight(tsplus_module_1.ensuring(restore(effect), tsplus_module_1.delay(self.release(permits), duration)))(restore(self.take(permits))));
50
+ return effect => tsplus_module_1.uninterruptibleMask(restore => tsplus_module_1.zipRight(tsplus_module_1.ensuring(restore(effect), tsplus_module_1.delay(self.release(permits), duration)))(restore(self.take(permits))));
51
51
  };
52
52
  }
53
53
  /**
@@ -55,14 +55,14 @@ function SEM_withPermitsDuration(permits, duration) {
55
55
  * @tsplus static Collection.Aspects batchNPar
56
56
  */
57
57
  function batchNPar(n, forEachItem, forEachBatch) {
58
- return items => tsplus_module_3.ext_forEachParWithIndex(tsplus_module_3.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_1.forEachParWithIndex(_, (_, j) => forEachItem(_, j, i)), _ => forEachBatch(_, i)));
58
+ return items => tsplus_module_2.ext_forEachParWithIndex(tsplus_module_2.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_1.forEachParWithIndex(_, (_, j) => forEachItem(_, j, i)), _ => forEachBatch(_, i)));
59
59
  }
60
60
  /**
61
61
  * @tsplus pipeable Iterable batch
62
62
  * @tsplus static Collection.Aspects batch
63
63
  */
64
64
  function batch(n, forEachItem, forEachBatch) {
65
- return items => tsplus_module_3.ext_forEachWithIndex(tsplus_module_3.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_1.forEachParWithIndex(_, (_, j) => forEachItem(_, j, i)), _ => forEachBatch(_, i)));
65
+ return items => tsplus_module_2.ext_forEachWithIndex(tsplus_module_2.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_1.forEachParWithIndex(_, (_, j) => forEachItem(_, j, i)), _ => forEachBatch(_, i)));
66
66
  }
67
67
  // /**
68
68
  // * @tsplus pipeable Iterable rateLimit
@@ -88,6 +88,6 @@ function batch(n, forEachItem, forEachBatch) {
88
88
  * @tsplus static Collection.Aspects naiveRateLimit
89
89
  */
90
90
  function naiveRateLimit(n, d) {
91
- return items => (forEachItem, forEachBatch) => tsplus_module_3.ext_forEachWithIndex(tsplus_module_3.chunk_(items, n), (batch, i) => tsplus_module_1.zipRight(i === 0 ? tsplus_module_2.unit : tsplus_module_1.delay(tsplus_module_2.unit, d), tsplus_module_1.flatMap(tsplus_module_1.withParallelism(tsplus_module_3.ext_forEachEffectPar(batch, forEachItem), n), forEachBatch)));
91
+ return items => (forEachItem, forEachBatch) => tsplus_module_2.ext_forEachWithIndex(tsplus_module_2.chunk_(items, n), (batch, i) => tsplus_module_1.zipRight(i === 0 ? tsplus_module_3.unit : tsplus_module_1.delay(tsplus_module_3.unit, d), tsplus_module_1.flatMap(tsplus_module_1.withParallelism(tsplus_module_2.ext_forEachEffectPar(batch, forEachItem), n), forEachBatch)));
92
92
  }
93
93
  //# sourceMappingURL=rateLimit.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimit.cjs","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASM,SAAUA,uBAAuB,CAACC,OAAe,EAAEC,QAAkB;EACzE,OAAQC,IAAe,IAA2D;IAChF,OAAOC,MAAM,IACXC,oCACEC,OAAO,IAAGC,+BAEJF,gCAAO,CAACD,MAAM,CAAC,EAEbC,0BAAI,CAACG,OAAO,CAACP,OAAO,CAAC,EACZC,QAAQ,CAAC,CACnB,EALLI,OAAO,CAACH,IAAI,CAACM,IAAI,CAACR,OAAO,CAAC,CAAC,CAKtB,CACR;EACL,CAAC;AACH;AAEA;;;;AAIM,SAAUS,SAAS,CACvBC,CAAS,EACTC,WAA0E,EAC1EC,YAA4D;EAE5D,OAAQC,KAAkB,IACxBC,oEAAK,EAAOJ,CAAC,CAAC,EACe,CAACK,CAAC,EAAEC,CAAC,KAC9BZ,6DAAC,EAAqB,CAACW,CAAC,EAAEE,CAAC,KAAKN,WAAW,CAACI,CAAC,EAAEE,CAAC,EAAED,CAAC,CAAC,CAAC,EAC1CD,CAAC,IAAIH,YAAY,CAACG,CAAC,EAAEC,CAAC,CAAC,CAAC,CACpC;AACP;AAEA;;;;AAIM,SAAUE,KAAK,CACnBR,CAAS,EACTC,WAA+E,EAC/EC,YAA4D;EAE5D,OAAQC,KAAkB,IACxBC,iEAAK,EAAOJ,CAAC,CAAC,EACY,CAACK,CAAC,EAAEC,CAAC,KAC3BZ,6DAAC,EAAqB,CAACW,CAAC,EAAEE,CAAC,KAAKN,WAAW,CAACI,CAAC,EAAEE,CAAC,EAAED,CAAC,CAAC,CAAC,EAC1CD,CAAC,IAAIH,YAAY,CAACG,CAAC,EAAEC,CAAC,CAAC,CAAC,CACpC;AACP;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAKM,SAAUG,cAAc,CAC5BT,CAAS,EACTU,CAAM;EAEN,OAAWP,KAAkB,IAAM,CACjCF,WAAsC,EACtCC,YAAiD,KAEjDE,iEAAK,EAAOJ,CAAC,CAAC,EACY,CAACQ,KAAK,EAAEF,CAAC,KAC/BZ,yBAAEY,CAAC,KAAK,CAAC,GAAGV,uBAAeF,4CAAkBgB,CAAC,CAAC,EAE3ChB,kGAAK,EAAkBO,WAAW,CAAC,EAChBD,CAAC,CAAC,EACVE,YAAY,CAAC,CACzB,CACH;AACR","names":["SEM_withPermitsDuration","permits","duration","self","effect","tsplus_module_1","restore","tsplus_module_2","release","take","batchNPar","n","forEachItem","forEachBatch","items","tsplus_module_3","_","i","j","batch","naiveRateLimit","d"],"sourceRoot":"","sources":["../_src/rateLimit.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"rateLimit.cjs","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASM,SAAUA,uBAAuB,CAACC,OAAe,EAAEC,QAAkB;EACzE,OAAQC,IAAe,IAA2D;IAChF,OAAOC,MAAM,IACXC,oCACEC,OAAO,IAAGD,yBAEJA,gCAAO,CAACD,MAAM,CAAC,EAEbC,0BAAI,CAACE,OAAO,CAACN,OAAO,CAAC,EACZC,QAAQ,CAAC,CACnB,EALLI,OAAO,CAACH,IAAI,CAACK,IAAI,CAACP,OAAO,CAAC,CAAC,CAKtB,CACR;EACL,CAAC;AACH;AAEA;;;;AAIM,SAAUQ,SAAS,CACvBC,CAAS,EACTC,WAA0E,EAC1EC,YAA4D;EAE5D,OAAQC,KAAkB,IACxBC,oEAAK,EAAOJ,CAAC,CAAC,EACe,CAACK,CAAC,EAAEC,CAAC,KAC9BX,6DAAC,EAAqB,CAACU,CAAC,EAAEE,CAAC,KAAKN,WAAW,CAACI,CAAC,EAAEE,CAAC,EAAED,CAAC,CAAC,CAAC,EAC1CD,CAAC,IAAIH,YAAY,CAACG,CAAC,EAAEC,CAAC,CAAC,CAAC,CACpC;AACP;AAEA;;;;AAIM,SAAUE,KAAK,CACnBR,CAAS,EACTC,WAA+E,EAC/EC,YAA4D;EAE5D,OAAQC,KAAkB,IACxBC,iEAAK,EAAOJ,CAAC,CAAC,EACY,CAACK,CAAC,EAAEC,CAAC,KAC3BX,6DAAC,EAAqB,CAACU,CAAC,EAAEE,CAAC,KAAKN,WAAW,CAACI,CAAC,EAAEE,CAAC,EAAED,CAAC,CAAC,CAAC,EAC1CD,CAAC,IAAIH,YAAY,CAACG,CAAC,EAAEC,CAAC,CAAC,CAAC,CACpC;AACP;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAKM,SAAUG,cAAc,CAC5BT,CAAS,EACTU,CAAM;EAEN,OAAWP,KAAkB,IAAM,CACjCF,WAAsC,EACtCC,YAAiD,KAEjDE,iEAAK,EAAOJ,CAAC,CAAC,EACY,CAACQ,KAAK,EAAEF,CAAC,KAC/BX,yBAAEW,CAAC,KAAK,CAAC,GAAGK,uBAAehB,4CAAkBe,CAAC,CAAC,EAE3Cf,kGAAK,EAAkBM,WAAW,CAAC,EAChBD,CAAC,CAAC,EACVE,YAAY,CAAC,CACzB,CACH;AACR","names":["SEM_withPermitsDuration","permits","duration","self","effect","tsplus_module_1","restore","release","take","batchNPar","n","forEachItem","forEachBatch","items","tsplus_module_2","_","i","j","batch","naiveRateLimit","d","tsplus_module_3"],"sourceRoot":"","sources":["../_src/rateLimit.ts"],"sourcesContent":[null]}
@@ -13,9 +13,10 @@ var tsplus_module_6 = _interopRequireWildcard(require("@effect/io/Cause"));
13
13
  var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
14
14
  var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/core/Option"));
15
15
  var tsplus_module_9 = _interopRequireWildcard(require("@effect-app/prelude/_ext/misc"));
16
- var tsplus_module_10 = _interopRequireWildcard(require("@effect-app/core/Effect"));
17
- var tsplus_module_11 = _interopRequireWildcard(require("@effect-app/prelude/service"));
18
- var tsplus_module_12 = _interopRequireWildcard(require("@fp-ts/data/Duration"));
16
+ var tsplus_module_10 = _interopRequireWildcard(require("@effect-app/prelude/service"));
17
+ var tsplus_module_11 = _interopRequireWildcard(require("@fp-ts/data/Duration"));
18
+ var tsplus_module_12 = _interopRequireWildcard(require("@effect-app/core/Effect"));
19
+ var tsplus_module_13 = _interopRequireWildcard(require("@effect/io/Layer"));
19
20
  var _reportError = require("@effect-app/infra/api/reportError");
20
21
  var _errorReporter = require("@effect-app/infra/errorReporter");
21
22
  var _Operations = require("@effect-app/prelude/Operations");
@@ -71,23 +72,23 @@ const make = tsplus_module_1.sync(() => {
71
72
  });
72
73
  }));
73
74
  }
74
- return tsplus_module_11.make(_service2.Operations, {
75
+ return tsplus_module_10.make(_service2.Operations, {
75
76
  cleanup,
76
- register: tsplus_module_1.tap(makeOp, id => tsplus_module_10.EffectZipRight(tsplus_module_1.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))(tsplus_module_9.logAnnotateScoped("operationId", id))),
77
+ register: tsplus_module_1.tap(makeOp, id => tsplus_module_1.zipRight(tsplus_module_1.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))(tsplus_module_9.logAnnotateScoped("operationId", id))),
77
78
  find: findOp,
78
79
  update
79
80
  });
80
81
  });
81
82
  const cleanupLoop = tsplus_module_1.forkScoped(tsplus_module_1.forever(tsplus_module_1.delay(tsplus_module_1.flatMap(tsplus_module_1.exit(tsplus_module_1.serviceWithEffect(_service2.Operations, _ => _.cleanup)), _ => {
82
83
  if (tsplus_module_5.isSuccess(_)) {
83
- return tsplus_module_10.unit;
84
+ return tsplus_module_12.unit;
84
85
  } else {
85
86
  return reportAppError(_.cause);
86
87
  }
87
- }), tsplus_module_12.minutes(1))));
88
+ }), tsplus_module_11.minutes(1))));
88
89
  /**
89
90
  * @tsplus static Operations.Ops Live
90
91
  */
91
- const Live = tsplus_module_10.LayerProvideMerge(tsplus_module_10.toScopedDiscardLayer(cleanupLoop))(tsplus_module_1.toLayer(make, _service2.Operations));
92
+ const Live = tsplus_module_13.provideMerge(tsplus_module_12.toScopedDiscardLayer(cleanupLoop))(tsplus_module_1.toLayer(make, _service2.Operations));
92
93
  exports.Live = Live;
93
94
  //# sourceMappingURL=live.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.cjs","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAAyC;AAAA;AAEzC,MAAMA,cAAc,GAAG,8BAAW,EAACC,KAAK,IAAI,IAAIC,6BAAgB,CAACD,KAAK,CAAC,CAAC;AAExE,MAAME,IAAI,GAAGC,qBAAO,MAAK;EACvB,MAAMC,GAAG,GAAG,IAAIC,GAAG,EAA0B;EAC7C,MAAMC,MAAM,GAAGH,qBAAO,MAAMI,uBAAW,CAACL,IAAI,EAAE,CAAC;EAE/C,MAAMM,OAAO,GAAGL,qBAAO,MAAK;IAC1B,MAAMM,MAAM,GAAGC,iCAAIC,IAAI,EAAE,EAAU,CAAC,CAAC;IACrCC,iCAAG,CAACC,OAAO,EAAE,EAEVC,OAAO,CAAC,CAAC,CAACC,EAAE,EAAEC,EAAE,CAAC,KAAI;MACpB,MAAMC,WAAW,GAAGC,0BAA4C,MAAMF,EAAE,CAACG,SAAS,EAA9DD,6BAAoBF,EAAE,CAACI,SAAS,CAAC,CAA8B;MACnF,IAAIH,WAAW,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AAC;IACJ,CAAC,CAAC,CACH;EACH;EACA,SAASyC,MAAM,CAAC1B,EAAe,EAAE2B,QAA2B;IAC1D,OAAOvC,8BAAM,CAACY,EAAE,CAAC,EAASc,CAAC,IACzB1B,qBAAO,MAAK;MACV,IAAIe,wBAAC,CAAS,EAAE;QACd,MAAM,IAAIY,KAAK,CAAC,WAAW,CAAC;;MAE9B1B,GAAG,CAACmB,GAAG,CAACR,EAAE,EAAE;QAAE,GAAGc,CAAC,CAACE,KAAK;QAAEX,SAAS,EAAE,IAAIT,IAAI,EAAE;QAAE+B;MAAQ,CAAE,CAAC;IAC9D,CAAC,CAAC,CACH;EACH;EACA,OAAOC,0CAAU,EAAM;IACrBnC,OAAO;IACPoC,QAAQ,EAAEzC,0BAAM,EACTY,EAAE,IAAG8B,gCAEJ1C,oCAAK,CAACY,EAAE,CAAC,EACT,CAACc,CAAC,EAAED,IAAI,KAAKD,QAAQ,CAACZ,EAAE,EAAEa,IAAI,CAAC,CAChC,EAHHkB,kCAAyB,aAAa,EAAE/B,EAAE,CAAC,CAGxC,CACJ;IAEHgC,IAAI,EAAEtB,MAAM;IACZgB;GACD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAMO,WAAW,sDAAG7C,yHAAU,EAAkB0B,CAAC,IAAIA,CAAC,CAACrB,OAAO,CAAC,GAEpDqB,CAAC,IAAG;EACX,IAAII,2BAAC,CAAY,EAAE;IACjB;GACD,MAAM;IACL,OAAOlC,cAAc,CAAC8B,CAAC,CAAC7B,KAAK,CAAC;;AAElC,CAAC,CAAC,EACKiD,yBAAiB,CAAC,CAAC,CAAC,EAEhB;AAEb;;;AAGO,MAAMC,IAAI,4EACbF,WAAW,GADK7C,4BAAI,EAASgD,oBAAU,CAAC,CAEnB;AAAA","names":["reportAppError","cause","RequestException","make","tsplus_module_1","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","Date","tsplus_module_4","entries","forEach","id","op","lastChanged","tsplus_module_3","createdAt","updatedAt","delete","addOp","set","Operation","findOp","get","finishOp","exit","_","Error","value","result","tsplus_module_5","Success","Failure","message","tsplus_module_6","tsplus_module_7","tsplus_module_8","Guard","update","progress","tsplus_module_11","register","tsplus_module_10","tsplus_module_9","find","cleanupLoop","tsplus_module_12","Live","Operations"],"sourceRoot":"","sources":["../../../_src/services/Operations/live.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"live.cjs","mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAAyC;AAAA;AAEzC,MAAMA,cAAc,GAAG,8BAAW,EAACC,KAAK,IAAI,IAAIC,6BAAgB,CAACD,KAAK,CAAC,CAAC;AAExE,MAAME,IAAI,GAAGC,qBAAO,MAAK;EACvB,MAAMC,GAAG,GAAG,IAAIC,GAAG,EAA0B;EAC7C,MAAMC,MAAM,GAAGH,qBAAO,MAAMI,uBAAW,CAACL,IAAI,EAAE,CAAC;EAE/C,MAAMM,OAAO,GAAGL,qBAAO,MAAK;IAC1B,MAAMM,MAAM,GAAGC,iCAAIC,IAAI,EAAE,EAAU,CAAC,CAAC;IACrCC,iCAAG,CAACC,OAAO,EAAE,EAEVC,OAAO,CAAC,CAAC,CAACC,EAAE,EAAEC,EAAE,CAAC,KAAI;MACpB,MAAMC,WAAW,GAAGC,0BAA4C,MAAMF,EAAE,CAACG,SAAS,EAA9DD,6BAAoBF,EAAE,CAACI,SAAS,CAAC,CAA8B;MACnF,IAAIH,WAAW,GAAGR,MAAM,EAAE;QACxBL,GAAG,CAACiB,MAAM,CAACN,EAAE,CAAC;;IAElB,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,SAASO,KAAK,CAACP,EAAe;IAC5B,OAAOZ,qBAAO,MAAK;MACjBC,GAAG,CAACmB,GAAG,CAACR,EAAE,EAAE,IAAIS,qBAAS,CAAC;QAAET;MAAE,CAAE,CAAC,CAAC;IACpC,CAAC,CAAC;EACJ;EACA,SAASU,MAAM,CAACV,EAAe;IAC7B,OAAOZ,qBAAO,MAAMe,6BAAoBd,G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AAE+B;MAAQ,CAAE,CAAC;IAC9D,CAAC,CAAC,CACH;EACH;EACA,OAAOC,0CAAU,EAAM;IACrBnC,OAAO;IACPoC,QAAQ,EAAEzC,0BAAM,EACTY,EAAE,IAAGZ,yBAEJA,oCAAK,CAACY,EAAE,CAAC,EACT,CAACc,CAAC,EAAED,IAAI,KAAKD,QAAQ,CAACZ,EAAE,EAAEa,IAAI,CAAC,CAChC,EAHHiB,kCAAyB,aAAa,EAAE9B,EAAE,CAAC,CAGxC,CACJ;IAEH+B,IAAI,EAAErB,MAAM;IACZgB;GACD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAMM,WAAW,sDAAG5C,yHAAU,EAAkB0B,CAAC,IAAIA,CAAC,CAACrB,OAAO,CAAC,GAEpDqB,CAAC,IAAG;EACX,IAAII,2BAAC,CAAY,EAAE;IACjB;GACD,MAAM;IACL,OAAOlC,cAAc,CAAC8B,CAAC,CAAC7B,KAAK,CAAC;;AAElC,CAAC,CAAC,EACKgD,yBAAiB,CAAC,CAAC,CAAC,EAEhB;AAEb;;;AAGO,MAAMC,IAAI,uEACbF,WAAW,GADK5C,4BAAI,EAAS+C,oBAAU,CAAC,CAEnB;AAAA","names":["reportAppError","cause","RequestException","make","tsplus_module_1","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","Date","tsplus_module_4","entries","forEach","id","op","lastChanged","tsplus_module_3","createdAt","updatedAt","delete","addOp","set","Operation","findOp","get","finishOp","exit","_","Error","value","result","tsplus_module_5","Success","Failure","message","tsplus_module_6","tsplus_module_7","tsplus_module_8","Guard","update","progress","tsplus_module_10","register","tsplus_module_9","find","cleanupLoop","tsplus_module_11","Live","Operations"],"sourceRoot":"","sources":["../../../_src/services/Operations/live.ts"],"sourcesContent":[null]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MessageException = exports.FatalQueueException = void 0;
7
+ exports.forkDaemonReportQueue = forkDaemonReportQueue;
8
+ exports.reportFailure = reportFailure;
9
+ exports.reportQueueError = exports.reportFatalQueueError = void 0;
10
+ var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
11
+ var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/infra/RequestContext"));
12
+ var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Effect"));
13
+ var _errorReporter = require("@effect-app/infra/errorReporter");
14
+ var _errors = require("@effect-app/infra/errors");
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+ class MessageException extends _errors.CauseException {
18
+ constructor(cause) {
19
+ super(cause, "Message");
20
+ }
21
+ }
22
+ exports.MessageException = MessageException;
23
+ class FatalQueueException extends _errors.CauseException {
24
+ constructor(cause) {
25
+ super(cause, "Message");
26
+ }
27
+ }
28
+ exports.FatalQueueException = FatalQueueException;
29
+ const reportQueueError_ = (0, _errorReporter.reportError)(cause => new MessageException(cause));
30
+ const reportQueueError = (cause, context) => tsplus_module_1.serviceWithEffect(tsplus_module_2.tag, requestContext => tsplus_module_1.sync(() => reportQueueError_(cause, {
31
+ requestContext,
32
+ ...context
33
+ })));
34
+ /**
35
+ * Forks the effect into a new fiber attached to the global scope. Because the
36
+ * new fiber is attached to the global scope, when the fiber executing the
37
+ * returned effect terminates, the forked fiber will continue running.
38
+ *
39
+ * Reports errors.
40
+ *
41
+ * @tsplus getter effect/io/Effect forkDaemonReportQueue
42
+ */
43
+ exports.reportQueueError = reportQueueError;
44
+ function forkDaemonReportQueue(self) {
45
+ return tsplus_module_1.daemonChildren(tsplus_module_1.fork(tsplus_module_1.tapErrorCause(self, reportQueueError)));
46
+ }
47
+ const reportFatalQueueError = (0, _errorReporter.reportError)(cause => new FatalQueueException(cause));
48
+ exports.reportFatalQueueError = reportFatalQueueError;
49
+ function reportFailure(name) {
50
+ return self => tsplus_module_1.tap(tsplus_module_1.exit(self), exit => exit._tag === "Failure" ? reportFatalQueueError(exit.cause, {
51
+ name
52
+ }) : tsplus_module_3.unit);
53
+ }
54
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","mappings":";;;;;;;;;;;;AAAA;AACA;AAAyD;AAAA;AAGnD,MAAOA,gBAAoB,SAAQC,sBAAiB;EACxDC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,SAAS,CAAC;EACzB;;AACD;AAEK,MAAOC,mBAAuB,SAAQH,sBAAiB;EAC3DC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,SAAS,CAAC;EACzB;;AACD;AAED,MAAME,iBAAiB,GAAG,8BAAW,EAACF,KAAK,IAAI,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAEpE,MAAMG,gBAAgB,GAAG,CAACH,KAAqB,EAAEI,OAA6C,KACnGC,uDAAoCC,cAAc,IAChDD,2BAAOH,iBAAiB,CAACF,KAAK,EAAE;EAAEM,cAAc;EAAE,GAAGF;AAAO,CAAE,CAAC,CAAC,CACjE;AAEH;;;;;;;;;AAAA;AASM,SAAUG,qBAAqB,CAAUC,IAAqB;EAClE,2DAAOH,kCAAI,EAAeF,gBAAgB,CAAC;AAC7C;AAEO,MAAMM,qBAAqB,GAAG,8BAAW,EAC9CT,KAAK,IAAI,IAAIC,mBAAmB,CAACD,KAAK,CAAC,CACxC;AAAA;AAEK,SAAUU,aAAa,CAACC,IAAY;EACxC,OAAiBH,IAAqB,IACpCH,6CAAI,GAAUO,IAAI,IAChBA,IAAI,CAACC,IAAI,KAAK,SAAS,GACnBJ,qBAAqB,CAACG,IAAI,CAACZ,KAAK,EAAE;IAAEW;EAAI,CAAE,CAAC,GAC5CG,oBAAY,CAChB;AACL","names":["MessageException","CauseException","constructor","cause","FatalQueueException","reportQueueError_","reportQueueError","context","tsplus_module_1","requestContext","forkDaemonReportQueue","self","reportFatalQueueError","reportFailure","name","exit","_tag","tsplus_module_3"],"sourceRoot":"","sources":["../../../_src/services/QueueMaker/errors.ts"],"sourcesContent":[null]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeMemQueue = makeMemQueue;
7
+ exports.silence = silence;
8
+ var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
9
+ var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/infra/RequestContext"));
10
+ var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/_ext/Iterable"));
11
+ var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/infra/services/QueueMaker/errors"));
12
+ var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
13
+ var tsplus_module_6 = _interopRequireWildcard(require("@effect-app/prelude/_ext/misc"));
14
+ var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
15
+ var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/infra/api/setupRequest"));
16
+ var tsplus_module_9 = _interopRequireWildcard(require("@effect/io/Cause"));
17
+ var tsplus_module_10 = _interopRequireWildcard(require("@effect-app/core/Effect"));
18
+ var tsplus_module_11 = _interopRequireWildcard(require("@effect/io/Exit"));
19
+ var _memQueue = require("@effect-app/infra-adapters/memQueue");
20
+ var _errors2 = require("./errors.cjs");
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ /**
24
+ * @tsplus static QueueMaker.Ops makeMem
25
+ */
26
+ function makeMemQueue(queueName, queueDrainName, encoder, makeHandleEvent, provideContext, parseDrain) {
27
+ return tsplus_module_1.gen(function* ($) {
28
+ const mem = yield* $(tsplus_module_1.service(_memQueue.MemQueue));
29
+ const q = yield* $(mem.getOrCreateQueue(queueName));
30
+ const qReply = yield* $(mem.getOrCreateQueue(queueDrainName));
31
+ return {
32
+ publish: (...messages) => tsplus_module_1.gen(function* ($) {
33
+ const requestContext = yield* $(tsplus_module_1.service(tsplus_module_2.tag));
34
+ return yield* $(tsplus_module_4.forkDaemonReportQueue(tsplus_module_3.ext_forEach(messages, m => tsplus_module_1.asUnit(
35
+ // we JSON encode, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
36
+ tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.stringify(encoder({
37
+ body: m,
38
+ meta: requestContext
39
+ })))
40
+ // .tap((msg) => info("Publishing Mem Message: " + utils.inspect(msg)))
41
+ , _ => q.offer(_))))));
42
+ }),
43
+ drain: tsplus_module_1.gen(function* ($) {
44
+ const handleEvent = yield* $(makeHandleEvent);
45
+ const processMessage = msg =>
46
+ // we JSON parse, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
47
+ tsplus_module_1.flatMap(tsplus_module_1.orDie(tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.parse(msg)), parseDrain)), ({
48
+ body,
49
+ meta
50
+ }) => provideContext(tsplus_module_2.RequestContext.inherit(meta, {
51
+ id: body.id,
52
+ locale: "en",
53
+ name: tsplus_module_7.ReasonableString(body._tag)
54
+ }))(tsplus_module_1.zipRight(tsplus_module_6.logAnnotates({
55
+ body: tsplus_module_5.RecordPretty(tsplus_module_5.object$(body)),
56
+ meta: tsplus_module_5.RecordPretty(tsplus_module_5.object$(meta))
57
+ })(tsplus_module_1.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), silence(handleEvent(body)))));
58
+ return yield* $(tsplus_module_1.forkScoped(tsplus_module_8.setupReq3((0, _errors2.reportFailure)("drain")(tsplus_module_1.forever(tsplus_module_1.flatMap(qReply.take(), x => tsplus_module_1.uninterruptible(processMessage(x))))), "Queue.ReceiveMessage")));
59
+ })
60
+ };
61
+ });
62
+ }
63
+ // We want the Queue to continue processing even on errors per messages
64
+ // must make sure that the errors are processed/handled beforehand.
65
+ function silence(inp) {
66
+ return tsplus_module_1.flatMap(tsplus_module_1.exit(inp), result => tsplus_module_1.gen(function* ($) {
67
+ const requestContext = yield* $(tsplus_module_1.service(tsplus_module_2.tag));
68
+ return yield* $(tsplus_module_11.match(result, cause => {
69
+ if (tsplus_module_9.isInterrupted(cause)) {
70
+ return tsplus_module_1.failCause(cause);
71
+ }
72
+ (0, _errors2.reportQueueError)(cause, {
73
+ requestContext
74
+ });
75
+ return tsplus_module_10.unit;
76
+ }, () => tsplus_module_10.unit));
77
+ }));
78
+ }
79
+ //# sourceMappingURL=memQueue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memQueue.cjs","mappings":";;;;;;;;;;;;;;;;;;AAAA;AAGA;AAA6D;AAAA;AAG7D;;;AAGM,SAAUA,YAAY,CAC1BC,SAAiB,EACjBC,cAAsB,EACtBC,OAAyD,EACzDC,eAAwF,EACxFC,cAEuC,EACvCC,UAGmF;EAEnF,OAAOC,oBAAW,WAAUC,CAAC;IAC3B,MAAMC,GAAG,GAAG,OAAOD,CAAC,yBAACE,kBAAQ,EAAQ;IACrC,MAAMC,CAAC,GAAG,OAAOH,CAAC,CAACC,GAAG,CAACG,gBAAgB,CAACX,SAAS,CAAC,CAAC;IACnD,MAAMY,MAAM,GAAG,OAAOL,CAAC,CAACC,GAAG,CAACG,gBAAgB,CAACV,cAAc,CAAC,CAAC;IAE7D,OAAO;MACLY,OAAO,EAAE,CAAC,GAAGC,QAAQ,KACnBR,oBAAW,WAAUC,CAAC;QACpB,MAAMQ,cAAc,GAAG,OAAOR,CAAC,8CAA2B;QAC1D,OAAO,OAAOA,CAAC,uCACbS,oCAAQ,EAAeC,CAAC,IAAGX;QACzB;QACAA,6CAAO,MACLY,IAAI,CAACC,SAAS,CACZjB,OAAO,CAAC;UAAEkB,IAAI,EAAEH,CAAC;UAAEI,IAAI,EAAEN;QAAc,CAAE,CAAC,CAC3C;QAED;QAAA,EACSO,CAAC,IAAIZ,CAAC,CAACa,KAAK,CAACD,CAAC,CAAC,CAAC,CAClB,CACV,EAEF;MACH,CAAC,CAAC;MACJE,KAAK,EAAElB,oBAAW,WAAUC,CAAC;QAC3B,MAAMkB,WAAW,GAAG,OAAOlB,CAAC,CAACJ,eAAe,CAAC;QAC7C,MAAMuB,cAAc,GAAIC,GAAW;QACjC;QACArB,2FAAO,MAAMY,IAAI,CAACU,KAAK,CAACD,GAAG,CAAC,CAAC,EAClBtB,UAAU,CAAC,GAEX,CAAC;UAAEe,IAAI;UAAEC;QAAI,CAAE,KAMlBjB,cAAc,CACZyB,8BAAc,CAACC,OAAO,CAACT,IAAI,EAAE;UAC3BU,EAAE,EAAEX,IAAI,CAACW,EAAE;UACXC,MAAM,EAAE,IAAa;UACrBC,IAAI,EAAEC,gCAAgB,CAACd,IAAI,CAACe,IAAI;SACjC,CAAC,CACH,CAXL7B,yBAES8B,6BAAoB;UAAEhB,IAAI,uDAAEA,IAAI,EAAU;UAAEC,IAAI,uDAAEA,IAAI;QAAU,CAAE,CAAC,CAF5Ef,yBACY,OAAOL,cAAc,+BAA+B,CAAC,GAErDoC,OAAO,CAACZ,WAAW,CAACL,IAAI,CAAC,CAAC,CAAC,CASpC,CACJ;QACL,OAAO,OAAOb,CAAC,4BACb+B,0BAGS,0BAAa,EAAC,OAAO,CAAC,yBAH/BhC,8BAAM,CAACiC,IAAI,EAAE,EACFC,CAAC,IAAGlC,gCAACoB,cAAc,CAACc,CAAC,CAAC,CAAgB,CAAC,IAG1B,sBAAsB,CAAC,EAEhD;MACH,CAAC;KAC+B;EACpC,CAAC,CAAC;AACJ;AAEA;AACA;AACM,SAAUH,OAAO,CAAUI,GAAoB;EACnD,OAAOnC,gDAAG,GAAcoC,MAAM,IAC5BpC,oBAAW,WAAUC,CAAC;IACpB,MAAMQ,cAAc,GAAG,OAAOR,CAAC,8CAA2B;IAC1D,OAAO,OAAOA,CAAC,CACboC,6BAAM,EACJC,KAAK,IAAG;MACN,IAAIC,mCAAK,CAAgB,EAAE;QACzB,iCAAQD,KAAsB;;MAEhC,6BAAgB,EAACA,KAAK,EAAE;QAAE7B;MAAc,CAAE,CAAC;MAC3C;IACF,CAAC,EACD,MAAK+B,qBAAY,CAClB,CACF;EACH,CAAC,CAAC,CACH;AACH","names":["makeMemQueue","queueName","queueDrainName","encoder","makeHandleEvent","provideContext","parseDrain","tsplus_module_1","$","mem","MemQueue","q","getOrCreateQueue","qReply","publish","messages","requestContext","tsplus_module_3","m","JSON","stringify","body","meta","_","offer","drain","handleEvent","processMessage","msg","parse","RequestContext","inherit","id","locale","name","tsplus_module_7","_tag","tsplus_module_6","silence","tsplus_module_8","take","x","inp","result","tsplus_module_11","cause","tsplus_module_9","tsplus_module_10"],"sourceRoot":"","sources":["../../../_src/services/QueueMaker/memQueue.ts"],"sourcesContent":[null]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeServiceBusLayers = makeServiceBusLayers;
7
+ exports.makeServiceBusQueue = makeServiceBusQueue;
8
+ var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
9
+ var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Tag"));
10
+ var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
11
+ var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/prelude/_ext/misc"));
12
+ var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
13
+ var tsplus_module_6 = _interopRequireWildcard(require("@effect-app/infra/api/setupRequest"));
14
+ var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/infra/RequestContext"));
15
+ var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/infra/services/QueueMaker/errors"));
16
+ var tsplus_module_9 = _interopRequireWildcard(require("@effect/io/Layer"));
17
+ var _ServiceBus = require("@effect-app/infra-adapters/ServiceBus");
18
+ var _errorReporter = require("@effect-app/infra/errorReporter");
19
+ var _errors2 = require("./errors.cjs");
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ /**
23
+ * @tsplus static QueueMaker.Ops makeServiceBus
24
+ */
25
+ function makeServiceBusQueue(_queueName, queueDrainName, encoder, makeHandleEvent, provideContext, parseDrain) {
26
+ return tsplus_module_1.gen(function* ($) {
27
+ const s = yield* $(tsplus_module_1.service(_ServiceBus.Sender));
28
+ const receiver = yield* $(tsplus_module_1.service(_ServiceBus.Receiver));
29
+ const receiverLayer = tsplus_module_2.makeLayer(_ServiceBus.Receiver, receiver);
30
+ return {
31
+ drain: tsplus_module_1.gen(function* ($) {
32
+ const handleEvent = yield* $(makeHandleEvent);
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ function processMessage(messageBody) {
35
+ return tsplus_module_1.asUnit(tsplus_module_1.orDie(tsplus_module_6.setupReq3(tsplus_module_1.flatMap(tsplus_module_1.tapErrorCause(tsplus_module_1.orDie(tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.parse(messageBody)), x => parseDrain(x))), report), ({
36
+ body,
37
+ meta
38
+ }) => provideContext(tsplus_module_7.RequestContext.inherit(meta, {
39
+ id: body.id,
40
+ locale: "en",
41
+ name: tsplus_module_5.ReasonableString(body._tag)
42
+ }))(tsplus_module_1.tapErrorCause(tsplus_module_1.zipRight(tsplus_module_4.logAnnotates({
43
+ body: tsplus_module_3.RecordPretty(tsplus_module_3.object$(body)),
44
+ meta: tsplus_module_3.RecordPretty(tsplus_module_3.object$(meta))
45
+ })(tsplus_module_1.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), handleEvent(body)), report))), "Queue.ReceiveMessage")));
46
+ }
47
+ return yield* $(tsplus_module_1.provideSomeLayer((0, _ServiceBus.subscribe)({
48
+ processMessage: x => tsplus_module_1.uninterruptible(processMessage(x.body)),
49
+ processError: err => tsplus_module_1.sync(() => (0, _errorReporter.captureException)(err.error))
50
+ }), receiverLayer));
51
+ }),
52
+ publish: (...messages) => tsplus_module_1.gen(function* ($) {
53
+ const requestContext = yield* $(tsplus_module_1.service(tsplus_module_7.tag));
54
+ return yield* $(tsplus_module_8.forkDaemonReportQueue(tsplus_module_1.promise(() => s.sendMessages(messages.map(x => ({
55
+ body: JSON.stringify(encoder({
56
+ body: x,
57
+ meta: requestContext
58
+ })),
59
+ messageId: x.id,
60
+ contentType: "application/json"
61
+ }))))));
62
+ })
63
+ };
64
+ });
65
+ }
66
+ /**
67
+ * @tsplus static QueueMaker.Ops makeServiceBusLayers
68
+ */
69
+ function makeServiceBusLayers(url, queueName, queueDrainName) {
70
+ return tsplus_module_9.provide(tsplus_module_9.merge((0, _ServiceBus.LiveSender)(queueName))((0, _ServiceBus.LiveReceiver)(queueDrainName)))((0, _ServiceBus.LiveServiceBusClient)(url));
71
+ }
72
+ function report(cause) {
73
+ return tsplus_module_1.gen(function* ($) {
74
+ const requestContext = yield* $(tsplus_module_1.service(tsplus_module_7.tag));
75
+ return (0, _errors2.reportQueueError)(cause, {
76
+ requestContext
77
+ });
78
+ });
79
+ }
80
+ //# sourceMappingURL=sbqueue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sbqueue.cjs","mappings":";;;;;;;;;;;;;;;;AAAA;AASA;AAGA;AAA8C;AAAA;AAG9C;;;AAGM,SAAUA,mBAAmB,CAQjCC,UAAkB,EAClBC,cAAsB,EACtBC,OAAyD,EACzDC,eAAwF,EACxFC,cAEuC,EACvCC,UAGmF;EAEnF,OAAOC,oBAAW,WAAUC,CAAC;IAC3B,MAAMC,CAA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AGC,QAAQ,KACnB/B,oBAAW,WAAUC,CAAC;QACpB,MAAM+B,cAAc,GAAG,OAAO/B,CAAC,8CAA2B;QAC1D,OAAO,OAAOA,CAAC,uCACbD,wBAAe,MACbE,CAAC,CAAC+B,YAAY,CACZF,QAAQ,CAACG,GAAG,CAACnB,CAAC,KAAK;UACjBE,IAAI,EAAEJ,IAAI,CAACsB,SAAS,CAClBvC,OAAO,CAAC;YAAEqB,IAAI,EAAEF,CAAC;YAAEG,IAAI,EAAEc;UAAc,CAAE,CAAC,CAC3C;UACDI,SAAS,EAAErB,CAAC,CAACM,EAAE;UACfgB,WAAW,EAAE;SACd,CAAC,CAAC,CACJ,CACF,EAEF;MACH,CAAC;KAC6B;EACpC,CAAC,CAAC;AACJ;AAEA;;;AAGM,SAAUC,oBAAoB,CAACC,GAAW,EAAEC,SAAiB,EAAE7C,cAAsB;EACzF,+BACK8C,sBAAgC,0BAAU,EAACD,SAAS,CAAC,EAApD,4BAAY,EAAC7C,cAAc,CAAC,EAAyB,CADpD,oCAAoB,EAAC4C,GAAG,CAAC;AAElC;AAEA,SAASvB,MAAM,CAAI0B,KAAe;EAChC,OAAO1C,oBAAW,WAAUC,CAAC;IAC3B,MAAM+B,cAAc,GAAG,OAAO/B,CAAC,8CAA2B;IAC1D,OAAO,6BAAgB,EAACyC,KAAK,EAAE;MAAEV;IAAc,CAAE,CAAC;EACpD,CAAC,CAAC;AACJ","names":["makeServiceBusQueue","_queueName","queueDrainName","encoder","makeHandleEvent","provideContext","parseDrain","tsplus_module_1","$","s","Sender","receiver","Receiver","receiverLayer","tsplus_module_2","drain","handleEvent","processMessage","messageBody","tsplus_module_6","JSON","parse","x","report","body","meta","RequestContext","inherit","id","locale","name","tsplus_module_5","_tag","tsplus_module_4","processError","err","error","publish","messages","requestContext","sendMessages","map","stringify","messageId","contentType","makeServiceBusLayers","url","queueName","tsplus_module_9","cause"],"sourceRoot":"","sources":["../../../_src/services/QueueMaker/sbqueue.ts"],"sourcesContent":[null]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.QueueMaker = void 0;
7
+ const QueueMaker = {};
8
+ exports.QueueMaker = QueueMaker;
9
+ //# sourceMappingURL=service.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.cjs","mappings":";;;;;;AAaO,MAAMA,UAAU,GAAkB,EAAE;AAAA","names":["QueueMaker"],"sourceRoot":"","sources":["../../../_src/services/QueueMaker/service.ts"],"sourcesContent":[null]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.makeSomethingFilter_ = makeSomethingFilter_;
7
7
  exports.somethingsWhere = somethingsWhere;
8
8
  var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/infra/filter"));
9
- var _vitest = require("vitest");
10
9
  var _filter2 = require("../../filter.cjs");
11
10
  var _Cosmos = require("./Cosmos.cjs");
12
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -24,8 +23,8 @@ function somethingsWhere(makeWhere, mode) {
24
23
  };
25
24
  });
26
25
  }
27
- (0, _vitest.test)("works", () => {
28
- (0, _vitest.expect)((0, _Cosmos.buildWhereCosmosQuery)(somethingsWhere(_ => _("b", _ => "b2")), "Somethings", "importedMarkerId", undefined, 10)).toEqual({
26
+ test("works", () => {
27
+ expect((0, _Cosmos.buildWhereCosmosQuery)(somethingsWhere(_ => _("b", _ => "b2")), "Somethings", "importedMarkerId", undefined, 10)).toEqual({
29
28
  "parameters": [{
30
29
  "name": "@id",
31
30
  "value": "importedMarkerId"
@@ -40,7 +39,7 @@ function somethingsWhere(makeWhere, mode) {
40
39
  WHERE f.id != @id AND LOWER(f.b) = LOWER(@v0)
41
40
  OFFSET 0 LIMIT 10`
42
41
  });
43
- (0, _vitest.expect)((0, _Cosmos.buildWhereCosmosQuery)(somethingsWhere(_ => _("d.-1.a", _ => tsplus_module_1.$isnt(_, "a2"))), "Somethings", "importedMarkerId", undefined, 10)).toEqual({
42
+ expect((0, _Cosmos.buildWhereCosmosQuery)(somethingsWhere(_ => _("d.-1.a", _ => tsplus_module_1.$isnt(_, "a2"))), "Somethings", "importedMarkerId", undefined, 10)).toEqual({
44
43
  "parameters": [{
45
44
  "name": "@id",
46
45
  "value": "importedMarkerId"
@@ -1 +1 @@
1
- {"version":3,"file":"Cosmos.test.cjs","mappings":";;;;;;;;AACA;AACA;AACA;AAAmD;AAAA;AAEnD,MAAMA,EAAE,GAAG,wBAAW,GAAa;AAG7B,SAAUC,oBAAoB,CAACC,MAAqD;EACxF,OAAOA,MAAM,CAACF,EAAE,CAAC;AACnB;AAEM,SAAUG,eAAe,CAC7BC,SAEgC,EAChCC,IAAmB;EAEnB,OAAOJ,oBAAoB,CAACK,CAAC,IAAG;IAC9B,MAAMC,CAAC,GAAGH,SAAS,GAAGA,SAAS,CAACE,CAAC,CAAC,GAAG,EAAE;IACvC,OAAQ;MACND,IAAI;MACJG,KAAK,EAAGC,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAmC,GAAG,CAACA,CAAC;KACpE;EACH,CAAC,CAAC;AACJ;AAeA,gBAAI,EAAC,OAAO,EAAE,MAAK;EACjB,kBAAM,EAAC,iCAAqB,EAC1BJ,eAAe,CAACQ,CAAC,IAAIA,CAAC,CAAC,GAAG,EAAEA,CAAC,IAAI,IAAI,CAAC,CAAC,EACvC,YAAY,EACZ,kBAAkB,EAClBC,SAAS,EACT,EAAE,CACH,CAAC,CAACC,OAAO,CAAC;IACT,YAAY,EAAE,CACZ;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,EACD;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,CACF;IACD,OAAO,EAAE;;;;;;GAMV,CAAC;EAEF,kBAAM,EAAC,iCAAqB,EAC1BV,eAAe,CAACQ,CAAC,IAAIA,CAAC,CAAC,QAAQ,EAAEA,CAAC,IAAIG,uBAAC,EAAO,IAAI,CAAC,CAAC,CAAC,EACrD,YAAY,EACZ,kBAAkB,EAClBF,SAAS,EACT,EAAE,CACH,CAAC,CAACC,OAAO,CAAC;IACT,YAAY,EAAE,CACZ;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,EACD;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,CACF;IACD,OAAO,EAAE;;;;;;GAMV,CAAC;AACJ,CAAC,CAAC","names":["f_","makeSomethingFilter_","filter","somethingsWhere","makeWhere","mode","f","m","where","Array","isArray","_","undefined","toEqual","tsplus_module_1"],"sourceRoot":"","sources":["../../../_src/services/Store/Cosmos.test.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"Cosmos.test.cjs","mappings":";;;;;;;;AACA;AACA;AAAmD;AAAA;AAEnD,MAAMA,EAAE,GAAG,wBAAW,GAAa;AAG7B,SAAUC,oBAAoB,CAACC,MAAqD;EACxF,OAAOA,MAAM,CAACF,EAAE,CAAC;AACnB;AAEM,SAAUG,eAAe,CAC7BC,SAEgC,EAChCC,IAAmB;EAEnB,OAAOJ,oBAAoB,CAACK,CAAC,IAAG;IAC9B,MAAMC,CAAC,GAAGH,SAAS,GAAGA,SAAS,CAACE,CAAC,CAAC,GAAG,EAAE;IACvC,OAAQ;MACND,IAAI;MACJG,KAAK,EAAGC,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAmC,GAAG,CAACA,CAAC;KACpE;EACH,CAAC,CAAC;AACJ;AAeAI,IAAI,CAAC,OAAO,EAAE,MAAK;EACjBC,MAAM,CAAC,iCAAqB,EAC1BT,eAAe,CAACU,CAAC,IAAIA,CAAC,CAAC,GAAG,EAAEA,CAAC,IAAI,IAAI,CAAC,CAAC,EACvC,YAAY,EACZ,kBAAkB,EAClBC,SAAS,EACT,EAAE,CACH,CAAC,CAACC,OAAO,CAAC;IACT,YAAY,EAAE,CACZ;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,EACD;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,CACF;IACD,OAAO,EAAE;;;;;;GAMV,CAAC;EAEFH,MAAM,CAAC,iCAAqB,EAC1BT,eAAe,CAACU,CAAC,IAAIA,CAAC,CAAC,QAAQ,EAAEA,CAAC,IAAIG,uBAAC,EAAO,IAAI,CAAC,CAAC,CAAC,EACrD,YAAY,EACZ,kBAAkB,EAClBF,SAAS,EACT,EAAE,CACH,CAAC,CAACC,OAAO,CAAC;IACT,YAAY,EAAE,CACZ;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,EACD;MACE,MAAM,EAAE,KAAK;MACb,OAAO,EAAE;KACV,CACF;IACD,OAAO,EAAE;;;;;;GAMV,CAAC;AACJ,CAAC,CAAC","names":["f_","makeSomethingFilter_","filter","somethingsWhere","makeWhere","mode","f","m","where","Array","isArray","test","expect","_","undefined","toEqual","tsplus_module_1"],"sourceRoot":"","sources":["../../../_src/services/Store/Cosmos.test.ts"],"sourcesContent":[null]}
@@ -8,7 +8,6 @@ exports.somethingsWhere = somethingsWhere;
8
8
  var tsplus_module_1 = _interopRequireWildcard(require("@fp-ts/core/ReadonlyArray"));
9
9
  var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Array"));
10
10
  var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/infra/filter"));
11
- var _vitest = require("vitest");
12
11
  var _filter2 = require("../../filter.cjs");
13
12
  var _utils = require("./utils.cjs");
14
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -51,11 +50,11 @@ function somethingsWhere(makeWhere, mode) {
51
50
  };
52
51
  });
53
52
  }
54
- (0, _vitest.test)("works", () => {
55
- (0, _vitest.expect)(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("b", _ => "b2"))))(somethings))).toEqual([somethings[1]]);
56
- (0, _vitest.expect)(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("b", _ => "b"))))(somethings))).toEqual([somethings[0]]);
57
- (0, _vitest.expect)(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => "a5"))))(somethings))).toEqual([somethings[1]]);
58
- (0, _vitest.expect)(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => "a"))))(somethings))).toEqual([somethings[0]]);
59
- (0, _vitest.expect)(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => tsplus_module_3.$isnt(_, "a")))))(somethings))).toEqual([somethings[1]]);
53
+ test("works", () => {
54
+ expect(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("b", _ => "b2"))))(somethings))).toEqual([somethings[1]]);
55
+ expect(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("b", _ => "b"))))(somethings))).toEqual([somethings[0]]);
56
+ expect(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => "a5"))))(somethings))).toEqual([somethings[1]]);
57
+ expect(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => "a"))))(somethings))).toEqual([somethings[0]]);
58
+ expect(tsplus_module_2.iterableToArray(tsplus_module_1.filterMap((0, _utils.codeFilter)(somethingsWhere(_ => _("d.-1.a", _ => tsplus_module_3.$isnt(_, "a")))))(somethings))).toEqual([somethings[1]]);
60
59
  });
61
60
  //# sourceMappingURL=codeFilter.test.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeFilter.test.cjs","mappings":";;;;;;;;;;AACA;AACA;AACA;AAAuC;AAAA;AAEvC,MAAMA,UAAU,GAAG,CACjB;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG,CAAC;EAAEC,CAAC,EAAE,CAAC;IAAEH,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,EAAE;IAAED,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAC,CAAE,CAAC;EAAEG,EAAE,EAAE;AAAG,CAAE,EAC7E;EAAEJ,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,IAAI;EAAEC,CAAC,EAAE,CAAC,IAAI,CAAC;EAAEC,CAAC,EAAE,CAAC;IAAEH,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,EAAE;IAAED,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,CAAC;EAAEG,EAAE,EAAE;AAAG,CAAE,CAClD;AAEhC,MAAMC,EAAE,GAAG,wBAAW,GAAa;AAG7B,SAAUC,oBAAoB,CAACC,MAAqD;EACxF,OAAOA,MAAM,CAACF,EAAE,CAAC;AACnB;AAEM,SAAUG,eAAe,CAC7BC,SAEgC,EAChCC,IAAmB;EAEnB,OAAOJ,oBAAoB,CAACK,CAAC,IAAG;IAC9B,MAAMC,CAAC,GAAGH,SAAS,GAAGA,SAAS,CAACE,CAAC,CAAC,GAAG,EAAE;IACvC,OAAQ;MACND,IAAI;MACJG,KAAK,EAAGC,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAmC,GAAG,CAACA,CAAC;KACpE;EACH,CAAC,CAAC;AACJ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ere","makeWhere","mode","f","m","where","Array","isArray","tsplus_module_1","_","toEqual","tsplus_module_3"],"sourceRoot":"","sources":["../../../_src/services/Store/codeFilter.test.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"codeFilter.test.cjs","mappings":";;;;;;;;;;AACA;AACA;AAAuC;AAAA;AAEvC,MAAMA,UAAU,GAAG,CACjB;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG,CAAC;EAAEC,CAAC,EAAE,CAAC;IAAEH,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,EAAE;IAAED,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAC,CAAE,CAAC;EAAEG,EAAE,EAAE;AAAG,CAAE,EAC7E;EAAEJ,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,IAAI;EAAEC,CAAC,EAAE,CAAC,IAAI,CAAC;EAAEC,CAAC,EAAE,CAAC;IAAEH,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,EAAE;IAAED,CAAC,EAAE,IAAI;IAAEC,CAAC,EAAE;EAAC,CAAE,CAAC;EAAEG,EAAE,EAAE;AAAG,CAAE,CAClD;AAEhC,MAAMC,EAAE,GAAG,wBAAW,GAAa;AAG7B,SAAUC,oBAAoB,CAACC,MAAqD;EACxF,OAAOA,MAAM,CAACF,EAAE,CAAC;AACnB;AAEM,SAAUG,eAAe,CAC7BC,SAEgC,EAChCC,IAAmB;EAEnB,OAAOJ,oBAAoB,CAACK,CAAC,IAAG;IAC9B,MAAMC,CAAC,GAAGH,SAAS,GAAGA,SAAS,CAACE,CAAC,CAAC,GAAG,EAAE;IACvC,OAAQ;MACND,IAAI;MACJG,KAAK,EAAGC,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC,GAAGA,CAAmC,GAAG,CAACA,CAAC;KACpE;EACH,CAAC,CAAC;AACJ;AAeAI,IAAI,CAAC,OAAO,EAAE,MAAK;EACjBC,MAAM,iCACJC,0BAAqB,qBAAU,EAC7BV,eAAe,CAACW,CAAC,IAAIA,CAAC,CAAC,GAAG,EAAEA,CAAC,IAAI,IAAI,CAAC,CAAC,CACxC,EAFDpB,UAAU,CAER,EACH,CACEqB,OAAO,CAAC,CAACrB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;EAE3BkB,MAAM,iCACJC,0BAAqB,qBAAU,EAC7BV,eAAe,CAACW,CAAC,IAAIA,CAAC,CAAC,GAAG,EAAEA,CAAC,IAAI,GAAG,CAAC,CAAC,CACvC,EAFDpB,UAAU,CAER,EACH,CACEqB,OAAO,CAAC,CAACrB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;EAE3BkB,MAAM,iCACJC,0BAAqB,qBAAU,EAC7BV,eAAe,CAACW,CAAC,IAAIA,CAAC,CAAC,QAAQ,EAAEA,CAAC,IAAI,IAAI,CAAC,CAAC,CAC7C,EAFDpB,UAAU,CAER,EACH,CACEqB,OAAO,CAAC,CAACrB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;EAE3BkB,MAAM,iCACJC,0BAAqB,qBAAU,EAC7BV,eAAe,CAACW,CAAC,IAAIA,CAAC,CAAC,QAAQ,EAAEA,CAAC,IAAI,GAAG,CAAC,CAAC,CAC5C,EAFDpB,UAAU,CAER,EACH,CACEqB,OAAO,CAAC,CAACrB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;EAE3BkB,MAAM,iCACJC,0BAAqB,qBAAU,EAC7BV,eAAe,CAACW,CAAC,IAAIA,CAAC,CAAC,QAAQ,EAAEA,CAAC,IAAIE,uBAAC,EAAO,GAAG,CAAC,CAAC,CAAC,CACrD,EAFDtB,UAAU,CAER,EACH,CACEqB,OAAO,CAAC,CAACrB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC,CAAC","names":["somethings","a","b","c","d","id","f_","makeSomethingFilter_","filter","somethingsWhere","makeWhere","mode","f","m","where","Array","isArray","test","expect","tsplus_module_1","_","toEqual","tsplus_module_3"],"sourceRoot":"","sources":["../../../_src/services/Store/codeFilter.test.ts"],"sourcesContent":[null]}
@@ -10,6 +10,10 @@ import type {} from "@effect-app/infra/services/Emailer/Sendgrid"
10
10
  * @tsplus global
11
11
  */
12
12
  import type {} from "@effect-app/infra/services/Operations/live"
13
+ /**
14
+ * @tsplus global
15
+ */
16
+ import type {} from "@effect-app/infra/services/QueueMaker/errors"
13
17
  /**
14
18
  * @tsplus global
15
19
  */
@@ -20,3 +20,22 @@ export function setupRequest<R, E, A>(self: Effect<R, E, A>, requestContext: Req
20
20
  export function setupRequestFrom<R, E, A>(self: Effect<R, E, A>) {
21
21
  return RequestContext.Tag.accessWithEffect(requestContext => self.setupRequest(requestContext))
22
22
  }
23
+
24
+ /**
25
+ * @tsplus fluent effect/io/Effect setupRequestFromWith
26
+ */
27
+ export function setupReq3<R, E, A>(self: Effect<R, E, A>, name: string) {
28
+ return self
29
+ .setupRequestFrom
30
+ .provideService(RequestContext.Tag, makeInternalRequestContext(name))
31
+ }
32
+
33
+ function makeInternalRequestContext(name: string) {
34
+ const id = StringId.make()
35
+ return new RequestContext({
36
+ id,
37
+ rootId: id,
38
+ locale: "en",
39
+ name: ReasonableString(name)
40
+ })
41
+ }