@selvajs/platform 0.21.0-beta.3 → 1.0.0-beta.5

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 (362) hide show
  1. package/README.md +11 -8
  2. package/dist/access/index.d.ts +0 -1
  3. package/dist/access/index.js +0 -1
  4. package/dist/access/rules.d.ts +7 -14
  5. package/dist/access/rules.js +22 -26
  6. package/dist/apiTokens/index.d.ts +1 -2
  7. package/dist/apiTokens/index.js +1 -2
  8. package/dist/apiTokens/interface.d.ts +0 -1
  9. package/dist/apiTokens/interface.js +0 -1
  10. package/dist/apiTokens/scope.d.ts +0 -1
  11. package/dist/apiTokens/scope.js +0 -1
  12. package/dist/apiTokens/types.d.ts +0 -1
  13. package/dist/apiTokens/types.js +0 -1
  14. package/dist/auth/index.d.ts +0 -1
  15. package/dist/auth/index.js +0 -1
  16. package/dist/auth/interface.d.ts +4 -23
  17. package/dist/auth/interface.js +0 -1
  18. package/dist/auth/types.d.ts +4 -2
  19. package/dist/auth/types.js +0 -1
  20. package/dist/bindings/index.d.ts +0 -1
  21. package/dist/bindings/index.js +0 -1
  22. package/dist/bindings/interface.d.ts +0 -1
  23. package/dist/bindings/interface.js +0 -1
  24. package/dist/computeServer/index.d.ts +1 -7
  25. package/dist/computeServer/index.js +2 -8
  26. package/dist/computeServer/interface.d.ts +9 -6
  27. package/dist/computeServer/interface.js +0 -1
  28. package/dist/computeServer/public.d.ts +6 -0
  29. package/dist/computeServer/public.js +2 -0
  30. package/dist/computeServer/secrets.d.ts +12 -6
  31. package/dist/computeServer/secrets.js +35 -15
  32. package/dist/computeServer/types.d.ts +5 -2
  33. package/dist/computeServer/types.js +4 -1
  34. package/dist/computeServer/utils.d.ts +17 -6
  35. package/dist/computeServer/utils.js +31 -21
  36. package/dist/config.d.ts +1 -2
  37. package/dist/config.js +0 -1
  38. package/dist/context.d.ts +11 -1
  39. package/dist/context.js +51 -2
  40. package/dist/data/index.d.ts +0 -1
  41. package/dist/data/index.js +0 -1
  42. package/dist/data/interface.d.ts +0 -1
  43. package/dist/data/interface.js +0 -1
  44. package/dist/definitions/index.d.ts +2 -3
  45. package/dist/definitions/index.js +2 -3
  46. package/dist/definitions/interface.d.ts +0 -1
  47. package/dist/definitions/interface.js +0 -1
  48. package/dist/definitions/paths.d.ts +0 -1
  49. package/dist/definitions/paths.js +1 -12
  50. package/dist/definitions/schemas.d.ts +0 -21
  51. package/dist/definitions/schemas.js +6 -19
  52. package/dist/definitions/types.d.ts +3 -4
  53. package/dist/definitions/types.js +0 -3
  54. package/dist/errors/interface.d.ts +1 -2
  55. package/dist/errors/interface.js +0 -1
  56. package/dist/errors.d.ts +8 -1
  57. package/dist/errors.js +11 -1
  58. package/dist/events/audit.d.ts +1 -2
  59. package/dist/events/audit.js +0 -1
  60. package/dist/events/index.d.ts +0 -1
  61. package/dist/events/index.js +0 -1
  62. package/dist/events/interface.d.ts +0 -1
  63. package/dist/events/interface.js +0 -1
  64. package/dist/index.d.ts +18 -61
  65. package/dist/index.js +18 -24
  66. package/dist/invites/index.d.ts +0 -1
  67. package/dist/invites/index.js +0 -1
  68. package/dist/invites/interface.d.ts +5 -6
  69. package/dist/invites/interface.js +0 -1
  70. package/dist/invites/types.d.ts +0 -1
  71. package/dist/invites/types.js +0 -1
  72. package/dist/logging/interface.d.ts +0 -1
  73. package/dist/logging/interface.js +0 -1
  74. package/dist/metrics/interface.d.ts +0 -1
  75. package/dist/metrics/interface.js +0 -1
  76. package/dist/notifications/index.d.ts +0 -1
  77. package/dist/notifications/index.js +0 -1
  78. package/dist/notifications/interface.d.ts +1 -3
  79. package/dist/notifications/interface.js +1 -3
  80. package/dist/notifications/types.d.ts +0 -1
  81. package/dist/notifications/types.js +0 -1
  82. package/dist/organizations/index.d.ts +2 -3
  83. package/dist/organizations/index.js +1 -2
  84. package/dist/organizations/interface.d.ts +3 -5
  85. package/dist/organizations/interface.js +0 -1
  86. package/dist/organizations/paths.d.ts +1 -6
  87. package/dist/organizations/paths.js +2 -20
  88. package/dist/organizations/schemas.d.ts +5 -7
  89. package/dist/organizations/schemas.js +20 -13
  90. package/dist/organizations/types.d.ts +0 -1
  91. package/dist/organizations/types.js +0 -1
  92. package/dist/pagination.d.ts +21 -3
  93. package/dist/pagination.js +34 -1
  94. package/dist/permissions/index.d.ts +2 -2
  95. package/dist/permissions/index.js +2 -2
  96. package/dist/permissions/interface.d.ts +4 -4
  97. package/dist/permissions/interface.js +0 -1
  98. package/dist/permissions/types.d.ts +0 -1
  99. package/dist/permissions/types.js +0 -1
  100. package/dist/platformProjects/index.d.ts +1 -3
  101. package/dist/platformProjects/index.js +1 -2
  102. package/dist/platformProjects/interface.d.ts +0 -1
  103. package/dist/platformProjects/interface.js +0 -1
  104. package/dist/platformProjects/schemas.d.ts +0 -1
  105. package/dist/platformProjects/schemas.js +0 -1
  106. package/dist/platformProjects/types.d.ts +3 -2
  107. package/dist/platformProjects/types.js +0 -1
  108. package/dist/projects/index.d.ts +0 -1
  109. package/dist/projects/index.js +0 -1
  110. package/dist/projects/interface.d.ts +0 -1
  111. package/dist/projects/interface.js +0 -1
  112. package/dist/projects/schemas.d.ts +0 -1
  113. package/dist/projects/schemas.js +0 -1
  114. package/dist/projects/types.d.ts +0 -1
  115. package/dist/projects/types.js +0 -1
  116. package/dist/shareLinks/index.d.ts +0 -1
  117. package/dist/shareLinks/index.js +0 -1
  118. package/dist/shareLinks/interface.d.ts +6 -3
  119. package/dist/shareLinks/interface.js +0 -1
  120. package/dist/shareLinks/schemas.d.ts +0 -1
  121. package/dist/shareLinks/schemas.js +4 -2
  122. package/dist/shareLinks/types.d.ts +0 -1
  123. package/dist/shareLinks/types.js +0 -1
  124. package/dist/solveCache/interface.d.ts +2 -3
  125. package/dist/solveCache/interface.js +0 -1
  126. package/dist/storage/assetClasses.d.ts +4 -8
  127. package/dist/storage/assetClasses.js +6 -21
  128. package/dist/storage/cacheBust.d.ts +0 -1
  129. package/dist/storage/cacheBust.js +5 -3
  130. package/dist/storage/image.d.ts +8 -5
  131. package/dist/storage/image.js +74 -12
  132. package/dist/storage/index.d.ts +2 -4
  133. package/dist/storage/index.js +2 -3
  134. package/dist/storage/interface.d.ts +11 -3
  135. package/dist/storage/interface.js +0 -1
  136. package/dist/storage/safeKey.d.ts +7 -0
  137. package/dist/storage/safeKey.js +12 -0
  138. package/dist/testing/index.d.ts +5 -2
  139. package/dist/testing/index.js +3 -2
  140. package/dist/testing/suites/apiTokenStoreSuite.d.ts +0 -1
  141. package/dist/testing/suites/apiTokenStoreSuite.js +0 -1
  142. package/dist/testing/suites/auditQuerySuite.d.ts +18 -0
  143. package/dist/testing/suites/auditQuerySuite.js +73 -0
  144. package/dist/testing/suites/authProviderSuite.d.ts +14 -3
  145. package/dist/testing/suites/authProviderSuite.js +57 -32
  146. package/dist/testing/suites/computeServerStoreSuite.d.ts +1 -2
  147. package/dist/testing/suites/computeServerStoreSuite.js +68 -4
  148. package/dist/testing/suites/definitionStoreSuite.d.ts +2 -1
  149. package/dist/testing/suites/definitionStoreSuite.js +19 -16
  150. package/dist/testing/suites/emailLinkAuthSuite.d.ts +2 -5
  151. package/dist/testing/suites/emailLinkAuthSuite.js +1 -9
  152. package/dist/testing/suites/eventSinkSuite.d.ts +0 -1
  153. package/dist/testing/suites/eventSinkSuite.js +9 -1
  154. package/dist/testing/suites/helpers.d.ts +5 -1
  155. package/dist/testing/suites/helpers.js +7 -1
  156. package/dist/testing/suites/inviteStoreSuite.d.ts +0 -1
  157. package/dist/testing/suites/inviteStoreSuite.js +17 -7
  158. package/dist/testing/suites/oauthAuthSuite.d.ts +18 -0
  159. package/dist/testing/suites/oauthAuthSuite.js +26 -0
  160. package/dist/testing/suites/orgStoreSuite.d.ts +5 -1
  161. package/dist/testing/suites/orgStoreSuite.js +26 -7
  162. package/dist/testing/suites/platformPermissionStoreSuite.d.ts +0 -5
  163. package/dist/testing/suites/platformPermissionStoreSuite.js +12 -63
  164. package/dist/testing/suites/platformProjectGrantStoreSuite.d.ts +0 -1
  165. package/dist/testing/suites/platformProjectGrantStoreSuite.js +0 -5
  166. package/dist/testing/suites/projectStoreSuite.d.ts +5 -1
  167. package/dist/testing/suites/projectStoreSuite.js +6 -6
  168. package/dist/testing/suites/shareLinkStoreSuite.d.ts +2 -1
  169. package/dist/testing/suites/shareLinkStoreSuite.js +22 -25
  170. package/dist/testing/suites/solveMetricSinkSuite.d.ts +0 -1
  171. package/dist/testing/suites/solveMetricSinkSuite.js +2 -2
  172. package/dist/testing/suites/storageProviderSuite.d.ts +0 -1
  173. package/dist/testing/suites/storageProviderSuite.js +15 -10
  174. package/dist/testing/suites/userProfileStoreSuite.d.ts +1 -2
  175. package/dist/testing/suites/userProfileStoreSuite.js +42 -7
  176. package/dist/userProfile/index.d.ts +2 -2
  177. package/dist/userProfile/index.js +2 -2
  178. package/dist/userProfile/interface.d.ts +5 -6
  179. package/dist/userProfile/interface.js +0 -1
  180. package/dist/userProfile/types.d.ts +2 -1
  181. package/dist/userProfile/types.js +2 -1
  182. package/dist/utils/audit.d.ts +0 -1
  183. package/dist/utils/audit.js +0 -1
  184. package/dist/utils/index.d.ts +0 -2
  185. package/dist/utils/index.js +0 -1
  186. package/package.json +7 -6
  187. package/dist/access/index.d.ts.map +0 -1
  188. package/dist/access/index.js.map +0 -1
  189. package/dist/access/rules.d.ts.map +0 -1
  190. package/dist/access/rules.js.map +0 -1
  191. package/dist/apiTokens/index.d.ts.map +0 -1
  192. package/dist/apiTokens/index.js.map +0 -1
  193. package/dist/apiTokens/interface.d.ts.map +0 -1
  194. package/dist/apiTokens/interface.js.map +0 -1
  195. package/dist/apiTokens/scope.d.ts.map +0 -1
  196. package/dist/apiTokens/scope.js.map +0 -1
  197. package/dist/apiTokens/types.d.ts.map +0 -1
  198. package/dist/apiTokens/types.js.map +0 -1
  199. package/dist/auth/index.d.ts.map +0 -1
  200. package/dist/auth/index.js.map +0 -1
  201. package/dist/auth/interface.d.ts.map +0 -1
  202. package/dist/auth/interface.js.map +0 -1
  203. package/dist/auth/types.d.ts.map +0 -1
  204. package/dist/auth/types.js.map +0 -1
  205. package/dist/bindings/index.d.ts.map +0 -1
  206. package/dist/bindings/index.js.map +0 -1
  207. package/dist/bindings/interface.d.ts.map +0 -1
  208. package/dist/bindings/interface.js.map +0 -1
  209. package/dist/computeServer/index.d.ts.map +0 -1
  210. package/dist/computeServer/index.js.map +0 -1
  211. package/dist/computeServer/interface.d.ts.map +0 -1
  212. package/dist/computeServer/interface.js.map +0 -1
  213. package/dist/computeServer/secrets.d.ts.map +0 -1
  214. package/dist/computeServer/secrets.js.map +0 -1
  215. package/dist/computeServer/types.d.ts.map +0 -1
  216. package/dist/computeServer/types.js.map +0 -1
  217. package/dist/computeServer/utils.d.ts.map +0 -1
  218. package/dist/computeServer/utils.js.map +0 -1
  219. package/dist/config.d.ts.map +0 -1
  220. package/dist/config.js.map +0 -1
  221. package/dist/context.d.ts.map +0 -1
  222. package/dist/context.js.map +0 -1
  223. package/dist/data/index.d.ts.map +0 -1
  224. package/dist/data/index.js.map +0 -1
  225. package/dist/data/interface.d.ts.map +0 -1
  226. package/dist/data/interface.js.map +0 -1
  227. package/dist/definitions/index.d.ts.map +0 -1
  228. package/dist/definitions/index.js.map +0 -1
  229. package/dist/definitions/interface.d.ts.map +0 -1
  230. package/dist/definitions/interface.js.map +0 -1
  231. package/dist/definitions/paths.d.ts.map +0 -1
  232. package/dist/definitions/paths.js.map +0 -1
  233. package/dist/definitions/schemas.d.ts.map +0 -1
  234. package/dist/definitions/schemas.js.map +0 -1
  235. package/dist/definitions/types.d.ts.map +0 -1
  236. package/dist/definitions/types.js.map +0 -1
  237. package/dist/errors/interface.d.ts.map +0 -1
  238. package/dist/errors/interface.js.map +0 -1
  239. package/dist/errors.d.ts.map +0 -1
  240. package/dist/errors.js.map +0 -1
  241. package/dist/events/audit.d.ts.map +0 -1
  242. package/dist/events/audit.js.map +0 -1
  243. package/dist/events/index.d.ts.map +0 -1
  244. package/dist/events/index.js.map +0 -1
  245. package/dist/events/interface.d.ts.map +0 -1
  246. package/dist/events/interface.js.map +0 -1
  247. package/dist/index.d.ts.map +0 -1
  248. package/dist/index.js.map +0 -1
  249. package/dist/invites/index.d.ts.map +0 -1
  250. package/dist/invites/index.js.map +0 -1
  251. package/dist/invites/interface.d.ts.map +0 -1
  252. package/dist/invites/interface.js.map +0 -1
  253. package/dist/invites/types.d.ts.map +0 -1
  254. package/dist/invites/types.js.map +0 -1
  255. package/dist/logging/interface.d.ts.map +0 -1
  256. package/dist/logging/interface.js.map +0 -1
  257. package/dist/metrics/interface.d.ts.map +0 -1
  258. package/dist/metrics/interface.js.map +0 -1
  259. package/dist/notifications/index.d.ts.map +0 -1
  260. package/dist/notifications/index.js.map +0 -1
  261. package/dist/notifications/interface.d.ts.map +0 -1
  262. package/dist/notifications/interface.js.map +0 -1
  263. package/dist/notifications/types.d.ts.map +0 -1
  264. package/dist/notifications/types.js.map +0 -1
  265. package/dist/organizations/index.d.ts.map +0 -1
  266. package/dist/organizations/index.js.map +0 -1
  267. package/dist/organizations/interface.d.ts.map +0 -1
  268. package/dist/organizations/interface.js.map +0 -1
  269. package/dist/organizations/paths.d.ts.map +0 -1
  270. package/dist/organizations/paths.js.map +0 -1
  271. package/dist/organizations/schemas.d.ts.map +0 -1
  272. package/dist/organizations/schemas.js.map +0 -1
  273. package/dist/organizations/types.d.ts.map +0 -1
  274. package/dist/organizations/types.js.map +0 -1
  275. package/dist/pagination.d.ts.map +0 -1
  276. package/dist/pagination.js.map +0 -1
  277. package/dist/permissions/index.d.ts.map +0 -1
  278. package/dist/permissions/index.js.map +0 -1
  279. package/dist/permissions/interface.d.ts.map +0 -1
  280. package/dist/permissions/interface.js.map +0 -1
  281. package/dist/permissions/types.d.ts.map +0 -1
  282. package/dist/permissions/types.js.map +0 -1
  283. package/dist/platformProjects/index.d.ts.map +0 -1
  284. package/dist/platformProjects/index.js.map +0 -1
  285. package/dist/platformProjects/interface.d.ts.map +0 -1
  286. package/dist/platformProjects/interface.js.map +0 -1
  287. package/dist/platformProjects/schemas.d.ts.map +0 -1
  288. package/dist/platformProjects/schemas.js.map +0 -1
  289. package/dist/platformProjects/types.d.ts.map +0 -1
  290. package/dist/platformProjects/types.js.map +0 -1
  291. package/dist/projects/index.d.ts.map +0 -1
  292. package/dist/projects/index.js.map +0 -1
  293. package/dist/projects/interface.d.ts.map +0 -1
  294. package/dist/projects/interface.js.map +0 -1
  295. package/dist/projects/schemas.d.ts.map +0 -1
  296. package/dist/projects/schemas.js.map +0 -1
  297. package/dist/projects/types.d.ts.map +0 -1
  298. package/dist/projects/types.js.map +0 -1
  299. package/dist/shareLinks/index.d.ts.map +0 -1
  300. package/dist/shareLinks/index.js.map +0 -1
  301. package/dist/shareLinks/interface.d.ts.map +0 -1
  302. package/dist/shareLinks/interface.js.map +0 -1
  303. package/dist/shareLinks/schemas.d.ts.map +0 -1
  304. package/dist/shareLinks/schemas.js.map +0 -1
  305. package/dist/shareLinks/types.d.ts.map +0 -1
  306. package/dist/shareLinks/types.js.map +0 -1
  307. package/dist/solveCache/interface.d.ts.map +0 -1
  308. package/dist/solveCache/interface.js.map +0 -1
  309. package/dist/storage/assetClasses.d.ts.map +0 -1
  310. package/dist/storage/assetClasses.js.map +0 -1
  311. package/dist/storage/cacheBust.d.ts.map +0 -1
  312. package/dist/storage/cacheBust.js.map +0 -1
  313. package/dist/storage/image.d.ts.map +0 -1
  314. package/dist/storage/image.js.map +0 -1
  315. package/dist/storage/index.d.ts.map +0 -1
  316. package/dist/storage/index.js.map +0 -1
  317. package/dist/storage/interface.d.ts.map +0 -1
  318. package/dist/storage/interface.js.map +0 -1
  319. package/dist/testing/index.d.ts.map +0 -1
  320. package/dist/testing/index.js.map +0 -1
  321. package/dist/testing/suites/apiTokenStoreSuite.d.ts.map +0 -1
  322. package/dist/testing/suites/apiTokenStoreSuite.js.map +0 -1
  323. package/dist/testing/suites/authProviderSuite.d.ts.map +0 -1
  324. package/dist/testing/suites/authProviderSuite.js.map +0 -1
  325. package/dist/testing/suites/computeServerStoreSuite.d.ts.map +0 -1
  326. package/dist/testing/suites/computeServerStoreSuite.js.map +0 -1
  327. package/dist/testing/suites/definitionStoreSuite.d.ts.map +0 -1
  328. package/dist/testing/suites/definitionStoreSuite.js.map +0 -1
  329. package/dist/testing/suites/emailLinkAuthSuite.d.ts.map +0 -1
  330. package/dist/testing/suites/emailLinkAuthSuite.js.map +0 -1
  331. package/dist/testing/suites/eventSinkSuite.d.ts.map +0 -1
  332. package/dist/testing/suites/eventSinkSuite.js.map +0 -1
  333. package/dist/testing/suites/helpers.d.ts.map +0 -1
  334. package/dist/testing/suites/helpers.js.map +0 -1
  335. package/dist/testing/suites/inviteStoreSuite.d.ts.map +0 -1
  336. package/dist/testing/suites/inviteStoreSuite.js.map +0 -1
  337. package/dist/testing/suites/orgStoreSuite.d.ts.map +0 -1
  338. package/dist/testing/suites/orgStoreSuite.js.map +0 -1
  339. package/dist/testing/suites/platformPermissionStoreSuite.d.ts.map +0 -1
  340. package/dist/testing/suites/platformPermissionStoreSuite.js.map +0 -1
  341. package/dist/testing/suites/platformProjectGrantStoreSuite.d.ts.map +0 -1
  342. package/dist/testing/suites/platformProjectGrantStoreSuite.js.map +0 -1
  343. package/dist/testing/suites/projectStoreSuite.d.ts.map +0 -1
  344. package/dist/testing/suites/projectStoreSuite.js.map +0 -1
  345. package/dist/testing/suites/shareLinkStoreSuite.d.ts.map +0 -1
  346. package/dist/testing/suites/shareLinkStoreSuite.js.map +0 -1
  347. package/dist/testing/suites/solveMetricSinkSuite.d.ts.map +0 -1
  348. package/dist/testing/suites/solveMetricSinkSuite.js.map +0 -1
  349. package/dist/testing/suites/storageProviderSuite.d.ts.map +0 -1
  350. package/dist/testing/suites/storageProviderSuite.js.map +0 -1
  351. package/dist/testing/suites/userProfileStoreSuite.d.ts.map +0 -1
  352. package/dist/testing/suites/userProfileStoreSuite.js.map +0 -1
  353. package/dist/userProfile/index.d.ts.map +0 -1
  354. package/dist/userProfile/index.js.map +0 -1
  355. package/dist/userProfile/interface.d.ts.map +0 -1
  356. package/dist/userProfile/interface.js.map +0 -1
  357. package/dist/userProfile/types.d.ts.map +0 -1
  358. package/dist/userProfile/types.js.map +0 -1
  359. package/dist/utils/audit.d.ts.map +0 -1
  360. package/dist/utils/audit.js.map +0 -1
  361. package/dist/utils/index.d.ts.map +0 -1
  362. package/dist/utils/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,33 +1,27 @@
