@lit-protocol/vincent-ability-sdk 0.0.1-ea

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 (209) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/CONTRIBUTING.md +117 -0
  3. package/README.md +213 -0
  4. package/dist/package.json +44 -0
  5. package/dist/src/index.d.ts +15 -0
  6. package/dist/src/index.d.ts.map +1 -0
  7. package/dist/src/index.js +21 -0
  8. package/dist/src/index.js.map +1 -0
  9. package/dist/src/internal.d.ts +12 -0
  10. package/dist/src/internal.d.ts.map +1 -0
  11. package/dist/src/internal.js +32 -0
  12. package/dist/src/internal.js.map +1 -0
  13. package/dist/src/lib/abilityCore/abilityConfig/context/abilityContext.d.ts +28 -0
  14. package/dist/src/lib/abilityCore/abilityConfig/context/abilityContext.d.ts.map +1 -0
  15. package/dist/src/lib/abilityCore/abilityConfig/context/abilityContext.js +51 -0
  16. package/dist/src/lib/abilityCore/abilityConfig/context/abilityContext.js.map +1 -0
  17. package/dist/src/lib/abilityCore/abilityConfig/context/resultCreators.d.ts +18 -0
  18. package/dist/src/lib/abilityCore/abilityConfig/context/resultCreators.d.ts.map +1 -0
  19. package/dist/src/lib/abilityCore/abilityConfig/context/resultCreators.js +48 -0
  20. package/dist/src/lib/abilityCore/abilityConfig/context/resultCreators.js.map +1 -0
  21. package/dist/src/lib/abilityCore/abilityConfig/context/types.d.ts +31 -0
  22. package/dist/src/lib/abilityCore/abilityConfig/context/types.d.ts.map +1 -0
  23. package/dist/src/lib/abilityCore/abilityConfig/context/types.js +9 -0
  24. package/dist/src/lib/abilityCore/abilityConfig/context/types.js.map +1 -0
  25. package/dist/src/lib/abilityCore/abilityConfig/types.d.ts +20 -0
  26. package/dist/src/lib/abilityCore/abilityConfig/types.d.ts.map +1 -0
  27. package/dist/src/lib/abilityCore/abilityConfig/types.js +4 -0
  28. package/dist/src/lib/abilityCore/abilityConfig/types.js.map +1 -0
  29. package/dist/src/lib/abilityCore/bundledAbility/bundledAbility.d.ts +5 -0
  30. package/dist/src/lib/abilityCore/bundledAbility/bundledAbility.d.ts.map +1 -0
  31. package/dist/src/lib/abilityCore/bundledAbility/bundledAbility.js +21 -0
  32. package/dist/src/lib/abilityCore/bundledAbility/bundledAbility.js.map +1 -0
  33. package/dist/src/lib/abilityCore/bundledAbility/types.d.ts +18 -0
  34. package/dist/src/lib/abilityCore/bundledAbility/types.d.ts.map +1 -0
  35. package/dist/src/lib/abilityCore/bundledAbility/types.js +4 -0
  36. package/dist/src/lib/abilityCore/bundledAbility/types.js.map +1 -0
  37. package/dist/src/lib/abilityCore/helpers/getMappedAbilityPolicyParams.d.ts +5 -0
  38. package/dist/src/lib/abilityCore/helpers/getMappedAbilityPolicyParams.d.ts.map +1 -0
  39. package/dist/src/lib/abilityCore/helpers/getMappedAbilityPolicyParams.js +18 -0
  40. package/dist/src/lib/abilityCore/helpers/getMappedAbilityPolicyParams.js.map +1 -0
  41. package/dist/src/lib/abilityCore/helpers/getPkpInfo.d.ts +10 -0
  42. package/dist/src/lib/abilityCore/helpers/getPkpInfo.d.ts.map +1 -0
  43. package/dist/src/lib/abilityCore/helpers/getPkpInfo.js +26 -0
  44. package/dist/src/lib/abilityCore/helpers/getPkpInfo.js.map +1 -0
  45. package/dist/src/lib/abilityCore/helpers/index.d.ts +5 -0
  46. package/dist/src/lib/abilityCore/helpers/index.d.ts.map +1 -0
  47. package/dist/src/lib/abilityCore/helpers/index.js +12 -0
  48. package/dist/src/lib/abilityCore/helpers/index.js.map +1 -0
  49. package/dist/src/lib/abilityCore/helpers/resultCreators.d.ts +21 -0
  50. package/dist/src/lib/abilityCore/helpers/resultCreators.d.ts.map +1 -0
  51. package/dist/src/lib/abilityCore/helpers/resultCreators.js +48 -0
  52. package/dist/src/lib/abilityCore/helpers/resultCreators.js.map +1 -0
  53. package/dist/src/lib/abilityCore/helpers/supportedPoliciesForAbility.d.ts +55 -0
  54. package/dist/src/lib/abilityCore/helpers/supportedPoliciesForAbility.d.ts.map +1 -0
  55. package/dist/src/lib/abilityCore/helpers/supportedPoliciesForAbility.js +68 -0
  56. package/dist/src/lib/abilityCore/helpers/supportedPoliciesForAbility.js.map +1 -0
  57. package/dist/src/lib/abilityCore/helpers/typeGuards.d.ts +8 -0
  58. package/dist/src/lib/abilityCore/helpers/typeGuards.d.ts.map +1 -0
  59. package/dist/src/lib/abilityCore/helpers/typeGuards.js +28 -0
  60. package/dist/src/lib/abilityCore/helpers/typeGuards.js.map +1 -0
  61. package/dist/src/lib/abilityCore/helpers/validatePolicies.d.ts +24 -0
  62. package/dist/src/lib/abilityCore/helpers/validatePolicies.d.ts.map +1 -0
  63. package/dist/src/lib/abilityCore/helpers/validatePolicies.js +31 -0
  64. package/dist/src/lib/abilityCore/helpers/validatePolicies.js.map +1 -0
  65. package/dist/src/lib/abilityCore/helpers/zod.d.ts +43 -0
  66. package/dist/src/lib/abilityCore/helpers/zod.d.ts.map +1 -0
  67. package/dist/src/lib/abilityCore/helpers/zod.js +70 -0
  68. package/dist/src/lib/abilityCore/helpers/zod.js.map +1 -0
  69. package/dist/src/lib/abilityCore/vincentAbility.d.ts +54 -0
  70. package/dist/src/lib/abilityCore/vincentAbility.d.ts.map +1 -0
  71. package/dist/src/lib/abilityCore/vincentAbility.js +162 -0
  72. package/dist/src/lib/abilityCore/vincentAbility.js.map +1 -0
  73. package/dist/src/lib/assertSupportedAbilityVersion.d.ts +2 -0
  74. package/dist/src/lib/assertSupportedAbilityVersion.d.ts.map +1 -0
  75. package/dist/src/lib/assertSupportedAbilityVersion.js +15 -0
  76. package/dist/src/lib/assertSupportedAbilityVersion.js.map +1 -0
  77. package/dist/src/lib/constants.d.ts +2 -0
  78. package/dist/src/lib/constants.d.ts.map +1 -0
  79. package/dist/src/lib/constants.js +5 -0
  80. package/dist/src/lib/constants.js.map +1 -0
  81. package/dist/src/lib/handlers/constants.d.ts +2 -0
  82. package/dist/src/lib/handlers/constants.d.ts.map +1 -0
  83. package/dist/src/lib/handlers/constants.js +6 -0
  84. package/dist/src/lib/handlers/constants.js.map +1 -0
  85. package/dist/src/lib/handlers/evaluatePolicies.d.ts +11 -0
  86. package/dist/src/lib/handlers/evaluatePolicies.d.ts.map +1 -0
  87. package/dist/src/lib/handlers/evaluatePolicies.js +110 -0
  88. package/dist/src/lib/handlers/evaluatePolicies.js.map +1 -0
  89. package/dist/src/lib/handlers/vincentAbilityHandler.d.ts +15 -0
  90. package/dist/src/lib/handlers/vincentAbilityHandler.d.ts.map +1 -0
  91. package/dist/src/lib/handlers/vincentAbilityHandler.js +160 -0
  92. package/dist/src/lib/handlers/vincentAbilityHandler.js.map +1 -0
  93. package/dist/src/lib/handlers/vincentPolicyHandler.d.ts +13 -0
  94. package/dist/src/lib/handlers/vincentPolicyHandler.d.ts.map +1 -0
  95. package/dist/src/lib/handlers/vincentPolicyHandler.js +70 -0
  96. package/dist/src/lib/handlers/vincentPolicyHandler.js.map +1 -0
  97. package/dist/src/lib/policyCore/bundledPolicy/bundledPolicy.d.ts +5 -0
  98. package/dist/src/lib/policyCore/bundledPolicy/bundledPolicy.d.ts.map +1 -0
  99. package/dist/src/lib/policyCore/bundledPolicy/bundledPolicy.js +21 -0
  100. package/dist/src/lib/policyCore/bundledPolicy/bundledPolicy.js.map +1 -0
  101. package/dist/src/lib/policyCore/bundledPolicy/types.d.ts +17 -0
  102. package/dist/src/lib/policyCore/bundledPolicy/types.d.ts.map +1 -0
  103. package/dist/src/lib/policyCore/bundledPolicy/types.js +4 -0
  104. package/dist/src/lib/policyCore/bundledPolicy/types.js.map +1 -0
  105. package/dist/src/lib/policyCore/helpers/index.d.ts +5 -0
  106. package/dist/src/lib/policyCore/helpers/index.d.ts.map +1 -0
  107. package/dist/src/lib/policyCore/helpers/index.js +16 -0
  108. package/dist/src/lib/policyCore/helpers/index.js.map +1 -0
  109. package/dist/src/lib/policyCore/helpers/resultCreators.d.ts +38 -0
  110. package/dist/src/lib/policyCore/helpers/resultCreators.d.ts.map +1 -0
  111. package/dist/src/lib/policyCore/helpers/resultCreators.js +89 -0
  112. package/dist/src/lib/policyCore/helpers/resultCreators.js.map +1 -0
  113. package/dist/src/lib/policyCore/helpers/typeGuards.d.ts +7 -0
  114. package/dist/src/lib/policyCore/helpers/typeGuards.d.ts.map +1 -0
  115. package/dist/src/lib/policyCore/helpers/typeGuards.js +23 -0
  116. package/dist/src/lib/policyCore/helpers/typeGuards.js.map +1 -0
  117. package/dist/src/lib/policyCore/helpers/zod.d.ts +55 -0
  118. package/dist/src/lib/policyCore/helpers/zod.d.ts.map +1 -0
  119. package/dist/src/lib/policyCore/helpers/zod.js +82 -0
  120. package/dist/src/lib/policyCore/helpers/zod.js.map +1 -0
  121. package/dist/src/lib/policyCore/index.d.ts +3 -0
  122. package/dist/src/lib/policyCore/index.d.ts.map +1 -0
  123. package/dist/src/lib/policyCore/index.js +8 -0
  124. package/dist/src/lib/policyCore/index.js.map +1 -0
  125. package/dist/src/lib/policyCore/policyConfig/context/policyConfigContext.d.ts +12 -0
  126. package/dist/src/lib/policyCore/policyConfig/context/policyConfigContext.d.ts.map +1 -0
  127. package/dist/src/lib/policyCore/policyConfig/context/policyConfigContext.js +20 -0
  128. package/dist/src/lib/policyCore/policyConfig/context/policyConfigContext.js.map +1 -0
  129. package/dist/src/lib/policyCore/policyConfig/context/resultCreators.d.ts +6 -0
  130. package/dist/src/lib/policyCore/policyConfig/context/resultCreators.d.ts.map +1 -0
  131. package/dist/src/lib/policyCore/policyConfig/context/resultCreators.js +30 -0
  132. package/dist/src/lib/policyCore/policyConfig/context/resultCreators.js.map +1 -0
  133. package/dist/src/lib/policyCore/policyConfig/context/types.d.ts +24 -0
  134. package/dist/src/lib/policyCore/policyConfig/context/types.d.ts.map +1 -0
  135. package/dist/src/lib/policyCore/policyConfig/context/types.js +5 -0
  136. package/dist/src/lib/policyCore/policyConfig/context/types.js.map +1 -0
  137. package/dist/src/lib/policyCore/policyConfig/types.d.ts +46 -0
  138. package/dist/src/lib/policyCore/policyConfig/types.d.ts.map +1 -0
  139. package/dist/src/lib/policyCore/policyConfig/types.js +3 -0
  140. package/dist/src/lib/policyCore/policyConfig/types.js.map +1 -0
  141. package/dist/src/lib/policyCore/policyParameters/getOnchainPolicyParams.d.ts +17 -0
  142. package/dist/src/lib/policyCore/policyParameters/getOnchainPolicyParams.d.ts.map +1 -0
  143. package/dist/src/lib/policyCore/policyParameters/getOnchainPolicyParams.js +54 -0
  144. package/dist/src/lib/policyCore/policyParameters/getOnchainPolicyParams.js.map +1 -0
  145. package/dist/src/lib/policyCore/vincentPolicy.d.ts +92 -0
  146. package/dist/src/lib/policyCore/vincentPolicy.d.ts.map +1 -0
  147. package/dist/src/lib/policyCore/vincentPolicy.js +242 -0
  148. package/dist/src/lib/policyCore/vincentPolicy.js.map +1 -0
  149. package/dist/src/lib/types.d.ts +260 -0
  150. package/dist/src/lib/types.d.ts.map +1 -0
  151. package/dist/src/lib/types.js +4 -0
  152. package/dist/src/lib/types.js.map +1 -0
  153. package/dist/src/lib/utils.d.ts +2 -0
  154. package/dist/src/lib/utils.d.ts.map +1 -0
  155. package/dist/src/lib/utils.js +8 -0
  156. package/dist/src/lib/utils.js.map +1 -0
  157. package/dist/src/type-inference-verification/ability-definition-tests.d.ts +702 -0
  158. package/dist/src/type-inference-verification/ability-definition-tests.d.ts.map +1 -0
  159. package/dist/src/type-inference-verification/ability-definition-tests.js +203 -0
  160. package/dist/src/type-inference-verification/ability-definition-tests.js.map +1 -0
  161. package/dist/src/type-inference-verification/ability-lifecycle-inference.d.ts +2 -0
  162. package/dist/src/type-inference-verification/ability-lifecycle-inference.d.ts.map +1 -0
  163. package/dist/src/type-inference-verification/ability-lifecycle-inference.js +109 -0
  164. package/dist/src/type-inference-verification/ability-lifecycle-inference.js.map +1 -0
  165. package/dist/src/type-inference-verification/ability-lifecycle-succeed-fail-tests.d.ts +923 -0
  166. package/dist/src/type-inference-verification/ability-lifecycle-succeed-fail-tests.d.ts.map +1 -0
  167. package/dist/src/type-inference-verification/ability-lifecycle-succeed-fail-tests.js +196 -0
  168. package/dist/src/type-inference-verification/ability-lifecycle-succeed-fail-tests.js.map +1 -0
  169. package/dist/src/type-inference-verification/allow-deny-test-cases-ability.d.ts +4305 -0
  170. package/dist/src/type-inference-verification/allow-deny-test-cases-ability.d.ts.map +1 -0
  171. package/dist/src/type-inference-verification/allow-deny-test-cases-ability.js +644 -0
  172. package/dist/src/type-inference-verification/allow-deny-test-cases-ability.js.map +1 -0
  173. package/dist/src/type-inference-verification/allow-deny-test-cases.d.ts +646 -0
  174. package/dist/src/type-inference-verification/allow-deny-test-cases.d.ts.map +1 -0
  175. package/dist/src/type-inference-verification/allow-deny-test-cases.js +264 -0
  176. package/dist/src/type-inference-verification/allow-deny-test-cases.js.map +1 -0
  177. package/dist/src/type-inference-verification/context-switching-tests.d.ts +637 -0
  178. package/dist/src/type-inference-verification/context-switching-tests.d.ts.map +1 -0
  179. package/dist/src/type-inference-verification/context-switching-tests.js +229 -0
  180. package/dist/src/type-inference-verification/context-switching-tests.js.map +1 -0
  181. package/dist/src/type-inference-verification/create-policy-map-from-tool-policies.d.ts +2 -0
  182. package/dist/src/type-inference-verification/create-policy-map-from-tool-policies.d.ts.map +1 -0
  183. package/dist/src/type-inference-verification/create-policy-map-from-tool-policies.js +56 -0
  184. package/dist/src/type-inference-verification/create-policy-map-from-tool-policies.js.map +1 -0
  185. package/dist/src/type-inference-verification/create-vincent-ability-policy.d.ts +2 -0
  186. package/dist/src/type-inference-verification/create-vincent-ability-policy.d.ts.map +1 -0
  187. package/dist/src/type-inference-verification/create-vincent-ability-policy.js +49 -0
  188. package/dist/src/type-inference-verification/create-vincent-ability-policy.js.map +1 -0
  189. package/dist/src/type-inference-verification/create-vincent-ability.d.ts +250 -0
  190. package/dist/src/type-inference-verification/create-vincent-ability.d.ts.map +1 -0
  191. package/dist/src/type-inference-verification/create-vincent-ability.js +68 -0
  192. package/dist/src/type-inference-verification/create-vincent-ability.js.map +1 -0
  193. package/dist/src/type-inference-verification/parameter-inference-tests-tool.d.ts +1710 -0
  194. package/dist/src/type-inference-verification/parameter-inference-tests-tool.d.ts.map +1 -0
  195. package/dist/src/type-inference-verification/parameter-inference-tests-tool.js +537 -0
  196. package/dist/src/type-inference-verification/parameter-inference-tests-tool.js.map +1 -0
  197. package/dist/src/type-inference-verification/parameter-inference-tests.d.ts +456 -0
  198. package/dist/src/type-inference-verification/parameter-inference-tests.d.ts.map +1 -0
  199. package/dist/src/type-inference-verification/parameter-inference-tests.js +179 -0
  200. package/dist/src/type-inference-verification/parameter-inference-tests.js.map +1 -0
  201. package/dist/src/type-inference-verification/playground.d.ts +1556 -0
  202. package/dist/src/type-inference-verification/playground.d.ts.map +1 -0
  203. package/dist/src/type-inference-verification/playground.js +473 -0
  204. package/dist/src/type-inference-verification/playground.js.map +1 -0
  205. package/dist/src/type-inference-verification/schema-test.d.ts +470 -0
  206. package/dist/src/type-inference-verification/schema-test.d.ts.map +1 -0
  207. package/dist/src/type-inference-verification/schema-test.js +252 -0
  208. package/dist/src/type-inference-verification/schema-test.js.map +1 -0
  209. package/package.json +43 -0
