@stryke/trpc-next 0.5.98 → 0.5.99

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 (116) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/_virtual/_rolldown/runtime.cjs +14 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/action-handler.cjs +7 -0
  5. package/dist/action-handler.mjs +3 -1
  6. package/dist/action-handler.mjs.map +1 -1
  7. package/dist/action-handler.test.cjs +13 -0
  8. package/dist/action-handler.test.d.cts +1 -0
  9. package/dist/action-handler.test.d.mts +1 -0
  10. package/dist/action-handler.test.mjs +13 -0
  11. package/dist/action-handler.test.mjs.map +1 -0
  12. package/dist/client.cjs +10 -0
  13. package/dist/client.mjs +6 -1
  14. package/dist/client.mjs.map +1 -1
  15. package/dist/client.test.cjs +13 -0
  16. package/dist/client.test.d.cts +1 -0
  17. package/dist/client.test.d.mts +1 -0
  18. package/dist/client.test.mjs +13 -0
  19. package/dist/client.test.mjs.map +1 -0
  20. package/dist/index.cjs +22 -0
  21. package/dist/index.mjs +19 -1
  22. package/dist/index.mjs.map +1 -0
  23. package/dist/index.test.cjs +13 -0
  24. package/dist/index.test.d.cts +1 -0
  25. package/dist/index.test.d.mts +1 -0
  26. package/dist/index.test.mjs +13 -0
  27. package/dist/index.test.mjs.map +1 -0
  28. package/dist/server.cjs +11 -0
  29. package/dist/server.mjs +7 -1
  30. package/dist/server.mjs.map +1 -1
  31. package/dist/server.test.cjs +13 -0
  32. package/dist/server.test.d.cts +1 -0
  33. package/dist/server.test.d.mts +1 -0
  34. package/dist/server.test.mjs +13 -0
  35. package/dist/server.test.mjs.map +1 -0
  36. package/dist/shared.cjs +11 -0
  37. package/dist/shared.mjs +7 -1
  38. package/dist/shared.mjs.map +1 -1
  39. package/dist/shared.test.cjs +13 -0
  40. package/dist/shared.test.d.cts +1 -0
  41. package/dist/shared.test.d.mts +1 -0
  42. package/dist/shared.test.mjs +13 -0
  43. package/dist/shared.test.mjs.map +1 -0
  44. package/dist/shield/constructors.cjs +17 -0
  45. package/dist/shield/constructors.mjs +12 -1
  46. package/dist/shield/constructors.mjs.map +1 -1
  47. package/dist/shield/constructors.test.cjs +13 -0
  48. package/dist/shield/constructors.test.d.cts +1 -0
  49. package/dist/shield/constructors.test.d.mts +1 -0
  50. package/dist/shield/constructors.test.mjs +13 -0
  51. package/dist/shield/constructors.test.mjs.map +1 -0
  52. package/dist/shield/generator.cjs +9 -1
  53. package/dist/shield/generator.mjs +4 -1
  54. package/dist/shield/generator.mjs.map +1 -1
  55. package/dist/shield/generator.test.cjs +13 -0
  56. package/dist/shield/generator.test.d.cts +1 -0
  57. package/dist/shield/generator.test.d.mts +1 -0
  58. package/dist/shield/generator.test.mjs +13 -0
  59. package/dist/shield/generator.test.mjs.map +1 -0
  60. package/dist/shield/index.cjs +22 -1
  61. package/dist/shield/index.mjs +17 -1
  62. package/dist/shield/index.mjs.map +1 -0
  63. package/dist/shield/index.test.cjs +13 -0
  64. package/dist/shield/index.test.d.cts +1 -0
  65. package/dist/shield/index.test.d.mts +1 -0
  66. package/dist/shield/index.test.mjs +13 -0
  67. package/dist/shield/index.test.mjs.map +1 -0
  68. package/dist/shield/rules.cjs +19 -1
  69. package/dist/shield/rules.mjs +14 -1
  70. package/dist/shield/rules.mjs.map +1 -1
  71. package/dist/shield/rules.test.cjs +13 -0
  72. package/dist/shield/rules.test.d.cts +1 -0
  73. package/dist/shield/rules.test.d.mts +1 -0
  74. package/dist/shield/rules.test.mjs +13 -0
  75. package/dist/shield/rules.test.mjs.map +1 -0
  76. package/dist/shield/shield.cjs +9 -1
  77. package/dist/shield/shield.mjs +3 -1
  78. package/dist/shield/shield.mjs.map +1 -1
  79. package/dist/shield/shield.test.cjs +13 -0
  80. package/dist/shield/shield.test.d.cts +1 -0
  81. package/dist/shield/shield.test.d.mts +1 -0
  82. package/dist/shield/shield.test.mjs +13 -0
  83. package/dist/shield/shield.test.mjs.map +1 -0
  84. package/dist/shield/types.cjs +13 -0
  85. package/dist/shield/types.mjs +8 -0
  86. package/dist/shield/types.mjs.map +1 -0
  87. package/dist/shield/types.test.cjs +13 -0
  88. package/dist/shield/types.test.d.cts +1 -0
  89. package/dist/shield/types.test.d.mts +1 -0
  90. package/dist/shield/types.test.mjs +13 -0
  91. package/dist/shield/types.test.mjs.map +1 -0
  92. package/dist/shield/utils.cjs +15 -0
  93. package/dist/shield/utils.mjs +10 -1
  94. package/dist/shield/utils.mjs.map +1 -1
  95. package/dist/shield/utils.test.cjs +13 -0
  96. package/dist/shield/utils.test.d.cts +1 -0
  97. package/dist/shield/utils.test.d.mts +1 -0
  98. package/dist/shield/utils.test.mjs +13 -0
  99. package/dist/shield/utils.test.mjs.map +1 -0
  100. package/dist/shield/validation.cjs +12 -1
  101. package/dist/shield/validation.mjs +6 -1
  102. package/dist/shield/validation.mjs.map +1 -1
  103. package/dist/shield/validation.test.cjs +13 -0
  104. package/dist/shield/validation.test.d.cts +1 -0
  105. package/dist/shield/validation.test.d.mts +1 -0
  106. package/dist/shield/validation.test.mjs +13 -0
  107. package/dist/shield/validation.test.mjs.map +1 -0
  108. package/dist/types.cjs +13 -0
  109. package/dist/types.mjs +8 -0
  110. package/dist/types.mjs.map +1 -0
  111. package/dist/types.test.cjs +13 -0
  112. package/dist/types.test.d.cts +1 -0
  113. package/dist/types.test.d.mts +1 -0
  114. package/dist/types.test.mjs +13 -0
  115. package/dist/types.test.mjs.map +1 -0
  116. package/package.json +65 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/shield/types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport type ShieldRule<\n TContext extends Record<string, any> = Record<string, any>\n> = RuleInterface<TContext> | LogicRuleInterface<TContext>;\n\nexport interface RuleInterface<\n TContext extends Record<string, any> = Record<string, any>\n> {\n name: string;\n equals: (rule: RuleInterface<TContext>) => boolean;\n resolve: (\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown,\n options: OptionsInterface<TContext>\n ) => Promise<RuleResultInterface>;\n executeRule: <TContext extends Record<string, any>>(\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown,\n options: OptionsInterface<TContext>\n ) => string | boolean | Error | Promise<RuleResultInterface>;\n}\n\nexport interface RuleOptionsInterface {}\n\nexport interface LogicRuleInterface<\n TContext extends Record<string, any> = Record<string, any>\n> extends RuleInterface<TContext> {\n getRules: () => ShieldRule<TContext>[];\n evaluate: (\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown,\n options: OptionsInterface<TContext>\n ) => Promise<RuleResultInterface[]>;\n resolve: (\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown,\n options: OptionsInterface<TContext>\n ) => Promise<RuleResultInterface>;\n}\n\nexport type RuleResultInterface = boolean | string | Error;\nexport type RuleFunctionInterface<\n TContext extends Record<string, any> = Record<string, any>\n> = (\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown,\n options: OptionsInterface<TContext>\n) => RuleResultInterface | Promise<RuleResultInterface>;\n\nexport interface RuleConstructorOptionsInterface {}\n\n// Rules Definition Tree\n\nexport interface RuleTypeMapInterface<\n TContext extends Record<string, any> = Record<string, any>\n> {\n [key: string]:\n | ShieldRule<TContext>\n | RuleFieldMapInterface<TContext>\n | RuleTypeMapInterface<TContext>;\n}\n\nexport interface RuleFieldMapInterface<\n TContext extends Record<string, any> = Record<string, any>\n> {\n [key: string]: ShieldRule<TContext>;\n}\n\nexport type IRules<TContext extends Record<string, any> = Record<string, any>> =\n | ShieldRule<TContext>\n | RuleTypeMapInterface<TContext>;\n\nexport type IFallbackErrorMapperType<\n TContext extends Record<string, any> = Record<string, any>\n> = (\n err: unknown,\n ctx: TContext,\n type: string,\n path: string,\n input: { [name: string]: any },\n rawInput: unknown\n) => Promise<Error> | Error;\n\nexport type IFallbackErrorType<\n TContext extends Record<string, any> = Record<string, any>\n> = Error | IFallbackErrorMapperType<TContext>;\n\n// Generator Options\n\nexport interface OptionsInterface<\n TContext extends Record<string, any> = Record<string, any>\n> {\n debug: boolean;\n allowExternalErrors: boolean;\n fallbackRule: ShieldRule<TContext>;\n fallbackError?: IFallbackErrorType<TContext>;\n}\n\nexport interface OptionsConstructorInterface<\n TContext extends Record<string, any> = Record<string, any>\n> {\n debug?: boolean;\n allowExternalErrors?: boolean;\n fallbackRule?: ShieldRule<TContext>;\n fallbackError?: string | IFallbackErrorType<TContext>;\n}\n\nexport declare function shield<\n TContext extends Record<string, any> = Record<string, any>\n>(ruleTree: IRules<TContext>, options: OptionsInterface<TContext>): any;\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_shield_types = require('./types.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/shield/types.test.ts