1
1
  // @selvajs/platform — published API contract. Every symbol here is breaking-change-protected.
2
- export { PlatformPermissionSchema, ALL_PLATFORM_PERMISSIONS, OPERATOR_PLATFORM_PERMISSIONS } from './permissions/types.js';
3
- export { emptyProfile } from './userProfile/types.js';
4
- export { orgPaths } from './organizations/paths.js';
5
- export { OrgRoleSchema, OrgPermissionSchema, OrgAssetKindSchema, ALL_ORG_ASSET_KINDS, SlugSchema, slugify, RESERVED_SLUGS, CreateOrgSchema, UpdateOrgSchema, ALL_ORG_PERMISSIONS, DEFAULT_ORG_PERMISSIONS, OWNER_ADMIN_ONLY_PERMISSIONS, MEMBER_ASSIGNABLE_PERMISSIONS } from './organizations/schemas.js';
6
- export { ApiScopeActionSchema, ApiScopeStringSchema, ApiTokenRevokeReasonSchema, API_TOKEN_LIFETIME_DAYS, parseApiScope, formatApiScope, describeApiScope, scopeAllows, apiScopeActionCovers, narrowApiTokenContext, outsideTokenOrg } from './apiTokens/index.js';
7
- export { ProjectVisibilitySchema, ProjectRoleSchema, validateProjectFlags } from './projects/schemas.js';
8
- export { PlatformProjectGrantSchema, PlatformProjectGranteeTypeSchema } from './platformProjects/schemas.js';
9
- export { GH_EXTENSIONS, COVER_IMAGE_EXTENSIONS, ALLOWED_UPLOAD_EXTENSIONS, COVER_IMAGE_CONTENT_TYPES, toDefinitionListItem } from './definitions/types.js';
10
- export { definitionPaths } from './definitions/paths.js';
11
- export { DefinitionChannelSchema, PublishVersionInputSchema, CreateDefinitionInputSchema, UpdateMetadataInputSchema, GuidSchema, UUID_REGEX, toSourceDocumentId } from './definitions/schemas.js';
12
- export { DEFAULT_SHARE_LINK_MAX_SOLVES } from './shareLinks/types.js';
13
- export { CreateShareLinkInputSchema } from './shareLinks/schemas.js';
14
- export { IMAGE_MAX_WIDTH, IMAGE_WEBP_QUALITY, isImageUpload, toWebpPath, transcodeImageIfNeeded } from './storage/image.js';
15
- export { ASSET_CLASSES, classifyAssetPath, isPublicAssetPath } from './storage/assetClasses.js';
16
- export { withCacheBust } from './storage/cacheBust.js';
17
- export { ERASED_ACTOR_ID } from './data/interface.js';
18
- export { isPlatformServer, isOrgServer } from './computeServer/types.js';
19
- export { serversVisibleTo, defaultServerIdFor, resolveServerForOrg, findServerById, platformServers, orgServersFor, scopeConfigToOrg } from './computeServer/utils.js';
20
- export { canView, canSolve, canEdit, canCreateDefinition, canManage, canEditProjectSettings, canChangeVisibilityToPublic, canEditDefinition, canReclaim, canCreateProject, canChangeOrgRole, checkOwnerRemoval, withAdminBypass } from './access/rules.js';
21
- export { actorFrom, actorOf, NoopEventSink, AUDIT_EVENT_VERSION } from './events/interface.js';
2
+ export * from './access/index.js';
3
+ export * from './apiTokens/index.js';
4
+ export * from './auth/index.js';
5
+ export * from './computeServer/public.js';
6
+ export * from './data/index.js';
7
+ export * from './definitions/index.js';
8
+ export * from './events/index.js';
9
+ export * from './invites/index.js';
10
+ export * from './notifications/index.js';
11
+ export * from './organizations/index.js';
12
+ export * from './permissions/index.js';
13
+ export * from './platformProjects/index.js';
14
+ export * from './projects/index.js';
15
+ export * from './shareLinks/index.js';
16
+ export * from './storage/index.js';
17
+ export * from './userProfile/index.js';
18
+ export * from './utils/index.js';
22
19
  export { NoopSolveMetricSink } from './metrics/interface.js';
