@sqg/sqg 0.17.4 → 0.18.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.
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
9
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-Bt3dXI_J.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-BIikjK2O.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-DHD4h34g.css">
12
12
  </head>
13
13
  <body class="bg-gray-900 text-gray-100">
@@ -14,7 +14,7 @@ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
14
14
  var __getOwnPropNames$1 = Object.getOwnPropertyNames;
15
15
  var __getProtoOf$1 = Object.getPrototypeOf;
16
16
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
17
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
17
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
18
18
  var __copyProps$1 = (to, from, except, desc) => {
19
19
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
20
20
  key = keys[i];
@@ -1569,6 +1569,9 @@ var require_warnings = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1569
1569
  var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1570
1570
  const createError = require_error$1();
1571
1571
  const codes = {
1572
+ /**
1573
+ * Basic
1574
+ */
1572
1575
  FST_ERR_NOT_FOUND: createError("FST_ERR_NOT_FOUND", "Not Found", 404),
1573
1576
  FST_ERR_OPTIONS_NOT_OBJ: createError("FST_ERR_OPTIONS_NOT_OBJ", "Options must be an object", 500, TypeError),
1574
1577
  FST_ERR_QSP_NOT_FN: createError("FST_ERR_QSP_NOT_FN", "querystringParser option should be a function, instead got '%s'", 500, TypeError),
@@ -1580,6 +1583,9 @@ var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1580
1583
  FST_ERR_LISTEN_OPTIONS_INVALID: createError("FST_ERR_LISTEN_OPTIONS_INVALID", "Invalid listen options: '%s'", 500, TypeError),
1581
1584
  FST_ERR_ERROR_HANDLER_NOT_FN: createError("FST_ERR_ERROR_HANDLER_NOT_FN", "Error Handler must be a function", 500, TypeError),
1582
1585
  FST_ERR_ERROR_HANDLER_ALREADY_SET: createError("FST_ERR_ERROR_HANDLER_ALREADY_SET", "Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.", 500, TypeError),
1586
+ /**
1587
+ * ContentTypeParser
1588
+ */
1583
1589
  FST_ERR_CTP_ALREADY_PRESENT: createError("FST_ERR_CTP_ALREADY_PRESENT", "Content type parser '%s' already present."),
1584
1590
  FST_ERR_CTP_INVALID_TYPE: createError("FST_ERR_CTP_INVALID_TYPE", "The content type should be a string or a RegExp", 500, TypeError),
1585
1591
  FST_ERR_CTP_EMPTY_TYPE: createError("FST_ERR_CTP_EMPTY_TYPE", "The content type cannot be an empty string", 500, TypeError),
@@ -1591,23 +1597,38 @@ var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1591
1597
  FST_ERR_CTP_EMPTY_JSON_BODY: createError("FST_ERR_CTP_EMPTY_JSON_BODY", "Body cannot be empty when content-type is set to 'application/json'", 400),
1592
1598
  FST_ERR_CTP_INVALID_JSON_BODY: createError("FST_ERR_CTP_INVALID_JSON_BODY", "Body is not valid JSON but content-type is set to 'application/json'", 400),
1593
1599
  FST_ERR_CTP_INSTANCE_ALREADY_STARTED: createError("FST_ERR_CTP_INSTANCE_ALREADY_STARTED", "Cannot call \"%s\" when fastify instance is already started!", 400),
1600
+ /**
1601
+ * decorate
1602
+ */
1594
1603
  FST_ERR_DEC_ALREADY_PRESENT: createError("FST_ERR_DEC_ALREADY_PRESENT", "The decorator '%s' has already been added!"),
1595
1604
  FST_ERR_DEC_DEPENDENCY_INVALID_TYPE: createError("FST_ERR_DEC_DEPENDENCY_INVALID_TYPE", "The dependencies of decorator '%s' must be of type Array.", 500, TypeError),
1596
1605
  FST_ERR_DEC_MISSING_DEPENDENCY: createError("FST_ERR_DEC_MISSING_DEPENDENCY", "The decorator is missing dependency '%s'."),
1597
1606
  FST_ERR_DEC_AFTER_START: createError("FST_ERR_DEC_AFTER_START", "The decorator '%s' has been added after start!"),
1598
1607
  FST_ERR_DEC_REFERENCE_TYPE: createError("FST_ERR_DEC_REFERENCE_TYPE", "The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead."),
1599
1608
  FST_ERR_DEC_UNDECLARED: createError("FST_ERR_DEC_UNDECLARED", "No decorator '%s' has been declared on %s."),
1609
+ /**
1610
+ * hooks
1611
+ */
1600
1612
  FST_ERR_HOOK_INVALID_TYPE: createError("FST_ERR_HOOK_INVALID_TYPE", "The hook name must be a string", 500, TypeError),
1601
1613
  FST_ERR_HOOK_INVALID_HANDLER: createError("FST_ERR_HOOK_INVALID_HANDLER", "%s hook should be a function, instead got %s", 500, TypeError),
1602
1614
  FST_ERR_HOOK_INVALID_ASYNC_HANDLER: createError("FST_ERR_HOOK_INVALID_ASYNC_HANDLER", "Async function has too many arguments. Async hooks should not use the 'done' argument.", 500, TypeError),
1603
1615
  FST_ERR_HOOK_NOT_SUPPORTED: createError("FST_ERR_HOOK_NOT_SUPPORTED", "%s hook not supported!", 500, TypeError),
1616
+ /**
1617
+ * Middlewares
1618
+ */
1604
1619
  FST_ERR_MISSING_MIDDLEWARE: createError("FST_ERR_MISSING_MIDDLEWARE", "You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.", 500),
1605
1620
  FST_ERR_HOOK_TIMEOUT: createError("FST_ERR_HOOK_TIMEOUT", "A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise"),
1621
+ /**
1622
+ * logger
1623
+ */
1606
1624
  FST_ERR_LOG_INVALID_DESTINATION: createError("FST_ERR_LOG_INVALID_DESTINATION", "Cannot specify both logger.stream and logger.file options"),
1607
1625
  FST_ERR_LOG_INVALID_LOGGER: createError("FST_ERR_LOG_INVALID_LOGGER", "Invalid logger object provided. The logger instance should have these functions(s): '%s'.", 500, TypeError),
1608
1626
  FST_ERR_LOG_INVALID_LOGGER_INSTANCE: createError("FST_ERR_LOG_INVALID_LOGGER_INSTANCE", "loggerInstance only accepts a logger instance.", 500, TypeError),
1609
1627
  FST_ERR_LOG_INVALID_LOGGER_CONFIG: createError("FST_ERR_LOG_INVALID_LOGGER_CONFIG", "logger options only accepts a configuration object.", 500, TypeError),
1610
1628
  FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED: createError("FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED", "You cannot provide both logger and loggerInstance. Please provide only one.", 500, TypeError),
1629
+ /**
1630
+ * reply
1631
+ */
1611
1632
  FST_ERR_REP_INVALID_PAYLOAD_TYPE: createError("FST_ERR_REP_INVALID_PAYLOAD_TYPE", "Attempted to send payload of invalid type '%s'. Expected a string or Buffer.", 500, TypeError),
1612
1633
  FST_ERR_REP_RESPONSE_BODY_CONSUMED: createError("FST_ERR_REP_RESPONSE_BODY_CONSUMED", "Response.body is already consumed."),
1613
1634
  FST_ERR_REP_READABLE_STREAM_LOCKED: createError("FST_ERR_REP_READABLE_STREAM_LOCKED", "ReadableStream was locked. You should call releaseLock() method on reader before sending."),
@@ -1622,6 +1643,9 @@ var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1622
1643
  FST_ERR_MISSING_SERIALIZATION_FN: createError("FST_ERR_MISSING_SERIALIZATION_FN", "Missing serialization function. Key \"%s\""),
1623
1644
  FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN: createError("FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN", "Missing serialization function. Key \"%s:%s\""),
1624
1645
  FST_ERR_REQ_INVALID_VALIDATION_INVOCATION: createError("FST_ERR_REQ_INVALID_VALIDATION_INVOCATION", "Invalid validation invocation. Missing validation function for HTTP part \"%s\" nor schema provided."),
1646
+ /**
1647
+ * schemas
1648
+ */
1625
1649
  FST_ERR_SCH_MISSING_ID: createError("FST_ERR_SCH_MISSING_ID", "Missing schema $id property"),
1626
1650
  FST_ERR_SCH_ALREADY_PRESENT: createError("FST_ERR_SCH_ALREADY_PRESENT", "Schema with id '%s' already declared!"),
1627
1651
  FST_ERR_SCH_CONTENT_MISSING_SCHEMA: createError("FST_ERR_SCH_CONTENT_MISSING_SCHEMA", "Schema is missing for the content type '%s'"),
@@ -1629,8 +1653,14 @@ var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1629
1653
  FST_ERR_SCH_VALIDATION_BUILD: createError("FST_ERR_SCH_VALIDATION_BUILD", "Failed building the validation schema for %s: %s, due to error %s"),
1630
1654
  FST_ERR_SCH_SERIALIZATION_BUILD: createError("FST_ERR_SCH_SERIALIZATION_BUILD", "Failed building the serialization schema for %s: %s, due to error %s"),
1631
1655
  FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX: createError("FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX", "response schemas should be nested under a valid status code, e.g { 2xx: { type: \"object\" } }"),
1656
+ /**
1657
+ * initialConfig
1658
+ */
1632
1659
  FST_ERR_INIT_OPTS_INVALID: createError("FST_ERR_INIT_OPTS_INVALID", "Invalid initialization options: '%s'"),
1633
1660
  FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE: createError("FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE", "Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method"),
1661
+ /**
1662
+ * router
1663
+ */
1634
1664
  FST_ERR_DUPLICATED_ROUTE: createError("FST_ERR_DUPLICATED_ROUTE", "Method '%s' already declared for route '%s'"),
1635
1665
  FST_ERR_BAD_URL: createError("FST_ERR_BAD_URL", "'%s' is not a valid url component", 400, URIError),
1636
1666
  FST_ERR_ASYNC_CONSTRAINT: createError("FST_ERR_ASYNC_CONSTRAINT", "Unexpected error from async constraint", 500),
@@ -1646,12 +1676,21 @@ var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1646
1676
  FST_ERR_HANDLER_TIMEOUT: createError("FST_ERR_HANDLER_TIMEOUT", "Request timed out after %s ms on route '%s'", 503),
1647
1677
  FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT: createError("FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT", "'handlerTimeout' option must be an integer > 0. Got '%s'", 500, TypeError),
1648
1678
  FST_ERR_ROUTE_REWRITE_NOT_STR: createError("FST_ERR_ROUTE_REWRITE_NOT_STR", "Rewrite url for \"%s\" needs to be of type \"string\" but received \"%s\"", 500, TypeError),
1679
+ /**
1680
+ * again listen when close server
1681
+ */
1649
1682
  FST_ERR_REOPENED_CLOSE_SERVER: createError("FST_ERR_REOPENED_CLOSE_SERVER", "Fastify has already been closed and cannot be reopened"),
1650
1683
  FST_ERR_REOPENED_SERVER: createError("FST_ERR_REOPENED_SERVER", "Fastify is already listening"),
1651
1684
  FST_ERR_INSTANCE_ALREADY_LISTENING: createError("FST_ERR_INSTANCE_ALREADY_LISTENING", "Fastify instance is already listening. %s"),
1685
+ /**
1686
+ * plugin
1687
+ */
1652
1688
  FST_ERR_PLUGIN_VERSION_MISMATCH: createError("FST_ERR_PLUGIN_VERSION_MISMATCH", "fastify-plugin: %s - expected '%s' fastify version, '%s' is installed"),
1653
1689
  FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE: createError("FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE", "The decorator '%s'%s is not present in %s"),
1654
1690
  FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER: createError("FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER", "The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.", 500, TypeError),
1691
+ /**
1692
+ * Avvio Errors
1693
+ */
1655
1694
  FST_ERR_PLUGIN_CALLBACK_NOT_FN: createError("FST_ERR_PLUGIN_CALLBACK_NOT_FN", "fastify-plugin: %s", 500, TypeError),
1656
1695
  FST_ERR_PLUGIN_NOT_VALID: createError("FST_ERR_PLUGIN_NOT_VALID", "fastify-plugin: %s"),
1657
1696
  FST_ERR_ROOT_PLG_BOOTED: createError("FST_ERR_ROOT_PLG_BOOTED", "fastify-plugin: %s"),
@@ -5564,7 +5603,8 @@ var require_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5564
5603
  return bindingsFromJson;
5565
5604
  }
5566
5605
  function setBindings(newBindings) {
5567
- this[chindingsSym] = asChindings(this, newBindings);
5606
+ const chindings = asChindings(this, newBindings);
5607
+ this[chindingsSym] = chindings;
5568
5608
  }
5569
5609
  /**
5570
5610
  * Default strategy for creating `mergeObject` from arguments and the result from `mixin()`.
@@ -24331,6 +24371,7 @@ var require_http_method = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24331
24371
  }
24332
24372
  };
24333
24373
  },
24374
+ /* c8 ignore next 1 */
24334
24375
  deriveConstraint: (req) => req.method,
24335
24376
  mustMatchWhenDerived: true
24336
24377
  };
