@effect-app/infra 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/_cjs/api/codec.cjs +2 -4
  3. package/_cjs/api/codec.cjs.map +1 -1
  4. package/_cjs/api/defaultErrorHandler.cjs +18 -21
  5. package/_cjs/api/defaultErrorHandler.cjs.map +1 -1
  6. package/_cjs/api/express/makeJsonSchema.cjs +4 -4
  7. package/_cjs/api/express/makeJsonSchema.cjs.map +1 -1
  8. package/_cjs/api/express/makeOpenApiSpecs.cjs +5 -7
  9. package/_cjs/api/express/makeOpenApiSpecs.cjs.map +1 -1
  10. package/_cjs/api/express/schema/requestHandler.cjs +49 -49
  11. package/_cjs/api/express/schema/requestHandler.cjs.map +1 -1
  12. package/_cjs/api/express/schema/routing.cjs +22 -22
  13. package/_cjs/api/express/schema/routing.cjs.map +1 -1
  14. package/_cjs/api/reportError.cjs +6 -17
  15. package/_cjs/api/reportError.cjs.map +1 -1
  16. package/_cjs/api/routing.cjs +63 -63
  17. package/_cjs/api/routing.cjs.map +1 -1
  18. package/_cjs/api/setupRequest.cjs +2 -4
  19. package/_cjs/api/setupRequest.cjs.map +1 -1
  20. package/_cjs/api/writeDocs.cjs +6 -8
  21. package/_cjs/api/writeDocs.cjs.map +1 -1
  22. package/_cjs/errorReporter.cjs +11 -13
  23. package/_cjs/errorReporter.cjs.map +1 -1
  24. package/_cjs/errors.cjs +1 -1
  25. package/_cjs/errors.cjs.map +1 -1
  26. package/_cjs/instrument.cjs +1 -3
  27. package/_cjs/instrument.cjs.map +1 -1
  28. package/_cjs/rateLimit.cjs +6 -8
  29. package/_cjs/rateLimit.cjs.map +1 -1
  30. package/_cjs/services/Emailer/Sendgrid.cjs +12 -18
  31. package/_cjs/services/Emailer/Sendgrid.cjs.map +1 -1
  32. package/_cjs/services/Emailer/fake.cjs +4 -7
  33. package/_cjs/services/Emailer/fake.cjs.map +1 -1
  34. package/_cjs/services/Operations/live.cjs +23 -26
  35. package/_cjs/services/Operations/live.cjs.map +1 -1
  36. package/_cjs/services/Operations/service.cjs +3 -5
  37. package/_cjs/services/Operations/service.cjs.map +1 -1
  38. package/_cjs/services/Repository.cjs +28 -28
  39. package/_cjs/services/Repository.cjs.map +1 -1
  40. package/_cjs/services/Store/Cosmos.cjs +56 -56
  41. package/_cjs/services/Store/Cosmos.cjs.map +1 -1
  42. package/_cjs/services/Store/Disk.cjs +15 -16
  43. package/_cjs/services/Store/Disk.cjs.map +1 -1
  44. package/_cjs/services/Store/Memory.cjs +14 -16
  45. package/_cjs/services/Store/Memory.cjs.map +1 -1
  46. package/_cjs/services/Store/Redis.cjs +22 -23
  47. package/_cjs/services/Store/Redis.cjs.map +1 -1
  48. package/_cjs/services/Store/codeFilter.test.cjs +1 -1
  49. package/_cjs/services/Store/index.cjs +7 -7
  50. package/_cjs/services/Store/index.cjs.map +1 -1
  51. package/_cjs/services/Store/service.cjs +2 -4
  52. package/_cjs/services/Store/service.cjs.map +1 -1
  53. package/_cjs/services/Store/utils.cjs +16 -17
  54. package/_cjs/services/Store/utils.cjs.map +1 -1
  55. package/_cjs/services/simpledb/cosmosdb.cjs +23 -25
  56. package/_cjs/services/simpledb/cosmosdb.cjs.map +1 -1
  57. package/_cjs/services/simpledb/diskdb.cjs +20 -21
  58. package/_cjs/services/simpledb/diskdb.cjs.map +1 -1
  59. package/_cjs/services/simpledb/memdb.cjs +10 -10
  60. package/_cjs/services/simpledb/memdb.cjs.map +1 -1
  61. package/_cjs/services/simpledb/mongodb.cjs +18 -18
  62. package/_cjs/services/simpledb/mongodb.cjs.map +1 -1
  63. package/_cjs/services/simpledb/redisdb.cjs +23 -23
  64. package/_cjs/services/simpledb/redisdb.cjs.map +1 -1
  65. package/_cjs/services/simpledb/shared.cjs +4 -6
  66. package/_cjs/services/simpledb/shared.cjs.map +1 -1
  67. package/_cjs/services/simpledb/simpledb.cjs +15 -14
  68. package/_cjs/services/simpledb/simpledb.cjs.map +1 -1
  69. package/_src/errors.ts +1 -1
  70. package/_src/services/simpledb/memdb.ts +1 -1
  71. package/dist/RequestContext.d.ts +12 -12
  72. package/dist/api/codec.js +3 -5
  73. package/dist/api/defaultErrorHandler.js +20 -21
  74. package/dist/api/express/makeJsonSchema.js +3 -5
  75. package/dist/api/express/makeOpenApiSpecs.js +5 -7
  76. package/dist/api/express/schema/requestHandler.d.ts +5 -5
  77. package/dist/api/express/schema/requestHandler.js +45 -45
  78. package/dist/api/express/schema/routing.js +21 -23
  79. package/dist/api/reportError.js +6 -18
  80. package/dist/api/routing.js +60 -60
  81. package/dist/api/setupRequest.js +3 -5
  82. package/dist/api/writeDocs.js +7 -9
  83. package/dist/errorReporter.js +10 -12
  84. package/dist/errors.js +2 -2
  85. package/dist/instrument.js +2 -4
  86. package/dist/rateLimit.js +7 -9
  87. package/dist/services/Emailer/Sendgrid.js +15 -22
  88. package/dist/services/Emailer/fake.js +5 -8
  89. package/dist/services/Emailer/service.d.ts +1 -1
  90. package/dist/services/Operations/live.js +24 -27
  91. package/dist/services/Operations/service.js +4 -6
  92. package/dist/services/Repository.d.ts +4 -4
  93. package/dist/services/Repository.js +22 -22
  94. package/dist/services/Store/Cosmos.d.ts +1 -1
  95. package/dist/services/Store/Cosmos.js +61 -61
  96. package/dist/services/Store/Disk.js +16 -19
  97. package/dist/services/Store/Memory.d.ts +1 -1
  98. package/dist/services/Store/Memory.js +16 -18
  99. package/dist/services/Store/Redis.d.ts +1 -1
  100. package/dist/services/Store/Redis.js +21 -24
  101. package/dist/services/Store/index.js +6 -8
  102. package/dist/services/Store/service.d.ts +1 -1
  103. package/dist/services/Store/service.js +3 -5
  104. package/dist/services/Store/utils.d.ts +2 -2
  105. package/dist/services/Store/utils.js +18 -19
  106. package/dist/services/simpledb/cosmosdb.d.ts +2 -2
  107. package/dist/services/simpledb/cosmosdb.js +23 -25
  108. package/dist/services/simpledb/diskdb.d.ts +2 -2
  109. package/dist/services/simpledb/diskdb.js +18 -18
  110. package/dist/services/simpledb/memdb.d.ts +3 -3
  111. package/dist/services/simpledb/memdb.js +12 -11
  112. package/dist/services/simpledb/mongodb.d.ts +2 -2
  113. package/dist/services/simpledb/mongodb.js +18 -18
  114. package/dist/services/simpledb/redisdb.d.ts +8 -8
  115. package/dist/services/simpledb/redisdb.js +21 -21
  116. package/dist/services/simpledb/shared.d.ts +9 -9
  117. package/dist/services/simpledb/shared.js +5 -7
  118. package/dist/services/simpledb/simpledb.d.ts +1 -1
  119. package/dist/services/simpledb/simpledb.js +19 -17
  120. package/package.json +11 -11