23
20
  export { NoopSolveResultCache } from './solveCache/interface.js';
24
21
  export { NoopErrorReporter } from './errors/interface.js';
25
22
  export { NoopLogger } from './logging/interface.js';
26
- export { NoopNotificationProvider } from './notifications/index.js';
27
23
  export { NoopBindingResolver } from './bindings/interface.js';
28
- export { auditUpdate, auditSoftDelete } from './utils/audit.js';
29
24
  export { SYSTEM_CONTEXT, hasPermission, requireActingOrg, isShareContext, assertNotShareContext } from './context.js';
30
- export { DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT } from './pagination.js';
25
+ export { DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT, clampPageLimit, decodeOffsetCursor, encodeOffsetCursor, listAll, walkPages } from './pagination.js';
31
26
  export { isFlagEnabled, defineConfig } from './config.js';
32
27
  export { ProviderError } from './errors.js';
33
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  export type { Invite } from './types.js';
2
2
  export type { IInviteStore } from './interface.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=index.js.map
@@ -18,7 +18,8 @@ export interface IInviteStore {
18
18
  getByTokenHash(ctx: RequestContext, tokenHash: string): Promise<Invite | null>;
19
19
  listByOrg(ctx: RequestContext, orgId: string, opts?: ListOptions): Promise<Page<Invite>>;
20
20
  /** No-op if already accepted. */
21
- markAccepted(ctx: RequestContext, id: string, userId: string): Promise<void>;
21
+ /** True if this call accepted the invite, false if it was already accepted or is gone. */
22
+ markAccepted(ctx: RequestContext, id: string, userId: string): Promise<boolean>;
22
23
  /** No-op if already consumed or missing. */
23
24
  revoke(ctx: RequestContext, id: string): Promise<void>;
24
25
  /**
@@ -26,10 +27,9 @@ export interface IInviteStore {
26
27
  * revoked. Accepted invites are left alone — consuming one is history, not
27
28
  * a live grant.
28
29
  *
29
- * Offboarding needs this: `removeOrgMember` cascades `project_members` but
30
- * has never touched invites, so a dormant invite let a removed user walk
31
- * back in at their original role for the rest of its TTL. Matching by email
32
- * rather than user id is deliberate — an invite names an address, and the
30
+ * Offboarding needs this: `removeOrgMember` does not touch invites, so a
31
+ * dormant invite would let a removed user walk back in at their original role
32
+ * for the rest of its TTL. Matching by email rather than user id is deliberate — an invite names an address, and the
33
33
  * account it will create may not exist yet.
34
34
  *
35
35
  * One call rather than list-then-revoke-each: the loop would race a
@@ -39,4 +39,3 @@ export interface IInviteStore {
39
39
  /** Called from the `deleteOrg` cascade — invites to a deleted org are unredeemable orphans otherwise. */
40
40
  deleteByOrg(ctx: RequestContext, orgId: string): Promise<void>;
41
41
  }
