@pikku/addon-admin 0.12.17 → 0.12.20

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 (410) hide show
  1. package/README.md +24 -6
  2. package/dist/.pikku/addon/agent/index.d.ts +1 -1
  3. package/dist/.pikku/addon/agent/index.js +1 -1
  4. package/dist/.pikku/addon/agent/pikku-agent-map.gen.d.ts +1 -1
  5. package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts +1 -1
  6. package/dist/.pikku/addon/agent/pikku-model-aliases.gen.js +1 -1
  7. package/dist/.pikku/addon/agent/pikku-scorer-names.gen.d.ts +1 -1
  8. package/dist/.pikku/addon/analytics/index.d.ts +1 -1
  9. package/dist/.pikku/addon/analytics/index.js +1 -1
  10. package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts +1 -1
  11. package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js +1 -1
  12. package/dist/.pikku/addon/attention/index.d.ts +8 -0
  13. package/dist/.pikku/addon/attention/index.d.ts.map +1 -0
  14. package/dist/.pikku/addon/attention/index.js +8 -0
  15. package/dist/.pikku/addon/attention/index.js.map +1 -0
  16. package/dist/.pikku/addon/attention/pikku-attention-types.gen.d.ts +16 -0
  17. package/dist/.pikku/addon/attention/pikku-attention-types.gen.d.ts.map +1 -0
  18. package/dist/.pikku/addon/attention/pikku-attention-types.gen.js +14 -0
  19. package/dist/.pikku/addon/attention/pikku-attention-types.gen.js.map +1 -0
  20. package/dist/.pikku/addon/auth/index.d.ts +1 -1
  21. package/dist/.pikku/addon/auth/index.js +1 -1
  22. package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts +3 -17
  23. package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts.map +1 -1
  24. package/dist/.pikku/addon/auth/pikku-auth-types.gen.js +3 -17
  25. package/dist/.pikku/addon/auth/pikku-auth-types.gen.js.map +1 -1
  26. package/dist/.pikku/addon/channel/index.d.ts +1 -1
  27. package/dist/.pikku/addon/channel/index.js +1 -1
  28. package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts +1 -1
  29. package/dist/.pikku/addon/channel/pikku-channel-types.gen.js +1 -1
  30. package/dist/.pikku/addon/cli/index.d.ts +1 -1
  31. package/dist/.pikku/addon/cli/index.js +1 -1
  32. package/dist/.pikku/addon/cli/pikku-cli-types.gen.d.ts +1 -1
  33. package/dist/.pikku/addon/cli/pikku-cli-types.gen.js +1 -1
  34. package/dist/.pikku/addon/error/index.d.ts +1 -1
  35. package/dist/.pikku/addon/error/index.js +1 -1
  36. package/dist/.pikku/addon/error/pikku-error-types.gen.d.ts +1 -1
  37. package/dist/.pikku/addon/error/pikku-error-types.gen.js +1 -1
  38. package/dist/.pikku/addon/function/index.d.ts +1 -1
  39. package/dist/.pikku/addon/function/index.js +1 -1
  40. package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts +69 -14
  41. package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts.map +1 -1
  42. package/dist/.pikku/addon/function/pikku-function-types.gen.js +2 -10
  43. package/dist/.pikku/addon/function/pikku-function-types.gen.js.map +1 -1
  44. package/dist/.pikku/addon/function/pikku-functions-meta-verbose.gen.json +565 -216
  45. package/dist/.pikku/addon/function/pikku-functions-meta.gen.js +1 -1
  46. package/dist/.pikku/addon/function/pikku-functions-meta.gen.json +162 -72
  47. package/dist/.pikku/addon/function/pikku-functions.gen.js +7 -1
  48. package/dist/.pikku/addon/function/pikku-functions.gen.js.map +1 -1
  49. package/dist/.pikku/addon/harness/pikku-harness-gate-names.gen.d.ts +8 -0
  50. package/dist/.pikku/addon/harness/pikku-harness-gate-names.gen.d.ts.map +1 -0
  51. package/dist/.pikku/addon/harness/pikku-harness-gate-names.gen.js +8 -0
  52. package/dist/.pikku/addon/harness/pikku-harness-gate-names.gen.js.map +1 -0
  53. package/dist/.pikku/addon/http/index.d.ts +1 -1
  54. package/dist/.pikku/addon/http/index.js +1 -1
  55. package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts +1 -1
  56. package/dist/.pikku/addon/http/pikku-http-types.gen.js +1 -1
  57. package/dist/.pikku/addon/keypairs/index.d.ts +1 -1
  58. package/dist/.pikku/addon/keypairs/index.js +1 -1
  59. package/dist/.pikku/addon/keypairs/pikku-keypair-types.gen.d.ts +1 -1
  60. package/dist/.pikku/addon/keypairs/pikku-keypair-types.gen.js +1 -1
  61. package/dist/.pikku/addon/keypairs/pikku-keypairs.gen.d.ts +2 -1
  62. package/dist/.pikku/addon/keypairs/pikku-keypairs.gen.d.ts.map +1 -1
  63. package/dist/.pikku/addon/mcp/index.d.ts +1 -1
  64. package/dist/.pikku/addon/mcp/index.js +1 -1
  65. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts +1 -1
  66. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js +1 -1
  67. package/dist/.pikku/addon/middleware/index.d.ts +1 -1
  68. package/dist/.pikku/addon/middleware/index.js +1 -1
  69. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts +1 -1
  70. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js +1 -1
  71. package/dist/.pikku/addon/permissions/pikku-permissions.gen.d.ts +1 -1
  72. package/dist/.pikku/addon/permissions/pikku-permissions.gen.js +1 -1
  73. package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  74. package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.js +1 -1
  75. package/dist/.pikku/addon/pikku-bootstrap.gen.d.ts +1 -1
  76. package/dist/.pikku/addon/pikku-bootstrap.gen.js +1 -1
  77. package/dist/.pikku/addon/pikku-local-services.gen.js +1 -1
  78. package/dist/.pikku/addon/pikku-package.gen.js +2 -2
  79. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
  80. package/dist/.pikku/addon/pikku-services.gen.d.ts +6 -4
  81. package/dist/.pikku/addon/pikku-services.gen.d.ts.map +1 -1
  82. package/dist/.pikku/addon/pikku-services.gen.js +4 -2
  83. package/dist/.pikku/addon/pikku-services.gen.js.map +1 -1
  84. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.gen.d.ts +8 -1
  85. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +8 -1
  86. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +3 -1
  87. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  88. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  89. package/dist/.pikku/addon/scenarios/index.d.ts +1 -1
  90. package/dist/.pikku/addon/scenarios/index.js +1 -1
  91. package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  92. package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  93. package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  94. package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  95. package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  96. package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.js +1 -1
  97. package/dist/.pikku/addon/scenarios/schemas/register.gen.d.ts +1 -1
  98. package/dist/.pikku/addon/scenarios/schemas/register.gen.js +1 -1
  99. package/dist/.pikku/addon/schemas/register.gen.js +9 -1
  100. package/dist/.pikku/addon/schemas/register.gen.js.map +1 -1
  101. package/dist/.pikku/addon/schemas/schemas/AttentionInput.schema.json +1 -0
  102. package/dist/.pikku/addon/schemas/schemas/AttentionResult.schema.json +1 -0
  103. package/dist/.pikku/addon/schemas/schemas/InviteUserInput.schema.json +1 -0
  104. package/dist/.pikku/addon/schemas/schemas/InviteUserOutput.schema.json +1 -0
  105. package/dist/.pikku/addon/scopes/index.d.ts +1 -1
  106. package/dist/.pikku/addon/scopes/index.js +1 -1
  107. package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.d.ts +1 -1
  108. package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts +1 -1
  109. package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts +1 -1
  110. package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts +1 -1
  111. package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js +1 -1
  112. package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts +1 -1
  113. package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.js +1 -1
  114. package/dist/.pikku/addon/screens/index.d.ts +1 -1
  115. package/dist/.pikku/addon/screens/index.js +1 -1
  116. package/dist/.pikku/addon/screens/pikku-plugin-types.gen.d.ts +1 -0
  117. package/dist/.pikku/addon/screens/pikku-plugin-types.gen.d.ts.map +1 -1
  118. package/dist/.pikku/addon/screens/pikku-plugin-types.gen.js +2 -1
  119. package/dist/.pikku/addon/screens/pikku-plugin-types.gen.js.map +1 -1
  120. package/dist/.pikku/addon/secrets/index.d.ts +1 -1
  121. package/dist/.pikku/addon/secrets/index.js +1 -1
  122. package/dist/.pikku/addon/secrets/pikku-secret-types.gen.d.ts +1 -1
  123. package/dist/.pikku/addon/secrets/pikku-secret-types.gen.js +1 -1
  124. package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts +1 -1
  125. package/dist/.pikku/addon/secrets/pikku-secrets.gen.js +1 -1
  126. package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts +1 -1
  127. package/dist/.pikku/addon/services/pikku-meta-service.gen.js +1 -1
  128. package/dist/.pikku/addon/setup/index.d.ts +1 -1
  129. package/dist/.pikku/addon/setup/index.js +1 -1
  130. package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts +1 -1
  131. package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.js +1 -1
  132. package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts +1 -1
  133. package/dist/.pikku/addon/setup/pikku-setup-types.gen.js +1 -1
  134. package/dist/.pikku/addon/trigger/index.d.ts +1 -1
  135. package/dist/.pikku/addon/trigger/index.js +1 -1
  136. package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts +1 -1
  137. package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js +1 -1
  138. package/dist/.pikku/addon/utils/index.d.ts +1 -1
  139. package/dist/.pikku/addon/utils/index.js +1 -1
  140. package/dist/.pikku/addon/utils/pikku-utils-types.gen.d.ts +1 -1
  141. package/dist/.pikku/addon/utils/pikku-utils-types.gen.js +1 -1
  142. package/dist/.pikku/addon/variables/index.d.ts +1 -1
  143. package/dist/.pikku/addon/variables/index.js +1 -1
  144. package/dist/.pikku/addon/variables/pikku-variable-types.gen.d.ts +1 -1
  145. package/dist/.pikku/addon/variables/pikku-variable-types.gen.js +1 -1
  146. package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts +1 -1
  147. package/dist/.pikku/addon/variables/pikku-variables.gen.js +1 -1
  148. package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.d.ts +1 -1
  149. package/dist/.pikku/addon/workflow/index.d.ts +1 -1
  150. package/dist/.pikku/addon/workflow/index.js +1 -1
  151. package/dist/.pikku/addon/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
  152. package/dist/.pikku/addon/workflow/pikku-workflow-map.gen.d.ts +4 -2
  153. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts +1 -1
  154. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js +1 -1
  155. package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  156. package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  157. package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.js +1 -1
  158. package/dist/src/function-tags.test.d.ts +2 -0
  159. package/dist/src/function-tags.test.d.ts.map +1 -0
  160. package/dist/src/function-tags.test.js +22 -0
  161. package/dist/src/function-tags.test.js.map +1 -0
  162. package/dist/src/functions/agent-credential-check.function.d.ts.map +1 -1
  163. package/dist/src/functions/agent-credential-check.function.js +1 -0
  164. package/dist/src/functions/agent-credential-check.function.js.map +1 -1
  165. package/dist/src/functions/attention.function.test.d.ts +2 -0
  166. package/dist/src/functions/attention.function.test.d.ts.map +1 -0
  167. package/dist/src/functions/attention.function.test.js +46 -0
  168. package/dist/src/functions/attention.function.test.js.map +1 -0
  169. package/dist/src/functions/create-user.function.d.ts.map +1 -1
  170. package/dist/src/functions/create-user.function.js +1 -0
  171. package/dist/src/functions/create-user.function.js.map +1 -1
  172. package/dist/src/functions/credential-delete.function.d.ts.map +1 -1
  173. package/dist/src/functions/credential-delete.function.js +1 -0
  174. package/dist/src/functions/credential-delete.function.js.map +1 -1
  175. package/dist/src/functions/credential-get.function.d.ts.map +1 -1
  176. package/dist/src/functions/credential-get.function.js +1 -0
  177. package/dist/src/functions/credential-get.function.js.map +1 -1
  178. package/dist/src/functions/credential-list-users.function.d.ts.map +1 -1
  179. package/dist/src/functions/credential-list-users.function.js +1 -0
  180. package/dist/src/functions/credential-list-users.function.js.map +1 -1
  181. package/dist/src/functions/credential-set.function.d.ts.map +1 -1
  182. package/dist/src/functions/credential-set.function.js +1 -0
  183. package/dist/src/functions/credential-set.function.js.map +1 -1
  184. package/dist/src/functions/credential-status.function.d.ts.map +1 -1
  185. package/dist/src/functions/credential-status.function.js +1 -0
  186. package/dist/src/functions/credential-status.function.js.map +1 -1
  187. package/dist/src/functions/credential-users.function.d.ts.map +1 -1
  188. package/dist/src/functions/credential-users.function.js +1 -0
  189. package/dist/src/functions/credential-users.function.js.map +1 -1
  190. package/dist/src/functions/delete-agent-thread.function.d.ts.map +1 -1
  191. package/dist/src/functions/delete-agent-thread.function.js +1 -0
  192. package/dist/src/functions/delete-agent-thread.function.js.map +1 -1
  193. package/dist/src/functions/delete-workflow-run.function.d.ts.map +1 -1
  194. package/dist/src/functions/delete-workflow-run.function.js +1 -0
  195. package/dist/src/functions/delete-workflow-run.function.js.map +1 -1
  196. package/dist/src/functions/flag-clear-override.function.d.ts.map +1 -1
  197. package/dist/src/functions/flag-clear-override.function.js +1 -0
  198. package/dist/src/functions/flag-clear-override.function.js.map +1 -1
  199. package/dist/src/functions/flag-list.function.d.ts.map +1 -1
  200. package/dist/src/functions/flag-list.function.js +1 -0
  201. package/dist/src/functions/flag-list.function.js.map +1 -1
  202. package/dist/src/functions/flag-overrides.function.d.ts.map +1 -1
  203. package/dist/src/functions/flag-overrides.function.js +1 -0
  204. package/dist/src/functions/flag-overrides.function.js.map +1 -1
  205. package/dist/src/functions/flag-prune.function.d.ts.map +1 -1
  206. package/dist/src/functions/flag-prune.function.js +1 -0
  207. package/dist/src/functions/flag-prune.function.js.map +1 -1
  208. package/dist/src/functions/flag-set-enabled.function.d.ts.map +1 -1
  209. package/dist/src/functions/flag-set-enabled.function.js +1 -0
  210. package/dist/src/functions/flag-set-enabled.function.js.map +1 -1
  211. package/dist/src/functions/flag-set-override.function.d.ts.map +1 -1
  212. package/dist/src/functions/flag-set-override.function.js +1 -0
  213. package/dist/src/functions/flag-set-override.function.js.map +1 -1
  214. package/dist/src/functions/flag-set-rollout.function.d.ts.map +1 -1
  215. package/dist/src/functions/flag-set-rollout.function.js +1 -0
  216. package/dist/src/functions/flag-set-rollout.function.js.map +1 -1
  217. package/dist/src/functions/flag-sync.function.d.ts.map +1 -1
  218. package/dist/src/functions/flag-sync.function.js +1 -0
  219. package/dist/src/functions/flag-sync.function.js.map +1 -1
  220. package/dist/src/functions/get-addon-instances.function.d.ts.map +1 -1
  221. package/dist/src/functions/get-addon-instances.function.js +1 -0
  222. package/dist/src/functions/get-addon-instances.function.js.map +1 -1
  223. package/dist/src/functions/get-agent-run-scores.function.d.ts.map +1 -1
  224. package/dist/src/functions/get-agent-run-scores.function.js +1 -0
  225. package/dist/src/functions/get-agent-run-scores.function.js.map +1 -1
  226. package/dist/src/functions/get-agent-thread-messages.function.d.ts.map +1 -1
  227. package/dist/src/functions/get-agent-thread-messages.function.js +1 -0
  228. package/dist/src/functions/get-agent-thread-messages.function.js.map +1 -1
  229. package/dist/src/functions/get-agent-thread-runs.function.d.ts.map +1 -1
  230. package/dist/src/functions/get-agent-thread-runs.function.js +1 -0
  231. package/dist/src/functions/get-agent-thread-runs.function.js.map +1 -1
  232. package/dist/src/functions/get-agent-threads.function.d.ts.map +1 -1
  233. package/dist/src/functions/get-agent-threads.function.js +1 -0
  234. package/dist/src/functions/get-agent-threads.function.js.map +1 -1
  235. package/dist/src/functions/get-attention.function.d.ts +8 -0
  236. package/dist/src/functions/get-attention.function.d.ts.map +1 -0
  237. package/dist/src/functions/get-attention.function.js +10 -0
  238. package/dist/src/functions/get-attention.function.js.map +1 -0
  239. package/dist/src/functions/get-audit-filters.function.d.ts.map +1 -1
  240. package/dist/src/functions/get-audit-filters.function.js +1 -0
  241. package/dist/src/functions/get-audit-filters.function.js.map +1 -1
  242. package/dist/src/functions/get-audits.function.d.ts.map +1 -1
  243. package/dist/src/functions/get-audits.function.js +1 -0
  244. package/dist/src/functions/get-audits.function.js.map +1 -1
  245. package/dist/src/functions/get-incoming-webhook-receipt.function.d.ts.map +1 -1
  246. package/dist/src/functions/get-incoming-webhook-receipt.function.js +1 -0
  247. package/dist/src/functions/get-incoming-webhook-receipt.function.js.map +1 -1
  248. package/dist/src/functions/get-installed-addons.function.d.ts.map +1 -1
  249. package/dist/src/functions/get-installed-addons.function.js +1 -0
  250. package/dist/src/functions/get-installed-addons.function.js.map +1 -1
  251. package/dist/src/functions/get-my-access.function.d.ts.map +1 -1
  252. package/dist/src/functions/get-my-access.function.js +1 -0
  253. package/dist/src/functions/get-my-access.function.js.map +1 -1
  254. package/dist/src/functions/get-queue-history.function.d.ts.map +1 -1
  255. package/dist/src/functions/get-queue-history.function.js +1 -0
  256. package/dist/src/functions/get-queue-history.function.js.map +1 -1
  257. package/dist/src/functions/get-scheduler-history.function.d.ts.map +1 -1
  258. package/dist/src/functions/get-scheduler-history.function.js +1 -0
  259. package/dist/src/functions/get-scheduler-history.function.js.map +1 -1
  260. package/dist/src/functions/get-scorers.function.d.ts.map +1 -1
  261. package/dist/src/functions/get-scorers.function.js +1 -0
  262. package/dist/src/functions/get-scorers.function.js.map +1 -1
  263. package/dist/src/functions/get-virtual-user-run-steps.function.d.ts.map +1 -1
  264. package/dist/src/functions/get-virtual-user-run-steps.function.js +1 -0
  265. package/dist/src/functions/get-virtual-user-run-steps.function.js.map +1 -1
  266. package/dist/src/functions/get-virtual-user-runs.function.d.ts.map +1 -1
  267. package/dist/src/functions/get-virtual-user-runs.function.js +1 -0
  268. package/dist/src/functions/get-virtual-user-runs.function.js.map +1 -1
  269. package/dist/src/functions/get-virtual-user-schedules.function.d.ts.map +1 -1
  270. package/dist/src/functions/get-virtual-user-schedules.function.js +1 -0
  271. package/dist/src/functions/get-virtual-user-schedules.function.js.map +1 -1
  272. package/dist/src/functions/get-webhook-delivery.function.d.ts.map +1 -1
  273. package/dist/src/functions/get-webhook-delivery.function.js +1 -0
  274. package/dist/src/functions/get-webhook-delivery.function.js.map +1 -1
  275. package/dist/src/functions/get-workflow-run-history.function.d.ts.map +1 -1
  276. package/dist/src/functions/get-workflow-run-history.function.js +1 -0
  277. package/dist/src/functions/get-workflow-run-history.function.js.map +1 -1
  278. package/dist/src/functions/get-workflow-run-names.function.d.ts.map +1 -1
  279. package/dist/src/functions/get-workflow-run-names.function.js +1 -0
  280. package/dist/src/functions/get-workflow-run-names.function.js.map +1 -1
  281. package/dist/src/functions/get-workflow-run-steps.function.d.ts.map +1 -1
  282. package/dist/src/functions/get-workflow-run-steps.function.js +1 -0
  283. package/dist/src/functions/get-workflow-run-steps.function.js.map +1 -1
  284. package/dist/src/functions/get-workflow-run.function.d.ts.map +1 -1
  285. package/dist/src/functions/get-workflow-run.function.js +1 -0
  286. package/dist/src/functions/get-workflow-run.function.js.map +1 -1
  287. package/dist/src/functions/get-workflow-runs.function.d.ts.map +1 -1
  288. package/dist/src/functions/get-workflow-runs.function.js +1 -0
  289. package/dist/src/functions/get-workflow-runs.function.js.map +1 -1
  290. package/dist/src/functions/get-workflow-version.function.d.ts.map +1 -1
  291. package/dist/src/functions/get-workflow-version.function.js +1 -0
  292. package/dist/src/functions/get-workflow-version.function.js.map +1 -1
  293. package/dist/src/functions/invite-user.function.d.ts +23 -0
  294. package/dist/src/functions/invite-user.function.d.ts.map +1 -0
  295. package/dist/src/functions/invite-user.function.js +65 -0
  296. package/dist/src/functions/invite-user.function.js.map +1 -0
  297. package/dist/src/functions/invite-user.function.test.d.ts +2 -0
  298. package/dist/src/functions/invite-user.function.test.d.ts.map +1 -0
  299. package/dist/src/functions/invite-user.function.test.js +197 -0
  300. package/dist/src/functions/invite-user.function.test.js.map +1 -0
  301. package/dist/src/functions/list-incoming-webhook-receipts.function.d.ts.map +1 -1
  302. package/dist/src/functions/list-incoming-webhook-receipts.function.js +1 -0
  303. package/dist/src/functions/list-incoming-webhook-receipts.function.js.map +1 -1
  304. package/dist/src/functions/list-users.function.d.ts.map +1 -1
  305. package/dist/src/functions/list-users.function.js +1 -0
  306. package/dist/src/functions/list-users.function.js.map +1 -1
  307. package/dist/src/functions/list-webhook-deliveries.function.d.ts.map +1 -1
  308. package/dist/src/functions/list-webhook-deliveries.function.js +1 -0
  309. package/dist/src/functions/list-webhook-deliveries.function.js.map +1 -1
  310. package/dist/src/functions/ping.function.d.ts.map +1 -1
  311. package/dist/src/functions/ping.function.js +1 -0
  312. package/dist/src/functions/ping.function.js.map +1 -1
  313. package/dist/src/functions/refresh-attention.function.d.ts +4 -0
  314. package/dist/src/functions/refresh-attention.function.d.ts.map +1 -0
  315. package/dist/src/functions/refresh-attention.function.js +10 -0
  316. package/dist/src/functions/refresh-attention.function.js.map +1 -0
  317. package/dist/src/functions/remove-user.function.d.ts.map +1 -1
  318. package/dist/src/functions/remove-user.function.js +1 -0
  319. package/dist/src/functions/remove-user.function.js.map +1 -1
  320. package/dist/src/functions/revoke-user-sessions.function.d.ts.map +1 -1
  321. package/dist/src/functions/revoke-user-sessions.function.js +1 -0
  322. package/dist/src/functions/revoke-user-sessions.function.js.map +1 -1
  323. package/dist/src/functions/scope-add-scope-to-user.function.d.ts.map +1 -1
  324. package/dist/src/functions/scope-add-scope-to-user.function.js +1 -0
  325. package/dist/src/functions/scope-add-scope-to-user.function.js.map +1 -1
  326. package/dist/src/functions/scope-add-user-to-role.function.d.ts.map +1 -1
  327. package/dist/src/functions/scope-add-user-to-role.function.js +1 -0
  328. package/dist/src/functions/scope-add-user-to-role.function.js.map +1 -1
  329. package/dist/src/functions/scope-create-role.function.d.ts.map +1 -1
  330. package/dist/src/functions/scope-create-role.function.js +1 -0
  331. package/dist/src/functions/scope-create-role.function.js.map +1 -1
  332. package/dist/src/functions/scope-delete-role.function.d.ts.map +1 -1
  333. package/dist/src/functions/scope-delete-role.function.js +1 -0
  334. package/dist/src/functions/scope-delete-role.function.js.map +1 -1
  335. package/dist/src/functions/scope-list-declared.function.d.ts.map +1 -1
  336. package/dist/src/functions/scope-list-declared.function.js +1 -0
  337. package/dist/src/functions/scope-list-declared.function.js.map +1 -1
  338. package/dist/src/functions/scope-list-roles.function.d.ts.map +1 -1
  339. package/dist/src/functions/scope-list-roles.function.js +1 -0
  340. package/dist/src/functions/scope-list-roles.function.js.map +1 -1
  341. package/dist/src/functions/scope-list-user-roles.function.d.ts.map +1 -1
  342. package/dist/src/functions/scope-list-user-roles.function.js +1 -0
  343. package/dist/src/functions/scope-list-user-roles.function.js.map +1 -1
  344. package/dist/src/functions/scope-remove-scope-from-user.function.d.ts.map +1 -1
  345. package/dist/src/functions/scope-remove-scope-from-user.function.js +1 -0
  346. package/dist/src/functions/scope-remove-scope-from-user.function.js.map +1 -1
  347. package/dist/src/functions/scope-remove-user-from-role.function.d.ts.map +1 -1
  348. package/dist/src/functions/scope-remove-user-from-role.function.js +1 -0
  349. package/dist/src/functions/scope-remove-user-from-role.function.js.map +1 -1
  350. package/dist/src/functions/scope-set-role-scopes.function.d.ts.map +1 -1
  351. package/dist/src/functions/scope-set-role-scopes.function.js +1 -0
  352. package/dist/src/functions/scope-set-role-scopes.function.js.map +1 -1
  353. package/dist/src/functions/secret-get.function.d.ts.map +1 -1
  354. package/dist/src/functions/secret-get.function.js +1 -0
  355. package/dist/src/functions/secret-get.function.js.map +1 -1
  356. package/dist/src/functions/secret-has.function.d.ts.map +1 -1
  357. package/dist/src/functions/secret-has.function.js +1 -0
  358. package/dist/src/functions/secret-has.function.js.map +1 -1
  359. package/dist/src/functions/secret-set.function.d.ts.map +1 -1
  360. package/dist/src/functions/secret-set.function.js +1 -0
  361. package/dist/src/functions/secret-set.function.js.map +1 -1
  362. package/dist/src/functions/send-sign-in-link.function.d.ts.map +1 -1
  363. package/dist/src/functions/send-sign-in-link.function.js +1 -0
  364. package/dist/src/functions/send-sign-in-link.function.js.map +1 -1
  365. package/dist/src/functions/set-user-banned.function.d.ts.map +1 -1
  366. package/dist/src/functions/set-user-banned.function.js +1 -0
  367. package/dist/src/functions/set-user-banned.function.js.map +1 -1
  368. package/dist/src/functions/set-user-password.function.d.ts.map +1 -1
  369. package/dist/src/functions/set-user-password.function.js +1 -0
  370. package/dist/src/functions/set-user-password.function.js.map +1 -1
  371. package/dist/src/functions/stream-workflow-run.function.d.ts.map +1 -1
  372. package/dist/src/functions/stream-workflow-run.function.js +1 -0
  373. package/dist/src/functions/stream-workflow-run.function.js.map +1 -1
  374. package/dist/src/functions/trigger-source-disable.function.d.ts.map +1 -1
  375. package/dist/src/functions/trigger-source-disable.function.js +1 -0
  376. package/dist/src/functions/trigger-source-disable.function.js.map +1 -1
  377. package/dist/src/functions/trigger-source-enable.function.d.ts.map +1 -1
  378. package/dist/src/functions/trigger-source-enable.function.js +1 -0
  379. package/dist/src/functions/trigger-source-enable.function.js.map +1 -1
  380. package/dist/src/functions/trigger-source-forget.function.d.ts.map +1 -1
  381. package/dist/src/functions/trigger-source-forget.function.js +1 -0
  382. package/dist/src/functions/trigger-source-forget.function.js.map +1 -1
  383. package/dist/src/functions/trigger-source-list.function.d.ts.map +1 -1
  384. package/dist/src/functions/trigger-source-list.function.js +1 -0
  385. package/dist/src/functions/trigger-source-list.function.js.map +1 -1
  386. package/dist/src/functions/trigger-source-reconcile.function.d.ts.map +1 -1
  387. package/dist/src/functions/trigger-source-reconcile.function.js +1 -0
  388. package/dist/src/functions/trigger-source-reconcile.function.js.map +1 -1
  389. package/dist/src/functions/trigger-source-teardown.function.d.ts.map +1 -1
  390. package/dist/src/functions/trigger-source-teardown.function.js +1 -0
  391. package/dist/src/functions/trigger-source-teardown.function.js.map +1 -1
  392. package/dist/src/functions/variable-get.function.d.ts.map +1 -1
  393. package/dist/src/functions/variable-get.function.js +1 -0
  394. package/dist/src/functions/variable-get.function.js.map +1 -1
  395. package/dist/src/functions/variable-set.function.d.ts.map +1 -1
  396. package/dist/src/functions/variable-set.function.js +1 -0
  397. package/dist/src/functions/variable-set.function.js.map +1 -1
  398. package/dist/src/lib/invite-errors.d.ts +20 -0
  399. package/dist/src/lib/invite-errors.d.ts.map +1 -0
  400. package/dist/src/lib/invite-errors.js +50 -0
  401. package/dist/src/lib/invite-errors.js.map +1 -0
  402. package/dist/src/lib/user.schemas.d.ts +15 -0
  403. package/dist/src/lib/user.schemas.d.ts.map +1 -1
  404. package/dist/src/lib/user.schemas.js +15 -0
  405. package/dist/src/lib/user.schemas.js.map +1 -1
  406. package/dist/src/services.d.ts +1 -2
  407. package/dist/src/services.d.ts.map +1 -1
  408. package/dist/src/services.js +1 -2
  409. package/dist/src/services.js.map +1 -1
  410. package/package.json +3 -3
