@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,637 @@
1
+ /**
2
+ * Context Switching Tests
3
+ *
4
+ * This file contains test cases for verifying that the type constraints are
5
+ * properly enforced when switching between different policy function contexts
6
+ * (precheck, evaluate, commit) which may have different schemas.
7
+ */
8
+ import { z } from 'zod';
9
+ /**
10
+ * Test Case 1: Verify different schemas between precheck and evaluate
11
+ */
12
+ declare function testPrecheckEvaluateContextSwitching(): {
13
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/test-policy@1.2.3", z.ZodObject<{
14
+ actionType: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ actionType: string;
17
+ }, {
18
+ actionType: string;
19
+ }>, z.ZodUndefined, z.ZodObject<{
20
+ prelimStatus: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ prelimStatus: string;
23
+ }, {
24
+ prelimStatus: string;
25
+ }>, z.ZodObject<{
26
+ prelimReason: z.ZodString;
27
+ }, "strip", z.ZodTypeAny, {
28
+ prelimReason: string;
29
+ }, {
30
+ prelimReason: string;
31
+ }>, z.ZodObject<{
32
+ finalStatus: z.ZodString;
33
+ }, "strip", z.ZodTypeAny, {
34
+ finalStatus: string;
35
+ }, {
36
+ finalStatus: string;
37
+ }>, z.ZodObject<{
38
+ finalReason: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ finalReason: string;
41
+ }, {
42
+ finalReason: string;
43
+ }>, z.ZodUndefined, z.ZodUndefined, z.ZodUndefined, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
44
+ actionType: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ actionType: string;
47
+ }, {
48
+ actionType: string;
49
+ }>, z.ZodUndefined, z.ZodObject<{
50
+ finalStatus: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ finalStatus: string;
53
+ }, {
54
+ finalStatus: string;
55
+ }>, z.ZodObject<{
56
+ finalReason: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ finalReason: string;
59
+ }, {
60
+ finalReason: string;
61
+ }>>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
62
+ actionType: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ actionType: string;
65
+ }, {
66
+ actionType: string;
67
+ }>, z.ZodUndefined, z.ZodObject<{
68
+ prelimStatus: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ prelimStatus: string;
71
+ }, {
72
+ prelimStatus: string;
73
+ }>, z.ZodObject<{
74
+ prelimReason: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ prelimReason: string;
77
+ }, {
78
+ prelimReason: string;
79
+ }>>, import("../lib/types").CommitLifecycleFunction<z.ZodUndefined, z.ZodUndefined, z.ZodUndefined>>;
80
+ ipfsCid: "02u3kjwdsnfs2890hf";
81
+ abilityParameterMappings: Partial<{
82
+ action: "actionType";
83
+ target: "actionType";
84
+ amount: "actionType";
85
+ }>;
86
+ vincentAbilityApiVersion: string;
87
+ __schemaTypes: {
88
+ policyAbilityParamsSchema: z.ZodObject<{
89
+ actionType: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ actionType: string;
92
+ }, {
93
+ actionType: string;
94
+ }>;
95
+ userParamsSchema: z.ZodUndefined;
96
+ evalAllowResultSchema: z.ZodObject<{
97
+ finalStatus: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ finalStatus: string;
100
+ }, {
101
+ finalStatus: string;
102
+ }>;
103
+ evalDenyResultSchema: z.ZodObject<{
104
+ finalReason: z.ZodString;
105
+ }, "strip", z.ZodTypeAny, {
106
+ finalReason: string;
107
+ }, {
108
+ finalReason: string;
109
+ }>;
110
+ precheckAllowResultSchema: z.ZodObject<{
111
+ prelimStatus: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ prelimStatus: string;
114
+ }, {
115
+ prelimStatus: string;
116
+ }>;
117
+ precheckDenyResultSchema: z.ZodObject<{
118
+ prelimReason: z.ZodString;
119
+ }, "strip", z.ZodTypeAny, {
120
+ prelimReason: string;
121
+ }, {
122
+ prelimReason: string;
123
+ }>;
124
+ commitParamsSchema: z.ZodUndefined;
125
+ commitAllowResultSchema: z.ZodUndefined;
126
+ commitDenyResultSchema: z.ZodUndefined;
127
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
128
+ actionType: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ actionType: string;
131
+ }, {
132
+ actionType: string;
133
+ }>, z.ZodUndefined, z.ZodObject<{
134
+ finalStatus: z.ZodString;
135
+ }, "strip", z.ZodTypeAny, {
136
+ finalStatus: string;
137
+ }, {
138
+ finalStatus: string;
139
+ }>, z.ZodObject<{
140
+ finalReason: z.ZodString;
141
+ }, "strip", z.ZodTypeAny, {
142
+ finalReason: string;
143
+ }, {
144
+ finalReason: string;
145
+ }>>;
146
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
147
+ actionType: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ actionType: string;
150
+ }, {
151
+ actionType: string;
152
+ }>, z.ZodUndefined, z.ZodObject<{
153
+ prelimStatus: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ prelimStatus: string;
156
+ }, {
157
+ prelimStatus: string;
158
+ }>, z.ZodObject<{
159
+ prelimReason: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ prelimReason: string;
162
+ }, {
163
+ prelimReason: string;
164
+ }>> | undefined;
165
+ commit: import("../lib/types").CommitLifecycleFunction<z.ZodUndefined, z.ZodUndefined, z.ZodUndefined> | undefined;
166
+ };
167
+ };
168
+ /**
169
+ * Test Case 2: Verify different schemas between evaluate and commit
170
+ */
171
+ declare function testEvaluateCommitContextSwitching(): {
172
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/test-policy@1.23.1", z.ZodObject<{
173
+ actionType: z.ZodString;
174
+ }, "strip", z.ZodTypeAny, {
175
+ actionType: string;
176
+ }, {
177
+ actionType: string;
178
+ }>, z.ZodUndefined, z.ZodUndefined, z.ZodUndefined, z.ZodObject<{
179
+ approvalId: z.ZodString;
180
+ }, "strip", z.ZodTypeAny, {
181
+ approvalId: string;
182
+ }, {
183
+ approvalId: string;
184
+ }>, z.ZodObject<{
185
+ rejectionReason: z.ZodString;
186
+ }, "strip", z.ZodTypeAny, {
187
+ rejectionReason: string;
188
+ }, {
189
+ rejectionReason: string;
190
+ }>, z.ZodObject<{
191
+ confirmationId: z.ZodString;
192
+ }, "strip", z.ZodTypeAny, {
193
+ confirmationId: string;
194
+ }, {
195
+ confirmationId: string;
196
+ }>, z.ZodObject<{
197
+ transactionHash: z.ZodString;
198
+ }, "strip", z.ZodTypeAny, {
199
+ transactionHash: string;
200
+ }, {
201
+ transactionHash: string;
202
+ }>, z.ZodObject<{
203
+ failureCode: z.ZodNumber;
204
+ }, "strip", z.ZodTypeAny, {
205
+ failureCode: number;
206
+ }, {
207
+ failureCode: number;
208
+ }>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
209
+ actionType: z.ZodString;
210
+ }, "strip", z.ZodTypeAny, {
211
+ actionType: string;
212
+ }, {
213
+ actionType: string;
214
+ }>, z.ZodUndefined, z.ZodObject<{
215
+ approvalId: z.ZodString;
216
+ }, "strip", z.ZodTypeAny, {
217
+ approvalId: string;
218
+ }, {
219
+ approvalId: string;
220
+ }>, z.ZodObject<{
221
+ rejectionReason: z.ZodString;
222
+ }, "strip", z.ZodTypeAny, {
223
+ rejectionReason: string;
224
+ }, {
225
+ rejectionReason: string;
226
+ }>>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
227
+ actionType: z.ZodString;
228
+ }, "strip", z.ZodTypeAny, {
229
+ actionType: string;
230
+ }, {
231
+ actionType: string;
232
+ }>, z.ZodUndefined, z.ZodUndefined, z.ZodUndefined>, import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
233
+ confirmationId: z.ZodString;
234
+ }, "strip", z.ZodTypeAny, {
235
+ confirmationId: string;
236
+ }, {
237
+ confirmationId: string;
238
+ }>, z.ZodObject<{
239
+ transactionHash: z.ZodString;
240
+ }, "strip", z.ZodTypeAny, {
241
+ transactionHash: string;
242
+ }, {
243
+ transactionHash: string;
244
+ }>, z.ZodObject<{
245
+ failureCode: z.ZodNumber;
246
+ }, "strip", z.ZodTypeAny, {
247
+ failureCode: number;
248
+ }, {
249
+ failureCode: number;
250
+ }>>>;
251
+ ipfsCid: "048oifjnwfoij3208h";
252
+ abilityParameterMappings: Partial<{
253
+ action: "actionType";
254
+ target: "actionType";
255
+ amount: "actionType";
256
+ }>;
257
+ vincentAbilityApiVersion: string;
258
+ __schemaTypes: {
259
+ policyAbilityParamsSchema: z.ZodObject<{
260
+ actionType: z.ZodString;
261
+ }, "strip", z.ZodTypeAny, {
262
+ actionType: string;
263
+ }, {
264
+ actionType: string;
265
+ }>;
266
+ userParamsSchema: z.ZodUndefined;
267
+ evalAllowResultSchema: z.ZodObject<{
268
+ approvalId: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ approvalId: string;
271
+ }, {
272
+ approvalId: string;
273
+ }>;
274
+ evalDenyResultSchema: z.ZodObject<{
275
+ rejectionReason: z.ZodString;
276
+ }, "strip", z.ZodTypeAny, {
277
+ rejectionReason: string;
278
+ }, {
279
+ rejectionReason: string;
280
+ }>;
281
+ precheckAllowResultSchema: z.ZodUndefined;
282
+ precheckDenyResultSchema: z.ZodUndefined;
283
+ commitParamsSchema: z.ZodObject<{
284
+ confirmationId: z.ZodString;
285
+ }, "strip", z.ZodTypeAny, {
286
+ confirmationId: string;
287
+ }, {
288
+ confirmationId: string;
289
+ }>;
290
+ commitAllowResultSchema: z.ZodObject<{
291
+ transactionHash: z.ZodString;
292
+ }, "strip", z.ZodTypeAny, {
293
+ transactionHash: string;
294
+ }, {
295
+ transactionHash: string;
296
+ }>;
297
+ commitDenyResultSchema: z.ZodObject<{
298
+ failureCode: z.ZodNumber;
299
+ }, "strip", z.ZodTypeAny, {
300
+ failureCode: number;
301
+ }, {
302
+ failureCode: number;
303
+ }>;
304
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
305
+ actionType: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ actionType: string;
308
+ }, {
309
+ actionType: string;
310
+ }>, z.ZodUndefined, z.ZodObject<{
311
+ approvalId: z.ZodString;
312
+ }, "strip", z.ZodTypeAny, {
313
+ approvalId: string;
314
+ }, {
315
+ approvalId: string;
316
+ }>, z.ZodObject<{
317
+ rejectionReason: z.ZodString;
318
+ }, "strip", z.ZodTypeAny, {
319
+ rejectionReason: string;
320
+ }, {
321
+ rejectionReason: string;
322
+ }>>;
323
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
324
+ actionType: z.ZodString;
325
+ }, "strip", z.ZodTypeAny, {
326
+ actionType: string;
327
+ }, {
328
+ actionType: string;
329
+ }>, z.ZodUndefined, z.ZodUndefined, z.ZodUndefined> | undefined;
330
+ commit: import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
331
+ confirmationId: z.ZodString;
332
+ }, "strip", z.ZodTypeAny, {
333
+ confirmationId: string;
334
+ }, {
335
+ confirmationId: string;
336
+ }>, z.ZodObject<{
337
+ transactionHash: z.ZodString;
338
+ }, "strip", z.ZodTypeAny, {
339
+ transactionHash: string;
340
+ }, {
341
+ transactionHash: string;
342
+ }>, z.ZodObject<{
343
+ failureCode: z.ZodNumber;
344
+ }, "strip", z.ZodTypeAny, {
345
+ failureCode: number;
346
+ }, {
347
+ failureCode: number;
348
+ }>> | undefined;
349
+ };
350
+ };
351
+ /**
352
+ * Test Case 3: Full policy with all three contexts having different schemas
353
+ */
354
+ declare function testFullPolicyContextSwitching(): {
355
+ vincentPolicy: import("../internal").VincentPolicy<"@lit-protocol/testpolicyawesome@12.1.10", z.ZodObject<{
356
+ actionType: z.ZodString;
357
+ amount: z.ZodNumber;
358
+ }, "strip", z.ZodTypeAny, {
359
+ amount: number;
360
+ actionType: string;
361
+ }, {
362
+ amount: number;
363
+ actionType: string;
364
+ }>, z.ZodObject<{
365
+ limit: z.ZodNumber;
366
+ }, "strip", z.ZodTypeAny, {
367
+ limit: number;
368
+ }, {
369
+ limit: number;
370
+ }>, z.ZodObject<{
371
+ check: z.ZodBoolean;
372
+ }, "strip", z.ZodTypeAny, {
373
+ check: boolean;
374
+ }, {
375
+ check: boolean;
376
+ }>, z.ZodObject<{
377
+ checkFailed: z.ZodBoolean;
378
+ }, "strip", z.ZodTypeAny, {
379
+ checkFailed: boolean;
380
+ }, {
381
+ checkFailed: boolean;
382
+ }>, z.ZodObject<{
383
+ granted: z.ZodBoolean;
384
+ }, "strip", z.ZodTypeAny, {
385
+ granted: boolean;
386
+ }, {
387
+ granted: boolean;
388
+ }>, z.ZodObject<{
389
+ denied: z.ZodBoolean;
390
+ }, "strip", z.ZodTypeAny, {
391
+ denied: boolean;
392
+ }, {
393
+ denied: boolean;
394
+ }>, z.ZodObject<{
395
+ txId: z.ZodString;
396
+ }, "strip", z.ZodTypeAny, {
397
+ txId: string;
398
+ }, {
399
+ txId: string;
400
+ }>, z.ZodObject<{
401
+ completed: z.ZodBoolean;
402
+ }, "strip", z.ZodTypeAny, {
403
+ completed: boolean;
404
+ }, {
405
+ completed: boolean;
406
+ }>, z.ZodObject<{
407
+ aborted: z.ZodBoolean;
408
+ }, "strip", z.ZodTypeAny, {
409
+ aborted: boolean;
410
+ }, {
411
+ aborted: boolean;
412
+ }>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
413
+ actionType: z.ZodString;
414
+ amount: z.ZodNumber;
415
+ }, "strip", z.ZodTypeAny, {
416
+ amount: number;
417
+ actionType: string;
418
+ }, {
419
+ amount: number;
420
+ actionType: string;
421
+ }>, z.ZodObject<{
422
+ limit: z.ZodNumber;
423
+ }, "strip", z.ZodTypeAny, {
424
+ limit: number;
425
+ }, {
426
+ limit: number;
427
+ }>, z.ZodObject<{
428
+ granted: z.ZodBoolean;
429
+ }, "strip", z.ZodTypeAny, {
430
+ granted: boolean;
431
+ }, {
432
+ granted: boolean;
433
+ }>, z.ZodObject<{
434
+ denied: z.ZodBoolean;
435
+ }, "strip", z.ZodTypeAny, {
436
+ denied: boolean;
437
+ }, {
438
+ denied: boolean;
439
+ }>>, import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
440
+ actionType: z.ZodString;
441
+ amount: z.ZodNumber;
442
+ }, "strip", z.ZodTypeAny, {
443
+ amount: number;
444
+ actionType: string;
445
+ }, {
446
+ amount: number;
447
+ actionType: string;
448
+ }>, z.ZodObject<{
449
+ limit: z.ZodNumber;
450
+ }, "strip", z.ZodTypeAny, {
451
+ limit: number;
452
+ }, {
453
+ limit: number;
454
+ }>, z.ZodObject<{
455
+ check: z.ZodBoolean;
456
+ }, "strip", z.ZodTypeAny, {
457
+ check: boolean;
458
+ }, {
459
+ check: boolean;
460
+ }>, z.ZodObject<{
461
+ checkFailed: z.ZodBoolean;
462
+ }, "strip", z.ZodTypeAny, {
463
+ checkFailed: boolean;
464
+ }, {
465
+ checkFailed: boolean;
466
+ }>>, import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
467
+ txId: z.ZodString;
468
+ }, "strip", z.ZodTypeAny, {
469
+ txId: string;
470
+ }, {
471
+ txId: string;
472
+ }>, z.ZodObject<{
473
+ completed: z.ZodBoolean;
474
+ }, "strip", z.ZodTypeAny, {
475
+ completed: boolean;
476
+ }, {
477
+ completed: boolean;
478
+ }>, z.ZodObject<{
479
+ aborted: z.ZodBoolean;
480
+ }, "strip", z.ZodTypeAny, {
481
+ aborted: boolean;
482
+ }, {
483
+ aborted: boolean;
484
+ }>>>;
485
+ ipfsCid: "908joiun2f928q1hjbfn";
486
+ abilityParameterMappings: Partial<{
487
+ action: "amount" | "actionType";
488
+ target: "amount" | "actionType";
489
+ amount: "amount" | "actionType";
490
+ }>;
491
+ vincentAbilityApiVersion: string;
492
+ __schemaTypes: {
493
+ policyAbilityParamsSchema: z.ZodObject<{
494
+ actionType: z.ZodString;
495
+ amount: z.ZodNumber;
496
+ }, "strip", z.ZodTypeAny, {
497
+ amount: number;
498
+ actionType: string;
499
+ }, {
500
+ amount: number;
501
+ actionType: string;
502
+ }>;
503
+ userParamsSchema: z.ZodObject<{
504
+ limit: z.ZodNumber;
505
+ }, "strip", z.ZodTypeAny, {
506
+ limit: number;
507
+ }, {
508
+ limit: number;
509
+ }>;
510
+ evalAllowResultSchema: z.ZodObject<{
511
+ granted: z.ZodBoolean;
512
+ }, "strip", z.ZodTypeAny, {
513
+ granted: boolean;
514
+ }, {
515
+ granted: boolean;
516
+ }>;
517
+ evalDenyResultSchema: z.ZodObject<{
518
+ denied: z.ZodBoolean;
519
+ }, "strip", z.ZodTypeAny, {
520
+ denied: boolean;
521
+ }, {
522
+ denied: boolean;
523
+ }>;
524
+ precheckAllowResultSchema: z.ZodObject<{
525
+ check: z.ZodBoolean;
526
+ }, "strip", z.ZodTypeAny, {
527
+ check: boolean;
528
+ }, {
529
+ check: boolean;
530
+ }>;
531
+ precheckDenyResultSchema: z.ZodObject<{
532
+ checkFailed: z.ZodBoolean;
533
+ }, "strip", z.ZodTypeAny, {
534
+ checkFailed: boolean;
535
+ }, {
536
+ checkFailed: boolean;
537
+ }>;
538
+ commitParamsSchema: z.ZodObject<{
539
+ txId: z.ZodString;
540
+ }, "strip", z.ZodTypeAny, {
541
+ txId: string;
542
+ }, {
543
+ txId: string;
544
+ }>;
545
+ commitAllowResultSchema: z.ZodObject<{
546
+ completed: z.ZodBoolean;
547
+ }, "strip", z.ZodTypeAny, {
548
+ completed: boolean;
549
+ }, {
550
+ completed: boolean;
551
+ }>;
552
+ commitDenyResultSchema: z.ZodObject<{
553
+ aborted: z.ZodBoolean;
554
+ }, "strip", z.ZodTypeAny, {
555
+ aborted: boolean;
556
+ }, {
557
+ aborted: boolean;
558
+ }>;
559
+ evaluate: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
560
+ actionType: z.ZodString;
561
+ amount: z.ZodNumber;
562
+ }, "strip", z.ZodTypeAny, {
563
+ amount: number;
564
+ actionType: string;
565
+ }, {
566
+ amount: number;
567
+ actionType: string;
568
+ }>, z.ZodObject<{
569
+ limit: z.ZodNumber;
570
+ }, "strip", z.ZodTypeAny, {
571
+ limit: number;
572
+ }, {
573
+ limit: number;
574
+ }>, z.ZodObject<{
575
+ granted: z.ZodBoolean;
576
+ }, "strip", z.ZodTypeAny, {
577
+ granted: boolean;
578
+ }, {
579
+ granted: boolean;
580
+ }>, z.ZodObject<{
581
+ denied: z.ZodBoolean;
582
+ }, "strip", z.ZodTypeAny, {
583
+ denied: boolean;
584
+ }, {
585
+ denied: boolean;
586
+ }>>;
587
+ precheck: import("../lib/types").PolicyLifecycleFunction<z.ZodObject<{
588
+ actionType: z.ZodString;
589
+ amount: z.ZodNumber;
590
+ }, "strip", z.ZodTypeAny, {
591
+ amount: number;
592
+ actionType: string;
593
+ }, {
594
+ amount: number;
595
+ actionType: string;
596
+ }>, z.ZodObject<{
597
+ limit: z.ZodNumber;
598
+ }, "strip", z.ZodTypeAny, {
599
+ limit: number;
600
+ }, {
601
+ limit: number;
602
+ }>, z.ZodObject<{
603
+ check: z.ZodBoolean;
604
+ }, "strip", z.ZodTypeAny, {
605
+ check: boolean;
606
+ }, {
607
+ check: boolean;
608
+ }>, z.ZodObject<{
609
+ checkFailed: z.ZodBoolean;
610
+ }, "strip", z.ZodTypeAny, {
611
+ checkFailed: boolean;
612
+ }, {
613
+ checkFailed: boolean;
614
+ }>> | undefined;
615
+ commit: import("../lib/types").CommitLifecycleFunction<z.ZodObject<{
616
+ txId: z.ZodString;
617
+ }, "strip", z.ZodTypeAny, {
618
+ txId: string;
619
+ }, {
620
+ txId: string;
621
+ }>, z.ZodObject<{
622
+ completed: z.ZodBoolean;
623
+ }, "strip", z.ZodTypeAny, {
624
+ completed: boolean;
625
+ }, {
626
+ completed: boolean;
627
+ }>, z.ZodObject<{
628
+ aborted: z.ZodBoolean;
629
+ }, "strip", z.ZodTypeAny, {
630
+ aborted: boolean;
631
+ }, {
632
+ aborted: boolean;
633
+ }>> | undefined;
634
+ };
635
+ };
636
+ export { testPrecheckEvaluateContextSwitching, testEvaluateCommitContextSwitching, testFullPolicyContextSwitching, };
637
+ //# sourceMappingURL=context-switching-tests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-switching-tests.d.ts","sourceRoot":"","sources":["../../../src/type-inference-verification/context-switching-tests.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;GAEG;AACH,iBAAS,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4D5C;AAED;;GAEG;AACH,iBAAS,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkE1C;AAED;;GAEG;AACH,iBAAS,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgHtC;AAGD,OAAO,EACL,oCAAoC,EACpC,kCAAkC,EAClC,8BAA8B,GAC/B,CAAC"}