6
+ (0, vitest.describe)("shield/types.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_shield_types.types_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_shield_types.types_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,13 @@
1
+ import { types_exports } from "./types.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/shield/types.test.ts
5
+ describe("shield/types.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(types_exports).toBeDefined();
8
+ expect(typeof types_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ //# sourceMappingURL=types.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.test.mjs","names":["moduleExports"],"sources":["../../src/shield/types.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./types.ts\";\n\ndescribe(\"shield/types.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,iCAAiC;AACxC,IAAG,8BAA8B;AAC/B,SAAOA,cAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,cAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
@@ -1,7 +1,16 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_shield_rules = require('./rules.cjs');
3
4
 
4
5
  //#region src/shield/utils.ts
6
+ var utils_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ flattenObjectOf: () => flattenObjectOf,
8
+ isLogicRule: () => isLogicRule,
9
+ isRule: () => isRule,
10
+ isRuleFieldMap: () => isRuleFieldMap,
11
+ isRuleFunction: () => isRuleFunction,
12
+ withDefault: () => withDefault
13
+ });
5
14
  /**
6
15
  * Makes sure that a certain field is a rule.
7
16
  */
@@ -54,4 +63,10 @@ exports.isLogicRule = isLogicRule;
54
63
  exports.isRule = isRule;
55
64
  exports.isRuleFieldMap = isRuleFieldMap;
56
65
  exports.isRuleFunction = isRuleFunction;
66
+ Object.defineProperty(exports, 'utils_exports', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return utils_exports;
70
+ }
71
+ });
57
72
  exports.withDefault = withDefault;