@@ -7,7 +7,6 @@ exports.RequestException = void 0;
7
7
  exports.forkDaemonReportRequest = forkDaemonReportRequest;
8
8
  exports.forkDaemonReportRequestUnexpected = forkDaemonReportRequestUnexpected;
9
9
  exports.reportRequestError_ = exports.reportRequestError = exports.logRequestError_ = exports.logRequestError = void 0;
10
- var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
11
10
  var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/infra/RequestContext"));
12
11
  var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Effect"));
13
12
  var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Cause"));
@@ -16,7 +15,6 @@ var _errors = require("../errors.cjs");
16
15
  require("../RequestContext.cjs");
17
16
  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); }
18
17
  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; }
19
- const fileName_1 = "packages/infra/_src/api/reportError.ts";
20
18
  class RequestException extends _errors.CauseException {
21
19
  constructor(cause) {
22
20
  super(cause, "Request");
@@ -25,26 +23,17 @@ class RequestException extends _errors.CauseException {
25
23
  exports.RequestException = RequestException;
26
24
  const reportRequestError_ = (0, _errorReporter.reportError)(cause => new RequestException(cause));
27
25
  exports.reportRequestError_ = reportRequestError_;
28
- const reportRequestError = (cause, context) => tracer_1.withCallTrace(fileName_1 + ":13:22")(tsplus_module_2.serviceWithEffect(tsplus_module_1.tag, requestContext => reportRequestError_(cause, {
26
+ const reportRequestError = (cause, context) => tsplus_module_2.serviceWithEffect(tsplus_module_1.tag, requestContext => reportRequestError_(cause, {
29
27
  requestContext,
30
28
  ...context
31
- })));
29
+ }));
32
30
  exports.reportRequestError = reportRequestError;
33
31
  const logRequestError_ = (0, _errorReporter.logError)(cause => new RequestException(cause));
34
32
  exports.logRequestError_ = logRequestError_;
35
- const logRequestError = (cause, context) => tracer_1.withCallTrace(fileName_1 + ":18:22")(tsplus_module_2.serviceWithEffect(tsplus_module_1.tag, requestContext => logRequestError_(cause, {
33
+ const logRequestError = (cause, context) => tsplus_module_2.serviceWithEffect(tsplus_module_1.tag, requestContext => logRequestError_(cause, {
36
34
  requestContext,
37
35
  ...context
38
- }))
39
- /**
40
- * Forks the effect into a new fiber attached to the global scope. Because the
41
- * new fiber is attached to the global scope, when the fiber executing the
42
- * returned effect terminates, the forked fiber will continue running.
43
- *
44
- * Reports errors.
45
- *
46
- * @tsplus getter effect/io/Effect forkDaemonReportRequest
47
- */);
36
+ }));
48
37
  /**
49
38
  * Forks the effect into a new fiber attached to the global scope. Because the
50
39
  * new fiber is attached to the global scope, when the fiber executing the
@@ -56,7 +45,7 @@ const logRequestError = (cause, context) => tracer_1.withCallTrace(fileName_1 +
56
45
  */
57
46
  exports.logRequestError = logRequestError;
58
47
  function forkDaemonReportRequest(self) {
59
- return tsplus_module_2.daemonChildren(tsplus_module_2.fork(tracer_1.withCallTrace(fileName_1 + ":30:15")(tsplus_module_2.tapErrorCause(reportRequestError))(self)));
48
+ return tsplus_module_2.daemonChildren(tsplus_module_2.fork(tsplus_module_2.tapErrorCause(self, reportRequestError)));
60
49
  }
61
50
  /**
62
51
  * Forks the effect into a new fiber attached to the global scope. Because the
@@ -68,6 +57,6 @@ function forkDaemonReportRequest(self) {
68
57
  * @tsplus getter effect/io/Effect forkDaemonReportRequestUnexpected
69
58
  */
70
59
  function forkDaemonReportRequestUnexpected(self) {
71
- return tsplus_module_2.daemonChildren(tsplus_module_2.fork(tracer_1.withCallTrace(fileName_1 + ":44:15")(tsplus_module_2.tapErrorCause(cause => tsplus_module_3.isInterruptedOnly(cause) || tsplus_module_3.isDie(cause) ? reportRequestError(cause) : logRequestError(cause)))(self)));
60
+ return tsplus_module_2.daemonChildren(tsplus_module_2.fork(tsplus_module_2.tapErrorCause(self, cause => tsplus_module_3.isInterruptedOnly(cause) || tsplus_module_3.isDie(cause) ? reportRequestError(cause) : logRequestError(cause))));
72
61
  }
73
62
  //# sourceMappingURL=reportError.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reportError.cjs","mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAAqD;AAAA;;AAE/C,MAAOA,gBAAoB,SAAQC,sBAAiB;EACxDC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,SAAS,CAAC;EACzB;;AACD;AACM,MAAMC,mBAAmB,GAAG,8BAAW,EAACD,KAAK,IAAI,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAAA;AAE7E,MAAME,kBAAkB,GAAG,CAACF,KAAqB,EAAEG,OAA6C,KAAIC,8CACzGC,uDAAoCC,cAAc,IAAIL,mBAAmB,CAACD,KAAK,EAAE;EAAEM,cAAc;EAAE,GAAGH;AAAO,CAAE,CAAC,CAAC;AAAA;AAE5G,MAAMI,gBAAgB,GAAG,2BAAQ,EAACP,KAAK,IAAI,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAAA;AAEvE,MAAMQ,eAAe,GAAG,CAACR,KAAqB,EAAEG,OAA6C,KAAIC,8CACtGC,uDAAoCC,cAAc,IAAIC,gBAAgB,CAACP,KAAK,EAAE;EAAEM,cAAc;EAAE,GAAGH;AAAO,CAAE,CAAC;AAE/G;;;;;;;;GAAA,CAFgH;AAEhH;;;;;;;;;AAAA;AASM,SAAUM,uBAAuB,CAAUC,IAAqB;EACpE,2DAAON,4EAAmBF,kBAAkB,GAArCQ,IAAI,CAAkC;AAE/C;AAEA;;;;;;;;;AASM,SAAUC,iCAAiC,CAAUD,IAAqB;EAC9E,2DAAON,4EAAmBJ,KAAK,IAC7BY,uCAAK,CAAoB,IAAIA,2BAAK,CAAQ,GACtCV,kBAAkB,CAACF,KAAK,CAAC,GACzBQ,eAAe,CAACR,KAAK,CAAC,GAHrBU,IAAI,CAIV;AAEH","names":["RequestException","CauseException","constructor","cause","reportRequestError_","reportRequestError","context","tracer_1","tsplus_module_2","requestContext","logRequestError_","logRequestError","forkDaemonReportRequest","self","forkDaemonReportRequestUnexpected","tsplus_module_3"],"sourceRoot":"","sources":["../../_src/api/reportError.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"reportError.cjs","mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AAAqD;AAAA;AAE/C,MAAOA,gBAAoB,SAAQC,sBAAiB;EACxDC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,SAAS,CAAC;EACzB;;AACD;AACM,MAAMC,mBAAmB,GAAG,8BAAW,EAACD,KAAK,IAAI,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAAA;AAE7E,MAAME,kBAAkB,GAAG,CAACF,KAAqB,EAAEG,OAA6C,KACrGC,uDAAoCC,cAAc,IAAIJ,mBAAmB,CAACD,KAAK,EAAE;EAAEK,cAAc;EAAE,GAAGF;AAAO,CAAE,CAAC,CAAC;AAAA;AAE5G,MAAMG,gBAAgB,GAAG,2BAAQ,EAACN,KAAK,IAAI,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAAA;AAEvE,MAAMO,eAAe,GAAG,CAACP,KAAqB,EAAEG,OAA6C,KAClGC,uDAAoCC,cAAc,IAAIC,gBAAgB,CAACN,KAAK,EAAE;EAAEK,cAAc;EAAE,GAAGF;AAAO,CAAE,CAAC,CAAC;AAEhH;;;;;;;;;AAAA;AASM,SAAUK,uBAAuB,CAAUC,IAAqB;EACpE,2DAAOL,kCAAI,EAAeF,kBAAkB,CAAC;AAE/C;AAEA;;;;;;;;;AASM,SAAUQ,iCAAiC,CAAUD,IAAqB;EAC9E,2DAAOL,kCAAI,EAAeJ,KAAK,IAC7BW,uCAAK,CAAoB,IAAIA,2BAAK,CAAQ,GACtCT,kBAAkB,CAACF,KAAK,CAAC,GACzBO,eAAe,CAACP,KAAK,CAAC,CAC3B;AAEH","names":["RequestException","CauseException","constructor","cause","reportRequestError_","reportRequestError","context","tsplus_module_2","requestContext","logRequestError_","logRequestError","forkDaemonReportRequest","self","forkDaemonReportRequestUnexpected","tsplus_module_3"],"sourceRoot":"","sources":["../../_src/api/reportError.ts"],"sourcesContent":[null]}
@@ -12,7 +12,7 @@ exports.matchAllAlt = matchAllAlt;
12
12
  exports.matchResource = matchResource;
13
13
  exports.respondSuccess = respondSuccess;
14
14
  var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
15
- var tsplus_module_1 = _interopRequireWildcard(require("@fp-ts/data/Option"));
15
+ var tsplus_module_1 = _interopRequireWildcard(require("@fp-ts/core/Option"));
16
16
  var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Effect"));
17
17
  var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Effect"));
18
18
  var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/prelude/_ext/Schema.ext"));
@@ -33,15 +33,15 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
33
33
  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; }
34
34
  const fileName_1 = "packages/infra/_src/api/routing.ts";
35
35
  function makeRequestParsers(Request) {
36
- const ph = tracer_1.withCallTrace(fileName_1 + ":43:14")(tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Headers))))));
36
+ const ph = tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Headers)))));
37
37
  const parseHeaders = u => tracer_1.withCallTrace(fileName_1 + ":49:43")(tsplus_module_3.flatMapOpt(ph, d => d(u)));
