pgkiln 0.0.0-stage → 0.31.0

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 (375) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +12 -0
  3. package/README.md +239 -2
  4. package/SECURITY.md +204 -0
  5. package/bin/pgkiln.js +7 -0
  6. package/db/migrations/001_meta.sql +684 -0
  7. package/db/migrations/002_sprint3.sql +252 -0
  8. package/db/migrations/003_user_directory.sql +166 -0
  9. package/db/migrations/004_sso.sql +182 -0
  10. package/db/migrations/005_api.sql +118 -0
  11. package/db/migrations/006_accounts.sql +130 -0
  12. package/db/migrations/007_i18n.sql +194 -0
  13. package/db/migrations/008_drop_mail.sql +58 -0
  14. package/db/migrations/009_files.sql +75 -0
  15. package/db/migrations/010_data_load.sql +15 -0
  16. package/db/migrations/011_oauth.sql +172 -0
  17. package/db/migrations/012_report_layouts.sql +80 -0
  18. package/db/migrations/013_export_format.sql +153 -0
  19. package/db/migrations/014_saved_reports.sql +66 -0
  20. package/db/migrations/015_automations.sql +239 -0
  21. package/db/migrations/016_top_sql.sql +12 -0
  22. package/db/migrations/017_remember_me.sql +50 -0
  23. package/db/migrations/018_ldap.sql +48 -0
  24. package/db/migrations/019_saml.sql +26 -0
  25. package/db/migrations/020_documents.sql +170 -0
  26. package/db/migrations/021_approvals.sql +448 -0
  27. package/db/migrations/022_workflows.sql +333 -0
  28. package/db/migrations/023_pwa.sql +22 -0
  29. package/db/migrations/024_rest_modules.sql +174 -0
  30. package/db/migrations/025_map_tree.sql +7 -0
  31. package/db/migrations/026_map_report.sql +122 -0
  32. package/db/migrations/027_workflow_branches.sql +255 -0
  33. package/db/migrations/028_template_components.sql +299 -0
  34. package/db/migrations/029_logic.sql +359 -0
  35. package/db/migrations/030_rest_data_sources.sql +265 -0
  36. package/db/migrations/031_smart_filters_display_selector.sql +144 -0
  37. package/db/migrations/032_items.sql +13 -0
  38. package/db/migrations/034_export_import.sql +190 -0
  39. package/db/migrations/036_header_auth.sql +16 -0
  40. package/db/migrations/037_database_auth.sql +18 -0
  41. package/db/migrations/038_grid_reports.sql +83 -0
  42. package/db/migrations/039_page_logic.sql +249 -0
  43. package/db/migrations/040_globalization.sql +32 -0
  44. package/db/migrations/041_workshop.sql +263 -0
  45. package/db/migrations/042_builder_parity.sql +354 -0
  46. package/db/migrations/043_export_import.sql +242 -0
  47. package/db/migrations/044_automation_actions.sql +690 -0
  48. package/db/migrations/047_page_wizards.sql +693 -0
  49. package/db/migrations/050_rest_writeback_sync.sql +377 -0
  50. package/db/migrations/051_debug_messages.sql +142 -0
  51. package/db/migrations/052_web_request_parse_data.sql +539 -0
  52. package/db/migrations/053_theme_styles_template_options.sql +55 -0
  53. package/db/migrations/054_import_app_debug_defaults.sql +19 -0
  54. package/db/migrations/055_working_copies.sql +49 -0
  55. package/db/migrations/056_app_types_subscriptions.sql +50 -0
  56. package/db/migrations/057_data_reporter.sql +96 -0
  57. package/db/migrations/058_data_generator.sql +30 -0
  58. package/db/migrations/060_ai.sql +230 -0
  59. package/db/migrations/061_ai_assistant.sql +48 -0
  60. package/db/migrations/062_app_builder_ai.sql +42 -0
  61. package/db/migrations/063_blueprints.sql +28 -0
  62. package/db/migrations/064_workspaces.sql +76 -0
  63. package/db/migrations/065_drawers.sql +28 -0
  64. package/db/migrations/066_item_template_options.sql +17 -0
  65. package/db/migrations/067_session_sharing.sql +32 -0
  66. package/db/migrations/068_static_files.sql +301 -0
  67. package/db/migrations/069_plugins.sql +378 -0
  68. package/db/migrations/070_parse_zip_boolean.sql +619 -0
  69. package/db/migrations/071_object_storage.sql +13 -0
  70. package/db/migrations/072_workflow_tenants.sql +109 -0
  71. package/db/migrations/073_region_static_id.sql +13 -0
  72. package/db/migrations/074_push_notifications.sql +212 -0
  73. package/db/migrations/075_security_review.sql +36 -0
  74. package/docs/README.md +43 -0
  75. package/docs/apex-feature-parity.md +276 -0
  76. package/docs/guide/01-installation.md +351 -0
  77. package/docs/guide/02-concepts.md +234 -0
  78. package/docs/guide/03-builder.md +879 -0
  79. package/docs/guide/04-pages-and-regions.md +1354 -0
  80. package/docs/guide/05-items.md +222 -0
  81. package/docs/guide/06-processing.md +853 -0
  82. package/docs/guide/07-dynamic-actions.md +156 -0
  83. package/docs/guide/08-security.md +505 -0
  84. package/docs/guide/09-reference.md +572 -0
  85. package/docs/guide/10-tutorial.md +192 -0
  86. package/docs/guide/11-from-apex.md +169 -0
  87. package/docs/guide/12-development.md +381 -0
  88. package/docs/guide/13-rest-api.md +315 -0
  89. package/docs/guide/14-globalization.md +262 -0
  90. package/docs/guide/15-extensions.md +139 -0
  91. package/docs/guide/16-files.md +606 -0
  92. package/docs/guide/17-mobile.md +135 -0
  93. package/docs/guide/18-cli.md +246 -0
  94. package/docs/guide/19-rest-data-sources.md +306 -0
  95. package/docs/guide/20-ai-agents.md +113 -0
  96. package/examples/hr/README.md +51 -0
  97. package/examples/hr/hr.sql +644 -0
  98. package/examples/hr/hr_02_showcase.sql +115 -0
  99. package/examples/hr/hr_03_api.sql +57 -0
  100. package/examples/hr/hr_04_i18n.sql +145 -0
  101. package/examples/hr/hr_05_files.sql +61 -0
  102. package/examples/hr/hr_06_data_load.sql +55 -0
  103. package/examples/hr/hr_07_layouts.sql +19 -0
  104. package/examples/hr/hr_08_automations.sql +42 -0
  105. package/examples/hr/hr_09_documents.sql +59 -0
  106. package/examples/hr/hr_10_approvals.sql +73 -0
  107. package/examples/hr/hr_11_workflows.sql +53 -0
  108. package/examples/hr/hr_12_pwa.sql +26 -0
  109. package/examples/hr/hr_13_rest.sql +29 -0
  110. package/examples/hr/hr_14_maps.sql +30 -0
  111. package/examples/hr/hr_15_charts.sql +41 -0
  112. package/examples/hr/hr_16_documents.sql +52 -0
  113. package/examples/hr/hr_17_locations.sql +66 -0
  114. package/examples/hr/hr_18_workflow_branches.sql +38 -0
  115. package/examples/hr/hr_19_template_components.sql +196 -0
  116. package/examples/hr/hr_20_items.sql +126 -0
  117. package/examples/hr/hr_21_regions.sql +98 -0
  118. package/examples/hr/hr_22_logic.sql +133 -0
  119. package/examples/hr/hr_23_rest_sources.sql +121 -0
  120. package/examples/hr/hr_24_planner.sql +171 -0
  121. package/examples/hr/hr_25_large_tables.sql +74 -0
  122. package/examples/hr/hr_26_web_services_hint.sql +6 -0
  123. package/examples/hr/hr_27_popup_lov.sql +57 -0
  124. package/examples/hr/hr_28_grid.sql +85 -0
  125. package/examples/hr/hr_29_toolkit.sql +142 -0
  126. package/examples/hr/hr_30_formats.sql +97 -0
  127. package/examples/hr/hr_31_data_load_xml.sql +28 -0
  128. package/examples/hr/hr_32_lists.sql +111 -0
  129. package/examples/hr/hr_33_automation_actions.sql +67 -0
  130. package/examples/hr/hr_34_workflow_invoke_api.sql +69 -0
  131. package/examples/hr/hr_35_project_charts.sql +108 -0
  132. package/examples/hr/hr_36_map_layers.sql +118 -0
  133. package/examples/hr/hr_37_rest_writeback.sql +162 -0
  134. package/examples/hr/hr_38_parse_and_fetch.sql +101 -0
  135. package/examples/hr/hr_39_data_reporter.sql +89 -0
  136. package/examples/hr/hr_40_sample_data.sql +50 -0
  137. package/examples/hr/hr_41_ai_assistant.sql +118 -0
  138. package/examples/hr/hr_42_hr_assistant.sql +113 -0
  139. package/examples/hr/hr_43_drawer.sql +11 -0
  140. package/examples/hr/hr_44_built_in_components.sql +75 -0
  141. package/examples/hr/hr_45_photo_crop.sql +11 -0
  142. package/examples/hr/hr_46_static_files.sql +43 -0
  143. package/examples/hr/hr_47_plugins.sql +213 -0
  144. package/examples/hr/hr_48_map_tiles.sql +62 -0
  145. package/examples/hr/hr_49_push_notifications.sql +67 -0
  146. package/examples/keycloak-saml.sql +23 -0
  147. package/examples/keycloak-sso.sql +18 -0
  148. package/examples/ldap-directory.sql +19 -0
  149. package/examples/plugins/char-counter/char-counter.css +3 -0
  150. package/examples/plugins/char-counter/char-counter.js +19 -0
  151. package/examples/plugins/char-counter/plugin.json +11 -0
  152. package/examples/plugins/char-counter.plugin.json +26 -0
  153. package/examples/plugins/contact-card.plugin.json +54 -0
  154. package/examples/plugins/copy-value/copy-value.js +7 -0
  155. package/examples/plugins/copy-value/plugin.json +11 -0
  156. package/examples/plugins/copy-value.plugin.json +22 -0
  157. package/examples/plugins/log-event/install.sql +19 -0
  158. package/examples/plugins/log-event/plugin.json +13 -0
  159. package/examples/plugins/log-event.plugin.json +29 -0
  160. package/examples/plugins/show-more/plugin.json +13 -0
  161. package/examples/plugins/show-more/show-more.js +19 -0
  162. package/examples/plugins/show-more/template.html +1 -0
  163. package/examples/plugins/show-more.plugin.json +37 -0
  164. package/examples/plugins/status-badge.plugin.json +29 -0
  165. package/examples/plugins/timeline-item.plugin.json +45 -0
  166. package/examples/tasks-app.sql +115 -0
  167. package/package.json +89 -4
  168. package/public/app.css +1552 -0
  169. package/public/app.js +3038 -0
  170. package/public/builder-icons.svg +33 -0
  171. package/public/builder.css +761 -0
  172. package/public/builder.js +784 -0
  173. package/public/code-editor.css +172 -0
  174. package/public/code-editor.js +1017 -0
  175. package/public/icons.svg +138 -0
  176. package/public/samples/employees.csv +4 -0
  177. package/public/samples/employees.xml +21 -0
  178. package/public/sw.js +235 -0
  179. package/scripts/docker-start.ts +156 -0
  180. package/scripts/migrate.ts +19 -0
  181. package/src/accounts.ts +45 -0
  182. package/src/ai/anthropic.ts +70 -0
  183. package/src/ai/chat.ts +230 -0
  184. package/src/ai/openai.ts +59 -0
  185. package/src/ai/requests.ts +91 -0
  186. package/src/ai/service.ts +178 -0
  187. package/src/ai/types.ts +69 -0
  188. package/src/api.ts +73 -0
  189. package/src/app.ts +192 -0
  190. package/src/appfiles.ts +536 -0
  191. package/src/automations.ts +329 -0
  192. package/src/binds.ts +180 -0
  193. package/src/blueprint.ts +393 -0
  194. package/src/builder/advisor.ts +374 -0
  195. package/src/builder/ai-builder.ts +535 -0
  196. package/src/builder/ai.ts +282 -0
  197. package/src/builder/api.ts +255 -0
  198. package/src/builder/appfromfile.ts +389 -0
  199. package/src/builder/appsheets.ts +447 -0
  200. package/src/builder/appwizard.ts +233 -0
  201. package/src/builder/arrange.ts +280 -0
  202. package/src/builder/assistant.ts +185 -0
  203. package/src/builder/automations.ts +122 -0
  204. package/src/builder/blueprints.ts +263 -0
  205. package/src/builder/code-editor.ts +233 -0
  206. package/src/builder/components.ts +710 -0
  207. package/src/builder/dataload.ts +396 -0
  208. package/src/builder/designer.ts +434 -0
  209. package/src/builder/diagnostics.ts +235 -0
  210. package/src/builder/documents.ts +69 -0
  211. package/src/builder/forms.ts +198 -0
  212. package/src/builder/globalization.ts +301 -0
  213. package/src/builder/home.ts +292 -0
  214. package/src/builder/instance.ts +59 -0
  215. package/src/builder/layouts.ts +96 -0
  216. package/src/builder/ldap.ts +161 -0
  217. package/src/builder/locks.ts +197 -0
  218. package/src/builder/newapp.ts +120 -0
  219. package/src/builder/plugins.ts +212 -0
  220. package/src/builder/process-jobs.ts +30 -0
  221. package/src/builder/pwa.ts +142 -0
  222. package/src/builder/querybuilder.ts +370 -0
  223. package/src/builder/quicksql.ts +94 -0
  224. package/src/builder/region-settings.ts +883 -0
  225. package/src/builder/report-settings.ts +291 -0
  226. package/src/builder/reporter.ts +219 -0
  227. package/src/builder/rest.ts +23 -0
  228. package/src/builder/routes.ts +612 -0
  229. package/src/builder/sampledata.ts +349 -0
  230. package/src/builder/scripts.ts +333 -0
  231. package/src/builder/search.ts +218 -0
  232. package/src/builder/shared.ts +238 -0
  233. package/src/builder/sql.ts +132 -0
  234. package/src/builder/static-files.ts +198 -0
  235. package/src/builder/subscriptions.ts +179 -0
  236. package/src/builder/supporting.ts +133 -0
  237. package/src/builder/template-spec.ts +53 -0
  238. package/src/builder/templates.ts +392 -0
  239. package/src/builder/themeroller.ts +207 -0
  240. package/src/builder/top-sql.ts +89 -0
  241. package/src/builder/ui.ts +262 -0
  242. package/src/builder/unload.ts +247 -0
  243. package/src/builder/users.ts +519 -0
  244. package/src/builder/websources.ts +331 -0
  245. package/src/builder/wizards.ts +297 -0
  246. package/src/builder/workflows.ts +181 -0
  247. package/src/builder/workingcopies.ts +209 -0
  248. package/src/builder/workspaces.ts +286 -0
  249. package/src/cli/apps.ts +80 -0
  250. package/src/cli/diff.ts +79 -0
  251. package/src/cli/files.ts +69 -0
  252. package/src/cli/main.ts +463 -0
  253. package/src/cli/mcp.ts +586 -0
  254. package/src/cli/replace.ts +187 -0
  255. package/src/css.ts +39 -0
  256. package/src/customauth.ts +86 -0
  257. package/src/dataload.ts +507 -0
  258. package/src/db.ts +170 -0
  259. package/src/dbauth.ts +88 -0
  260. package/src/debug.ts +140 -0
  261. package/src/env.ts +15 -0
  262. package/src/headerauth.ts +95 -0
  263. package/src/html.ts +41 -0
  264. package/src/i18n/ar.ts +598 -0
  265. package/src/i18n/cs.ts +598 -0
  266. package/src/i18n/da.ts +598 -0
  267. package/src/i18n/de.ts +598 -0
  268. package/src/i18n/el.ts +598 -0
  269. package/src/i18n/es.ts +598 -0
  270. package/src/i18n/fi.ts +598 -0
  271. package/src/i18n/fr.ts +598 -0
  272. package/src/i18n/he.ts +598 -0
  273. package/src/i18n/it.ts +598 -0
  274. package/src/i18n/ja.ts +598 -0
  275. package/src/i18n/ko.ts +598 -0
  276. package/src/i18n/nb.ts +598 -0
  277. package/src/i18n/pl.ts +598 -0
  278. package/src/i18n/pt.ts +598 -0
  279. package/src/i18n/ru.ts +598 -0
  280. package/src/i18n/sv.ts +598 -0
  281. package/src/i18n/tr.ts +598 -0
  282. package/src/i18n/uk.ts +598 -0
  283. package/src/i18n/zh.ts +598 -0
  284. package/src/i18n.ts +1277 -0
  285. package/src/icons.ts +95 -0
  286. package/src/instance.ts +137 -0
  287. package/src/layout.ts +28 -0
  288. package/src/ldap.ts +181 -0
  289. package/src/maptiles.ts +18 -0
  290. package/src/metadata.ts +369 -0
  291. package/src/migrate.ts +139 -0
  292. package/src/mvt.ts +185 -0
  293. package/src/numformat.ts +518 -0
  294. package/src/oauth.ts +103 -0
  295. package/src/objectstore.ts +148 -0
  296. package/src/process-jobs.ts +178 -0
  297. package/src/push.ts +332 -0
  298. package/src/qrcode.ts +310 -0
  299. package/src/quicksql.ts +554 -0
  300. package/src/remember.ts +89 -0
  301. package/src/restsync.ts +231 -0
  302. package/src/richtext.ts +315 -0
  303. package/src/runtime/account.ts +273 -0
  304. package/src/runtime/ai-filter.ts +223 -0
  305. package/src/runtime/ai.ts +182 -0
  306. package/src/runtime/assistant.ts +494 -0
  307. package/src/runtime/authz.ts +119 -0
  308. package/src/runtime/builtin-components.ts +111 -0
  309. package/src/runtime/calendar.ts +382 -0
  310. package/src/runtime/charts.ts +846 -0
  311. package/src/runtime/compute.ts +159 -0
  312. package/src/runtime/context.ts +185 -0
  313. package/src/runtime/data-reporter.ts +556 -0
  314. package/src/runtime/display-selector.ts +61 -0
  315. package/src/runtime/document.ts +577 -0
  316. package/src/runtime/documents.ts +41 -0
  317. package/src/runtime/engine.ts +582 -0
  318. package/src/runtime/facet-state.ts +275 -0
  319. package/src/runtime/facets.ts +210 -0
  320. package/src/runtime/files.ts +428 -0
  321. package/src/runtime/format.ts +140 -0
  322. package/src/runtime/grid-layout.ts +149 -0
  323. package/src/runtime/grid.ts +666 -0
  324. package/src/runtime/items.ts +516 -0
  325. package/src/runtime/links.ts +41 -0
  326. package/src/runtime/lists.ts +234 -0
  327. package/src/runtime/locale.ts +323 -0
  328. package/src/runtime/logic.ts +233 -0
  329. package/src/runtime/maps.ts +271 -0
  330. package/src/runtime/master-detail.ts +87 -0
  331. package/src/runtime/pdf.ts +410 -0
  332. package/src/runtime/plugins.ts +212 -0
  333. package/src/runtime/processes.ts +290 -0
  334. package/src/runtime/push.ts +83 -0
  335. package/src/runtime/pwa.ts +215 -0
  336. package/src/runtime/region-cache.ts +164 -0
  337. package/src/runtime/regions.ts +404 -0
  338. package/src/runtime/render.ts +371 -0
  339. package/src/runtime/report-views.ts +145 -0
  340. package/src/runtime/report.ts +1098 -0
  341. package/src/runtime/rest-sources.ts +182 -0
  342. package/src/runtime/rest.ts +267 -0
  343. package/src/runtime/routes.ts +1293 -0
  344. package/src/runtime/smart-filters.ts +140 -0
  345. package/src/runtime/spatial.ts +215 -0
  346. package/src/runtime/static-files.ts +76 -0
  347. package/src/runtime/styles.ts +199 -0
  348. package/src/runtime/tasks.ts +182 -0
  349. package/src/runtime/template-components.ts +642 -0
  350. package/src/runtime/template-options.ts +61 -0
  351. package/src/runtime/template-region.ts +67 -0
  352. package/src/runtime/tree.ts +78 -0
  353. package/src/runtime/workflows.ts +101 -0
  354. package/src/saml.ts +127 -0
  355. package/src/sampledata-words.ts +88 -0
  356. package/src/sampledata.ts +989 -0
  357. package/src/secrets.ts +44 -0
  358. package/src/security.ts +106 -0
  359. package/src/server.ts +14 -0
  360. package/src/session.ts +120 -0
  361. package/src/sharedlogin.ts +97 -0
  362. package/src/sqlscript.ts +230 -0
  363. package/src/sso.ts +258 -0
  364. package/src/subscriptions.ts +221 -0
  365. package/src/unload.ts +218 -0
  366. package/src/unpack.ts +70 -0
  367. package/src/webclient.ts +246 -0
  368. package/src/webrequests.ts +169 -0
  369. package/src/websources.ts +895 -0
  370. package/src/workflow.ts +825 -0
  371. package/src/workingcopy.ts +361 -0
  372. package/src/xlsx.ts +181 -0
  373. package/src/xml.ts +316 -0
  374. package/src/yamltext.ts +246 -0
  375. package/tsconfig.json +13 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ pgkiln