package/README.md CHANGED
@@ -3,12 +3,8 @@
3
3
  Administration for a Pikku application, as ordinary namespaced RPCs: the user
4
4
  directory, roles and scopes, credentials, and the audit trail.
5
5
 
6
- Separate from `@pikku/addon-console` on purpose. The console addon exists to be
7
- served alongside a running dev server — it reads generated metadata, project
8
- source and knowledge notes from disk. This one touches nothing but the services
9
- your application already has, so it can be wired into a deployed serverless
10
- unit and called from your own admin screens without the console anywhere in
11
- sight.
6
+ It touches nothing but the services your application already has, so it can be
7
+ wired into a deployed serverless unit and called from your own admin screens.
12
8
 
13
9
  ## Install
14
10
 
@@ -56,6 +52,28 @@ functions work through the internal adapter, and each is already gated by its
56
52
  own `admin:*` scope — `admin()` would only add a second check against a `role`
57
53
  column that has to be kept in step with the scopes it duplicates.
58
54
 
55
+ ### Inviting someone
56
+
57
+ `admin:inviteUser` `{ email, name?, role? }` is the whole invite in one call:
58
+ it creates the account without a password when the email has none, mails a
59
+ sign-in link, then grants `role` if one is given. It answers
60
+ `{ userId, created }`, and calling it again for the same email sends a new
61
+ link. It needs better-auth's `magicLink()` plugin with sign-up disabled, so the
62
+ link only admits the account the invite created:
63
+
64
+ ```ts
65
+ import { magicLink } from 'better-auth/plugins'
66
+
67
+ betterAuth({
68
+ plugins: [magicLink({ disableSignUp: true, sendMagicLink })],
69
+ })
70
+ ```
71
+
72
+ The call needs `admin:users:create`; granting a role also needs
73
+ `admin:scopes:manage`. A refusal's message starts with a code a client can
74
+ match on: `USER_BANNED` (422), `UNKNOWN_ROLE` (400, checked before anything is
75
+ created) or `MAIL_FAILED` (422, the account is kept and no role is granted).
76
+
59
77
  `admin:audit:read` needs an audit sink that can be read back. Both report their
