@arkstack/common 0.22.2 → 0.22.4

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.
@@ -3085,7 +3085,7 @@ function mergeDeep(target, source) {
3085
3085
  });
3086
3086
  import_dayjs_min.default.extend(import_customParseFormat.default);
3087
3087
  //#endregion
3088
- //#region ../http/dist/redirect-D4Oybkdd.js
3088
+ //#region ../http/dist/redirect-D-xLtwbE.js
3089
3089
  const unwrapRequestSource = (source) => {
3090
3090
  if (source.original) return unwrapRequestSource(source.original);
3091
3091
  if (source.headers) return source;
@@ -3122,13 +3122,17 @@ const isRecord = (value) => {
3122
3122
  };
3123
3123
  let fallbackRequest;
3124
3124
  const requestResolvers = /* @__PURE__ */ new Set();
3125
- const currentRequest = () => {
3125
+ /**
3126
+ * The request being handled, from the registered request resolvers only. Unlike
3127
+ * the `request()` helper it never falls back to the last request constructed.
3128
+ */
3129
+ const handledRequest = () => {
3126
3130
  for (const resolver of requestResolvers) {
3127
3131
  const request = resolver();
3128
3132
  if (request) return request;
3129
3133
  }
3130
- return fallbackRequest;
3131
3134
  };
3135
+ const currentRequest = () => handledRequest() ?? fallbackRequest;
3132
3136
  const requestHelper = ((key) => {
3133
3137
  const request = currentRequest();
3134
3138
  return key ? request?.input(key) : request;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as EnvLoader, a as env, c as nodeEnv, d as resolveRuntimeDir, f as resolveRuntimeModule, g as configLoader, h as ConfigLoader, i as discoverCommands, l as outputDir, m as CONFIG_KEY, n as appUrl, o as importFile, p as toOutputPath, r as config, s as interopDefault, t as appKey, u as rebuildOutput, v as envLoader } from "./system-DzAzwH__.js";
2
- import { A as SecureChannel, C as Codec, D as Keys, E as KeyPair, O as NodeCipher, S as Cipher, T as EncryptionKey, _ as setModelResolver, b as Exception, c as abortIf, d as getModelSync, f as initializeGlobalContext, g as resolvePagination, h as perPage, k as SealedBox, l as assertFound, m as normalizePositiveInteger, p as isClass, s as abort, u as getModel, v as RequestException, w as Encryption, x as Hash, y as AppException } from "./utils-DDV77Y54.js";
2
+ import { A as SecureChannel, C as Codec, D as Keys, E as KeyPair, O as NodeCipher, S as Cipher, T as EncryptionKey, _ as setModelResolver, b as Exception, c as abortIf, d as getModelSync, f as initializeGlobalContext, g as resolvePagination, h as perPage, k as SealedBox, l as assertFound, m as normalizePositiveInteger, p as isClass, s as abort, u as getModel, v as RequestException, w as Encryption, x as Hash, y as AppException } from "./utils-4xwmZ_Zh.js";
3
3
  import { ArkstackPlugin, Hook, Hook as Hook$1, Plugins } from "@arkstack/foundry";
4
4
  import { Arkstack, ArkstackKitDriver } from "@arkstack/contract";
5
5
  import { str } from "@h3ravel/support";
@@ -1,2 +1,2 @@
1
- import { A as SecureChannel, C as Codec, D as Keys, E as KeyPair, O as NodeCipher, S as Cipher, T as EncryptionKey, _ as setModelResolver, a as use, c as abortIf, d as getModelSync, f as initializeGlobalContext, g as resolvePagination, h as perPage, i as trait, k as SealedBox, l as assertFound, m as normalizePositiveInteger, n as crc32, o as uses, p as isClass, r as getTraitMethods, s as abort, t as callTraitMethods, u as getModel, w as Encryption, x as Hash } from "../utils-DDV77Y54.js";
1
+ import { A as SecureChannel, C as Codec, D as Keys, E as KeyPair, O as NodeCipher, S as Cipher, T as EncryptionKey, _ as setModelResolver, a as use, c as abortIf, d as getModelSync, f as initializeGlobalContext, g as resolvePagination, h as perPage, i as trait, k as SealedBox, l as assertFound, m as normalizePositiveInteger, n as crc32, o as uses, p as isClass, r as getTraitMethods, s as abort, t as callTraitMethods, u as getModel, w as Encryption, x as Hash } from "../utils-4xwmZ_Zh.js";
2
2
  export { Cipher, Codec, Encryption, EncryptionKey, Hash, KeyPair, Keys, NodeCipher, SealedBox, SecureChannel, abort, abortIf, assertFound, callTraitMethods, crc32, getModel, getModelSync, getTraitMethods, initializeGlobalContext, isClass, normalizePositiveInteger, perPage, resolvePagination, setModelResolver, trait, use, uses };
@@ -402,7 +402,7 @@ function getModelSync(modelName) {
402
402
  }
403
403
  const initializeGlobalContext = async ({ Request, Response, Session } = {}) => {
404
404
  try {
405
- const { Request: Req, Response: Res, Session: Ses } = await import("./dist-CyPXnyte.js");
405
+ const { Request: Req, Response: Res, Session: Ses } = await import("./dist-CO87lECP.js");
406
406
  Session ??= new Ses();
407
407
  Request ??= new Req();
408
408
  Response ??= new Res();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/common",
3
- "version": "0.22.2",
3
+ "version": "0.22.4",
4
4
  "type": "module",
5
5
  "description": "Core utilities, primitives, and shared infrastructure for the Arkstack ecosystem.",
6
6
  "homepage": "https://arkstack.toneflix.net",
@@ -44,13 +44,13 @@
44
44
  "otpauth": "^9.5.1",
45
45
  "pino": "^10.3.1",
46
46
  "selfsigned": "^2.4.1",
47
- "@arkstack/encryption": "^0.22.2"
47
+ "@arkstack/encryption": "^0.22.4"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@h3ravel/support": "^2.2.7",
51
51
  "arkormx": "^2.12.8",
52
- "@arkstack/contract": "^0.22.2",
53
- "@arkstack/foundry": "^0.22.2"
52
+ "@arkstack/contract": "^0.22.4",
53
+ "@arkstack/foundry": "^0.22.4"
54
54
  },
55
55
  "optionalDependencies": {
56
56
  "@faker-js/faker": "^10.4.0"