38
- const pq = tracer_1.withCallTrace(fileName_1 + ":51:14")(tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Query))))));
38
+ const pq = tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Query)))));
39
39
  const parseQuery = u => tracer_1.withCallTrace(fileName_1 + ":57:41")(tsplus_module_3.flatMapOpt(pq, d => d(u)));
40
- const pb = tracer_1.withCallTrace(fileName_1 + ":59:14")(tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Body))))));
40
+ const pb = tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Body)))));
41
41
  const parseBody = u => tracer_1.withCallTrace(fileName_1 + ":65:40")(tsplus_module_3.flatMapOpt(pb, d => d(u)));
42
- const pp = tracer_1.withCallTrace(fileName_1 + ":67:14")(tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Path))))));
42
+ const pp = tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Path)))));
43
43
  const parsePath = u => tracer_1.withCallTrace(fileName_1 + ":73:40")(tsplus_module_3.flatMapOpt(pp, d => d(u)));
44
- const pc = tracer_1.withCallTrace(fileName_1 + ":75:14")(tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Cookie))))));
44
+ const pc = tsplus_module_2.sync(() => tsplus_module_1.map(MO.condemnFail)(tsplus_module_1.map(MO.Parser.for)(tsplus_module_1.map(s => s)(tsplus_module_1.fromNullable(Request.Cookie)))));
45
45
  const parseCookie = u => tracer_1.withCallTrace(fileName_1 + ":81:42")(tsplus_module_3.flatMapOpt(pc, d => d(u)));
46
46
  return {
47
47
  parseBody,
@@ -61,12 +61,12 @@ function match(requestHandler, errorHandler, middleware) {
61
61
  requestHandler = handler;
62
62
  makeMiddlewareContext = makeContext;
63
63
  }
64
- return tracer_1.withCallTrace(fileName_1 + ":175:5")(tsplus_module_2.zipRight(tracer_1.withCallTrace(fileName_1 + ":176:5")(tsplus_module_2.sync(() => (0, _routing.makeRouteDescriptor)(requestHandler.Request.path, requestHandler.Request.method, requestHandler)))))(Ex.match(requestHandler.Request.method.toLowerCase())(requestHandler.Request.path.split("?")[0], makeRequestHandler(requestHandler, errorHandler, makeMiddlewareContext)));
64
+ return tsplus_module_2.zipRight(Ex.match(requestHandler.Request.method.toLowerCase())(requestHandler.Request.path.split("?")[0], makeRequestHandler(requestHandler, errorHandler, makeMiddlewareContext)), tsplus_module_2.sync(() => (0, _routing.makeRouteDescriptor)(requestHandler.Request.path, requestHandler.Request.method, requestHandler)));
65
65
  }
66
66
  function respondSuccess(encodeResponse) {
67
- return (req, res, a) => tracer_1.withCallTrace(fileName_1 + ":191:8")(tsplus_module_2.flatMap(r => tracer_1.withCallTrace(fileName_1 + ":192:9")(tsplus_module_2.sync(() => {
67
+ return (req, res, a) => tsplus_module_2.flatMap(tsplus_module_2.sync(() => encodeResponse(req)(a)), r => tsplus_module_2.sync(() => {
68
68
  r === undefined ? res.status(204).send() : res.status(200).send(JSON.stringify(r));
69
- }))))(tracer_1.withCallTrace(fileName_1 + ":190:5")(tsplus_module_2.sync(() => encodeResponse(req)(a))));
69
+ }));
70
70
  }
71
71
  function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
72
72
  const {
@@ -82,7 +82,7 @@ function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
82
82
  const parseRequest = (0, _requestHandler.parseRequestParams)(requestParsers);
83
83
  const respond = respondSuccess(encodeResponse);
84
84
  function getParams(req) {
85
- return tracer_1.withCallTrace(fileName_1 + ":246:12")(tsplus_module_2.sync(() => ({
85
+ return tsplus_module_2.sync(() => ({
86
86
  path: req.params,
87
87
  query: req.query,
88
88
  body: req.body,
@@ -94,7 +94,7 @@ function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
94
94
  prev[key] = typeof value === "string" || Array.isArray(value) ? (0, _util.snipValue)(value) : value;
95
95
  return prev;
96
96
  }, {}) : req.cookies
97
- })));
97
+ }));
98
98
  }
99
99
  function makeContext(req) {
100
100
  const start = new Date();
@@ -126,10 +126,55 @@ function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
126
126
  return requestContext;
127
127
  }
