@intentius/chant-lexicon-cedar 0.44.8

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 (265) hide show
  1. package/README.md +190 -0
  2. package/dist/avp/ambient.d.ts +54 -0
  3. package/dist/avp/ambient.d.ts.map +1 -0
  4. package/dist/avp/client.d.ts +127 -0
  5. package/dist/avp/client.d.ts.map +1 -0
  6. package/dist/avp/describe-resources.d.ts +42 -0
  7. package/dist/avp/describe-resources.d.ts.map +1 -0
  8. package/dist/avp/embed.d.ts +120 -0
  9. package/dist/avp/embed.d.ts.map +1 -0
  10. package/dist/avp/live-export.d.ts +94 -0
  11. package/dist/avp/live-export.d.ts.map +1 -0
  12. package/dist/avp/ownership.d.ts +97 -0
  13. package/dist/avp/ownership.d.ts.map +1 -0
  14. package/dist/avp/statement.d.ts +22 -0
  15. package/dist/avp/statement.d.ts.map +1 -0
  16. package/dist/avp/store.d.ts +82 -0
  17. package/dist/avp/store.d.ts.map +1 -0
  18. package/dist/avp/testdata/mock-transport.d.ts +55 -0
  19. package/dist/avp/testdata/mock-transport.d.ts.map +1 -0
  20. package/dist/codegen/docs-cli.d.ts +3 -0
  21. package/dist/codegen/docs-cli.d.ts.map +1 -0
  22. package/dist/codegen/docs.d.ts +26 -0
  23. package/dist/codegen/docs.d.ts.map +1 -0
  24. package/dist/codegen/emit.d.ts +85 -0
  25. package/dist/codegen/emit.d.ts.map +1 -0
  26. package/dist/codegen/generate-cli.d.ts +3 -0
  27. package/dist/codegen/generate-cli.d.ts.map +1 -0
  28. package/dist/codegen/generate.d.ts +37 -0
  29. package/dist/codegen/generate.d.ts.map +1 -0
  30. package/dist/codegen/naming.d.ts +48 -0
  31. package/dist/codegen/naming.d.ts.map +1 -0
  32. package/dist/codegen/package.d.ts +10 -0
  33. package/dist/codegen/package.d.ts.map +1 -0
  34. package/dist/composites/deny-by-default-set.d.ts +58 -0
  35. package/dist/composites/deny-by-default-set.d.ts.map +1 -0
  36. package/dist/composites/index.d.ts +12 -0
  37. package/dist/composites/index.d.ts.map +1 -0
  38. package/dist/composites/owner-can-manage.d.ts +48 -0
  39. package/dist/composites/owner-can-manage.d.ts.map +1 -0
  40. package/dist/config.d.ts +102 -0
  41. package/dist/config.d.ts.map +1 -0
  42. package/dist/coverage.d.ts +59 -0
  43. package/dist/coverage.d.ts.map +1 -0
  44. package/dist/detect.d.ts +18 -0
  45. package/dist/detect.d.ts.map +1 -0
  46. package/dist/generated/index.d.ts +251 -0
  47. package/dist/generated/index.d.ts.map +1 -0
  48. package/dist/generated/runtime.d.ts +2 -0
  49. package/dist/generated/runtime.d.ts.map +1 -0
  50. package/dist/import/adapter.d.ts +21 -0
  51. package/dist/import/adapter.d.ts.map +1 -0
  52. package/dist/import/clause-text.d.ts +38 -0
  53. package/dist/import/clause-text.d.ts.map +1 -0
  54. package/dist/import/generator.d.ts +53 -0
  55. package/dist/import/generator.d.ts.map +1 -0
  56. package/dist/import/parser.d.ts +57 -0
  57. package/dist/import/parser.d.ts.map +1 -0
  58. package/dist/index.d.ts +34 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/init-templates.d.ts +32 -0
  61. package/dist/init-templates.d.ts.map +1 -0
  62. package/dist/integrity.json +22 -0
  63. package/dist/lint/audit-catalog.d.ts +29 -0
  64. package/dist/lint/audit-catalog.d.ts.map +1 -0
  65. package/dist/lint/post-synth/cedar-helpers.d.ts +97 -0
  66. package/dist/lint/post-synth/cedar-helpers.d.ts.map +1 -0
  67. package/dist/lint/post-synth/cedc010.d.ts +17 -0
  68. package/dist/lint/post-synth/cedc010.d.ts.map +1 -0
  69. package/dist/lint/post-synth/cedc011.d.ts +17 -0
  70. package/dist/lint/post-synth/cedc011.d.ts.map +1 -0
  71. package/dist/lint/post-synth/cedc012.d.ts +21 -0
  72. package/dist/lint/post-synth/cedc012.d.ts.map +1 -0
  73. package/dist/lint/post-synth/cedc013.d.ts +20 -0
  74. package/dist/lint/post-synth/cedc013.d.ts.map +1 -0
  75. package/dist/lint/post-synth/cedc014.d.ts +19 -0
  76. package/dist/lint/post-synth/cedc014.d.ts.map +1 -0
  77. package/dist/lint/post-synth/cede010.d.ts +34 -0
  78. package/dist/lint/post-synth/cede010.d.ts.map +1 -0
  79. package/dist/lint/post-synth/cede011.d.ts +22 -0
  80. package/dist/lint/post-synth/cede011.d.ts.map +1 -0
  81. package/dist/lint/post-synth/ceds010.d.ts +24 -0
  82. package/dist/lint/post-synth/ceds010.d.ts.map +1 -0
  83. package/dist/lint/post-synth/ceds011.d.ts +19 -0
  84. package/dist/lint/post-synth/ceds011.d.ts.map +1 -0
  85. package/dist/lint/post-synth/ceds012.d.ts +17 -0
  86. package/dist/lint/post-synth/ceds012.d.ts.map +1 -0
  87. package/dist/lint/post-synth/index.d.ts +3 -0
  88. package/dist/lint/post-synth/index.d.ts.map +1 -0
  89. package/dist/lint/post-synth/wasm-helpers.d.ts +108 -0
  90. package/dist/lint/post-synth/wasm-helpers.d.ts.map +1 -0
  91. package/dist/lint/rules/index.d.ts +10 -0
  92. package/dist/lint/rules/index.d.ts.map +1 -0
  93. package/dist/lint/rules/policy-shape.d.ts +31 -0
  94. package/dist/lint/rules/policy-shape.d.ts.map +1 -0
  95. package/dist/lsp/completions.d.ts +24 -0
  96. package/dist/lsp/completions.d.ts.map +1 -0
  97. package/dist/lsp/hover.d.ts +11 -0
  98. package/dist/lsp/hover.d.ts.map +1 -0
  99. package/dist/lsp/registry.d.ts +45 -0
  100. package/dist/lsp/registry.d.ts.map +1 -0
  101. package/dist/manifest.json +8 -0
  102. package/dist/mcp/index.d.ts +34 -0
  103. package/dist/mcp/index.d.ts.map +1 -0
  104. package/dist/mcp/policy-coverage.d.ts +81 -0
  105. package/dist/mcp/policy-coverage.d.ts.map +1 -0
  106. package/dist/meta.json +699 -0
  107. package/dist/okf/index.md +37 -0
  108. package/dist/okf/rules/CEDC001.md +11 -0
  109. package/dist/okf/rules/CEDC010.md +11 -0
  110. package/dist/okf/rules/CEDC011.md +15 -0
  111. package/dist/okf/rules/CEDC012.md +11 -0
  112. package/dist/okf/rules/CEDC013.md +15 -0
  113. package/dist/okf/rules/CEDC014.md +15 -0
  114. package/dist/okf/rules/CEDE010.md +15 -0
  115. package/dist/okf/rules/CEDE011.md +15 -0
  116. package/dist/okf/rules/CEDS010.md +15 -0
  117. package/dist/okf/rules/CEDS011.md +11 -0
  118. package/dist/okf/rules/CEDS012.md +15 -0
  119. package/dist/okf/types/AdminAction.md +14 -0
  120. package/dist/okf/types/Application.md +14 -0
  121. package/dist/okf/types/ApproveAction.md +13 -0
  122. package/dist/okf/types/CommentAction.md +14 -0
  123. package/dist/okf/types/CreateAction.md +14 -0
  124. package/dist/okf/types/DeleteAction.md +14 -0
  125. package/dist/okf/types/Document.md +18 -0
  126. package/dist/okf/types/Folder.md +15 -0
  127. package/dist/okf/types/Group.md +14 -0
  128. package/dist/okf/types/ListAction.md +14 -0
  129. package/dist/okf/types/Policy.md +29 -0
  130. package/dist/okf/types/ReadAction.md +14 -0
  131. package/dist/okf/types/ServiceAccount.md +15 -0
  132. package/dist/okf/types/ShareAction.md +14 -0
  133. package/dist/okf/types/Team.md +14 -0
  134. package/dist/okf/types/User.md +18 -0
  135. package/dist/okf/types/WriteAction.md +14 -0
  136. package/dist/package-cli.d.ts +3 -0
  137. package/dist/package-cli.d.ts.map +1 -0
  138. package/dist/plugin.d.ts +8 -0
  139. package/dist/plugin.d.ts.map +1 -0
  140. package/dist/rules/cedar-helpers.ts +209 -0
  141. package/dist/rules/cedc010.ts +80 -0
  142. package/dist/rules/cedc011.ts +47 -0
  143. package/dist/rules/cedc012.ts +64 -0
  144. package/dist/rules/cedc013.ts +68 -0
  145. package/dist/rules/cedc014.ts +73 -0
  146. package/dist/rules/cede010.ts +89 -0
  147. package/dist/rules/cede011.ts +58 -0
  148. package/dist/rules/ceds010.ts +57 -0
  149. package/dist/rules/ceds011.ts +42 -0
  150. package/dist/rules/ceds012.ts +50 -0
  151. package/dist/rules/policy-shape.ts +148 -0
  152. package/dist/rules/wasm-helpers.ts +315 -0
  153. package/dist/serializer.d.ts +138 -0
  154. package/dist/serializer.d.ts.map +1 -0
  155. package/dist/spec/fetch.d.ts +71 -0
  156. package/dist/spec/fetch.d.ts.map +1 -0
  157. package/dist/spec/parse.d.ts +113 -0
  158. package/dist/spec/parse.d.ts.map +1 -0
  159. package/dist/spec/pin.d.ts +116 -0
  160. package/dist/spec/pin.d.ts.map +1 -0
  161. package/dist/spec/pinned-names.json +18 -0
  162. package/dist/spec/wasm.d.ts +143 -0
  163. package/dist/spec/wasm.d.ts.map +1 -0
  164. package/dist/types/index.d.ts +219 -0
  165. package/dist/validate-cli.d.ts +3 -0
  166. package/dist/validate-cli.d.ts.map +1 -0
  167. package/dist/validate.d.ts +25 -0
  168. package/dist/validate.d.ts.map +1 -0
  169. package/package.json +75 -0
  170. package/src/avp/OWNERSHIP.md +125 -0
  171. package/src/avp/ambient.test.ts +113 -0
  172. package/src/avp/ambient.ts +124 -0
  173. package/src/avp/client.ts +310 -0
  174. package/src/avp/describe-resources.test.ts +316 -0
  175. package/src/avp/describe-resources.ts +215 -0
  176. package/src/avp/embed.test.ts +114 -0
  177. package/src/avp/embed.ts +190 -0
  178. package/src/avp/live-export.test.ts +232 -0
  179. package/src/avp/live-export.ts +185 -0
  180. package/src/avp/ownership.test.ts +101 -0
  181. package/src/avp/ownership.ts +170 -0
  182. package/src/avp/statement.ts +50 -0
  183. package/src/avp/store.ts +152 -0
  184. package/src/avp/testdata/mock-transport.ts +147 -0
  185. package/src/codegen/docs-cli.ts +7 -0
  186. package/src/codegen/docs.ts +873 -0
  187. package/src/codegen/emit.ts +496 -0
  188. package/src/codegen/generate-cli.ts +18 -0
  189. package/src/codegen/generate.test.ts +128 -0
  190. package/src/codegen/generate.ts +123 -0
  191. package/src/codegen/naming.ts +101 -0
  192. package/src/codegen/package.ts +52 -0
  193. package/src/composites/composites.test.ts +206 -0
  194. package/src/composites/deny-by-default-set.ts +98 -0
  195. package/src/composites/index.ts +13 -0
  196. package/src/composites/owner-can-manage.ts +80 -0
  197. package/src/config-namespace.test.ts +44 -0
  198. package/src/config.test.ts +82 -0
  199. package/src/config.ts +119 -0
  200. package/src/coverage.test.ts +61 -0
  201. package/src/coverage.ts +166 -0
  202. package/src/detect.test.ts +64 -0
  203. package/src/detect.ts +59 -0
  204. package/src/generated/index.d.ts +219 -0
  205. package/src/generated/index.ts +279 -0
  206. package/src/generated/lexicon-cedar.json +699 -0
  207. package/src/generated/runtime.ts +2 -0
  208. package/src/import/adapter.ts +63 -0
  209. package/src/import/clause-text.ts +178 -0
  210. package/src/import/generator.test.ts +133 -0
  211. package/src/import/generator.ts +219 -0
  212. package/src/import/parser.test.ts +265 -0
  213. package/src/import/parser.ts +352 -0
  214. package/src/import/roundtrip.test.ts +127 -0
  215. package/src/import/testdata/full.cedar +36 -0
  216. package/src/import/testdata/full.cedar.json +238 -0
  217. package/src/import/testdata/realistic.cedar +35 -0
  218. package/src/import/testdata/simple.cedar +6 -0
  219. package/src/index.ts +94 -0
  220. package/src/init-templates.test.ts +158 -0
  221. package/src/init-templates.ts +358 -0
  222. package/src/lint/audit-catalog.ts +130 -0
  223. package/src/lint/post-synth/cedar-helpers.ts +209 -0
  224. package/src/lint/post-synth/cedc010.ts +80 -0
  225. package/src/lint/post-synth/cedc011.ts +47 -0
  226. package/src/lint/post-synth/cedc012.ts +64 -0
  227. package/src/lint/post-synth/cedc013.ts +68 -0
  228. package/src/lint/post-synth/cedc014.ts +73 -0
  229. package/src/lint/post-synth/cede010.ts +89 -0
  230. package/src/lint/post-synth/cede011.ts +58 -0
  231. package/src/lint/post-synth/ceds010.ts +57 -0
  232. package/src/lint/post-synth/ceds011.ts +42 -0
  233. package/src/lint/post-synth/ceds012.ts +50 -0
  234. package/src/lint/post-synth/index.ts +25 -0
  235. package/src/lint/post-synth/post-synth.test.ts +474 -0
  236. package/src/lint/post-synth/wasm-helpers.ts +315 -0
  237. package/src/lint/rules/index.ts +12 -0
  238. package/src/lint/rules/policy-shape.test.ts +90 -0
  239. package/src/lint/rules/policy-shape.ts +148 -0
  240. package/src/lsp/completions.test.ts +111 -0
  241. package/src/lsp/completions.ts +55 -0
  242. package/src/lsp/hover.test.ts +82 -0
  243. package/src/lsp/hover.ts +75 -0
  244. package/src/lsp/registry.ts +74 -0
  245. package/src/mcp/index.ts +103 -0
  246. package/src/mcp/policy-coverage.test.ts +176 -0
  247. package/src/mcp/policy-coverage.ts +205 -0
  248. package/src/package-cli.ts +22 -0
  249. package/src/plugin.test.ts +115 -0
  250. package/src/plugin.ts +312 -0
  251. package/src/serializer.test.ts +502 -0
  252. package/src/serializer.ts +335 -0
  253. package/src/skills/chant-cedar-authoring.md +180 -0
  254. package/src/skills/chant-cedar-avp-embedding.md +125 -0
  255. package/src/skills/chant-cedar-meta-policy.md +119 -0
  256. package/src/spec/default-schema.cedarschema +108 -0
  257. package/src/spec/fetch.ts +107 -0
  258. package/src/spec/parse.test.ts +123 -0
  259. package/src/spec/parse.ts +253 -0
  260. package/src/spec/pin.test.ts +88 -0
  261. package/src/spec/pin.ts +243 -0
  262. package/src/spec/pinned-names.json +18 -0
  263. package/src/spec/wasm.ts +283 -0
  264. package/src/validate-cli.ts +8 -0
  265. package/src/validate.ts +85 -0