60
78
  absence rather than failing.
61
79
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/agent` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/agent` resolves here.
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  export type AgentMap = {}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  import { CoreAgent } from '@pikku/core/agent';
5
5
  import { pikkuAgentScorer as corePikkuAgentScorer, pikkuAgentJudge as corePikkuAgentJudge } from '@pikku/core/agent-scorer';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/state';
5
5
  pikkuState('@pikku/addon-admin', 'agent', 'modelAliases', {});
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * The AI scorers declared in this project.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/analytics` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/analytics` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  export { defineAnalyticsEvents, createAnalyticsSinks, cookieAnalyticsIdentity, composeAnalyticsIdentity, anonymousAnalyticsIdentity, mintCookie, randomDigits, LoggerAnalyticsService, } from '@pikku/core/analytics';
5
5
  export type { AnalyticsClientContext, AnalyticsEventBase, AnalyticsEventDefinitions, AnalyticsEventPropsSchema, AnalyticsIdentity, AnalyticsIdentityResolver, AnalyticsLog, AnalyticsRecord, AnalyticsService, AnalyticsEventMap, AnalyticsEventSink, AnalyticsSinkRegistry, } from '@pikku/core/analytics';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  export { defineAnalyticsEvents, createAnalyticsSinks, cookieAnalyticsIdentity, composeAnalyticsIdentity, anonymousAnalyticsIdentity, mintCookie, randomDigits, LoggerAnalyticsService, } from '@pikku/core/analytics';