128
128
  return (req, res) => {
129
- return tracer_1.withCallTrace(fileName_1 + ":316:8")(tsplus_module_2.flatMap(({
129
+ return tsplus_module_2.flatMap(tsplus_module_2.struct({
130
+ requestContext: tsplus_module_2.sync(() => {
131
+ const requestContext = makeContext(req);
132
+ if (req.method === "GET") {
133
+ res.setHeader("Cache-Control", "no-store");
134
+ }
135
+ res.setHeader("Content-Language", requestContext.locale);
136
+ return requestContext;
137
+ }),
138
+ pars: getParams(req)
139
+ }), ({
130
140
  pars,
131
141
  requestContext
132
- }) => tsplus_module_9.setupRequest(tracer_1.withCallTrace(fileName_1 + ":398:12")(tsplus_module_2.provideService(tsplus_module_5.tag, requestContext))(tracer_1.withCallTrace(fileName_1 + ":383:12")(tsplus_module_2.tap(() => tracer_1.withCallTrace(fileName_1 + ":384:20")(tsplus_module_2.suspendSucceed(() => {
142
+ }) => tsplus_module_9.setupRequest(tsplus_module_2.provideService(tsplus_module_2.tap(tsplus_module_2.tapErrorCause(tsplus_module_2.zipRight(tsplus_module_7.logAnnotates({
143
+ method: req.method,
144
+ path: req.originalUrl,
145
+ reqPath: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.path)),
146
+ reqQuery: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.query)),
147
+ reqBody: (0, tsplus_module_6.pretty)(pars.body),
148
+ reqCookies: (0, tsplus_module_6.pretty)(pars.cookies),
149
+ reqHeaders: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.headers))
150
+ })(tsplus_module_2.logInfo("Processing request")), tsplus_module_2.suspendSucceed(() => {
151
+ const handleRequest = tsplus_module_2.flatMap(tsplus_module_2.map(parseRequest(req), ({
152
+ body,
153
+ path,
154
+ query
155
+ }) => {
156
+ const hn = {
157
+ ...tsplus_module_8.getOrUndefined(body),
158
+ ...tsplus_module_8.getOrUndefined(query),
159
+ ...tsplus_module_8.getOrUndefined(path)
160
+ };
161
+ return hn;
162
+ }), parsedReq => tsplus_module_2.flatMap(handle(parsedReq), r => respond(parsedReq, res, r)));
163
+ // Commands should not be interruptable.
164
+ const r = req.method !== "GET" ? tsplus_module_2.uninterruptible(handleRequest) : handleRequest; // .instrument("Performance.RequestResponse")
165
+ // the first log entry should be of the request start.
166
+ const r2 = makeMiddlewareContext ? tsplus_module_3.provideSomeContextEffect(makeMiddlewareContext(req, res, requestContext))(r)
167
+ // PR is not relevant here
168
+ : r;
169
+ return errorHandler(req, res, requestContext, r2);
170
+ })), cause => tsplus_module_2.tapErrorCause(tsplus_module_2.zipRight(tsplus_module_2.suspendSucceed(() => {
171
+ res.status(500).send();
172
+ return (0, _reportError.reportRequestError)(cause, {
173
+ requestContext,
174
+ path: req.originalUrl,
175
+ method: req.method
176
+ });
177
+ }), tsplus_module_2.suspendSucceed(() => {
133
178
  const headers = res.getHeaders();
134
179
  return tsplus_module_7.logAnnotates({
135
180
  method: req.method,
@@ -139,8 +184,8 @@ function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
139
184
  prev[key] = value && typeof value === "string" ? (0, _util.snipString)(value) : value;
140
185
  return prev;
141
186
  }, {})))
142
- })(tracer_1.withCallTrace(fileName_1 + ":386:29")(tsplus_module_2.logInfo("Processed request")));
143
- }))))(tracer_1.withCallTrace(fileName_1 + ":355:12")(tsplus_module_2.tapErrorCause(cause => tracer_1.withCallTrace(fileName_1 + ":381:16")(tsplus_module_2.tapErrorCause(cause => tracer_1.withCallTrace(fileName_1 + ":381:39")(tsplus_module_2.sync(() => console.error("Error occurred while reporting error", cause)))))(tracer_1.withCallTrace(fileName_1 + ":363:16")(tsplus_module_2.zipRight(tracer_1.withCallTrace(fileName_1 + ":364:22")(tsplus_module_2.suspendSucceed(() => {
187
+ })(tsplus_module_2.logErrorCauseMessage("Processed request", cause));
188
+ })), cause => tsplus_module_2.sync(() => console.error("Error occurred while reporting error", cause)))), () => tsplus_module_2.suspendSucceed(() => {
144
189
  const headers = res.getHeaders();
145
190
  return tsplus_module_7.logAnnotates({
146
191
  method: req.method,
@@ -150,54 +195,9 @@ function makeRequestHandler(handler, errorHandler, makeMiddlewareContext) {
150
195
  prev[key] = value && typeof value === "string" ? (0, _util.snipString)(value) : value;
151
196
  return prev;
152
197
  }, {})))
153
- })(tracer_1.withCallTrace(fileName_1 + ":366:31")(tsplus_module_2.logErrorCauseMessage("Processed request", cause)));
154
- }))))(tracer_1.withCallTrace(fileName_1 + ":356:20")(tsplus_module_2.suspendSucceed(() => {
155
- res.status(500).send();
156
- return (0, _reportError.reportRequestError)(cause, {
157
- requestContext,
158
- path: req.originalUrl,
159
- method: req.method
160
- });
161
- }))))))(tracer_1.withCallTrace(fileName_1 + ":325:13")(tsplus_module_2.zipRight(tracer_1.withCallTrace(fileName_1 + ":326:18")(tsplus_module_2.suspendSucceed(() => {
162
- const handleRequest = tracer_1.withCallTrace(fileName_1 + ":336:16")(tsplus_module_2.flatMap(parsedReq => tracer_1.withCallTrace(fileName_1 + ":338:20")(tsplus_module_2.flatMap(r => respond(parsedReq, res, r)))(handle(parsedReq))))(tracer_1.withCallTrace(fileName_1 + ":328:16")(tsplus_module_2.map(({
163
- body,
164
- path,
165
- query
166
- }) => {
167
- const hn = {
168
- ...tsplus_module_8.getOrUndefined(body),
169
- ...tsplus_module_8.getOrUndefined(query),
170
- ...tsplus_module_8.getOrUndefined(path)
171
- };
172
- return hn;
173
- }))(parseRequest(req)));
174
- // Commands should not be interruptable.
175
- const r = req.method !== "GET" ? tsplus_module_2.uninterruptible(handleRequest) : handleRequest; // .instrument("Performance.RequestResponse")
176
- // the first log entry should be of the request start.
177
- const r2 = makeMiddlewareContext ? tsplus_module_3.provideSomeContextEffect(makeMiddlewareContext(req, res, requestContext))(r)
178
- // PR is not relevant here
179
- : r;
180
- return errorHandler(req, res, requestContext, r2);
181
- }))))(tsplus_module_7.logAnnotates({
182
- method: req.method,
183
- path: req.originalUrl,
184
- reqPath: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.path)),
185
- reqQuery: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.query)),
186
- reqBody: (0, tsplus_module_6.pretty)(pars.body),
187
- reqCookies: (0, tsplus_module_6.pretty)(pars.cookies),
188
- reqHeaders: tsplus_module_6.RecordPretty(tsplus_module_6.object$(pars.headers))
189
- })(tracer_1.withCallTrace(fileName_1 + ":317:16")(tsplus_module_2.logInfo("Processing request"))))))) // otherwise external error reporter breaks.
190
- , requestContext)))(tracer_1.withCallTrace(fileName_1 + ":305:19")(tsplus_module_2.struct({
191
- requestContext: tracer_1.withCallTrace(fileName_1 + ":306:23")(tsplus_module_2.sync(() => {
192
- const requestContext = makeContext(req);
193
- if (req.method === "GET") {
194
- res.setHeader("Cache-Control", "no-store");
195
- }
196
- res.setHeader("Content-Language", requestContext.locale);
197
- return requestContext;
198
- })),
199
- pars: getParams(req)
200
- })));
198
+ })(tsplus_module_2.logInfo("Processed request"));
199
+ })), tsplus_module_5.tag, requestContext) // otherwise external error reporter breaks.
200
+ , requestContext));
201
201
  };
202
202
  }