@@ -1,6 +1,15 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
1
2
  import { LogicRule, Rule } from "./rules.mjs";
2
3
 
3
4
  //#region src/shield/utils.ts
5
+ var utils_exports = /* @__PURE__ */ __exportAll({
6
+ flattenObjectOf: () => flattenObjectOf,
7
+ isLogicRule: () => isLogicRule,
8
+ isRule: () => isRule,
9
+ isRuleFieldMap: () => isRuleFieldMap,
10
+ isRuleFunction: () => isRuleFunction,
11
+ withDefault: () => withDefault
12
+ });
4
13
  /**
5
14
  * Makes sure that a certain field is a rule.
6
15
  */
@@ -48,5 +57,5 @@ function withDefault(fallback) {
48
57
  }
49
58
 
50
59
  //#endregion
51
- export { flattenObjectOf, isLogicRule, isRule, isRuleFieldMap, isRuleFunction, withDefault };
60
+ export { flattenObjectOf, isLogicRule, isRule, isRuleFieldMap, isRuleFunction, utils_exports, withDefault };
52
61
  //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/shield/utils.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogicRule, Rule } from \"./rules\";\nimport type {\n LogicRuleInterface,\n RuleFieldMapInterface,\n RuleInterface,\n ShieldRule\n} from \"./types\";\n\n/**\n * Makes sure that a certain field is a rule.\n */\nexport function isRule<TContext extends Record<string, any>>(\n x: any\n): x is RuleInterface<TContext> {\n return (\n x instanceof Rule || (x && x.constructor && x.constructor.name === \"Rule\")\n );\n}\n\n/**\n * Makes sure that a certain field is a logic rule.\n */\nexport function isLogicRule<TContext extends Record<string, any>>(\n x: any\n): x is LogicRuleInterface<TContext> {\n return (\n x instanceof LogicRule ||\n (x &&\n x.constructor &&\n (x.constructor.name === \"RuleOr\" ||\n x.constructor.name === \"RuleAnd\" ||\n x.constructor.name === \"RuleChain\" ||\n x.constructor.name === \"RuleRace\" ||\n x.constructor.name === \"RuleNot\" ||\n x.constructor.name === \"RuleTrue\" ||\n x.constructor.name === \"RuleFalse\"))\n );\n}\n\n/**\n * Makes sure that a certain field is a rule or a logic rule.\n */\nexport function isRuleFunction<TContext extends Record<string, any>>(\n x: any\n): x is ShieldRule<TContext> {\n return isRule(x) || isLogicRule(x);\n}\n\n/**\n * Determines whether a certain field is rule field map or not.\n */\nexport function isRuleFieldMap<TContext extends Record<string, any>>(\n x: any\n): x is RuleFieldMapInterface<TContext> {\n return (\n typeof x === \"object\" &&\n Object.values(x).every(rule => isRuleFunction(rule))\n );\n}\n\n/**\n * Flattens object of particular type by checking if the leaf\n * evaluates to true from particular function.\n */\nexport function flattenObjectOf<T>(\n obj: { [key: string]: any },\n f: (x: any) => boolean\n): T[] {\n const values = Object.keys(obj).reduce<T[]>((acc, key) => {\n const val = obj[key];\n if (f(val)) {\n return [...acc, val];\n } else if (typeof val === \"object\" && !f(val)) {\n return [...acc, ...flattenObjectOf(val, f)];\n } else {\n return acc;\n }\n }, []);\n\n return values;\n}\n\n/**\n * Returns fallback is provided value is undefined\n */\nexport function withDefault<T>(fallback: T): (value: T | undefined) => T {\n return value => {\n if (value === undefined) return fallback;\n return value;\n };\n}\n"],"mappings":";;;;;;AA6BA,SAAgB,OACd,GAC8B;AAC9B,QACE,aAAa,QAAS,KAAK,EAAE,eAAe,EAAE,YAAY,SAAS;;;;;AAOvE,SAAgB,YACd,GACmC;AACnC,QACE,aAAa,aACZ,KACC,EAAE,gBACD,EAAE,YAAY,SAAS,YACtB,EAAE,YAAY,SAAS,aACvB,EAAE,YAAY,SAAS,eACvB,EAAE,YAAY,SAAS,cACvB,EAAE,YAAY,SAAS,aACvB,EAAE,YAAY,SAAS,cACvB,EAAE,YAAY,SAAS;;;;;AAO/B,SAAgB,eACd,GAC2B;AAC3B,QAAO,OAAO,EAAE,IAAI,YAAY,EAAE;;;;;AAMpC,SAAgB,eACd,GACsC;AACtC,QACE,OAAO,MAAM,YACb,OAAO,OAAO,EAAE,CAAC,OAAM,SAAQ,eAAe,KAAK,CAAC;;;;;;AAQxD,SAAgB,gBACd,KACA,GACK;AAYL,QAXe,OAAO,KAAK,IAAI,CAAC,QAAa,KAAK,QAAQ;EACxD,MAAM,MAAM,IAAI;AAChB,MAAI,EAAE,IAAI,CACR,QAAO,CAAC,GAAG,KAAK,IAAI;WACX,OAAO,QAAQ,YAAY,CAAC,EAAE,IAAI,CAC3C,QAAO,CAAC,GAAG,KAAK,GAAG,gBAAgB,KAAK,EAAE,CAAC;MAE3C,QAAO;IAER,EAAE,CAEQ;;;;;AAMf,SAAgB,YAAe,UAA0C;AACvE,SAAO,UAAS;AACd,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/shield/utils.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogicRule, Rule } from \"./rules\";\nimport type {\n LogicRuleInterface,\n RuleFieldMapInterface,\n RuleInterface,\n ShieldRule\n} from \"./types\";\n\n/**\n * Makes sure that a certain field is a rule.\n */\nexport function isRule<TContext extends Record<string, any>>(\n x: any\n): x is RuleInterface<TContext> {\n return (\n x instanceof Rule || (x && x.constructor && x.constructor.name === \"Rule\")\n );\n}\n\n/**\n * Makes sure that a certain field is a logic rule.\n */\nexport function isLogicRule<TContext extends Record<string, any>>(\n x: any\n): x is LogicRuleInterface<TContext> {\n return (\n x instanceof LogicRule ||\n (x &&\n x.constructor &&\n (x.constructor.name === \"RuleOr\" ||\n x.constructor.name === \"RuleAnd\" ||\n x.constructor.name === \"RuleChain\" ||\n x.constructor.name === \"RuleRace\" ||\n x.constructor.name === \"RuleNot\" ||\n x.constructor.name === \"RuleTrue\" ||\n x.constructor.name === \"RuleFalse\"))\n );\n}\n\n/**\n * Makes sure that a certain field is a rule or a logic rule.\n */\nexport function isRuleFunction<TContext extends Record<string, any>>(\n x: any\n): x is ShieldRule<TContext> {\n return isRule(x) || isLogicRule(x);\n}\n\n/**\n * Determines whether a certain field is rule field map or not.\n */\nexport function isRuleFieldMap<TContext extends Record<string, any>>(\n x: any\n): x is RuleFieldMapInterface<TContext> {\n return (\n typeof x === \"object\" &&\n Object.values(x).every(rule => isRuleFunction(rule))\n );\n}\n\n/**\n * Flattens object of particular type by checking if the leaf\n * evaluates to true from particular function.\n */\nexport function flattenObjectOf<T>(\n obj: { [key: string]: any },\n f: (x: any) => boolean\n): T[] {\n const values = Object.keys(obj).reduce<T[]>((acc, key) => {\n const val = obj[key];\n if (f(val)) {\n return [...acc, val];\n } else if (typeof val === \"object\" && !f(val)) {\n return [...acc, ...flattenObjectOf(val, f)];\n } else {\n return acc;\n }\n }, []);\n\n return values;\n}\n\n/**\n * Returns fallback is provided value is undefined\n */\nexport function withDefault<T>(fallback: T): (value: T | undefined) => T {\n return value => {\n if (value === undefined) return fallback;\n return value;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAgB,OACd,GAC8B;AAC9B,QACE,aAAa,QAAS,KAAK,EAAE,eAAe,EAAE,YAAY,SAAS;;;;;AAOvE,SAAgB,YACd,GACmC;AACnC,QACE,aAAa,aACZ,KACC,EAAE,gBACD,EAAE,YAAY,SAAS,YACtB,EAAE,YAAY,SAAS,aACvB,EAAE,YAAY,SAAS,eACvB,EAAE,YAAY,SAAS,cACvB,EAAE,YAAY,SAAS,aACvB,EAAE,YAAY,SAAS,cACvB,EAAE,YAAY,SAAS;;;;;AAO/B,SAAgB,eACd,GAC2B;AAC3B,QAAO,OAAO,EAAE,IAAI,YAAY,EAAE;;;;;AAMpC,SAAgB,eACd,GACsC;AACtC,QACE,OAAO,MAAM,YACb,OAAO,OAAO,EAAE,CAAC,OAAM,SAAQ,eAAe,KAAK,CAAC;;;;;;AAQxD,SAAgB,gBACd,KACA,GACK;AAYL,QAXe,OAAO,KAAK,IAAI,CAAC,QAAa,KAAK,QAAQ;EACxD,MAAM,MAAM,IAAI;AAChB,MAAI,EAAE,IAAI,CACR,QAAO,CAAC,GAAG,KAAK,IAAI;WACX,OAAO,QAAQ,YAAY,CAAC,EAAE,IAAI,CAC3C,QAAO,CAAC,GAAG,KAAK,GAAG,gBAAgB,KAAK,EAAE,CAAC;MAE3C,QAAO;IAER,EAAE,CAEQ;;;;;AAMf,SAAgB,YAAe,UAA0C;AACvE,SAAO,UAAS;AACd,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_shield_utils = require('./utils.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/shield/utils.test.ts