5
5
  //# sourceMappingURL=pikku-analytics-types.gen.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.217
3
+ */
4
+ /**
5
+ * Subpath entry — `#pikku/attention` resolves here.
6
+ */
7
+ export * from './pikku-attention-types.gen.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":["../../../../.pikku/addon/attention/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,cAAc,gCAAgC,CAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.217
3
+ */
4
+ /**
5
+ * Subpath entry — `#pikku/attention` resolves here.
6
+ */
7
+ export * from './pikku-attention-types.gen.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../.pikku/addon/attention/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,cAAc,gCAAgC,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.217
3
+ */
4
+ import { pikkuAttentionFunc as corePikkuAttentionFunc } from '@pikku/core/attention-func';
5
+ import type { Services } from '../function/pikku-function-types.gen.js';
6
+ export type { AttentionScore, AttentionFuncInput, } from '@pikku/core/attention-func';
7
+ /**
8
+ * Declares what a widget needs attention for. Return nothing when all is fine,
9
+ * or `{ score: 0..1, verdict?, reason?, impact?, since? }` when it is not.
10
+ * Declare it in a `*.attention.ts` file; `widget` is a `<screen>.<slot>` of
11
+ * this plugin's own arranged screens.
12
+ *
13
+ * @example snippet: attentionFunc
14
+ */
15
+ export declare const pikkuAttentionFunc: (config: Parameters<typeof corePikkuAttentionFunc<Services>>[0]) => import("@pikku/core/attention-func").PikkuAttentionFunc<Services>;
16
+ //# sourceMappingURL=pikku-attention-types.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-attention-types.gen.d.ts","sources":["../../../../.pikku/addon/attention/pikku-attention-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAEvE,YAAY,EACV,cAAc,EACd,kBAAkB,GACnB,MAAM,4BAA4B,CAAA;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,WACrB,UAAU,CAAC,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,sEACnB,CAAA"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.217
3
+ */
4
+ import { pikkuAttentionFunc as corePikkuAttentionFunc } from '@pikku/core/attention-func';
5
+ /**
6
+ * Declares what a widget needs attention for. Return nothing when all is fine,
7
+ * or `{ score: 0..1, verdict?, reason?, impact?, since? }` when it is not.
8
+ * Declare it in a `*.attention.ts` file; `widget` is a `<screen>.<slot>` of
9
+ * this plugin's own arranged screens.
10
+ *
11
+ * @example snippet: attentionFunc
12
+ */
13
+ export const pikkuAttentionFunc = (config) => corePikkuAttentionFunc(config);
14
+ //# sourceMappingURL=pikku-attention-types.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-attention-types.gen.js","sources":["../../../../.pikku/addon/attention/pikku-attention-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAQzF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAA8D,EAC9D,EAAE,CAAC,sBAAsB,CAAW,MAAM,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/auth` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/auth` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Permission, auth gate and credential definitions
@@ -76,22 +76,8 @@ type PikkuAuthConfig<RequiredServices extends SecretlessServices<SingletonServic
76
76
  * Auth permissions only receive services and session (no request data),