203
203
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"routing.cjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAGA;AAKA;AAEA;AAEA;AAEA;AACA;AACA;AAAiD;AAAA;;AAE3C,SAAUA,kBAAkB,CAWhCC,OAUY;EAEZ,MAAMC,EAAE,iDAAGC,2BACTC,oBAGOC,EAAE,CAACC,WAAW,EAHrBF,oBAEOC,EAxCG,CAwCHE,MAAM,CAAC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G,CAACV,GAAG,CAAC,CAAC,CAACH,QAAQ,CAACG,GAAG,CAAQ,CAAC;MAClD,OAAOjD,IAAI;IACb,CAAC,EAAE,EAAS,CAAC;IAEb,OAAOrC,OASN;EACH,CAAC;AACH","names":["makeRequestParsers","Request","ph","tsplus_module_2","tsplus_module_1","MO","condemnFail","Parser","for","s","Headers","parseHeaders","u","tracer_1","tsplus_module_3","d","pq","Query","parseQuery","pb","Body","parseBody","pp","Path","parsePath","pc","Cookie","parseCookie","match","requestHandler","errorHandler","middleware","makeMiddlewareContext","undefined","handler","makeContext","path","method","Ex","toLowerCase","split","makeRequestHandler","respondSuccess","encodeResponse","req","res","a","r","status","send","JSON","stringify","Response","adaptResponse","h","handle","response","Void","encoder","Encoder","requestParsers","parseRequest","respond","getParams","params","query","body","headers","Object","entries","reduce","prev","key","value","cookies","Array","isArray","start","Date","supported","desiredLocale","locale","includes","requestId","rootId","tsplus_module_4","RequestId","make","requestContext","RequestContext","name","ReasonableString","Model","SchemaNamed","createdAt","pars","tsplus_module_9","getHeaders","tsplus_module_7","originalUrl","statusCode","toString","resHeaders","cause","console","error","handleRequest","parsedReq","hn","r2","reqPath","reqQuery","reqBody","reqCookies","reqHeaders","setHeader","matchAll","handlers","mapped","tsplus_module_6","cur","defaultBasicErrorHandler","matchAllAlt","matches","forEach","_","extractRequest","extractResponse","ResponseOpenApi","matchResource","mod"],"sourceRoot":"","sources":["../../_src/api/routing.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"routing.cjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAGA;AAKA;AAEA;AAEA;AAEA;AACA;AACA;AAAiD;AAAA;;AAE3C,SAAUA,kBAAkB,CAWhCC,OAUY;EAEZ,MAAMC,EAAE,GAAGC,2BACTC,oBAGOC,EAAE,CAACC,WAAW,EAHrBF,oBAEOC,EAxCG,CAwCHE,MAAM,CAACC,GAAG,EAFjBJ,oBACOK,CAAC,IAAIA,CAAC,EADbL,6BAAiBH,OAAO,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AAEA;;;;AAIM,SAAUI,WAAW,CAAgCL,QAAW;EACpE,MAAMC,MAAM,GAAGC,2DAAQ,GAASjD,MAAM,CAAC,CAACC,IAAI,EAAEiD,GAAG,KAAI;IACnD,MAAMG,OAAO,GAAGP,QAAQ,CAACC,QAAQ,CAACG,GAAG,CAAC,CAAC;IACvCD,0DAAO,GAASK,OAAO,CAACpD,GAAG,IAAID,IAAI,CAAC,GAAGiD,GAAa,IAAIhD,GAAa,EAAE,CAAC,GAAGmD,OAAO,CAACnD,GAAG,CAAC,CAAC;IACxF,OAAOD,IAAI;EACb,CAAC,EAAE,EAAS,CAA2C;EAEvD,OAAO+C,MAAM;AACf;AAwCM,SAAU/D,MAAM,CAMpBsE,CAAsC,EACtCxE,aAAmB;EAEnB;EACA,MAAMnD,OAAO,GAAGI,EAAE,CAACwH,cAAc,CAACD,CAAC,CAAC;EACpC,MAAMzE,QAAQ,GAAG9C,EAAE,CAACyH,eAAe,CAACF,CAAC,CAAC;EAUtC,OACEvE,CAAgC,KAC5B;IACJD,aAAa;IACbC,CAAC;IACDpD,OAAO;IACPkD,QAAQ;IACR4E,eAAe,EAAEH,CAAC,CAACG,eAAe,IAAI5E;GAQtC;AACJ;AAqBA;;;;;;;;;;;;;;;AAeM,SAAU6E,aAAa,CAAuDC,GAAa;EAE/F,OAOEb,QAAmB,IACjB;IACF,MAAMlF,OAAO,GAAGoF,sDAAG,GAASjD,MAAM,CAAC,CAACC,IAAI,EAAEiD,GAAG,KAAI;MAC/CjD,IAAI,CAACiD,GAAG,CAAC,GAAGjE,MAAM,CAAC2E,GAAG,CAACV,GAAG,CAAC,CAAC,CAACH,QAAQ,CAACG,GAAG,CAAQ,CAAC;MAClD,OAAOjD,IAAI;IACb,CAAC,EAAE,EAAS,CAAC;IAEb,OAAOpC,OASN;EACH,CAAC;AACH","names":["makeRequestParsers","Request","ph","tsplus_module_2","tsplus_module_1","MO","condemnFail","Parser","for","s","Headers","parseHeaders","u","tracer_1","tsplus_module_3","d","pq","Query","parseQuery","pb","Body","parseBody","pp","Path","parsePath","pc","Cookie","parseCookie","match","requestHandler","errorHandler","middleware","makeMiddlewareContext","undefined","handler","makeContext","method","toLowerCase","path","split","makeRequestHandler","respondSuccess","encodeResponse","req","res","a","r","status","send","JSON","stringify","Response","adaptResponse","h","handle","response","Void","encoder","Encoder","requestParsers","parseRequest","respond","getParams","params","query","body","headers","Object","entries","reduce","prev","key","value","cookies","Array","isArray","start","Date","supported","desiredLocale","locale","includes","requestId","rootId","tsplus_module_4","RequestId","make","requestContext","RequestContext","name","ReasonableString","Model","SchemaNamed","createdAt","setHeader","pars","tsplus_module_9","tsplus_module_7","originalUrl","reqPath","reqQuery","reqBody","reqCookies","reqHeaders","handleRequest","hn","parsedReq","r2","cause","getHeaders","statusCode","toString","resHeaders","console","error","matchAll","handlers","mapped","tsplus_module_6","cur","defaultBasicErrorHandler","matchAllAlt","matches","forEach","_","extractRequest","extractResponse","ResponseOpenApi","matchResource","mod"],"sourceRoot":"","sources":["../../_src/api/routing.ts"],"sourcesContent":[null]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setupRequest = void 0;
7
7
  exports.setupRequestFrom = setupRequestFrom;
8
- var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
9
8
  var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
10
9
  var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/_ext/Prelude.ext"));
11
10
  var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Function"));
@@ -13,14 +12,13 @@ var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/infra/Request
13
12
  require("../RequestContext.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); }
15
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; }
16
- const fileName_1 = "packages/infra/_src/api/setupRequest.ts";
17
15
  const setupRequest = setupRequest_1;
18
16
  exports.setupRequest = setupRequest;
19
17
  /**
20
18
  * @tsplus fluent effect/io/Effect setupRequest
21
19
  */
22
20
  function setupRequest_1(self, requestContext) {
23
- return tsplus_module_3.pipe(tracer_1.withCallTrace(fileName_1 + ":8:10")(tsplus_module_1.logSpan("request"))(self), tsplus_module_2.logAnnotates({
21
+ return tsplus_module_3.pipe(tsplus_module_1.logSpan(self, "request"), tsplus_module_2.logAnnotates({
24
22
  requestRootId: requestContext.rootId,
25
23
  requestId: requestContext.id,
26
24
  requestName: requestContext.name
@@ -30,6 +28,6 @@ function setupRequest_1(self, requestContext) {
30
28
  * @tsplus getter effect/io/Effect setupRequestFrom
31
29
  */
32
30
  function setupRequestFrom(self) {
33
- return tracer_1.withCallTrace(fileName_1 + ":21:29")(tsplus_module_1.serviceWithEffect(tsplus_module_4.tag, requestContext => setupRequest_1(self, requestContext)));
31
+ return tsplus_module_1.serviceWithEffect(tsplus_module_4.tag, requestContext => setupRequest_1(self, requestContext));
34
32
  }
35
33
  //# 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,qEAAa,SAAS,GAAtBH,IAAI,CAAmB,EACvBI,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,qDAAOY,uDAAoCX,cAAc,IAAIY,mBAAI,EAAcZ,cAAc,CAAC,CAAC;AACjG","names":["setupRequest","self","requestContext","tsplus_module_3","tracer_1","tsplus_module_2","requestRootId","rootId","requestId","id","requestName","name","setupRequestFrom","tsplus_module_1","setupRequest_1"],"sourceRoot":"","sources":["../../_src/api/setupRequest.ts"],"sourcesContent":[null]}
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]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.writeOpenapiDocs = writeOpenapiDocs;
7
- var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
8
7
  var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
9
8
  var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Order"));
10
9
  var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/_ext/ord.ext"));
@@ -15,17 +14,16 @@ var Plutus = _interopRequireWildcard(require("@effect-app/infra-adapters/Openapi
15
14
  var _makeOpenApiSpecs = require("./express/makeOpenApiSpecs.cjs");
16
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); }
17
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; }
18
- const fileName_1 = "packages/infra/_src/api/writeDocs.ts";
19
17
  function writeOpenapiDocs(rdescs) {
20
- return tracer_1.withCallTrace(fileName_1 + ":24:6")(tsplus_module_1.flatMap(() => tracer_1.withCallTrace(fileName_1 + ":24:27")(tsplus_module_1.logInfo("OpenAPI spec written to './openapi.json'"))))(tracer_1.withCallTrace(fileName_1 + ":23:6")(tsplus_module_1.flatMap(_ => tsplus_module_1.orDie((0, _fileUtil.writeTextFile)("./openapi.json", JSON.stringify(_, undefined, 2)))))(tracer_1.withCallTrace(fileName_1 + ":17:6")(tsplus_module_1.map(_ => ({
18
+ return tsplus_module_1.flatMap(tsplus_module_1.flatMap(tsplus_module_1.map((0, _makeOpenApiSpecs.makeOpenApiSpecs)(tsplus_module_4.sortWith(tsplus_module_3.OrdContramap(a => a.path)(tsplus_module_2.string))((0, _utils.typedValuesOf)(rdescs).reduce((prev, cur) => prev.concat((0, _utils.typedValuesOf)(cur)), [])), Plutus.info({
19
+ title: "api",
20
+ version: "X",
21
+ pageTitle: "api"
22
+ })), _ => ({
21
23
  ..._,
22
24
  tags: [
23
25
  // add the tags here
24
26
  ]
25
- })))((0, _makeOpenApiSpecs.makeOpenApiSpecs)(tsplus_module_4.sortWith(tsplus_module_3.OrdContramap(a => a.path)(tsplus_module_2.string))((0, _utils.typedValuesOf)(rdescs).reduce((prev, cur) => prev.concat((0, _utils.typedValuesOf)(cur)), [])), Plutus.info({
26
- title: "api",
27
- version: "X",
28
- pageTitle: "api"
29
- })))));
27
+ })), _ => tsplus_module_1.orDie((0, _fileUtil.writeTextFile)("./openapi.json", JSON.stringify(_, undefined, 2)))), () => tsplus_module_1.logInfo("OpenAPI spec written to './openapi.json'"));
30
28
  }
31
29
  //# sourceMappingURL=writeDocs.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeDocs.cjs","mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AAAgE;AAAA;;AAG1D,SAAUA,gBAAgB,CAACC,MAA0D;EACzF,OAAOC,qEAgBI,MAAKA,8CAACC,wBAAe,0CAA0C,CAAC,IAhBpED,qEAeIE,CAAC,IAAGD,sBAAC,2BAAa,EAAC,gBAAgB,EAAEE,IAAI,CAACC,SAAS,CAACF,CAAC,EAAEG,SAAS,EAAE,CAAC,CAAC,CAAC,CAAM,GAf/EL,iEASAE,CAAC,KAAK;IACT,GAAGA,CAAC;IACJI,IAAI,EAAE;MACJ;IAAA;GAEH,CAAC,GAdG,sCAAgB,EACrBC,yBACYC,6BAAwBC,CAAqB,IAAKA,CAAC,CAACC,IAAI,yBAAC,EADrE,wBAAa,EAACX,MAAM,CAAC,CAACY,MAAM,CAAC,CAACC,IAAI,EAAEC,GAAG,KAAKD,IAAI,CAACE,MAAM,CAAC,wBAAa,EAACD,GAAG,CAAC,CAAC,EAAE,EAAmC,CAAC,CAC3C,EACtEE,MAAM,CAACC,IAAI,CAAC;IACVC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE;GACZ,CAAC,CACH,CAMI,CACkF,CACX;AAC9E","names":["writeOpenapiDocs","rdescs","tracer_1","tsplus_module_1","_","JSON","stringify","undefined","tags","tsplus_module_4","tsplus_module_3","a","path","reduce","prev","cur","concat","Plutus","info","title","version","pageTitle"],"sourceRoot":"","sources":["../../_src/api/writeDocs.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"writeDocs.cjs","mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AAAgE;AAAA;AAG1D,SAAUA,gBAAgB,CAACC,MAA0D;EACzF,OAAOC,0GAAgB,EACrBC,yBACYC,6BAAwBC,CAAqB,IAAKA,CAAC,CAACC,IAAI,yBAAC,EADrE,wBAAa,EAACL,MAAM,CAAC,CAACM,MAAM,CAAC,CAACC,IAAI,EAAEC,GAAG,KAAKD,IAAI,CAACE,MAAM,CAAC,wBAAa,EAACD,GAAG,CAAC,CAAC,EAAE,EAAmC,CAAC,CAC3C,EACtEE,MAAM,CAACC,IAAI,CAAC;IACVC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE;GACZ,CAAC,CACH,EACMC,CAAC,KAAK;IACT,GAAGA,CAAC;IACJC,IAAI,EAAE;MACJ;IAAA;GAEH,CAAC,CAAC,EACMD,CAAC,IAAGd,sBAAC,2BAAa,EAAC,gBAAgB,EAAEgB,IAAI,CAACC,SAAS,CAACH,CAAC,EAAEI,SAAS,EAAE,CAAC,CAAC,CAAC,CAAM,CAAC,EAC5E,MAAMlB,wBAAe,0CAA0C,CAAC,CAAC;AAC9E","names":["writeOpenapiDocs","rdescs","tsplus_module_1","tsplus_module_4","tsplus_module_3","a","path","reduce","prev","cur","concat","Plutus","info","title","version","pageTitle","_","tags","JSON","stringify","undefined"],"sourceRoot":"","sources":["../../_src/api/writeDocs.ts"],"sourcesContent":[null]}
@@ -8,18 +8,16 @@ exports.logError = logError;
8
8
  exports.reportError = reportError;
9
9
  exports.reportMessage = reportMessage;
10
10
  exports.reportMessageM = reportMessageM;
11
- var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
12
11
  var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Cause"));
13
12
  var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
14
13
  var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Effect"));
15
14
  var Sentry = _interopRequireWildcard(require("@sentry/node"));
16
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); }
17
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; }
18
- const fileName_1 = "packages/infra/_src/errorReporter.ts";
19
17
  function reportError(makeError) {
20
- return (cause, context) => tracer_1.withCallTrace(fileName_1 + ":8:12")(tsplus_module_3.gen(function* ($) {
18
+ return (cause, context) => tsplus_module_3.gen(function* ($) {
21
19
  if (tsplus_module_1.isInterrupted(cause)) {
22
- yield* $(tracer_1.withCallTrace(fileName_1 + ":10:25")(tsplus_module_3.logDebug("Interrupted: " + (context ? tsplus_module_2.RecordPretty(tsplus_module_2.object$(context)) : ""))));
20
+ yield* $(tsplus_module_3.logDebug("Interrupted: " + (context ? tsplus_module_2.RecordPretty(tsplus_module_2.object$(context)) : "")));
23
21
  return;
24
22
  }
25
23
  const error = makeError(cause);
@@ -28,14 +26,14 @@ function reportError(makeError) {
28
26
  error: error.toJSON()
29
27
  };
30
28
  reportSentry(error, extras);
31
- yield* $(tracer_1.withCallTrace(fileName_1 + ":17:29")(tsplus_module_3.logAnnotate("extras", JSON.stringify({
29
+ yield* $(tsplus_module_3.logAnnotate(tsplus_module_3.logErrorCause(cause), "extras", JSON.stringify({
32
30
  context,
33
31
  error: {
34
32
  _tag: error._tag,
35
33
  message: error.message
36
34
  }
37
- })))(tsplus_module_3.logErrorCause(cause)));
38
- }));
35
+ })));
36
+ });
39
37
  }
40
38
  function reportSentry(error, extras) {
41
39
  const scope = new Sentry.Scope();
@@ -43,20 +41,20 @@ function reportSentry(error, extras) {
43
41
  Sentry.captureException(error, scope);
44
42
  }
45
43
  function logError(makeError) {
46
- return (cause, context) => tracer_1.withCallTrace(fileName_1 + ":35:12")(tsplus_module_3.gen(function* ($) {
44
+ return (cause, context) => tsplus_module_3.gen(function* ($) {
47
45
  if (tsplus_module_1.isInterrupted(cause)) {
48
- yield* $(tracer_1.withCallTrace(fileName_1 + ":37:25")(tsplus_module_3.logDebug("Interrupted: " + (context ? tsplus_module_2.RecordPretty(tsplus_module_2.object$(context)) : ""))));
46
+ yield* $(tsplus_module_3.logDebug("Interrupted: " + (context ? tsplus_module_2.RecordPretty(tsplus_module_2.object$(context)) : "")));
49
47
  return;
50
48
  }
51
49
  const error = makeError(cause);
52
- yield* $(tracer_1.withCallTrace(fileName_1 + ":42:31")(tsplus_module_3.logAnnotate("extras", JSON.stringify({
50
+ yield* $(tsplus_module_3.logAnnotate(tsplus_module_3.logWarningCause(cause), "extras", JSON.stringify({
53
51
  context,
54
52
  error: {
55
53
  _tag: error._tag,
56
54
  message: error.message
57
55
  }
58
- })))(tsplus_module_3.logWarningCause(cause)));
59
- }));
56
+ })));
57
+ });
60
58
  }
61
59
  function captureException(error) {
62
60
  Sentry.captureException(error);
@@ -67,6 +65,6 @@ function reportMessage(message) {
67
65
  console.warn(message);
68
66
  }
69
67
  function reportMessageM(message) {
70
- return tracer_1.withCallTrace(fileName_1 + ":62:10")(tsplus_module_3.sync(() => reportMessage(message)));
68
+ return tsplus_module_3.sync(() => reportMessage(message));
71
69
  }
72
70
  //# sourceMappingURL=errorReporter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorReporter.cjs","mappings":";;;;;;;;;;;;;;AAAA;AAAsC;AAAA;;AAGhC,SAAUA,WAAW,CACzBC,SAAkC;EAElC,OAAO,CAACC,KAAe,EAAEC,OAAiC,KAAIC,6CAC5DC,oBAAW,WAAUC,CAAC;IACpB,IAAIC,mCAAK,CAAgB,EAAE;MACzB,OAAOD,CAAC,+CAACD,yBAAgB,eAAe,IAAIF,OAAO,GAAEK,qDAACL,OAAO,KAAa,EAAE,CAAC,CAAC,EAAC;MAC/E;;IAEF,MAAMM,KAAK,GAAGR,SAAS,CAACC,KAAK,CAAC;IAC9B,MAAMQ,MAAM,GAAG;MAAEP,OAAO;MAAEM,KAAK,EAAEA,KAAK,CAACE,MAAM;IAAE,CAAE;IACjDC,YAAY,CAACH,KAAK,EAAEC,MAAM,CAAC;IAC3B,OAAOJ,CAAC,CACNF,0EACE,QAAQ,EACRS,IAAI,CAACC,SAAS,CAAC;MAAEX,OAAO;MAAEM,KAAK,EAAE;QAAEM,IAAI,EAAEN,KAAK,CAACM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ACvC","names":["reportError","makeError","cause","context","tracer_1","tsplus_module_3","$","tsplus_module_1","tsplus_module_2","error","extras","toJSON","reportSentry","JSON","stringify","_tag","message","scope","Sentry","Scope","setExtras","captureException","logError","console","reportMessage","captureMessage","warn","reportMessageM"],"sourceRoot":"","sources":["../_src/errorReporter.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"errorReporter.cjs","mappings":";;;;;;;;;;;;;AAAA;AAAsC;AAAA;AAGhC,SAAUA,WAAW,CACzBC,SAAkC;EAElC,OAAO,CAACC,KAAe,EAAEC,OAAiC,KACxDC,oBAAW,WAAUC,CAAC;IACpB,IAAIC,mCAAK,CAAgB,EAAE;MACzB,OAAOD,CAAC,CAACD,yBAAgB,eAAe,IAAID,OAAO,GAAEI,qDAACJ,OAAO,KAAa,EAAE,CAAC,CAAC,CAAC;MAC/E;;IAEF,MAAMK,KAAK,GAAGP,SAAS,CAACC,KAAK,CAAC;IAC9B,MAAMO,MAAM,GAAG;MAAEN,OAAO;MAAEK,KAAK,EAAEA,KAAK,CAACE,MAAM;IAAE,CAAE;IACjDC,YAAY,CAACH,KAAK,EAAEC,MAAM,CAAC;IAC3B,OAAOJ,CAAC,CACND,+DAAK,GACH,QAAQ,EACRQ,IAAI,CAACC,SAAS,CAAC;MAAEV,OAAO;MAAEK,KAAK,EAAE;QAAEM,IAAI,EAAEN,KAAK,CAACM,IAAI;QAAEC,OAAO,EAAEP,KAAK,CAACO;MAAO;IAAE,CAAE,CAAC,CACjF,CACF;EACH,CAAC,CAAC;AACN;AAEA,SAASJ,YAAY,CAACH,KAAc,EAAEC,MAA+B;EACnE,MAAMO,KAAK,GAAG,IAAIC,MAAM,CAACC,KAAK,EAAE;EAChCF,KAAK,CAACG,SAAS,CAACV,MAAM,CAAC;EACvBQ,MAAM,CAACG,gBAAgB,CAACZ,KAAK,EAAEQ,KAAK,CAAC;AACvC;AAEM,SAAUK,QAAQ,CACtBpB,SAAkC;EAElC,OAAO,CAACC,KAAe,EAAEC,OAAiC,KACxDC,oBAAW,WAAUC,CAAC;IACpB,IAAIC,mCAAK,CAAgB,EAAE;MACzB,OAAOD,CAAC,CAACD,yBAAgB,eAAe,IAAID,OAAO,GAAEI,qDAACJ,OAAO,KAAa,EAAE,CAAC,CAAC,CAAC;MAC/E;;IAEF,MAAMK,KAAK,GAAGP,SAAS,CAACC,KAAK,CAAC;IAC9B,OAAOG,CAAC,CACND,iEAAK,GACH,QAAQ,EACRQ,IAAI,CAACC,SAAS,CAAC;MAAEV,OAAO;MAAEK,KAAK,EAAE;QAAEM,IAAI,EAAEN,KAAK,CAACM,IAAI;QAAEC,OAAO,EAAEP,KAAK,CAACO;MAAO;IAAE,CAAE,CAAC,CACjF,CACF;EACH,CAAC,CAAC;AACN;AAEM,SAAUK,gBAAgB,CAACZ,KAAc;EAC7CS,MAAM,CAACG,gBAAgB,CAACZ,KAAK,CAAC;EAC9Bc,OAAO,CAACd,KAAK,CAACA,KAAK,CAAC;AACtB;AAEM,SAAUe,aAAa,CAACR,OAAe;EAC3CE,MAAM,CAACO,cAAc,CAACT,OAAO,CAAC;EAE9BO,OAAO,CAACG,IAAI,CAACV,OAAO,CAAC;AACvB;AAEM,SAAUW,cAAc,CAACX,OAAe;EAC5C,OAAOX,2BAAOmB,aAAa,CAACR,OAAO,CAAC,CAAC;AACvC","names":["reportError","makeError","cause","context","tsplus_module_3","$","tsplus_module_1","tsplus_module_2","error","extras","toJSON","reportSentry","JSON","stringify","_tag","message","scope","Sentry","Scope","setExtras","captureException","logError","console","reportMessage","captureMessage","warn","reportMessageM"],"sourceRoot":"","sources":["../_src/errorReporter.ts"],"sourcesContent":[null]}
package/_cjs/errors.cjs CHANGED
@@ -55,7 +55,7 @@ class CauseException extends Error {
55
55
  super(`An unexpected ${_tag} Exception occurred, see \`pretty\` for details.`);
56
56
  this.exitCause = exitCause;
57
57
  this._tag = _tag;
58
- this.pretty = tsplus_module_1.pretty()(exitCause);
58
+ this.pretty = tsplus_module_1.pretty(exitCause);
59
59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AE;IAAmB,YAAO,GAAPgB,OAAO;IAAoB,UAAK,GAALC,KAAK;IAFxF,SAAI,GAAG,gCAAgC;IAG9C,IAAI,CAAChB,OAAO,GAAG,YAAYF,IAAI,IAAIC,EAAE,iBAAiB;EACxD;;AACD","names":["NotFoundError","constructor","type","id","message","ValidationError","errors","NotLoggedInError","UnauthorizedError","LoginError","InvalidStateError","CauseException","Error","exitCause","_tag","pretty","tsplus_module_1","toJSON","OptimisticConcurrencyException","current","found"],"sourceRoot":"","sources":["../_src/errors.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"errors.cjs","mappings":";;;;;;;;;AAAM,MAAOA,aAAa;EAGxBC,YAAYC,IAAO,EAAEC,EAAU;IAFf,SAAI,GAAG,eAAe;IAGpC,IAAI,CAACC,OAAO,GAAG,eAAeF,IAAI,IAAIC,EAAE,EAAE;EAC5C;;AACD;AAEK,MAAOE,eAAe;EAE1BJ,YAA4BK,MAA8B;IAA9B,WAAM,GAANA,MAAM;IADlB,SAAI,GAAG,iBAAiB;EACqB;;AAC9D;AAEK,MAAOC,gBAAgB;EAA7BN;IACkB,SAAI,GAAG,kBAAkB;EAC3C;;AAAC;AAEK,MAAOO,iBAAiB;EAA9BP;IACkB,SAAI,GAAG,mBAAmB;EAC5C;;AAEA;;;AAAA;AAGM,MAAOQ,UAAW,SAAQF,gBAAgB;EAC9CN,YAAqBG,OAAe;IAClC,KAAK,EAAE;IADY,YAAO,GAAPA,OAAO;EAE5B;;AACD;AAEK,MAAOM,iBAAiB;EAE5BT,YAA4BG,OAAe;IAAf,YAAO,GAAPA,OAAO;IADnB,SAAI,GAAG,mBAAmB;EACI;;AAC/C;AAEK,MAAOO,cAAkB,SAAQC,KAAK;EAE1CX,YAAqBY,SAAmB,EAAWC,IAAY;IAC7D,KAAK,CAAC,iBAAiBA,IAAI,kDAAkD,CAAC;IAD3D,cAAS,GAATD,SAAS;IAAqB,SAAI,GAAJC,IAAI;IAErD,IAAI,CAACC,MAAM,0BAAGF,SAAS,CAAO;EAChC;EAEAG,MAAM;IACJ,OAAO;MACLF,IAAI,EAAE,IAAI,CAACA,IAAI;MACfV,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBW,MAAM,EAAE,IAAI,CAACA;MACb;KACD;EACH;;AACD;AAEK,MAAOE,8BAA8B;EAGzChB,YAAqBC,IAAY,EAAWC,EAAU,EAAWe,OAAgB,EAAWC,KAAc;IAArF,SAAI,GAAJjB,IAAI;IAAmB,OAAE,GAAFC,EAAE;IAAmB,YAAO,GAAPe,OAAO;IAAoB,UAAK,GAALC,KAAK;IAFxF,SAAI,GAAG,gCAAgC;IAG9C,IAAI,CAACf,OAAO,GAAG,YAAYF,IAAI,IAAIC,EAAE,iBAAiB;EACxD;;AACD","names":["NotFoundError","constructor","type","id","message","ValidationError","errors","NotLoggedInError","UnauthorizedError","LoginError","InvalidStateError","CauseException","Error","exitCause","_tag","pretty","toJSON","OptimisticConcurrencyException","current","found"],"sourceRoot":"","sources":["../_src/errors.ts"],"sourcesContent":[null]}
@@ -4,17 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.instr = instr;
7
- var tracer_1 = _interopRequireWildcard(require("@effect/io/Debug"));
8
7
  var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
9
8
  var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Effect"));
10
9
  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); }
11
10
  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; }
12
- const fileName_1 = "packages/infra/_src/instrument.ts";
13
11
  /**
14
12
  * @tsplus fluent effect/io/Effect instrument
15
13
  */
16
14
  function instr(self, name, properties) {
17
- return tracer_1.withCallTrace(fileName_1 + ":7:6")(tsplus_module_2.logSpan(name))(tracer_1.withCallTrace(fileName_1 + ":6:6")(tsplus_module_2.tap(() => tracer_1.withCallTrace(fileName_1 + ":6:48")(tsplus_module_2.logAnnotate("properties", tsplus_module_1.RecordPretty(tsplus_module_1.object$(properties || {}))))(tracer_1.withCallTrace(fileName_1 + ":6:23")(tsplus_module_2.logDebug(`instrumented`)))))(self));
15
+ return tsplus_module_2.logSpan(tsplus_module_2.tap(self, () => tsplus_module_2.logAnnotate(tsplus_module_2.logDebug(`instrumented`), "properties", tsplus_module_1.RecordPretty(tsplus_module_1.object$(properties || {})))), name);
18
16
  // trackMetric(name, time, properties))
19
17
  }
20
18
  //# sourceMappingURL=instrument.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrument.cjs","mappings":";;;;;;;;;;;;AAAA;;;AAGM,SAAUA,KAAK,CAAUC,IAAqB,EAAEC,IAAY,EAAEC,UAAmC;EACrG,OAAOC,oEAEIF,IAAI,GAFRE,gEACA,MAAMA,yEAA4C,YAAY,uDAAGD,UAAU,IAAI,EAAE,CAAC,iDAA5EE,yBAAgB,cAAc,CAAC,EAAwD,GAD7FJ,IAAI,CAC0F,CACrF;EAChB;AACF","names":["instr","self","name","properties","tracer_1","tsplus_module_2"],"sourceRoot":"","sources":["../_src/instrument.ts"],"sourcesContent":[null]}
1
+ {"version":3,"file":"instrument.cjs","mappings":";;;;;;;;;;AAAA;;;AAGM,SAAUA,KAAK,CAAUC,IAAqB,EAAEC,IAAY,EAAEC,UAAmC;EACrG,OAAOC,gDAAI,EACJ,MAAMA,qDAAgB,cAAc,CAAC,EAAa,YAAY,uDAAGD,UAAU,IAAI,EAAE,CAAC,EAAW,CAAC,EAC1FD,IAAI,CAAC;EAChB;AACF","names":["instr","self","name","properties","tsplus_module_2"],"sourceRoot":"","sources":["../_src/instrument.ts"],"sourcesContent":[null]}