2
+ Copyright 2026 Vargar
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Oracle and Oracle APEX are registered trademarks of Oracle and/or its
7
+ affiliates. This project is not affiliated with, endorsed by, or sponsored
8
+ by Oracle.
9
+
10
+ Third-party components shipped with pgkiln keep their own licences: Leaflet
11
+ (BSD-2-Clause) for map regions and Lucide icons (ISC, https://lucide.dev/license),
12
+ served from their npm packages.
package/README.md CHANGED
@@ -1,3 +1,240 @@
1
- # Temporary Holding Version
1
+ # pgkiln
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/pgkiln/pgkiln/actions/workflows/ci.yml/badge.svg)](https://github.com/pgkiln/pgkiln/actions/workflows/ci.yml)
4
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
5
+ [![Website](https://img.shields.io/badge/website-pgkiln.vargar.eu-c2410c.svg)](https://pgkiln.vargar.eu)
6
+
7
+ **[Website](https://pgkiln.vargar.eu)** · **[Documentation](https://pgkiln.vargar.eu/docs/)** ·
8
+ **[Tutorial](https://pgkiln.vargar.eu/docs/tutorial)** · **[Coming from Oracle APEX](https://pgkiln.vargar.eu/docs/from-apex)** ·
9
+ **[Roadmap](ROADMAP.md)**
10
+
11
+ A low-code, SQL-driven application builder for PostgreSQL, modeled on
12
+ Oracle APEX. Applications are **data**: pages, regions, items, buttons,
13
+ dynamic actions, validations and processes are rows in the `meta` schema. A
14
+ runtime turns those rows into web pages, and the builder is an editor for
15
+ them.
16
+
17
+ > pgkiln is an independent open source project and is not affiliated with Oracle. Oracle and APEX are trademarks of Oracle.
18
+
19
+ <p align="center">
20
+ <img src="docs/images/builder-page-designer.png" alt="The page designer: component tree, layout and property editor" width="100%">
21
+ </p>
22
+
23
+ ## Screenshots
24
+
25
+ Everything below is the HR example application (`npm run example:hr`) and the builder. The
26
+ screenshots are made by `npm run screenshots`.
27
+
28
+ | | |
29
+ |---|---|
30
+ | ![Dashboard with metric cards and charts](docs/images/app-dashboard.png) | ![Interactive report with search and filters](docs/images/app-interactive-report.png) |
31
+ | **Dashboard**: metric cards and charts, all of it SQL | **Interactive report**: search, filters, sort, download |
32
+ | ![Faceted search with suggested filters](docs/images/app-faceted-search.png) | ![Map and cards regions](docs/images/app-cards-map.png) |
33
+ | **Smart filters and faceted search** | **Map and cards** regions on the same table |
34
+ | ![Charts in dark mode](docs/images/app-charts-dark.png) | ![Calendar region](docs/images/app-calendar.png) |
35
+ | **Charts**, in dark mode | **Calendar** of leave requests |
36
+ | ![App Builder home](docs/images/builder-home.png) | ![SQL Workshop object browser](docs/images/builder-object-browser.png) |
37
+ | **App Builder** home | **SQL Workshop**: object browser with RLS and grants |
38
+
39
+ <p align="center">
40
+ <img src="docs/images/app-phone.png" alt="The dashboard on a phone" width="260"><br>
41
+ <em>Responsive on phones and tablets, and installable as a Progressive Web App</em>
42
+ </p>
43
+
44
+ ## Quick start
45
+
46
+ With Docker (no Node.js needed):
47
+
48
+ ```bash
49
+ mkdir pgkiln && cd pgkiln
50
+ curl -fsSLO https://raw.githubusercontent.com/pgkiln/pgkiln/main/deploy/compose.yaml
51
+ curl -fsSL -o .env https://raw.githubusercontent.com/pgkiln/pgkiln/main/deploy/.env.example # fill in the four secrets
52
+ docker compose up -d # http://127.0.0.1:3100/builder (admin / the password from .env)
53
+ ```
54
+
55
+ Or from the source, for developing:
56
+
57
+ ```bash
58
+ npm install
59
+ cp .env.example .env
60
+ npm run setup # Postgres 17 on localhost:5434 + the pgkiln schema (migrations)
61
+ npm run dev # http://127.0.0.1:3100/builder (admin / admin)
62
+ ```
63
+
64
+ Then build an application on your own tables: *Create application* in the builder generates
65
+ report and form pages from a table, and everything else (regions, items, processes, security,
66
+ translations, documents, approvals) is added in the page designer and Shared Components. The
67
+ [tutorial](docs/guide/10-tutorial.md) walks through one.
68
+
69
+ ### The example application
70
+
71
+ pgkiln itself contains no application. The repository ships an example built on it, **HR**
72
+ (`examples/hr/`): employees and departments, leave requests with approvals, a dashboard, a REST API,
73
+ translations, documents, automations and row level security, all of it ordinary pgkiln metadata
74
+ and PostgreSQL code, the way you would build your own.
75
+
76
+ ```bash
77
+ npm run example:hr # http://127.0.0.1:3100/a/hr
78
+ ```
79
+
80
+ Users (password = username): `king` is admin and manager (the president), `blake` and `jones` are
81
+ managers, `allen` and `scott` are employees, and `demo` is an admin who is not an employee. Sign
82
+ in as different users to see authorization schemes and row level security at work.
83
+
84
+ ### Developing pgkiln
85
+
86
+ ```bash
87
+ npm test # unit + security regression tests (installs the HR example as their fixture)
88
+ npm run test:e2e # browser tests on phone/tablet/desktop (npx playwright install chromium first)
89
+ ```
90
+
91
+ `npm run db:reset` recreates the database (pgkiln only). Schema changes go in a new
92
+ `db/migrations/NNN_*.sql` file; `npm run db:migrate` applies pending ones.
93
+
94
+ ## Working with AI coding agents
95
+
96
+ pgkiln ships an **MCP server** (`pgkiln mcp`), so Claude Code, Cursor and other agents can find an
97
+ application, read and explain its pages, look at the tables and RLS policies behind them, search
98
+ this documentation, and change the application: export it as files (one YAML file per component,
99
+ SQL inline), edit them, show the diff, and import them again in one transaction. In a checkout,
100
+ `.mcp.json` starts it for Claude Code; for your own project:
101
+
102
+ ```bash
103
+ claude mcp add pgkiln -- /path/to/pgkiln/bin/pgkiln.js mcp
104
+ ```
105
+
106
+ Then ask things like *"explain what happens when I press Save on page 3 of hr"* or *"add a hire
107
+ date column to the employee report and show me the diff"*. Queries it runs are read-only. See
108
+ [AI coding agents](docs/guide/20-ai-agents.md).
109
+
110
+ Without an agent, the same export and import is on the command line (`pgkiln export hr --format text`,
111
+ `pgkiln diff`, `pgkiln import --replace`, see [the CLI](docs/guide/18-cli.md)) and in the builder
112
+ (*Export* / *Import*).
113
+
114
+ ## Documentation
115
+
116
+ What's next: [ROADMAP.md](ROADMAP.md).
117
+
118
+
119
+ The **[user guide](docs/README.md)** explains how everything works: installation and
120
+ configuration, concepts, the builder, every region and item type, processing, dynamic actions,
121
+ security, the SQL reference, a step-by-step tutorial, a guide for Oracle APEX developers, and
122
+ developing pgkiln itself.
123
+
124
+ ## What's in the box
125
+
126
+ For a full comparison with Oracle APEX 26.1, including what's missing, see
127
+ **[docs/apex-feature-parity.md](docs/apex-feature-parity.md)**.
128
+
129
+ **Runtime (Universal Theme-style UI, responsive on phone, tablet and desktop)**
130
+ - Side or top navigation (a drawer on tablets and phones), breadcrumbs, user menu, dark mode, theme colours
131
+ - 12-column region grid; region templates *standard*, *plain*, *collapsible*
132
+ - Regions:
133
+ - **Interactive report**: search, column filters, sort, rows per page, CSV download, reflow on phones
134
+ - **Interactive grid**: inline edit, add and delete rows
135
+ - **Form**: automatic row fetch and DML, in a page or a **modal dialog**
136
+ - **Charts**: bar, column, line, area and donut
137
+ - **Cards and metric cards**, **calendar**, **faceted search**
138
+ - **Static and dynamic content**
139
+ - **Items**: text, textarea, number, date, datetime, select, popup LOV (searchable), radio, checkbox, switch, checkbox group, multi-select, email, phone, URL, colour, display, hidden, password. Lists of values come from SQL, `STATIC:` or shared lists; items can be required or read-only (by condition), and select lists can cascade.
140
+ - **Dynamic actions**:
141
+ - Client-side: show, hide, enable, disable, alert, submit
142
+ - Server-side: set value from SQL, execute SQL, refresh a region, refresh an item
143
+ - Validations, processes (form DML, grid DML, any SQL/PL/pgSQL), branches, application items and processes
144
+
145
+ **Builder**
146
+ - App Builder home, app dashboard, and create page wizards from any table: *Report and form*, *Interactive grid*, *Form*, *Cards*, *Calendar*, *Chart*, *Map*, *Faceted search* and *Master detail*, with defaults from the catalog
147
+ - A **page designer** with a component tree and a grouped property editor
148
+ - **Shared components**: navigation menu, authorization schemes, lists of values, application items and processes, users
149
+ - Settings with theme and a security checklist, and an **activity monitor**
150
+ - **SQL Workshop**: SQL commands, plus an object browser with RLS policies and grants
151
+ - Export and import of apps as JSON, and developer accounts
152
+ - A `pgkiln` command line: migrations, export/import, and apps as one file per component for git
153
+ (diff, update in place)
154
+ - An MCP server for AI coding agents (`pgkiln mcp`): read, explain, change, diff and import applications
155
+
156
+ **Security** is covered in [SECURITY.md](SECURITY.md): least-privilege runtime role, per-app database roles, authorization schemes, checksummed URLs and grid rows, CSRF protection, login throttling, a strict CSP, and 28 security regression tests.
157
+
158
+ ## PL/pgSQL examples in the HR example application
159
+
160
+ The example ([`examples/hr/hr.sql`](examples/hr/hr.sql)) keeps its business rules in
161
+ the database and calls them from the app:
162
+
163
+ | Where in the app | Database object | Shows |
164
+ |---|---|---|
165
+ | Leave requests → *Submit request* | `hr.request_leave()` | Validation in PL/pgSQL (dates, overlaps, a 25-day balance). `raise exception … using column = 'end_date'` puts the message on the matching form field. |
166
+ | Leave request → *Approve* / *Reject* | `hr.decide_leave()` | Authorization in the database: a recursive CTE checks the management chain (`hr.is_manager_of`). |
167
+ | Manager's dashboard, employee's dashboard | `hr.notify_leave_requested()`, `hr.notify_leave_decided()` | Triggers creating notifications for *other* users (SECURITY DEFINER past RLS) |
168
+ | Employee form → *Give 10% raise* | `hr.give_raise()` | Role check via `meta.has_role()`; the returned salary is written back into the item |
169
+ | Employee form, salary field | trigger `hr.check_salary()` | A BEFORE trigger rule whose error appears on the Salary field |
170
+ | Employee form, *Job* | `hr.suggest_salary()` | Dynamic action: set a value from SQL as you type |
171
+ | Leave form, dates | `hr.business_days()` | Dynamic action computing working days live |
172
+ | Administration → Audit trail | trigger `hr.audit()` | A generic jsonb-diff audit trail recording the **application user** |
173
+ | Leave requests, notifications, audit | RLS policies | Each user sees only their own and their team's rows |
174
+ | Sign in | after-login application process | Maps the app user to an employee (`AI_EMPNO`, `AI_ENAME`) |
175
+
176
+ ## How it works
177
+
178
+ ```
179
+ Browser ── HTML + /static/app.js (dialogs, dynamic actions; no inline JS)
180
+ │
181
+ Runtime (Fastify, server-rendered) Builder (/builder)
182
+ │ per request: BEGIN │ owner connection
183
+ │ set pgkiln.app_user / app_id / session │ edits meta.* rows
184
+ │ SET LOCAL ROLE <app db_role> │ SQL Workshop
185
+ │ authorization → visibility → render/process
186
+ │ COMMIT
187
+ │ connects as pgkiln_runtime (least privilege)
188
+ Postgres
189
+ meta.* app definitions, sessions (hashed tokens), activity log
190
+ your schemas tables, PL/pgSQL, RLS policies
191
+ ```
192
+
193
+ ### Bind variables
194
+
195
+ `:NAME` in developer SQL is replaced by the item's value as an **escaped,
196
+ untyped string literal**. Postgres then resolves the literal's type from its
197
+ context, the way Oracle converts types implicitly. APEX patterns like
198
+ `where :P2_DEPTNO is null or deptno = :P2_DEPTNO` therefore work. With `$1`
199
+ parameters they fail with *could not determine data type of parameter*.
200
+ Empty strings are `NULL`, as in APEX. The scanner skips literals,
201
+ identifiers, comments, dollar quotes and `::` casts (see `test/binds.test.ts`).
202
+ Inside functions and `DO` blocks, use `meta.v('P1_X')`.
203
+
204
+ ### SQL API for developers
205
+
206
+ | Function | Purpose |
207
+ |---|---|
208
+ | `meta.app_user()` | Signed-in application user (`nobody` when anonymous) |
209
+ | `meta.has_role('admin')` | Role check; use it in RLS policies |
210
+ | `meta.v('P1_ITEM')` | Session state value |
211
+ | `meta.page_url(3, '{"P3_ID": 7}')` | Link with a valid checksum |
212
+ | `meta.generate_crud('app', 'schema.table', 2, 3)` | The page wizard |
213
+ | `meta.generate_page('app', 'calendar', 'schema.table', 4)` | The other page wizards (form, cards, calendar, chart, map, facets, master_detail) |
214
+ | `meta.export_app('alias')` / `meta.import_app(json)` | Deployment (or `pgkiln export` / `pgkiln import`, [chapter 18](docs/guide/18-cli.md)) |
215
+
216
+ ## Project layout
217
+
218
+ ```
219
+ db/migrations/ pgkiln: versioned schema (metadata repository, roles, SQL API)
220
+ examples/hr/ an example application built on pgkiln (not part of it): schema, PL/pgSQL, RLS, app definition
221
+ src/runtime/ context, authz, items, report, grid, charts, calendar, facets, regions, render, engine, routes
222
+ src/builder/ builder UI; components.ts is the spec the property editor is generated from
223
+ src/security.ts checksums, headers, password policy
224
+ src/cli/ the `pgkiln` command line (bin/pgkiln.js; docs/guide/18-cli.md)
225
+ public/ theme (CSS), app.js, icon sprite
226
+ test/ bind scanner unit tests, security regression tests, e2e/ browser tests
227
+ ```
228
+
229
+ ## Roadmap
230
+
231
+ See the prioritised roadmap at the end of [docs/apex-feature-parity.md](docs/apex-feature-parity.md#roadmap-proposed-priority).
232
+
233
+ ## Contributing
234
+
235
+ Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md), and report
236
+ vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
237
+
238
+ ## License
239
+
240
+ Copyright 2026 Vargar. Licensed under the [Apache License, Version 2.0](LICENSE).