77
77
  * making them evaluable before request data is available.
78
78
  *
79
- * @example
80
- * \`\`\`typescript
81
- * const isAdmin = pikkuAuth(async ({ logger }, session) => {
82
- * return session.role === 'admin'
83
- * })
84
- *
85
- * // Passes with no session: the function decides what an anonymous caller sees
86
- * const isNotSuspended = pikkuAuth({
87
- * name: 'Not Suspended',
88
- * description: 'Refuses suspended users; anonymous callers pass',
89
- * skipWithoutSession: true,
90
- * func: async ({ logger }, session) => {
91
- * return !session.suspended
92
- * }
93
- * })
94
- * \`\`\`
79
+ * @example snippet: shopIsAuthenticated
80
+ * @example snippet: globalPermission
95
81
  */
96
82
  export declare const pikkuAuth: <RequiredServices extends SecretlessServices<SingletonServices> = WiredAuthServices>(auth: PikkuAuth<RequiredServices> | PikkuAuthConfig<RequiredServices>) => PikkuPermission<any, any>;
97
83
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-auth-types.gen.d.ts","sources":["../../../../.pikku/addon/auth/pikku-auth-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EACV,mBA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,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,EAAE,GAAG,OAAO,eAAe,mBAAmB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,EAAE,SAE9H,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Permission, auth gate and credential definitions
@@ -25,22 +25,8 @@ export const pikkuPermission = (permission) => {
25
25
  * Auth permissions only receive services and session (no request data),
26
26
  * making them evaluable before request data is available.
27
27
  *
28
- * @example
29
- * \`\`\`typescript
30
- * const isAdmin = pikkuAuth(async ({ logger }, session) => {
31
- * return session.role === 'admin'
32
- * })
33
- *
34
- * // Passes with no session: the function decides what an anonymous caller sees
35
- * const isNotSuspended = pikkuAuth({
36
- * name: 'Not Suspended',
37
- * description: 'Refuses suspended users; anonymous callers pass',
38
- * skipWithoutSession: true,
39
- * func: async ({ logger }, session) => {
40
- * return !session.suspended
41
- * }
42
- * })
43
- * \`\`\`
28
+ * @example snippet: shopIsAuthenticated
29
+ * @example snippet: globalPermission
44
30
  */
45
31
  export const pikkuAuth = (auth) => {
46
32
  return pikkuAuthCore(auth);
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-auth-types.gen.js","sources":["../../../../.pikku/addon/auth/pikku-auth-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AASH,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,eAAe,IAAI,mBAAmB,EACtC,sBAAsB,IAAI,0BAA0B,GACrD,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AASvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AA6CzD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC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;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAiD,EACV,EAAE;IACzC,OAAO,0BAA0B,CAAC,OAAc,CAAQ,CAAA;AAC1D,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAe,WAA6E,EAAE,EAAE;IACjI,uBAAuB,CAAC,WAAkB,EAAE,oBAAoB,CAAC,CAAA;AACnE,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/channel` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/channel` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Channel-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Channel-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/cli` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/cli` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/error` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/error` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Error catalogue — `#pikku/error` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Error catalogue — `#pikku/error` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/function` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/function` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.213
2
+ * This file was generated by @pikku/cli@0.12.217
3
3
  */