@@ -0,0 +1,219 @@
1
+ // Code generated by chant generate. DO NOT EDIT.
2
+ import type { Declarable } from "@intentius/chant/declarable";
3
+
4
+ /**
5
+ * Entity UID of `App::Application`.
6
+ */
7
+ export type ApplicationUid = `App::Application::"${string}"`;
8
+
9
+ export interface ApplicationAttributesProps {
10
+ name: string;
11
+ owner: TeamUid;
12
+ }
13
+
14
+ /**
15
+ * Entity UID of `App::Document`.
16
+ * Member of: App::Folder.
17
+ */
18
+ export type DocumentUid = `App::Document::"${string}"`;
19
+
20
+ export interface DocumentAttributesProps {
21
+ classification: string;
22
+ folder: FolderUid;
23
+ owner: UserUid;
24
+ public: boolean;
25
+ tags: string[];
26
+ title: string;
27
+ }
28
+
29
+ /**
30
+ * Entity UID of `App::Folder`.
31
+ */
32
+ export type FolderUid = `App::Folder::"${string}"`;
33
+
34
+ export interface FolderAttributesProps {
35
+ name: string;
36
+ owner: UserUid;
37
+ tags: string[];
38
+ }
39
+
40
+ /**
41
+ * Entity UID of `App::Group`.
42
+ */
43
+ export type GroupUid = `App::Group::"${string}"`;
44
+
45
+ export interface GroupAttributesProps {
46
+ description?: string;
47
+ name: string;
48
+ }
49
+
50
+ /**
51
+ * Entity UID of `App::ServiceAccount`.
52
+ * Member of: App::Group.
53
+ */
54
+ export type ServiceAccountUid = `App::ServiceAccount::"${string}"`;
55
+
56
+ export interface ServiceAccountAttributesProps {
57
+ name: string;
58
+ owner: UserUid;
59
+ rotatedAt?: string;
60
+ }
61
+
62
+ /**
63
+ * Entity UID of `App::Team`.
64
+ * Member of: App::Group.
65
+ */
66
+ export type TeamUid = `App::Team::"${string}"`;
67
+
68
+ export interface TeamAttributesProps {
69
+ costCenter?: string;
70
+ name: string;
71
+ }
72
+
73
+ /**
74
+ * Entity UID of `App::User`.
75
+ * Member of: App::Group, App::Team.
76
+ */
77
+ export type UserUid = `App::User::"${string}"`;
78
+
79
+ export interface UserAttributesProps {
80
+ department: string;
81
+ email: string;
82
+ level: number;
83
+ manager?: UserUid;
84
+ mfaEnabled: boolean;
85
+ roles: string[];
86
+ }
87
+
88
+ export interface AdminContextProps {
89
+ breakGlass?: boolean;
90
+ mfa: boolean;
91
+ }
92
+
93
+ export interface ApproveContextProps {
94
+ mfa: boolean;
95
+ }
96
+
97
+ export interface CommentContextProps {
98
+ mfa: boolean;
99
+ reason?: string;
100
+ }
101
+
102
+ export interface CreateContextProps {
103
+ mfa: boolean;
104
+ reason?: string;
105
+ }
106
+
107
+ export interface DeleteContextProps {
108
+ approvedBy?: UserUid;
109
+ mfa: boolean;
110
+ }
111
+
112
+ export interface ListContextProps {
113
+ mfa: boolean;
114
+ sourceIp?: string;
115
+ }
116
+
117
+ export interface ReadContextProps {
118
+ mfa: boolean;
119
+ sourceIp?: string;
120
+ }
121
+
122
+ export interface ShareContextProps {
123
+ approvedBy?: UserUid;
124
+ mfa: boolean;
125
+ }
126
+
127
+ export interface WriteContextProps {
128
+ mfa: boolean;
129
+ reason?: string;
130
+ }
131
+
132
+ /** Every entity type name the schema declares, as Cedar writes it. */
133
+ export type EntityTypeName = "App::Application" | "App::Document" | "App::Folder" | "App::Group" | "App::ServiceAccount" | "App::Team" | "App::User";
134
+
135
+ /** Every entity UID the schema can produce. */
136
+ export type EntityUid = ApplicationUid | DocumentUid | FolderUid | GroupUid | ServiceAccountUid | TeamUid | UserUid;
137
+
138
+ /** Every action UID the schema declares. */
139
+ export type ActionUid = "App::Action::\"admin\"" | "App::Action::\"approve\"" | "App::Action::\"comment\"" | "App::Action::\"create\"" | "App::Action::\"delete\"" | "App::Action::\"list\"" | "App::Action::\"read\"" | "App::Action::\"share\"" | "App::Action::\"write\"";
140
+
141
+ /** Anything a policy scope may name. */
142
+ export type PolicyRef = EntityUid | ActionUid;
143
+
144
+ /** A Cedar policy either permits or forbids; there is no third effect. */
145
+ export type PolicyEffect = "permit" | "forbid";
146
+
147
+ /**
148
+ * One scope position (`principal`, `action`, `resource`).
149
+ *
150
+ * `{}` is the unconstrained form Cedar writes as a bare variable. The
151
+ * constrained forms mirror the grammar: `== E`, `in E`, `in [E, …]`,
152
+ * `is T`, and `is T in E`.
153
+ */
154
+ export type PolicyScope =
155
+ | Record<string, never>
156
+ | { eq: PolicyRef; in?: never; is?: never }
157
+ | { in: PolicyRef | PolicyRef[]; eq?: never; is?: never }
158
+ | { is: EntityTypeName; in?: PolicyRef | PolicyRef[]; eq?: never };
159
+
160
+ /**
161
+ * The props of a `Cedar::Policy`.
162
+ *
163
+ * `when`/`unless` carry Cedar expression text. They stay strings because
164
+ * Cedar's expression grammar is the policy language itself — typing it in
165
+ * TypeScript is import/reconcile's problem (epic #1645 sub-issue 6), not
166
+ * codegen's.
167
+ */
168
+ export interface PolicyProps {
169
+ /** Defaults to `permit` when omitted. */
170
+ effect?: PolicyEffect;
171
+ principal?: PolicyScope;
172
+ action?: PolicyScope;
173
+ resource?: PolicyScope;
174
+ /** Cedar expression strings, each emitted as its own `when { … }` clause. */
175
+ when?: string[];
176
+ /** Cedar expression strings, each emitted as its own `unless { … }` clause. */
177
+ unless?: string[];
178
+ /** Emitted as `@key("value")`; an explicit `id` wins over the logical name. */
179
+ annotations?: Record<string, string>;
180
+ }
181
+
182
+ export declare const Policy: new (props: PolicyProps) => Declarable;
183
+
184
+ export declare const Application: new (props: ApplicationAttributesProps) => Declarable;
185
+ export declare const ApplicationAttributes: new (props: ApplicationAttributesProps) => Declarable;
186
+ export declare const Document: new (props: DocumentAttributesProps) => Declarable;
187
+ export declare const DocumentAttributes: new (props: DocumentAttributesProps) => Declarable;
188
+ export declare const Folder: new (props: FolderAttributesProps) => Declarable;
189
+ export declare const FolderAttributes: new (props: FolderAttributesProps) => Declarable;
190
+ export declare const Group: new (props: GroupAttributesProps) => Declarable;
191
+ export declare const GroupAttributes: new (props: GroupAttributesProps) => Declarable;
192
+ export declare const ServiceAccount: new (props: ServiceAccountAttributesProps) => Declarable;
193
+ export declare const ServiceAccountAttributes: new (props: ServiceAccountAttributesProps) => Declarable;
194
+ export declare const Team: new (props: TeamAttributesProps) => Declarable;
195
+ export declare const TeamAttributes: new (props: TeamAttributesProps) => Declarable;
196
+ export declare const User: new (props: UserAttributesProps) => Declarable;
197
+ export declare const UserAttributes: new (props: UserAttributesProps) => Declarable;
198
+
199
+ export declare const AdminAction: "App::Action::\"admin\"";
200
+ export declare const AdminContext: new (props: AdminContextProps) => Declarable;
201
+ export declare const ApproveAction: "App::Action::\"approve\"";
202
+ export declare const ApproveContext: new (props: ApproveContextProps) => Declarable;
203
+ export declare const CommentAction: "App::Action::\"comment\"";
204
+ export declare const CommentContext: new (props: CommentContextProps) => Declarable;
205
+ export declare const CreateAction: "App::Action::\"create\"";
206
+ export declare const CreateContext: new (props: CreateContextProps) => Declarable;
207
+ export declare const DeleteAction: "App::Action::\"delete\"";
208
+ export declare const DeleteContext: new (props: DeleteContextProps) => Declarable;
209
+ export declare const ListAction: "App::Action::\"list\"";
210
+ export declare const ListContext: new (props: ListContextProps) => Declarable;
211
+ export declare const ReadAction: "App::Action::\"read\"";
212
+ export declare const ReadContext: new (props: ReadContextProps) => Declarable;
213
+ export declare const ShareAction: "App::Action::\"share\"";
214
+ export declare const ShareContext: new (props: ShareContextProps) => Declarable;
215
+ export declare const WriteAction: "App::Action::\"write\"";
216
+ export declare const WriteContext: new (props: WriteContextProps) => Declarable;
217
+
218
+ export declare const ALL_ACTIONS: readonly ActionUid[];
219
+ export declare const ALL_ENTITY_TYPES: readonly EntityTypeName[];
@@ -0,0 +1,279 @@
1
+ // Code generated by chant generate. DO NOT EDIT.
2
+ import type { Declarable } from "@intentius/chant/declarable";
3
+ import { createProperty, createResource } from "./runtime";
4
+
5
+ /**
6
+ * Entity UID of `App::Application`.
7
+ */
8
+ export type ApplicationUid = `App::Application::"${string}"`;
9
+
10
+ export interface ApplicationAttributesProps {
11
+ name: string;
12
+ owner: TeamUid;
13
+ }
14
+
15
+ /**
16
+ * Entity UID of `App::Document`.
17
+ * Member of: App::Folder.
18
+ */
19
+ export type DocumentUid = `App::Document::"${string}"`;
20
+
21
+ export interface DocumentAttributesProps {
22
+ classification: string;
23
+ folder: FolderUid;
24
+ owner: UserUid;
25
+ public: boolean;
26
+ tags: string[];
27
+ title: string;
28
+ }
29
+
30
+ /**
31
+ * Entity UID of `App::Folder`.
32
+ */
33
+ export type FolderUid = `App::Folder::"${string}"`;
34
+
35
+ export interface FolderAttributesProps {
36
+ name: string;
37
+ owner: UserUid;
38
+ tags: string[];
39
+ }
40
+
41
+ /**
42
+ * Entity UID of `App::Group`.
43
+ */
44
+ export type GroupUid = `App::Group::"${string}"`;
45
+
46
+ export interface GroupAttributesProps {
47
+ description?: string;
48
+ name: string;
49
+ }
50
+
51
+ /**
52
+ * Entity UID of `App::ServiceAccount`.
53
+ * Member of: App::Group.
54
+ */
55
+ export type ServiceAccountUid = `App::ServiceAccount::"${string}"`;
56
+
57
+ export interface ServiceAccountAttributesProps {
58
+ name: string;
59
+ owner: UserUid;
60
+ rotatedAt?: string;
61
+ }
62
+
63
+ /**
64
+ * Entity UID of `App::Team`.
65
+ * Member of: App::Group.
66
+ */
67
+ export type TeamUid = `App::Team::"${string}"`;
68
+
69
+ export interface TeamAttributesProps {
70
+ costCenter?: string;
71
+ name: string;
72
+ }
73
+
74
+ /**
75
+ * Entity UID of `App::User`.
76
+ * Member of: App::Group, App::Team.
77
+ */
78
+ export type UserUid = `App::User::"${string}"`;
79
+
80
+ export interface UserAttributesProps {
81
+ department: string;
82
+ email: string;
83
+ level: number;
84
+ manager?: UserUid;
85
+ mfaEnabled: boolean;
86
+ roles: string[];
87
+ }
88
+
89
+ export interface AdminContextProps {
90
+ breakGlass?: boolean;
91
+ mfa: boolean;
92
+ }
93
+
94
+ export interface ApproveContextProps {
95
+ mfa: boolean;
96
+ }
97
+
98
+ export interface CommentContextProps {
99
+ mfa: boolean;
100
+ reason?: string;
101
+ }
102
+
103
+ export interface CreateContextProps {
104
+ mfa: boolean;
105
+ reason?: string;
106
+ }
107
+
108
+ export interface DeleteContextProps {
109
+ approvedBy?: UserUid;
110
+ mfa: boolean;
111
+ }
112
+
113
+ export interface ListContextProps {
114
+ mfa: boolean;
115
+ sourceIp?: string;
116
+ }
117
+
118
+ export interface ReadContextProps {
119
+ mfa: boolean;
120
+ sourceIp?: string;
121
+ }
122
+
123
+ export interface ShareContextProps {
124
+ approvedBy?: UserUid;
125
+ mfa: boolean;
126
+ }
127
+
128
+ export interface WriteContextProps {
129
+ mfa: boolean;
130
+ reason?: string;
131
+ }
132
+
133
+ /** Every entity type name the schema declares, as Cedar writes it. */
134
+ export type EntityTypeName = "App::Application" | "App::Document" | "App::Folder" | "App::Group" | "App::ServiceAccount" | "App::Team" | "App::User";
135
+
136
+ /** Every entity UID the schema can produce. */
137
+ export type EntityUid = ApplicationUid | DocumentUid | FolderUid | GroupUid | ServiceAccountUid | TeamUid | UserUid;
138
+
139
+ /** Every action UID the schema declares. */
140
+ export type ActionUid = "App::Action::\"admin\"" | "App::Action::\"approve\"" | "App::Action::\"comment\"" | "App::Action::\"create\"" | "App::Action::\"delete\"" | "App::Action::\"list\"" | "App::Action::\"read\"" | "App::Action::\"share\"" | "App::Action::\"write\"";
141
+
142
+ /** Anything a policy scope may name. */
143
+ export type PolicyRef = EntityUid | ActionUid;
144
+
145
+ /** A Cedar policy either permits or forbids; there is no third effect. */
146
+ export type PolicyEffect = "permit" | "forbid";
147
+
148
+ /**
149
+ * One scope position (`principal`, `action`, `resource`).
150
+ *
151
+ * `{}` is the unconstrained form Cedar writes as a bare variable. The
152
+ * constrained forms mirror the grammar: `== E`, `in E`, `in [E, …]`,
153
+ * `is T`, and `is T in E`.
154
+ */
155
+ export type PolicyScope =
156
+ | Record<string, never>
157
+ | { eq: PolicyRef; in?: never; is?: never }
158
+ | { in: PolicyRef | PolicyRef[]; eq?: never; is?: never }
159
+ | { is: EntityTypeName; in?: PolicyRef | PolicyRef[]; eq?: never };
160
+
161
+ /**
162
+ * The props of a `Cedar::Policy`.
163
+ *
164
+ * `when`/`unless` carry Cedar expression text. They stay strings because
165
+ * Cedar's expression grammar is the policy language itself — typing it in
166
+ * TypeScript is import/reconcile's problem (epic #1645 sub-issue 6), not
167
+ * codegen's.
168
+ */
169
+ export interface PolicyProps {
170
+ /** Defaults to `permit` when omitted. */
171
+ effect?: PolicyEffect;
172
+ principal?: PolicyScope;
173
+ action?: PolicyScope;
174
+ resource?: PolicyScope;
175
+ /** Cedar expression strings, each emitted as its own `when { … }` clause. */
176
+ when?: string[];
177
+ /** Cedar expression strings, each emitted as its own `unless { … }` clause. */
178
+ unless?: string[];
179
+ /** Emitted as `@key("value")`; an explicit `id` wins over the logical name. */
180
+ annotations?: Record<string, string>;
181
+ }
182
+
183
+ /**
184
+ * The policy resource. Declare one per policy:
185
+ *
186
+ * ```ts
187
+ * export const allowOwnerRead = new Policy({
188
+ * principal: { is: "App::User" },
189
+ * action: { eq: ReadAction },
190
+ * when: ['resource.owner == principal'],
191
+ * });
192
+ * ```
193
+ */
194
+ export const Policy = createResource("Cedar::Policy", "cedar", {}) as unknown as new (props: PolicyProps) => Declarable;
195
+
196
+ export const Application = createResource("App::Application", "cedar", {}) as unknown as new (props: ApplicationAttributesProps) => Declarable;
197
+ export const ApplicationAttributes = createProperty("App::Application.Attributes", "cedar") as unknown as new (props: ApplicationAttributesProps) => Declarable;
198
+ export const Document = createResource("App::Document", "cedar", {}) as unknown as new (props: DocumentAttributesProps) => Declarable;
199
+ export const DocumentAttributes = createProperty("App::Document.Attributes", "cedar") as unknown as new (props: DocumentAttributesProps) => Declarable;
200
+ export const Folder = createResource("App::Folder", "cedar", {}) as unknown as new (props: FolderAttributesProps) => Declarable;
201
+ export const FolderAttributes = createProperty("App::Folder.Attributes", "cedar") as unknown as new (props: FolderAttributesProps) => Declarable;
202
+ export const Group = createResource("App::Group", "cedar", {}) as unknown as new (props: GroupAttributesProps) => Declarable;
203
+ export const GroupAttributes = createProperty("App::Group.Attributes", "cedar") as unknown as new (props: GroupAttributesProps) => Declarable;
204
+ export const ServiceAccount = createResource("App::ServiceAccount", "cedar", {}) as unknown as new (props: ServiceAccountAttributesProps) => Declarable;
205
+ export const ServiceAccountAttributes = createProperty("App::ServiceAccount.Attributes", "cedar") as unknown as new (props: ServiceAccountAttributesProps) => Declarable;
206
+ export const Team = createResource("App::Team", "cedar", {}) as unknown as new (props: TeamAttributesProps) => Declarable;
207
+ export const TeamAttributes = createProperty("App::Team.Attributes", "cedar") as unknown as new (props: TeamAttributesProps) => Declarable;
208
+ export const User = createResource("App::User", "cedar", {}) as unknown as new (props: UserAttributesProps) => Declarable;
209
+ export const UserAttributes = createProperty("App::User.Attributes", "cedar") as unknown as new (props: UserAttributesProps) => Declarable;
210
+
211
+ /**
212
+ * `App::Action::"admin"`.
213
+ * Principals: App::User.
214
+ * Resources: App::Application.
215
+ */
216
+ export const AdminAction = "App::Action::\"admin\"" as const;
217
+ export const AdminContext = createProperty("App::Action::\"admin\".Context", "cedar") as unknown as new (props: AdminContextProps) => Declarable;
218
+ /**
219
+ * `App::Action::"approve"`.
220
+ * Principals: App::User.
221
+ * Resources: App::Document.
222
+ */
223
+ export const ApproveAction = "App::Action::\"approve\"" as const;
224
+ export const ApproveContext = createProperty("App::Action::\"approve\".Context", "cedar") as unknown as new (props: ApproveContextProps) => Declarable;
225
+ /**
226
+ * `App::Action::"comment"`.
227
+ * Principals: App::User.
228
+ * Resources: App::Document, App::Folder.
229
+ */
230
+ export const CommentAction = "App::Action::\"comment\"" as const;
231
+ export const CommentContext = createProperty("App::Action::\"comment\".Context", "cedar") as unknown as new (props: CommentContextProps) => Declarable;
232
+ /**
233
+ * `App::Action::"create"`.
234
+ * Principals: App::User.
235
+ * Resources: App::Document, App::Folder.
236
+ */
237
+ export const CreateAction = "App::Action::\"create\"" as const;
238
+ export const CreateContext = createProperty("App::Action::\"create\".Context", "cedar") as unknown as new (props: CreateContextProps) => Declarable;
239
+ /**
240
+ * `App::Action::"delete"`.
241
+ * Principals: App::User.
242
+ * Resources: App::Document.
243
+ */
244
+ export const DeleteAction = "App::Action::\"delete\"" as const;
245
+ export const DeleteContext = createProperty("App::Action::\"delete\".Context", "cedar") as unknown as new (props: DeleteContextProps) => Declarable;
246
+ /**
247
+ * `App::Action::"list"`.
248
+ * Principals: App::ServiceAccount, App::User.
249
+ * Resources: App::Document, App::Folder.
250
+ */
251
+ export const ListAction = "App::Action::\"list\"" as const;
252
+ export const ListContext = createProperty("App::Action::\"list\".Context", "cedar") as unknown as new (props: ListContextProps) => Declarable;
253
+ /**
254
+ * `App::Action::"read"`.
255
+ * Principals: App::ServiceAccount, App::User.
256
+ * Resources: App::Document, App::Folder.
257
+ */
258
+ export const ReadAction = "App::Action::\"read\"" as const;
259
+ export const ReadContext = createProperty("App::Action::\"read\".Context", "cedar") as unknown as new (props: ReadContextProps) => Declarable;
260
+ /**
261
+ * `App::Action::"share"`.
262
+ * Principals: App::User.
263
+ * Resources: App::Document.
264
+ */
265
+ export const ShareAction = "App::Action::\"share\"" as const;
266
+ export const ShareContext = createProperty("App::Action::\"share\".Context", "cedar") as unknown as new (props: ShareContextProps) => Declarable;
267
+ /**
268
+ * `App::Action::"write"`.
269
+ * Principals: App::User.
270
+ * Resources: App::Document, App::Folder.
271
+ */
272
+ export const WriteAction = "App::Action::\"write\"" as const;
273
+ export const WriteContext = createProperty("App::Action::\"write\".Context", "cedar") as unknown as new (props: WriteContextProps) => Declarable;
274
+
275
+ /** Every generated action constant, for exhaustive iteration. */
276
+ export const ALL_ACTIONS: readonly ActionUid[] = [AdminAction, ApproveAction, CommentAction, CreateAction, DeleteAction, ListAction, ReadAction, ShareAction, WriteAction];
277
+
278
+ /** Every entity type name the schema declares. */
279
+ export const ALL_ENTITY_TYPES: readonly EntityTypeName[] = ["App::Application", "App::Document", "App::Folder", "App::Group", "App::ServiceAccount", "App::Team", "App::User"];