42
- //# sourceMappingURL=interface.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interface.js.map
@@ -39,4 +39,3 @@ export interface Invite {
39
39
  acceptedAt?: string;
40
40
  acceptedByUserId?: string;
41
41
  }
42
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -65,4 +65,3 @@ export declare class NoopLogger implements ILogger {
65
65
  error(_message: string, _fields?: LogFields): void;
66
66
  child(_fields: LogFields): ILogger;
67
67
  }
68
- //# sourceMappingURL=interface.d.ts.map
@@ -22,4 +22,3 @@ export class NoopLogger {
22
22
  return this;
23
23
  }
24
24
  }
25
- //# sourceMappingURL=interface.js.map
@@ -71,4 +71,3 @@ export interface ISolveMetricSink {
71
71
  export declare class NoopSolveMetricSink implements ISolveMetricSink {
72
72
  record(_ctx: RequestContext, _metric: SolveMetric): Promise<void>;
73
73
  }
74
- //# sourceMappingURL=interface.d.ts.map
@@ -2,4 +2,3 @@
2
2
  export class NoopSolveMetricSink {
3
3
  async record(_ctx, _metric) { }
4
4
  }
5
- //# sourceMappingURL=interface.js.map
@@ -1,4 +1,3 @@
1
1
  export type { NotificationKind, OutboundMessage, SendResult } from './types.js';
2
2
  export type { INotificationProvider } from './interface.js';
3
3
  export { NoopNotificationProvider } from './interface.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { NoopNotificationProvider } from './interface.js';
2
- //# sourceMappingURL=index.js.map
@@ -35,12 +35,10 @@ export interface INotificationProvider {
35
35
  * Default `INotificationProvider` — sends nothing, reports `not-configured`.
36
36
  *
37
37
  * Mail is optional in every deployment, so this is a supported wiring rather
38
- * than a test double: callers already handle `not-configured` as "no mail",
39
- * which keeps the no-SMTP path identical to the pre-notification behaviour.
38
+ * than a test double: callers already handle `not-configured` as "no mail".
40
39
  */
41
40
  export declare class NoopNotificationProvider implements INotificationProvider {
42
41
  readonly name = "None";
43
42
  send(_message: OutboundMessage, _log?: ILogger): Promise<SendResult>;
44
43
  isConfigured(): boolean;
45
44
  }
46
- //# sourceMappingURL=interface.d.ts.map
@@ -2,8 +2,7 @@
2
2
  * Default `INotificationProvider` — sends nothing, reports `not-configured`.
3
3
  *
4
4
  * Mail is optional in every deployment, so this is a supported wiring rather
5
- * than a test double: callers already handle `not-configured` as "no mail",
6
- * which keeps the no-SMTP path identical to the pre-notification behaviour.
5
+ * than a test double: callers already handle `not-configured` as "no mail".
7
6
  */
8
7
  export class NoopNotificationProvider {
9
8
  name = 'None';
@@ -14,4 +13,3 @@ export class NoopNotificationProvider {
14
13
  return false;
15
14
  }
16
15
  }
17
- //# sourceMappingURL=interface.js.map
@@ -37,4 +37,3 @@ export type SendResult = {
37
37
  status: 'failed';
38
38
  reason: string;
39
39
  };
40
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,6 +1,5 @@
1
1
  export type { Organization, OrgMember, OrgAssets } from './types.js';
2
2
  export type { IOrgStore } from './interface.js';
3
3
  export { orgPaths } from './paths.js';
4
- export type { OrgRole, OrgPermission, OrgAssetKind, CreateOrgInput, UpdateOrgInput } from './schemas.js';
5
- export { OrgRoleSchema, OrgPermissionSchema, OrgAssetKindSchema, ALL_ORG_ASSET_KINDS, SlugSchema, slugify, RESERVED_SLUGS, CreateOrgSchema, UpdateOrgSchema, ALL_ORG_PERMISSIONS, DEFAULT_ORG_PERMISSIONS, OWNER_ADMIN_ONLY_PERMISSIONS, MEMBER_ASSIGNABLE_PERMISSIONS } from './schemas.js';
6
- //# sourceMappingURL=index.d.ts.map
4
+ export type { OrgRole, OrgPermission, OrgAssetKind } from './schemas.js';
5
+ export { OrgRoleSchema, OrgPermissionSchema, OrgAssetKindSchema, SlugSchema, slugify, RESERVED_SLUGS, orgSlugFromName, CreateOrgSchema, UpdateOrgSchema, ALL_ORG_PERMISSIONS, DEFAULT_ORG_PERMISSIONS, OWNER_ADMIN_ONLY_PERMISSIONS, MEMBER_ASSIGNABLE_PERMISSIONS } from './schemas.js';
@@ -1,3 +1,2 @@
1
1
  export { orgPaths } from './paths.js';
2
- export { OrgRoleSchema, OrgPermissionSchema, OrgAssetKindSchema, ALL_ORG_ASSET_KINDS, SlugSchema, slugify, RESERVED_SLUGS, CreateOrgSchema, UpdateOrgSchema, ALL_ORG_PERMISSIONS, DEFAULT_ORG_PERMISSIONS, OWNER_ADMIN_ONLY_PERMISSIONS, MEMBER_ASSIGNABLE_PERMISSIONS } from './schemas.js';
3
- //# sourceMappingURL=index.js.map
2
+ export { OrgRoleSchema, OrgPermissionSchema, OrgAssetKindSchema, SlugSchema, slugify, RESERVED_SLUGS, orgSlugFromName, CreateOrgSchema, UpdateOrgSchema, ALL_ORG_PERMISSIONS, DEFAULT_ORG_PERMISSIONS, OWNER_ADMIN_ONLY_PERMISSIONS, MEMBER_ASSIGNABLE_PERMISSIONS } from './schemas.js';
@@ -13,10 +13,9 @@ export interface IOrgStore {
13
13
  createOrg(ctx: RequestContext, org: Organization): Promise<void>;
14
14
  updateOrg(ctx: RequestContext, id: string, patch: Partial<Pick<Organization, 'name' | 'slug' | 'assets'>>): Promise<void>;
15
15
  /**
16
- * Soft-deletes the org, cascading to org members, projects, and project
17
- * members (definitions and share links cascade through project deletion).
18
- * Invites and the org compute-server override are NOT cascaded — clean
19
- * those up explicitly if needed.
16
+ * Soft-deletes the org, cascading to org members, projects, project members and
17
+ * definitions. Share links die with their definition. Hard-deletes its invites,
18
+ * API tokens, compute servers and compute defaults.
20
19
  */
21
20
  deleteOrg(ctx: RequestContext, id: string): Promise<void>;
22
21
  listOrgMembers(ctx: RequestContext, orgId: string, opts?: ListOptions): Promise<Page<OrgMember>>;
@@ -47,4 +46,3 @@ export interface IOrgStore {
47
46
  updateOrgMemberPermissions(ctx: RequestContext, orgId: string, userId: string, permissions: readonly OrgPermission[]): Promise<void>;
48
47
  removeOrgMember(ctx: RequestContext, orgId: string, userId: string): Promise<void>;
49
48
  }
50
- //# sourceMappingURL=interface.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interface.js.map
@@ -6,14 +6,9 @@ import type { OrgAssetKind } from './schemas.js';
6
6
  *
7
7
  * Branding lives under `orgs/{id}/branding/` because it's a *public* asset
8
8
  * class — anyone, including logged-out viewers, may read a company logo.
9
- * That segment distinguishes it from `orgs/{id}/private/` (members-only).
10
- * `classifyAssetPath` / `ASSET_CLASSES` decide public-vs-private from these
11
- * prefixes.
9
+ * `classifyAssetPath` / `ASSET_CLASSES` decide visibility from these prefixes.
12
10
  */
13
11
  export declare const orgPaths: {
14
12
  readonly asset: (id: string, kind: OrgAssetKind) => string;
15
- /** Members-only blob; `name` includes the extension. */
16
- readonly privateAsset: (id: string, name: string) => string;
17
13
  readonly prefix: (id: string) => string;
18
14
  };
19
- //# sourceMappingURL=paths.d.ts.map
@@ -1,13 +1,4 @@
1
- /**
2
- * Blocks path traversal, separators, and empty segments. Called by every
3
- * helper below so a malicious `id` can't escape the `orgs/` prefix.
4
- */
5
- function assertSafeKey(value, label) {
6
- // The regex alone allows '.' and '..' — both fully match the allowed alphabet — so they need an explicit check.
7
- if (!value || !/^[A-Za-z0-9._-]+$/.test(value) || value === '.' || value === '..') {
8
- throw new Error(`Unsafe ${label}: ${JSON.stringify(value)}`);
9
- }
10
- }
1
+ import { assertSafeKey } from '../storage/safeKey.js';
11
2
  /**
12
3
  * Every branding asset is stored as `.webp` (uploads go through the shared
13
4
  * transcoder), so the path per kind is fixed and a re-upload overwrites in
@@ -15,9 +6,7 @@ function assertSafeKey(value, label) {
15
6
  *
16
7
  * Branding lives under `orgs/{id}/branding/` because it's a *public* asset
17
8
  * class — anyone, including logged-out viewers, may read a company logo.
18
- * That segment distinguishes it from `orgs/{id}/private/` (members-only).
19
- * `classifyAssetPath` / `ASSET_CLASSES` decide public-vs-private from these
20
- * prefixes.
9
+ * `classifyAssetPath` / `ASSET_CLASSES` decide visibility from these prefixes.
21
10
  */
22
11
  export const orgPaths = {
23
12
  asset: (id, kind) => {
@@ -25,15 +14,8 @@ export const orgPaths = {
25
14
  assertSafeKey(kind, 'assetKind');
26
15
  return `orgs/${id}/branding/${kind}.webp`;
27
16
  },
28
- /** Members-only blob; `name` includes the extension. */
29
- privateAsset: (id, name) => {
30
- assertSafeKey(id, 'orgId');
31
- assertSafeKey(name, 'assetName');
32
- return `orgs/${id}/private/${name}`;
33
- },
34
17
  prefix: (id) => {
35
18
  assertSafeKey(id, 'orgId');
36
19
  return `orgs/${id}/`;
37
20
  }
38
21
  };
39
- //# sourceMappingURL=paths.js.map
@@ -1,12 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * Top-level path segments a tenant slug must never equal, so a slug can never
4
- * shadow (or be shadowed by) a route. `/o/{slug}/` is the planned shape for
5
- * per-org URLs, so `o` is reserved even though the length gate below already
6
- * makes a 1-char slug impossible — that keeps a future move to `/o/{slug}/…`
7
- * collision-free before any external link is minted against a slug.
8
- * Lowercase; matching is case-insensitive so `Admin` can't slip through. Keep
9
- * in sync with the route tree's top-level directories.
4
+ * shadow (or be shadowed by) a route. `o` is reserved for `/o/{slug}/` even though
5
+ * the length gate below already makes a 1-char slug impossible.
6
+ * `reserved-slugs.test.ts` in the selva app holds this to the route tree.
10
7
  */
11
8
  export declare const RESERVED_SLUGS: readonly string[];
12
9
  /**
@@ -15,6 +12,8 @@ export declare const RESERVED_SLUGS: readonly string[];
15
12
  * untouched — run the result through `SlugSchema` where validity matters.
16
13
  */
17
14
  export declare function slugify(name: string): string;
15
+ /** A slug for an org named without a slug of its own. Always passes `SlugSchema`. */
16
+ export declare function orgSlugFromName(name: string, fallback?: string): string;
18
17
  /** Lowercase alphanumeric with internal hyphens, 3–63 chars, not a reserved word. */
19
18
  export declare const SlugSchema: z.ZodString;
20
19
  export declare const OrgRoleSchema: z.ZodEnum<{
@@ -54,4 +53,3 @@ export declare const UpdateOrgSchema: z.ZodObject<{
54
53
  }, z.core.$strip>;
55
54
  export type CreateOrgInput = z.infer<typeof CreateOrgSchema>;
56
55
  export type UpdateOrgInput = z.infer<typeof UpdateOrgSchema>;
57
- //# sourceMappingURL=schemas.d.ts.map
@@ -1,12 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * Top-level path segments a tenant slug must never equal, so a slug can never
4
- * shadow (or be shadowed by) a route. `/o/{slug}/` is the planned shape for
5
- * per-org URLs, so `o` is reserved even though the length gate below already
6
- * makes a 1-char slug impossible — that keeps a future move to `/o/{slug}/…`
7
- * collision-free before any external link is minted against a slug.
8
- * Lowercase; matching is case-insensitive so `Admin` can't slip through. Keep
9
- * in sync with the route tree's top-level directories.
4
+ * shadow (or be shadowed by) a route. `o` is reserved for `/o/{slug}/` even though
5
+ * the length gate below already makes a 1-char slug impossible.
6
+ * `reserved-slugs.test.ts` in the selva app holds this to the route tree.
10
7
  */
11
8
  export const RESERVED_SLUGS = [
12
9
  'o',
@@ -16,11 +13,13 @@ export const RESERVED_SLUGS = [
16
13
  'login',
17
14
  'logout',
18
15
  'setup',
19
- 'settings',
20
16
  'team',
21
17
  'library',
22
18
  'projects',
23
- 'accept-invite'
19
+ 'accept-invite',
20
+ 'docs',
21
+ 'mcp',
22
+ 'oauth'
24
23
  ];
25
24
  const RESERVED_SLUG_SET = new Set(RESERVED_SLUGS);
26
25
  /**
@@ -30,18 +29,27 @@ const RESERVED_SLUG_SET = new Set(RESERVED_SLUGS);
30
29
  */
31
30
  export function slugify(name) {
32
31
  return name
32
+ .normalize('NFKD')
33
+ .replace(/\p{M}/gu, '')
33
34
  .trim()
34
35
  .toLowerCase()
35
36
  .replace(/[^a-z0-9]+/g, '-')
36
- .replace(/^-|-$/g, '')
37
- .slice(0, 63);
37
+ .slice(0, 63)
38
+ .replace(/^-+|-+$/g, '');
39
+ }
40
+ /** A slug for an org named without a slug of its own. Always passes `SlugSchema`. */
41
+ export function orgSlugFromName(name, fallback = 'default') {
42
+ const slug = slugify(name);
43
+ if (slug.length < 3)
44
+ return fallback;
45
+ return RESERVED_SLUG_SET.has(slug) ? `${slug}-org` : slug;
38
46
  }
39
47
  /** Lowercase alphanumeric with internal hyphens, 3–63 chars, not a reserved word. */
40
48
  export const SlugSchema = z
41
49
  .string()
42
50
  .min(3, 'Slug must be at least 3 characters')
43
51
  .max(63, 'Slug must be at most 63 characters')
44
- .regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, 'Slug must be lowercase alphanumeric with hyphens (no leading/trailing/consecutive hyphens)')
52
+ .regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, 'Slug must be lowercase alphanumeric with hyphens (no leading or trailing hyphen)')
45
53
  .refine((s) => !RESERVED_SLUG_SET.has(s), {
46
54
  message: 'Slug is reserved and cannot be used'
47
55
  });
@@ -70,8 +78,7 @@ export const DEFAULT_ORG_PERMISSIONS = {
70
78
  member: []
71
79
  };
72
80
  export const CreateOrgSchema = z.object({
73
- name: z.string().min(1, 'Organization name is required').max(128),
81
+ name: z.string().trim().min(1, 'Organization name is required').max(128),
74
82
  slug: SlugSchema
75
83
  });
76
84
  export const UpdateOrgSchema = CreateOrgSchema.partial();
77
- //# sourceMappingURL=schemas.js.map
@@ -35,4 +35,3 @@ export interface OrgMember {
35
35
  updatedBy: string;
36
36
  deletedAt?: string | null;
37
37
  }
38
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,7 +1,9 @@
1
1
  import type { DefinitionStatus } from './definitions/types.js';
2
2
  /**
3
- * Cursor-paginated list options. Adapters default to limit=50, orderBy=createdAt
4
- * desc, and clamp limit to `MAX_PAGE_LIMIT`.
3
+ * Cursor-paginated list options. Adapters default to limit=50 and clamp limit to
4
+ * `MAX_PAGE_LIMIT`. Order is `createdAt` desc unless a store says otherwise: local
5
+ * definitions default to `name` asc, and the Supabase member, invite and token
6
+ * lists have one fixed order and ignore `orderBy`.
5
7
  *
6
8
  * Cursors are opaque — adapters may use row ids, offsets, or keyset encodings.
7
9
  * Callers must not inspect them.
@@ -44,4 +46,20 @@ export interface Page<T> {
44
46
  }
45
47
  export declare const DEFAULT_PAGE_LIMIT = 50;
46
48
  export declare const MAX_PAGE_LIMIT = 200;
47
- //# sourceMappingURL=pagination.d.ts.map
49
+ /** For adapters paging by offset. Junk and negatives read as the first page. */
50
+ export declare function decodeOffsetCursor(cursor: string | undefined): number;
51
+ export declare function encodeOffsetCursor(offset: number): string;
52
+ type PageFetcher<T> = (page: {
53
+ limit: number;
54
+ cursor?: string;
55
+ }) => Promise<Page<T>>;
56
+ /**
57
+ * Every page of a list, in order. One call stops at `MAX_PAGE_LIMIT` without saying so, which is
58
+ * fatal for a read that must see every row. Break out of the loop to stop reading.
59
+ */
60
+ export declare function walkPages<T>(fetchPage: PageFetcher<T>): AsyncGenerator<Page<T>>;
61
+ /** Every row of a list, across all its pages. */
62
+ export declare function listAll<T>(fetchPage: PageFetcher<T>): Promise<T[]>;
63
+ /** The effective page size for a requested limit. */
64
+ export declare function clampPageLimit(limit: number | undefined): number;
65
+ export {};
@@ -1,3 +1,36 @@
1
1
  export const DEFAULT_PAGE_LIMIT = 50;
2
2
  export const MAX_PAGE_LIMIT = 200;
3
- //# sourceMappingURL=pagination.js.map
3
+ /** For adapters paging by offset. Junk and negatives read as the first page. */
4
+ export function decodeOffsetCursor(cursor) {
5
+ const offset = cursor ? parseInt(cursor, 10) : 0;
6
+ return Number.isFinite(offset) && offset >= 0 ? offset : 0;
7
+ }
8
+ export function encodeOffsetCursor(offset) {
9
+ return String(offset);
10
+ }
11
+ /**
12
+ * Every page of a list, in order. One call stops at `MAX_PAGE_LIMIT` without saying so, which is
13
+ * fatal for a read that must see every row. Break out of the loop to stop reading.
14
+ */
15
+ export async function* walkPages(fetchPage) {
16
+ let cursor;
17
+ do {
18
+ const page = await fetchPage({ limit: MAX_PAGE_LIMIT, cursor });
19
+ yield page;
20
+ cursor = page.nextCursor;
21
+ } while (cursor);
22
+ }
23
+ /** Every row of a list, across all its pages. */
24
+ export async function listAll(fetchPage) {
25
+ const items = [];
26
+ for await (const page of walkPages(fetchPage))
27
+ items.push(...page.items);
28
+ return items;
29
+ }
30
+ /** The effective page size for a requested limit. */
31
+ export function clampPageLimit(limit) {
32
+ const requested = limit ?? DEFAULT_PAGE_LIMIT;
33
+ if (!Number.isFinite(requested))
34
+ return DEFAULT_PAGE_LIMIT;
35
+ return Math.min(Math.max(1, Math.floor(requested)), MAX_PAGE_LIMIT);
36
+ }
@@ -1,4 +1,4 @@
1
1
  export type { PlatformPermission } from './types.js';
2
- export { PlatformPermissionSchema, ALL_PLATFORM_PERMISSIONS } from './types.js';
2
+ export { PlatformPermissionSchema, ALL_PLATFORM_PERMISSIONS, OPERATOR_PLATFORM_PERMISSIONS } from './types.js';
3
3
  export type { IPlatformPermissionStore } from './interface.js';
4
- //# sourceMappingURL=index.d.ts.map
4
+ export { assertCanManagePermissions, assertCanReadPermissions, assertCanReadPermissionsBatch } from '../context.js';
@@ -1,2 +1,2 @@
1
- export { PlatformPermissionSchema, ALL_PLATFORM_PERMISSIONS } from './types.js';
2
- //# sourceMappingURL=index.js.map
1
+ export { PlatformPermissionSchema, ALL_PLATFORM_PERMISSIONS, OPERATOR_PLATFORM_PERMISSIONS } from './types.js';
2
+ export { assertCanManagePermissions, assertCanReadPermissions, assertCanReadPermissionsBatch } from '../context.js';
@@ -27,7 +27,9 @@ export interface IPlatformPermissionStore {
27
27
  set(ctx: RequestContext, userId: string, permissions: readonly PlatformPermission[]): Promise<UserManagementResult>;
28
28
  /**
29
29
  * True if at least one *enabled* user holds `instance_admin`. Adapters
30
- * must exclude disabled users — over-count is safer than under-count.
30
+ * must exclude disabled users. One that can't see the disabled flag, like local,
31
+ * relies on the routes: disabling revokes `instance_admin` first, and a disabled
32
+ * user can't be granted it.
31
33
  */
32
34
  hasInstanceAdmin(ctx: RequestContext): Promise<boolean>;
33
35
  /**
@@ -45,8 +47,7 @@ export interface IPlatformPermissionStore {
45
47
  * write: on a fresh single-tenant install with no
46
48
  * `BOOTSTRAP_INSTANCE_ADMIN_EMAIL` configured, any signer is eligible, so
47
49
  * two people signing in at the same moment both observe "no admin" and both
48
- * become permanent platform admins. §2 promises "first signer wins" — this
49
- * is what makes that true rather than aspirational.
50
+ * become permanent platform admins. This is what makes first signer win.
50
51
  *
51
52
  * Same shape as the sole-admin invariant (`set`), pointing the other way:
52
53
  * that one refuses to drop the last admin, this one refuses to create a
@@ -54,4 +55,3 @@ export interface IPlatformPermissionStore {
54
55
  */
55
56
  claimFirstInstanceAdmin(ctx: RequestContext, userId: string, permissions: readonly PlatformPermission[]): Promise<boolean>;
56
57
  }
57
- //# sourceMappingURL=interface.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interface.js.map
@@ -23,4 +23,3 @@ export declare const ALL_PLATFORM_PERMISSIONS: readonly PlatformPermission[];
23
23
  * `manage_api_tokens` is granted to ordinary users, who have no business there.
24
24
  */
25
25
  export declare const OPERATOR_PLATFORM_PERMISSIONS: readonly PlatformPermission[];
26
- //# sourceMappingURL=types.d.ts.map
@@ -22,4 +22,3 @@ export const ALL_PLATFORM_PERMISSIONS = PlatformPermissionSchema.options;
22
22
  * `manage_api_tokens` is granted to ordinary users, who have no business there.
23
23
  */
24
24
  export const OPERATOR_PLATFORM_PERMISSIONS = ALL_PLATFORM_PERMISSIONS.filter((p) => p !== 'manage_api_tokens');
25
- //# sourceMappingURL=types.js.map
@@ -1,4 +1,2 @@
1
- export type { PlatformProjectGrant, PlatformProjectGranteeType } from './types.js';
1
+ export type { PlatformProjectGrant } from './types.js';
2
2
  export type { IPlatformProjectGrantStore } from './interface.js';
3
- export { PlatformProjectGrantSchema, PlatformProjectGranteeTypeSchema } from './schemas.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
- export { PlatformProjectGrantSchema, PlatformProjectGranteeTypeSchema } from './schemas.js';
2
- //# sourceMappingURL=index.js.map
1
+ export {};
@@ -22,4 +22,3 @@ export interface IPlatformProjectGrantStore {
22
22
  */
23
23
  deleteByGranteeOrg(ctx: RequestContext, orgId: string): Promise<void>;
24
24
  }
25
- //# sourceMappingURL=interface.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interface.js.map
@@ -15,4 +15,3 @@ export declare const PlatformProjectGrantSchema: z.ZodObject<{
15
15
  createdBy: z.ZodString;
16
16
  createdAt: z.ZodString;
17
17
  }, z.core.$strip>;
18
- //# sourceMappingURL=schemas.d.ts.map
@@ -9,4 +9,3 @@ export const PlatformProjectGrantSchema = z.object({
9
9
  createdBy: z.string(),
10
10
  createdAt: z.string()
11
11
  });
12
- //# sourceMappingURL=schemas.js.map
@@ -1,4 +1,6 @@
1
- export type PlatformProjectGranteeType = 'org' | 'user';
1
+ import type { z } from 'zod';
2
+ import type { PlatformProjectGranteeTypeSchema } from './schemas.js';
3
+ export type PlatformProjectGranteeType = z.infer<typeof PlatformProjectGranteeTypeSchema>;
2
4
  /**
3
5
  * Grants view-only or view+solve access to a `platform`-visibility project
4
6
  * for an org or an individual user, without creating project membership rows.
@@ -16,4 +18,3 @@ export interface PlatformProjectGrant {
16
18
  createdBy: string;
17
19
  createdAt: string;
18
20
  }
19
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -2,4 +2,3 @@ export type { Project, ProjectMember } from './types.js';
2
2
  export type { IProjectStore } from './interface.js';
3
3
  export type { ProjectVisibility, ProjectRole } from './schemas.js';
4
4
  export { ProjectVisibilitySchema, ProjectRoleSchema, validateProjectFlags } from './schemas.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { ProjectVisibilitySchema, ProjectRoleSchema, validateProjectFlags } from './schemas.js';
2
- //# sourceMappingURL=index.js.map
@@ -38,4 +38,3 @@ export interface IProjectStore {
38
38
  updateProjectMemberRole(ctx: RequestContext, projectId: string, userId: string, role: ProjectRole): Promise<void>;
39
39
  removeProjectMember(ctx: RequestContext, projectId: string, userId: string): Promise<void>;
40
40
  }
41
- //# sourceMappingURL=interface.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interface.js.map
@@ -20,4 +20,3 @@ export declare function validateProjectFlags(merged: {
20
20
  path: string;
21
21
  message: string;
22
22
  }[];
23
- //# sourceMappingURL=schemas.d.ts.map
@@ -18,4 +18,3 @@ export function validateProjectFlags(merged) {
18
18
  }
19
19
  return issues;
20
20
  }
21
- //# sourceMappingURL=schemas.js.map