@@ -0,0 +1,470 @@
1
+ /**
2
+ * Schema Test File
3
+ *
4
+ * This file contains minimal test cases to verify that type checking
5
+ * is working correctly for the allow() and deny() methods with various
6
+ * schema configurations.
7
+ */
8
+ import type { ZodUndefined } from 'zod';
9
+ import { z } from 'zod';
10
+ import type { PolicyContext } from '../lib/policyCore/policyConfig/context/types';
11
+ /**
12
+ * Test 1: With Schema
13
+ *
14
+ * This test verifies that TypeScript properly enforces schema constraints
15
+ * when schemas are provided.
16
+ */
17
+ declare const objSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ }, {
22
+ id: string;
23
+ }>;
24
+ export declare function testContextSignature(context: PolicyContext<typeof objSchema, ZodUndefined>): import("../lib/policyCore/policyConfig/context/types").ContextAllowResponse<{
25
+ id: string;
26
+ }>;
27
+ export declare const testRealPolicy: {
28
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/schema-test-policy@1.0.0", z.ZodObject<{
29
+ actionType: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ actionType: string;
32
+ }, {
33
+ actionType: string;
34
+ }>, ZodUndefined, ZodUndefined, ZodUndefined, z.ZodObject<{
35
+ id: z.ZodString;
36
+ }, "strip", z.ZodTypeAny, {
37
+ id: string;
38
+ }, {
39
+ id: string;
40
+ }>, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
41
+ actionType: z.ZodString;
42
+ }, "strip", z.ZodTypeAny, {
43
+ actionType: string;
44
+ }, {
45
+ actionType: string;
46
+ }>, ZodUndefined, z.ZodObject<{
47
+ id: z.ZodString;
48
+ }, "strip", z.ZodTypeAny, {
49
+ id: string;
50
+ }, {
51
+ id: string;
52
+ }>, ZodUndefined>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
53
+ actionType: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ actionType: string;
56
+ }, {
57
+ actionType: string;
58
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>, import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined>>;
59
+ ipfsCid: "1091jkfn2039j802jf";
60
+ abilityParameterMappings: Partial<{
61
+ action: "actionType";
62
+ target: "actionType";
63
+ amount: "actionType";
64
+ }>;
65
+ vincentAbilityApiVersion: string;
66
+ __schemaTypes: {
67
+ policyAbilityParamsSchema: z.ZodObject<{
68
+ actionType: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ actionType: string;
71
+ }, {
72
+ actionType: string;
73
+ }>;
74
+ userParamsSchema: ZodUndefined;
75
+ evalAllowResultSchema: z.ZodObject<{
76
+ id: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ id: string;
79
+ }, {
80
+ id: string;
81
+ }>;
82
+ evalDenyResultSchema: ZodUndefined;
83
+ precheckAllowResultSchema: ZodUndefined;
84
+ precheckDenyResultSchema: ZodUndefined;
85
+ commitParamsSchema: ZodUndefined;
86
+ commitAllowResultSchema: ZodUndefined;
87
+ commitDenyResultSchema: ZodUndefined;
88
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
89
+ actionType: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ actionType: string;
92
+ }, {
93
+ actionType: string;
94
+ }>, ZodUndefined, z.ZodObject<{
95
+ id: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ id: string;
98
+ }, {
99
+ id: string;
100
+ }>, ZodUndefined>;
101
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
102
+ actionType: z.ZodString;
103
+ }, "strip", z.ZodTypeAny, {
104
+ actionType: string;
105
+ }, {
106
+ actionType: string;
107
+ }>, ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
108
+ commit: import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
109
+ };
110
+ };
111
+ /**
112
+ * Test 2: Without Schema
113
+ *
114
+ * This test verifies that TypeScript properly enforces constraints
115
+ * when no schemas are provided (no args for allow, string or no args for deny).
116
+ */
117
+ export declare function testWithoutSchema(): {
118
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/schema-test-policy@1.0.0", z.ZodObject<{
119
+ actionType: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ actionType: string;
122
+ }, {
123
+ actionType: string;
124
+ }>, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
125
+ actionType: z.ZodString;
126
+ }, "strip", z.ZodTypeAny, {
127
+ actionType: string;
128
+ }, {
129
+ actionType: string;
130
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
131
+ actionType: z.ZodString;
132
+ }, "strip", z.ZodTypeAny, {
133
+ actionType: string;
134
+ }, {
135
+ actionType: string;
136
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>, import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined>>;
137
+ ipfsCid: "1091jkfn2039j802jf";
138
+ abilityParameterMappings: Partial<{
139
+ action: "actionType";
140
+ target: "actionType";
141
+ amount: "actionType";
142
+ }>;
143
+ vincentAbilityApiVersion: string;
144
+ __schemaTypes: {
145
+ policyAbilityParamsSchema: z.ZodObject<{
146
+ actionType: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ actionType: string;
149
+ }, {
150
+ actionType: string;
151
+ }>;
152
+ userParamsSchema: ZodUndefined;
153
+ evalAllowResultSchema: ZodUndefined;
154
+ evalDenyResultSchema: ZodUndefined;
155
+ precheckAllowResultSchema: ZodUndefined;
156
+ precheckDenyResultSchema: ZodUndefined;
157
+ commitParamsSchema: ZodUndefined;
158
+ commitAllowResultSchema: ZodUndefined;
159
+ commitDenyResultSchema: ZodUndefined;
160
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
161
+ actionType: z.ZodString;
162
+ }, "strip", z.ZodTypeAny, {
163
+ actionType: string;
164
+ }, {
165
+ actionType: string;
166
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>;
167
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
168
+ actionType: z.ZodString;
169
+ }, "strip", z.ZodTypeAny, {
170
+ actionType: string;
171
+ }, {
172
+ actionType: string;
173
+ }>, ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
174
+ commit: import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
175
+ };
176
+ };
177
+ /**
178
+ * Test 3: String Schema
179
+ *
180
+ * This test verifies handling of string schemas, which are a special case.
181
+ */
182
+ export declare function testStringSchema(): {
183
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/schema-test-policy@1.0.0", z.ZodObject<{
184
+ actionType: z.ZodString;
185
+ }, "strip", z.ZodTypeAny, {
186
+ actionType: string;
187
+ }, {
188
+ actionType: string;
189
+ }>, ZodUndefined, ZodUndefined, ZodUndefined, z.ZodString, z.ZodString, ZodUndefined, ZodUndefined, ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
190
+ actionType: z.ZodString;
191
+ }, "strip", z.ZodTypeAny, {
192
+ actionType: string;
193
+ }, {
194
+ actionType: string;
195
+ }>, ZodUndefined, z.ZodString, z.ZodString>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
196
+ actionType: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ actionType: string;
199
+ }, {
200
+ actionType: string;
201
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>, import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined>>;
202
+ ipfsCid: "1091jkfn2039j802jf";
203
+ abilityParameterMappings: Partial<{
204
+ action: "actionType";
205
+ target: "actionType";
206
+ amount: "actionType";
207
+ }>;
208
+ vincentAbilityApiVersion: string;
209
+ __schemaTypes: {
210
+ policyAbilityParamsSchema: z.ZodObject<{
211
+ actionType: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ actionType: string;
214
+ }, {
215
+ actionType: string;
216
+ }>;
217
+ userParamsSchema: ZodUndefined;
218
+ evalAllowResultSchema: z.ZodString;
219
+ evalDenyResultSchema: z.ZodString;
220
+ precheckAllowResultSchema: ZodUndefined;
221
+ precheckDenyResultSchema: ZodUndefined;
222
+ commitParamsSchema: ZodUndefined;
223
+ commitAllowResultSchema: ZodUndefined;
224
+ commitDenyResultSchema: ZodUndefined;
225
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
226
+ actionType: z.ZodString;
227
+ }, "strip", z.ZodTypeAny, {
228
+ actionType: string;
229
+ }, {
230
+ actionType: string;
231
+ }>, ZodUndefined, z.ZodString, z.ZodString>;
232
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
233
+ actionType: z.ZodString;
234
+ }, "strip", z.ZodTypeAny, {
235
+ actionType: string;
236
+ }, {
237
+ actionType: string;
238
+ }>, ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
239
+ commit: import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
240
+ };
241
+ };
242
+ /**
243
+ * Test 4: Different Contexts
244
+ *
245
+ * This test verifies that different schemas are enforced correctly
246
+ * in different contexts (precheck, evaluate, commit).
247
+ */
248
+ export declare function testDifferentContexts(): {
249
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/schema-test-policy@1.0.0", z.ZodObject<{
250
+ actionType: z.ZodString;
251
+ }, "strip", z.ZodTypeAny, {
252
+ actionType: string;
253
+ }, {
254
+ actionType: string;
255
+ }>, ZodUndefined, z.ZodObject<{
256
+ validCheck: z.ZodBoolean;
257
+ }, "strip", z.ZodTypeAny, {
258
+ validCheck: boolean;
259
+ }, {
260
+ validCheck: boolean;
261
+ }>, ZodUndefined, z.ZodObject<{
262
+ status: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ status: string;
265
+ }, {
266
+ status: string;
267
+ }>, ZodUndefined, z.ZodObject<{
268
+ confirmation: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ confirmation: string;
271
+ }, {
272
+ confirmation: string;
273
+ }>, z.ZodObject<{
274
+ txId: z.ZodString;
275
+ }, "strip", z.ZodTypeAny, {
276
+ txId: string;
277
+ }, {
278
+ txId: string;
279
+ }>, ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
280
+ actionType: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
282
+ actionType: string;
283
+ }, {
284
+ actionType: string;
285
+ }>, ZodUndefined, z.ZodObject<{
286
+ status: z.ZodString;
287
+ }, "strip", z.ZodTypeAny, {
288
+ status: string;
289
+ }, {
290
+ status: string;
291
+ }>, ZodUndefined>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
292
+ actionType: z.ZodString;
293
+ }, "strip", z.ZodTypeAny, {
294
+ actionType: string;
295
+ }, {
296
+ actionType: string;
297
+ }>, ZodUndefined, z.ZodObject<{
298
+ validCheck: z.ZodBoolean;
299
+ }, "strip", z.ZodTypeAny, {
300
+ validCheck: boolean;
301
+ }, {
302
+ validCheck: boolean;
303
+ }>, ZodUndefined>, import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
304
+ confirmation: z.ZodString;
305
+ }, "strip", z.ZodTypeAny, {
306
+ confirmation: string;
307
+ }, {
308
+ confirmation: string;
309
+ }>, z.ZodObject<{
310
+ txId: z.ZodString;
311
+ }, "strip", z.ZodTypeAny, {
312
+ txId: string;
313
+ }, {
314
+ txId: string;
315
+ }>, ZodUndefined>>;
316
+ ipfsCid: "1091jkfn2039j802jf";
317
+ abilityParameterMappings: Partial<{
318
+ action: "actionType";
319
+ target: "actionType";
320
+ amount: "actionType";
321
+ }>;
322
+ vincentAbilityApiVersion: string;
323
+ __schemaTypes: {
324
+ policyAbilityParamsSchema: z.ZodObject<{
325
+ actionType: z.ZodString;
326
+ }, "strip", z.ZodTypeAny, {
327
+ actionType: string;
328
+ }, {
329
+ actionType: string;
330
+ }>;
331
+ userParamsSchema: ZodUndefined;
332
+ evalAllowResultSchema: z.ZodObject<{
333
+ status: z.ZodString;
334
+ }, "strip", z.ZodTypeAny, {
335
+ status: string;
336
+ }, {
337
+ status: string;
338
+ }>;
339
+ evalDenyResultSchema: ZodUndefined;
340
+ precheckAllowResultSchema: z.ZodObject<{
341
+ validCheck: z.ZodBoolean;
342
+ }, "strip", z.ZodTypeAny, {
343
+ validCheck: boolean;
344
+ }, {
345
+ validCheck: boolean;
346
+ }>;
347
+ precheckDenyResultSchema: ZodUndefined;
348
+ commitParamsSchema: z.ZodObject<{
349
+ confirmation: z.ZodString;
350
+ }, "strip", z.ZodTypeAny, {
351
+ confirmation: string;
352
+ }, {
353
+ confirmation: string;
354
+ }>;
355
+ commitAllowResultSchema: z.ZodObject<{
356
+ txId: z.ZodString;
357
+ }, "strip", z.ZodTypeAny, {
358
+ txId: string;
359
+ }, {
360
+ txId: string;
361
+ }>;
362
+ commitDenyResultSchema: ZodUndefined;
363
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
364
+ actionType: z.ZodString;
365
+ }, "strip", z.ZodTypeAny, {
366
+ actionType: string;
367
+ }, {
368
+ actionType: string;
369
+ }>, ZodUndefined, z.ZodObject<{
370
+ status: z.ZodString;
371
+ }, "strip", z.ZodTypeAny, {
372
+ status: string;
373
+ }, {
374
+ status: string;
375
+ }>, ZodUndefined>;
376
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
377
+ actionType: z.ZodString;
378
+ }, "strip", z.ZodTypeAny, {
379
+ actionType: string;
380
+ }, {
381
+ actionType: string;
382
+ }>, ZodUndefined, z.ZodObject<{
383
+ validCheck: z.ZodBoolean;
384
+ }, "strip", z.ZodTypeAny, {
385
+ validCheck: boolean;
386
+ }, {
387
+ validCheck: boolean;
388
+ }>, ZodUndefined> | undefined;
389
+ commit: import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
390
+ confirmation: z.ZodString;
391
+ }, "strip", z.ZodTypeAny, {
392
+ confirmation: string;
393
+ }, {
394
+ confirmation: string;
395
+ }>, z.ZodObject<{
396
+ txId: z.ZodString;
397
+ }, "strip", z.ZodTypeAny, {
398
+ txId: string;
399
+ }, {
400
+ txId: string;
401
+ }>, ZodUndefined> | undefined;
402
+ };
403
+ };
404
+ /**
405
+ * Test 5: Number and Boolean Schemas
406
+ *
407
+ * This test verifies that number and boolean schemas work correctly.
408
+ */
409
+ export declare function testPrimitiveSchemas(): {
410
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/schema-test-policy@1.0.0", z.ZodObject<{
411
+ actionType: z.ZodString;
412
+ }, "strip", z.ZodTypeAny, {
413
+ actionType: string;
414
+ }, {
415
+ actionType: string;
416
+ }>, ZodUndefined, ZodUndefined, ZodUndefined, z.ZodNumber, z.ZodBoolean, ZodUndefined, ZodUndefined, ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
417
+ actionType: z.ZodString;
418
+ }, "strip", z.ZodTypeAny, {
419
+ actionType: string;
420
+ }, {
421
+ actionType: string;
422
+ }>, ZodUndefined, z.ZodNumber, z.ZodBoolean>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
423
+ actionType: z.ZodString;
424
+ }, "strip", z.ZodTypeAny, {
425
+ actionType: string;
426
+ }, {
427
+ actionType: string;
428
+ }>, ZodUndefined, ZodUndefined, ZodUndefined>, import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined>>;
429
+ ipfsCid: "1091jkfn2039j802jf";
430
+ abilityParameterMappings: Partial<{
431
+ action: "actionType";
432
+ target: "actionType";
433
+ amount: "actionType";
434
+ }>;
435
+ vincentAbilityApiVersion: string;
436
+ __schemaTypes: {
437
+ policyAbilityParamsSchema: z.ZodObject<{
438
+ actionType: z.ZodString;
439
+ }, "strip", z.ZodTypeAny, {
440
+ actionType: string;
441
+ }, {
442
+ actionType: string;
443
+ }>;
444
+ userParamsSchema: ZodUndefined;
445
+ evalAllowResultSchema: z.ZodNumber;
446
+ evalDenyResultSchema: z.ZodBoolean;
447
+ precheckAllowResultSchema: ZodUndefined;
448
+ precheckDenyResultSchema: ZodUndefined;
449
+ commitParamsSchema: ZodUndefined;
450
+ commitAllowResultSchema: ZodUndefined;
451
+ commitDenyResultSchema: ZodUndefined;
452
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
453
+ actionType: z.ZodString;
454
+ }, "strip", z.ZodTypeAny, {
455
+ actionType: string;
456
+ }, {
457
+ actionType: string;
458
+ }>, ZodUndefined, z.ZodNumber, z.ZodBoolean>;
459
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
460
+ actionType: z.ZodString;
461
+ }, "strip", z.ZodTypeAny, {
462
+ actionType: string;
463
+ }, {
464
+ actionType: string;
465
+ }>, ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
466
+ commit: import("../lib/types").CommitLifecycleFunction<ZodUndefined, ZodUndefined, ZodUndefined> | undefined;
467
+ };
468
+ };
469
+ export {};
470
+ //# sourceMappingURL=schema-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-test.d.ts","sourceRoot":"","sources":["../../../src/type-inference-verification/schema-test.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAYlF;;;;;GAKG;AACH,QAAA,MAAM,SAAS;;;;;;EAA+B,CAAC;AAG/C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,SAAS,EAAE,YAAY,CAAC;;GAY1F;AAuBD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMzB,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDhC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC/B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEpC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCnC"}