4
4
  /**
5
5
  * Core function types for all wirings
@@ -81,15 +81,7 @@ export type PikkuApprovalDescription<In = unknown, RequiredServices extends Secr
81
81
  /**
82
82
  * Factory function for creating approval description functions with tree-shaking support.
83
83
  *
84
- * @example
85
- * ```typescript
86
- * export const deleteTodoApproval = pikkuApprovalDescription(
87
- * async ({ todoStore }, { id }) => {
88
- * const todo = await todoStore.get(id)
89
- * return \`Delete todo: "${todo.title}"\`
90
- * }
91
- * )
92
- * ```
84
+ * @example snippet: approvalDescription
93
85
  */
94
86
  export declare const pikkuApprovalDescription: <In = unknown, RequiredServices extends SecretlessServices<Services> = WiredServices>(fn: PikkuApprovalDescription<In, RequiredServices>) => PikkuApprovalDescription<In, RequiredServices>;
95
87
  /**
@@ -126,15 +118,19 @@ export type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output>
126
118
  * @template Out - The output type
127
119
  * @template PikkuFunc - The function type (can be narrowed to PikkuFunction or PikkuFunctionSessionless)
128
120
  */
129
- export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires, any> | PikkuFunctionSessionless<In, Out, RequiredWires, any, any> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, ScopeId, FeatureFlagName>, 'node'> & {
121
+ export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires, any> | PikkuFunctionSessionless<In, Out, RequiredWires, any, any> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, ScopeId, FeatureFlagName>, 'node' | 'mock'> & {
130
122
  node?: NodeConfig;
123
+ /** A function with a body is not a mock: see `PikkuMockFunctionConfig`. */
124
+ mock?: never;
131
125
  };
132
126
  /**
133
127
  * {@link PikkuFunctionConfig} for a function that runs without a session.
134
128
  * Has no `scopes`: an anonymous caller holds none, so none can ever be met.
135
129
  */
136
- type PikkuFunctionSessionlessConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunctionSessionless<In, Out, RequiredWires, any> = PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<CorePikkuSessionlessFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, FeatureFlagName>, 'node'> & {
130
+ type PikkuFunctionSessionlessConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunctionSessionless<In, Out, RequiredWires, any> = PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<CorePikkuSessionlessFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema, FeatureFlagName>, 'node' | 'mock'> & {
137
131
  node?: NodeConfig;
132
+ /** A function with a body is not a mock: see `PikkuMockFunctionConfig`. */
133
+ mock?: never;
138
134
  };
139
135
  /**
140
136
  * Configuration object for Pikku functions with Zod schema validation.
@@ -146,7 +142,7 @@ type SchemaInferred<S, Fallback = unknown> = S extends StandardSchemaV1 ? InferS
146
142
  * Schema-overload variant for pikkuFunc. Derived from CorePikkuFunctionConfig
147
143
  * so adding a field on the core type automatically propagates here.
148
144
  */
149
- type PikkuFunctionConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined, RequiredWires extends keyof PikkuWire = never, RequiredServices extends SecretlessServices<Services> = WiredServices> = Omit<CorePikkuFunctionConfig<PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices> | PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>, CorePikkuPermission<any>, PikkuMiddleware, undefined, undefined, ScopeId, FeatureFlagName>, 'func' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'> & {
145
+ type PikkuFunctionConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined, RequiredWires extends keyof PikkuWire = never, RequiredServices extends SecretlessServices<Services> = WiredServices> = Omit<CorePikkuFunctionConfig<PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices> | PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>, CorePikkuPermission<any>, PikkuMiddleware, undefined, undefined, ScopeId, FeatureFlagName>, 'func' | 'mock' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'> & {
150
146
  /** The function body: `async (services, data, wire) => output`. */
151
147
  func: PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices> | PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>;
152
148
  /** Zod schema for the input. Validated at runtime; the type of `data` is inferred from it. */
@@ -154,10 +150,61 @@ type PikkuFunctionConfigWithSchema<InputSchema extends StandardSchemaV1 | undefi
154
150
  /** Zod schema for the output. The function's return type is inferred from it. */
155
151
  output?: OutputSchema;
156
152
  node?: NodeConfig;
153
+ /** A function with a body is not a mock: see `PikkuMockFunctionConfigWithSchema`. */
154
+ mock?: never;
157
155
  /** `pikkuPermission` guards checked before the body runs. Pass one, an array, or groups of alternatives. */
158
156
  permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined;
159
157
  approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never;
160
158
  };
159
+ /**
160
+ * A function declared but not implemented yet: its `input` and `output`,
161
+ * `mock: true`, and no `func`. It stays in every map and generated client,
162
+ * calling it on a real backend fails, and `pikku validate` refuses to publish
163
+ * it. Implementing it means writing `func` and deleting `mock`.
164
+ */
165
+ type PikkuMockFunctionConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>, 'func' | 'mock'> & {
166
+ /** Declared, not implemented: there is no body yet. */
167
+ mock: true;
168
+ /** Typed like a real body, so trying this overload first leaves a real body's inferred types alone; no body can be given. */
169
+ func?: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>['func'] & {
170
+ readonly __mockHasNoBody: never;
171
+ };
172
+ };
173
+ /** {@link PikkuMockFunctionConfigWithSchema} for a function typed with generics. */
174
+ type PikkuMockFunctionConfig<In, Out> = Omit<PikkuFunctionConfig<In, Out, 'session' | 'rpc'>, 'func' | 'mock'> & {
175
+ /** Declared, not implemented: there is no body yet. */
176
+ mock: true;
177
+ /** Typed like a real body, so trying this overload first leaves a real body's inferred types alone; no body can be given. */
178
+ func?: PikkuFunctionConfig<In, Out, 'session' | 'rpc'>['func'] & {
179
+ readonly __mockHasNoBody: never;
180
+ };
181
+ };
182
+ /** {@link PikkuMockFunctionConfigWithSchema} for a sessionless function. */
183
+ type PikkuMockSessionlessFunctionConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = Omit<PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>, 'func' | 'mock'> & {
184
+ /** Declared, not implemented: there is no body yet. */
185
+ mock: true;
186
+ /** Typed like a real body, so trying this overload first leaves a real body's inferred types alone; no body can be given. */
187
+ func?: PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>['func'] & {
188
+ readonly __mockHasNoBody: never;
189
+ };
190
+ };
191
+ /** {@link PikkuMockFunctionConfig} for a sessionless function. */
192
+ type PikkuMockSessionlessFunctionConfig<In, Out> = Omit<PikkuFunctionSessionlessConfig<In, Out, 'session' | 'rpc'>, 'func' | 'mock'> & {
193
+ /** Declared, not implemented: there is no body yet. */
194
+ mock: true;
195
+ /**
196
+ * Typed like a real body so a mock overload tried first does not change how
197
+ * the body of a real function is inferred, but no body can be given.
198
+ */
199
+ /** Typed like a real body, so trying this overload first leaves a real body's inferred types alone; no body can be given. */
200
+ func?: PikkuFunctionSessionlessConfig<In, Out, 'session' | 'rpc'>['func'] & {
201
+ readonly __mockHasNoBody: never;
202
+ };
203
+ };
204
+ /** @hidden */
205
+ export declare function pikkuFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuMockFunctionConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
206
+ /** @hidden */
207
+ export declare function pikkuFunc<In, Out = unknown>(config: PikkuMockFunctionConfig<In, Out>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
161
208
  /**
162
209
  * Creates a Pikku function that can be either session-aware or sessionless.
163
210
  * This is the main function wrapper for creating API endpoints.
@@ -192,6 +239,8 @@ func: PikkuFunction<In, Out, 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, '
192
239
  * time because it names no topic. It is wired as an `sse: true` route or a
193
240
  * channel action, never callable as an RPC, and a public topic is wired
194
241
  * with `auth: false` like any public route.
242
+ *
243
+ * @example snippet: orderStatusChannel
195
244
  */
196
245
  export declare function pikkuSubscribeFunc<In, TopicShape extends string>(config: PikkuFunctionConfig<In, TopicShape, 'session' | 'rpc', PikkuFunction<In, TopicShape, 'session' | 'rpc'>>): PikkuFunctionConfig<In, TopicShape, 'session' | 'rpc'>;
197
246
  /**
@@ -216,7 +265,7 @@ export declare const pikkuListFunc: <F extends Record<string, unknown> = {}, Row
216
265
  * CorePikkuSessionlessFunctionConfig to stay in sync with the generic-typed
217
266
  * config — so it has no `scopes` either.
218
267
  */
219
- type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined, RequiredWires extends keyof PikkuWire = never, RequiredServices extends SecretlessServices<Services> = WiredServices> = Omit<CorePikkuSessionlessFunctionConfig<PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>>, 'func' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'> & {
268
+ type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined, RequiredWires extends keyof PikkuWire = never, RequiredServices extends SecretlessServices<Services> = WiredServices> = Omit<CorePikkuSessionlessFunctionConfig<PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>>, 'func' | 'mock' | 'input' | 'output' | 'permissions' | 'approvalDescription' | 'node'> & {
220
269
  /** The function body: `async (services, data, wire) => output`. */
221
270
  func: PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires, RequiredServices>;
222
271
  /** Zod schema for the input. Validated at runtime; the type of `data` is inferred from it. */
@@ -224,10 +273,16 @@ type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends StandardSchema
224
273
  /** Zod schema for the output. The function's return type is inferred from it. */
225
274
  output?: OutputSchema;
226
275
  node?: NodeConfig;
276
+ /** A function with a body is not a mock: see `PikkuMockFunctionConfigWithSchema`. */
277
+ mock?: never;
227
278
  /** `pikkuPermission` guards checked before the body runs. Pass one, an array, or groups of alternatives. */
228
279
  permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined;
229
280
  approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never;
230
281
  };
282
+ /** @hidden */
283
+ export declare function pikkuSessionlessFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuMockSessionlessFunctionConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
284
+ /** @hidden */
285
+ export declare function pikkuSessionlessFunc<In, Out = unknown>(config: PikkuMockSessionlessFunctionConfig<In, Out>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
231
286
  /**
232
287
  * Creates a sessionless Pikku function that doesn't require user authentication.
233
288
  * Use this for public endpoints, webhooks, or background tasks.