@@ -25643,6 +25684,10 @@ var require_route = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25643
25684
  let keepAliveConnections;
25644
25685
  let closing = false;
25645
25686
  return {
25687
+ /**
25688
+ * @param {import('../fastify').FastifyServerOptions} options
25689
+ * @param {*} fastifyArgs
25690
+ */
25646
25691
  setup(options, fastifyArgs) {
25647
25692
  avvio = fastifyArgs.avvio;
25648
25693
  fourOhFour = fastifyArgs.fourOhFour;
@@ -28256,10 +28301,11 @@ var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28256
28301
  function Response(req, onEnd, reject) {
28257
28302
  http$1.ServerResponse.call(this, req);
28258
28303
  if (req._lightMyRequest?.payloadAsStream) {
28304
+ const read = this.emit.bind(this, "drain");
28259
28305
  this._lightMyRequest = {
28260
28306
  headers: null,
28261
28307
  trailers: {},
28262
- stream: new Readable({ read: this.emit.bind(this, "drain") })
28308
+ stream: new Readable({ read })
28263
28309
  };
28264
28310
  const signal = req._lightMyRequest.signal;
28265
28311
  if (signal) addAbortSignal(signal, this._lightMyRequest.stream);
@@ -39019,7 +39065,8 @@ var SimulatedStack = class {
39019
39065
  this.stack.push(this.state, 0, 0);
39020
39066
  this.base += 3;
39021
39067
  } else this.base -= (depth - 1) * 3;
39022
- this.state = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
39068
+ let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
39069
+ this.state = goto;
39023
39070
  }
39024
39071
  };
39025
39072
  var StackBufferCursor = class StackBufferCursor {
@@ -39232,7 +39279,8 @@ var InputStream = class {
39232
39279
  this.chunk2 = this.chunk;
39233
39280
  this.chunk2Pos = this.chunkPos;
39234
39281
  let nextChunk = this.input.chunk(this.pos);
39235
- this.chunk = this.pos + nextChunk.length > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
39282
+ let end = this.pos + nextChunk.length;
39283
+ this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
39236
39284
  this.chunkPos = this.pos;
39237
39285
  this.chunkOff = 0;
39238
39286
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqg/sqg",
3
- "version": "0.17.4",
3
+ "version": "0.18.0",
4
4
  "description": "SQG - SQL Query Generator - Type-safe code generation from SQL (https://sqg.dev)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",