6
+ (0, vitest.describe)("shield/utils.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_shield_utils.utils_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_shield_utils.utils_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,13 @@
1
+ import { utils_exports } from "./utils.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/shield/utils.test.ts
5
+ describe("shield/utils.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(utils_exports).toBeDefined();
8
+ expect(typeof utils_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ //# sourceMappingURL=utils.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.mjs","names":["moduleExports"],"sources":["../../src/shield/utils.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./utils.ts\";\n\ndescribe(\"shield/utils.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,iCAAiC;AACxC,IAAG,8BAA8B;AAC/B,SAAOA,cAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,cAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
@@ -1,7 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_shield_utils = require('./utils.cjs');
3
4
 
4
5
  //#region src/shield/validation.ts
6
+ var validation_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ ValidationError: () => ValidationError,
8
+ validateRuleTree: () => validateRuleTree
9
+ });
5
10
  /**
6
11
  * Validates the rule tree declaration by checking references of rule
7
12
  * functions. We deem rule tree valid if no two rules with the same name point
@@ -57,4 +62,10 @@ var ValidationError = class extends Error {
57
62
 
58
63
  //#endregion
59
64
  exports.ValidationError = ValidationError;
60
- exports.validateRuleTree = validateRuleTree;
65
+ exports.validateRuleTree = validateRuleTree;
66
+ Object.defineProperty(exports, 'validation_exports', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return validation_exports;
70
+ }
71
+ });
@@ -1,6 +1,11 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
1
2
  import { flattenObjectOf, isLogicRule, isRuleFunction } from "./utils.mjs";
2
3
 
3
4
  //#region src/shield/validation.ts
5
+ var validation_exports = /* @__PURE__ */ __exportAll({
6
+ ValidationError: () => ValidationError,
7
+ validateRuleTree: () => validateRuleTree
8
+ });
4
9
  /**
5
10
  * Validates the rule tree declaration by checking references of rule
6
11
  * functions. We deem rule tree valid if no two rules with the same name point
@@ -55,5 +60,5 @@ var ValidationError = class extends Error {
55
60
  };
56
61
 
57
62
  //#endregion
58
- export { ValidationError, validateRuleTree };
63
+ export { ValidationError, validateRuleTree, validation_exports };
59
64
  //# sourceMappingURL=validation.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.mjs","names":[],"sources":["../../src/shield/validation.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n IRules,\n LogicRuleInterface,\n RuleInterface,\n ShieldRule\n} from \"./types\";\nimport { flattenObjectOf, isLogicRule, isRuleFunction } from \"./utils\";\n\n/**\n * Validates the rule tree declaration by checking references of rule\n * functions. We deem rule tree valid if no two rules with the same name point\n * to different rules.\n */\nexport function validateRuleTree<TContext extends Record<string, any>>(\n ruleTree: IRules<TContext>\n): { status: \"ok\" } | { status: \"err\"; message: string } {\n const rules = extractRules(ruleTree);\n\n const valid = rules.reduce<{\n map: Map<string, RuleInterface<TContext>>;\n duplicates: string[];\n }>(\n ({ map, duplicates }, rule) => {\n if (!map.has(rule.name)) {\n return { map: map.set(rule.name, rule), duplicates };\n } else if (\n !map.get(rule.name)!.equals(rule) &&\n !duplicates.includes(rule.name)\n ) {\n return {\n map: map.set(rule.name, rule),\n duplicates: [...duplicates, rule.name]\n };\n } else {\n return { map, duplicates };\n }\n },\n { map: new Map<string, RuleInterface<TContext>>(), duplicates: [] }\n );\n\n if (valid.duplicates.length === 0) {\n return { status: \"ok\" };\n } else {\n const duplicates = valid.duplicates.join(\", \");\n\n return {\n status: \"err\",\n message: `There seem to be multiple definitions of these rules: ${duplicates}`\n };\n }\n\n /**\n * Extracts rules from rule tree.\n */\n function extractRules<TContext extends Record<string, any>>(\n ruleTree: IRules<TContext>\n ): RuleInterface<TContext>[] {\n const resolvers = flattenObjectOf<ShieldRule<TContext>>(\n ruleTree,\n isRuleFunction\n );\n\n const rules = resolvers.reduce<RuleInterface<TContext>[]>((rules, rule) => {\n if (isLogicRule(rule)) {\n return [\n ...rules,\n ...extractLogicRules(rule)\n ] as RuleInterface<TContext>[];\n } else {\n return [...rules, rule] as RuleInterface<TContext>[];\n }\n }, []);\n\n return rules;\n }\n\n /**\n * Recursively extracts Rules from LogicRule\n */\n function extractLogicRules<TContext extends Record<string, any>>(\n rule: LogicRuleInterface<TContext>\n ): RuleInterface<TContext>[] {\n return rule\n .getRules()\n .reduce<RuleInterface<TContext>[]>((acc, shieldRule) => {\n if (isLogicRule(shieldRule)) {\n return [\n ...acc,\n ...extractLogicRules(shieldRule)\n ] as RuleInterface<TContext>[];\n } else {\n return [...acc, shieldRule] as RuleInterface<TContext>[];\n }\n }, []);\n }\n}\n\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,iBACd,UACuD;CAGvD,MAAM,QAFQ,aAAa,SAER,CAAC,QAIjB,EAAE,KAAK,cAAc,SAAS;AAC7B,MAAI,CAAC,IAAI,IAAI,KAAK,KAAK,CACrB,QAAO;GAAE,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK;GAAE;GAAY;WAEpD,CAAC,IAAI,IAAI,KAAK,KAAK,CAAE,OAAO,KAAK,IACjC,CAAC,WAAW,SAAS,KAAK,KAAK,CAE/B,QAAO;GACL,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK;GAC7B,YAAY,CAAC,GAAG,YAAY,KAAK,KAAK;GACvC;MAED,QAAO;GAAE;GAAK;GAAY;IAG9B;EAAE,qBAAK,IAAI,KAAsC;EAAE,YAAY,EAAE;EAAE,CACpE;AAED,KAAI,MAAM,WAAW,WAAW,EAC9B,QAAO,EAAE,QAAQ,MAAM;KAIvB,QAAO;EACL,QAAQ;EACR,SAAS,yDAJQ,MAAM,WAAW,KAAK,KAIqC;EAC7E;;;;CAMH,SAAS,aACP,UAC2B;AAiB3B,SAhBkB,gBAChB,UACA,eAGqB,CAAC,QAAmC,OAAO,SAAS;AACzE,OAAI,YAAY,KAAK,CACnB,QAAO,CACL,GAAG,OACH,GAAG,kBAAkB,KAAK,CAC3B;OAED,QAAO,CAAC,GAAG,OAAO,KAAK;KAExB,EAAE,CAEO;;;;;CAMd,SAAS,kBACP,MAC2B;AAC3B,SAAO,KACJ,UAAU,CACV,QAAmC,KAAK,eAAe;AACtD,OAAI,YAAY,WAAW,CACzB,QAAO,CACL,GAAG,KACH,GAAG,kBAAkB,WAAW,CACjC;OAED,QAAO,CAAC,GAAG,KAAK,WAAW;KAE5B,EAAE,CAAC;;;AAIZ,IAAa,kBAAb,cAAqC,MAAM;CACzC,YAAY,SAAiB;AAC3B,QAAM,QAAQ"}
1
+ {"version":3,"file":"validation.mjs","names":[],"sources":["../../src/shield/validation.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n IRules,\n LogicRuleInterface,\n RuleInterface,\n ShieldRule\n} from \"./types\";\nimport { flattenObjectOf, isLogicRule, isRuleFunction } from \"./utils\";\n\n/**\n * Validates the rule tree declaration by checking references of rule\n * functions. We deem rule tree valid if no two rules with the same name point\n * to different rules.\n */\nexport function validateRuleTree<TContext extends Record<string, any>>(\n ruleTree: IRules<TContext>\n): { status: \"ok\" } | { status: \"err\"; message: string } {\n const rules = extractRules(ruleTree);\n\n const valid = rules.reduce<{\n map: Map<string, RuleInterface<TContext>>;\n duplicates: string[];\n }>(\n ({ map, duplicates }, rule) => {\n if (!map.has(rule.name)) {\n return { map: map.set(rule.name, rule), duplicates };\n } else if (\n !map.get(rule.name)!.equals(rule) &&\n !duplicates.includes(rule.name)\n ) {\n return {\n map: map.set(rule.name, rule),\n duplicates: [...duplicates, rule.name]\n };\n } else {\n return { map, duplicates };\n }\n },\n { map: new Map<string, RuleInterface<TContext>>(), duplicates: [] }\n );\n\n if (valid.duplicates.length === 0) {\n return { status: \"ok\" };\n } else {\n const duplicates = valid.duplicates.join(\", \");\n\n return {\n status: \"err\",\n message: `There seem to be multiple definitions of these rules: ${duplicates}`\n };\n }\n\n /**\n * Extracts rules from rule tree.\n */\n function extractRules<TContext extends Record<string, any>>(\n ruleTree: IRules<TContext>\n ): RuleInterface<TContext>[] {\n const resolvers = flattenObjectOf<ShieldRule<TContext>>(\n ruleTree,\n isRuleFunction\n );\n\n const rules = resolvers.reduce<RuleInterface<TContext>[]>((rules, rule) => {\n if (isLogicRule(rule)) {\n return [\n ...rules,\n ...extractLogicRules(rule)\n ] as RuleInterface<TContext>[];\n } else {\n return [...rules, rule] as RuleInterface<TContext>[];\n }\n }, []);\n\n return rules;\n }\n\n /**\n * Recursively extracts Rules from LogicRule\n */\n function extractLogicRules<TContext extends Record<string, any>>(\n rule: LogicRuleInterface<TContext>\n ): RuleInterface<TContext>[] {\n return rule\n .getRules()\n .reduce<RuleInterface<TContext>[]>((acc, shieldRule) => {\n if (isLogicRule(shieldRule)) {\n return [\n ...acc,\n ...extractLogicRules(shieldRule)\n ] as RuleInterface<TContext>[];\n } else {\n return [...acc, shieldRule] as RuleInterface<TContext>[];\n }\n }, []);\n }\n}\n\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,iBACd,UACuD;CAGvD,MAAM,QAFQ,aAAa,SAER,CAAC,QAIjB,EAAE,KAAK,cAAc,SAAS;AAC7B,MAAI,CAAC,IAAI,IAAI,KAAK,KAAK,CACrB,QAAO;GAAE,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK;GAAE;GAAY;WAEpD,CAAC,IAAI,IAAI,KAAK,KAAK,CAAE,OAAO,KAAK,IACjC,CAAC,WAAW,SAAS,KAAK,KAAK,CAE/B,QAAO;GACL,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK;GAC7B,YAAY,CAAC,GAAG,YAAY,KAAK,KAAK;GACvC;MAED,QAAO;GAAE;GAAK;GAAY;IAG9B;EAAE,qBAAK,IAAI,KAAsC;EAAE,YAAY,EAAE;EAAE,CACpE;AAED,KAAI,MAAM,WAAW,WAAW,EAC9B,QAAO,EAAE,QAAQ,MAAM;KAIvB,QAAO;EACL,QAAQ;EACR,SAAS,yDAJQ,MAAM,WAAW,KAAK,KAIqC;EAC7E;;;;CAMH,SAAS,aACP,UAC2B;AAiB3B,SAhBkB,gBAChB,UACA,eAGqB,CAAC,QAAmC,OAAO,SAAS;AACzE,OAAI,YAAY,KAAK,CACnB,QAAO,CACL,GAAG,OACH,GAAG,kBAAkB,KAAK,CAC3B;OAED,QAAO,CAAC,GAAG,OAAO,KAAK;KAExB,EAAE,CAEO;;;;;CAMd,SAAS,kBACP,MAC2B;AAC3B,SAAO,KACJ,UAAU,CACV,QAAmC,KAAK,eAAe;AACtD,OAAI,YAAY,WAAW,CACzB,QAAO,CACL,GAAG,KACH,GAAG,kBAAkB,WAAW,CACjC;OAED,QAAO,CAAC,GAAG,KAAK,WAAW;KAE5B,EAAE,CAAC;;;AAIZ,IAAa,kBAAb,cAAqC,MAAM;CACzC,YAAY,SAAiB;AAC3B,QAAM,QAAQ"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ const require_shield_validation = require('./validation.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/shield/validation.test.ts
6
+ (0, vitest.describe)("shield/validation.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_shield_validation.validation_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_shield_validation.validation_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,13 @@
1
+ import { validation_exports } from "./validation.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/shield/validation.test.ts
5
+ describe("shield/validation.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(validation_exports).toBeDefined();
8
+ expect(typeof validation_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ //# sourceMappingURL=validation.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.test.mjs","names":["moduleExports"],"sources":["../../src/shield/validation.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./validation.ts\";\n\ndescribe(\"shield/validation.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,sCAAsC;AAC7C,IAAG,8BAA8B;AAC/B,SAAOA,mBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,mBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/dist/types.cjs CHANGED
@@ -0,0 +1,13 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+
4
+ //#region src/types.ts
5
+ var types_exports = /* @__PURE__ */ require_runtime.__exportAll({});
6
+
7
+ //#endregion
8
+ Object.defineProperty(exports, 'types_exports', {
9
+ enumerable: true,
10
+ get: function () {
11
+ return types_exports;
12
+ }
13
+ });
package/dist/types.mjs CHANGED
@@ -0,0 +1,8 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
2
+
3
+ //#region src/types.ts
4
+ var types_exports = /* @__PURE__ */ __exportAll({});
5
+
6
+ //#endregion
7
+ export { types_exports };
8
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport interface BaseContext<\n TPrisma = any | undefined,\n TSession = { user?: any } | undefined,\n THeaders extends { [k: string]: string } | undefined =\n | { [k: string]: string }\n | undefined\n> {\n /**\n * The Prisma Client instance.\n */\n prisma: TPrisma;\n\n /**\n * The session object.\n */\n session: TSession;\n\n /**\n * The request headers.\n */\n headers: THeaders;\n}\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_types = require('./types.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/types.test.ts
6
+ (0, vitest.describe)("types.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_types.types_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_types.types_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,13 @@
1
+ import { types_exports } from "./types.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/types.test.ts
5
+ describe("types.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(types_exports).toBeDefined();
8
+ expect(typeof types_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ //# sourceMappingURL=types.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.test.mjs","names":["moduleExports"],"sources":["../src/types.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./types.ts\";\n\ndescribe(\"types.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,0BAA0B;AACjC,IAAG,8BAA8B;AAC/B,SAAOA,cAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,cAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/trpc-next",
3
- "version": "0.5.98",
3
+ "version": "0.5.99",
4
4
  "private": false,
5
5
  "description": "A package to help in using tRPC in modern NextJs applications.",
6
6
  "repository": {
@@ -15,18 +15,38 @@
15
15
  "import": "./dist/action-handler.mjs",
16
16
  "require": "./dist/action-handler.cjs"
17
17
  },
18
+ "./action-handler.test": {
19
+ "import": "./dist/action-handler.test.mjs",
20
+ "require": "./dist/action-handler.test.cjs"
21
+ },
18
22
  "./client": {
19
23
  "import": "./dist/client.mjs",
20
24
  "require": "./dist/client.cjs"
21
25
  },
26
+ "./client.test": {
27
+ "import": "./dist/client.test.mjs",
28
+ "require": "./dist/client.test.cjs"
29
+ },
30
+ "./index.test": {
31
+ "import": "./dist/index.test.mjs",
32
+ "require": "./dist/index.test.cjs"
33
+ },
22
34
  "./server": {
23
35
  "import": "./dist/server.mjs",
24
36
  "require": "./dist/server.cjs"
25
37
  },
38
+ "./server.test": {
39
+ "import": "./dist/server.test.mjs",
40
+ "require": "./dist/server.test.cjs"
41
+ },
26
42
  "./shared": {
27
43
  "import": "./dist/shared.mjs",
28
44
  "require": "./dist/shared.cjs"
29
45
  },
46
+ "./shared.test": {
47
+ "import": "./dist/shared.test.mjs",
48
+ "require": "./dist/shared.test.cjs"
49
+ },
30
50
  "./shield": {
31
51
  "import": "./dist/shield/index.mjs",
32
52
  "require": "./dist/shield/index.cjs"
@@ -35,30 +55,62 @@
35
55
  "import": "./dist/shield/constructors.mjs",
36
56
  "require": "./dist/shield/constructors.cjs"
37
57
  },
58
+ "./shield/constructors.test": {
59
+ "import": "./dist/shield/constructors.test.mjs",
60
+ "require": "./dist/shield/constructors.test.cjs"
61
+ },
38
62
  "./shield/generator": {
39
63
  "import": "./dist/shield/generator.mjs",
40
64
  "require": "./dist/shield/generator.cjs"
41
65
  },
66
+ "./shield/generator.test": {
67
+ "import": "./dist/shield/generator.test.mjs",
68
+ "require": "./dist/shield/generator.test.cjs"
69
+ },
70
+ "./shield/index.test": {
71
+ "import": "./dist/shield/index.test.mjs",
72
+ "require": "./dist/shield/index.test.cjs"
73
+ },
42
74
  "./shield/rules": {
43
75
  "import": "./dist/shield/rules.mjs",
44
76
  "require": "./dist/shield/rules.cjs"
45
77
  },
78
+ "./shield/rules.test": {
79
+ "import": "./dist/shield/rules.test.mjs",
80
+ "require": "./dist/shield/rules.test.cjs"
81
+ },
46
82
  "./shield/shield": {
47
83
  "import": "./dist/shield/shield.mjs",
48
84
  "require": "./dist/shield/shield.cjs"
49
85
  },
86
+ "./shield/shield.test": {
87
+ "import": "./dist/shield/shield.test.mjs",
88
+ "require": "./dist/shield/shield.test.cjs"
89
+ },
50
90
  "./shield/types": {
51
91
  "import": "./dist/shield/types.mjs",
52
92
  "require": "./dist/shield/types.cjs"
53
93
  },
94
+ "./shield/types.test": {
95
+ "import": "./dist/shield/types.test.mjs",
96
+ "require": "./dist/shield/types.test.cjs"
97
+ },
54
98
  "./shield/utils": {
55
99
  "import": "./dist/shield/utils.mjs",
56
100
  "require": "./dist/shield/utils.cjs"
57
101
  },
102
+ "./shield/utils.test": {
103
+ "import": "./dist/shield/utils.test.mjs",
104
+ "require": "./dist/shield/utils.test.cjs"
105
+ },
58
106
  "./shield/validation": {
59
107
  "import": "./dist/shield/validation.mjs",
60
108
  "require": "./dist/shield/validation.cjs"
61
109
  },
110
+ "./shield/validation.test": {
111
+ "import": "./dist/shield/validation.test.mjs",
112
+ "require": "./dist/shield/validation.test.cjs"
113
+ },
62
114
  "./tanstack-query/client": {
63
115
  "import": "./dist/tanstack-query/client.mjs",
64
116
  "require": "./dist/tanstack-query/client.cjs"
@@ -68,6 +120,10 @@
68
120
  "require": "./dist/tanstack-query/server.cjs"
69
121
  },
70
122
  "./types": { "import": "./dist/types.mjs", "require": "./dist/types.cjs" },
123
+ "./types.test": {
124
+ "import": "./dist/types.test.mjs",
125
+ "require": "./dist/types.test.cjs"
126
+ },
71
127
  "./*": "./*"
72
128
  },
73
129
  "main": "./dist/index.cjs",
@@ -75,13 +131,13 @@
75
131
  "types": "./dist/index.d.cts",
76
132
  "dependencies": {
77
133
  "@js-temporal/polyfill": "^0.5.1",
78
- "@stryke/env": "^0.20.96",
79
- "@stryke/fs": "^0.33.79",
80
- "@stryke/path": "^0.29.6",
81
- "@stryke/string-format": "^0.17.21",
82
- "@stryke/type-checks": "^0.6.12",
83
- "@stryke/types": "^0.12.7",
84
- "@stryke/url": "^0.4.30",
134
+ "@stryke/env": "^0.20.97",
135
+ "@stryke/fs": "^0.33.80",
136
+ "@stryke/path": "^0.29.7",
137
+ "@stryke/string-format": "^0.17.22",
138
+ "@stryke/type-checks": "^0.6.13",
139
+ "@stryke/types": "^0.12.8",
140
+ "@stryke/url": "^0.4.31",
85
141
  "@tanstack/react-query": "^5.100.14",
86
142
  "@trpc/client": "^11.17.0",
87
143
  "@trpc/next": "^11.17.0",
@@ -108,5 +164,5 @@
108
164
  "react-native": { "optional": true }
109
165
  },
110
166
  "publishConfig": { "access": "public" },
111
- "gitHead": "cbaf8374918fb105ab59ad0af4635de069052e4c"
167
+ "gitHead": "004d35078864920425b41d1d90b45ef504f5a092"
112
168
  }