@kedem/okdb 1.0.1 → 1.0.4

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 (142) hide show
  1. package/bin/okdb.js +1 -1
  2. package/keys/public.pem +3 -0
  3. package/okdb.js +1 -1
  4. package/package.json +2 -2
  5. package/public/admin-app.js +1 -1
  6. package/public/components/admin-route-host.ok.js +1 -1
  7. package/public/components/env-picker.ok.js +1 -1
  8. package/public/components/field-path-input.ok.js +1 -1
  9. package/public/components/field.html +154 -2
  10. package/public/components/geo-map.ok.js +1 -1
  11. package/public/components/ok-cron-input.ok.js +1 -1
  12. package/public/components/ok-dropzone.ok.js +1 -1
  13. package/public/components/ok-js-input.ok.js +1 -1
  14. package/public/components/ok-json-input.ok.js +1 -1
  15. package/public/components/ok-text-monaco-input.ok.js +1 -1
  16. package/public/components/theme-toggle.ok.js +1 -1
  17. package/public/index.html +29 -2
  18. package/public/layouts/_default.ok.html +1 -1
  19. package/public/layouts/okdb-cube.ok.html +1 -1
  20. package/public/login-app.js +1 -1
  21. package/public/login.html +205 -1
  22. package/public/modules/ok.js +1 -1
  23. package/public/sections/api/index.ok.html +1 -1
  24. package/public/sections/api/parts/api-endpoint.ok.js +1 -1
  25. package/public/sections/auth/index.ok.html +1 -1
  26. package/public/sections/auth/modals/create-token-modal.ok.js +1 -1
  27. package/public/sections/auth/modals/edit-token-modal.ok.js +1 -1
  28. package/public/sections/auth/modals/perm-info-popover.ok.js +1 -1
  29. package/public/sections/auth/parts/token-detail.ok.js +1 -1
  30. package/public/sections/auth/parts/token-list.ok.js +1 -1
  31. package/public/sections/db/index.ok.html +1 -1
  32. package/public/sections/db/modals/add-item-modal.ok.js +1 -1
  33. package/public/sections/db/modals/create-env-modal.ok.js +1 -1
  34. package/public/sections/db/modals/create-fts-modal.ok.js +1 -1
  35. package/public/sections/db/modals/create-index-modal.ok.js +1 -1
  36. package/public/sections/db/modals/create-pipeline-modal.ok.js +1 -1
  37. package/public/sections/db/modals/demo-env-modal.ok.js +1 -1
  38. package/public/sections/db/modals/remove-env-modal.ok.js +1 -1
  39. package/public/sections/db/modals/schema-edit-modal.ok.js +1 -1
  40. package/public/sections/db/parts/db-overview.ok.js +1 -1
  41. package/public/sections/db/parts/db-pipelines-panel.ok.js +1 -1
  42. package/public/sections/db/parts/edit-row.ok.js +1 -1
  43. package/public/sections/db/parts/tm-timeline.ok.js +1 -1
  44. package/public/sections/db/parts/type-changelog.ok.js +1 -1
  45. package/public/sections/db/parts/type-list.ok.js +1 -1
  46. package/public/sections/db/parts/type-pipelines-tab.ok.js +1 -1
  47. package/public/sections/db/parts/type-schema-tab.ok.js +1 -1
  48. package/public/sections/db/parts/type-viewer.ok.js +1 -1
  49. package/public/sections/db/parts/type-violations-tab.ok.js +1 -1
  50. package/public/sections/docs/index.ok.html +1 -1
  51. package/public/sections/embeddings/index.ok.html +1 -1
  52. package/public/sections/embeddings/modals/register-model-modal.ok.js +1 -1
  53. package/public/sections/embeddings/parts/embed-create-panel.ok.js +1 -1
  54. package/public/sections/embeddings/parts/embed-embedder-panel.ok.js +1 -1
  55. package/public/sections/embeddings/parts/embed-engine-declaration-editor.ok.js +1 -1
  56. package/public/sections/embeddings/parts/embed-engine-list.ok.js +1 -1
  57. package/public/sections/embeddings/parts/embed-indexer-panel.ok.js +1 -1
  58. package/public/sections/embeddings/parts/embed-lifecycle-bar.ok.js +1 -1
  59. package/public/sections/embeddings/parts/embed-model-catalog.ok.js +1 -1
  60. package/public/sections/embeddings/parts/embed-overview.ok.js +1 -1
  61. package/public/sections/embeddings/parts/embed-search-panel.ok.js +1 -1
  62. package/public/sections/embeddings/parts/embed-worker-panel.ok.js +1 -1
  63. package/public/sections/embeddings/parts/embeddings-engine-panel.ok.js +1 -1
  64. package/public/sections/embeddings/parts/engines-overview.ok.js +1 -1
  65. package/public/sections/embeddings/parts/pipeline-create-panel.ok.js +1 -1
  66. package/public/sections/engines/engine-panel-shared-style.js +1 -1
  67. package/public/sections/engines/engine-ui-utils.js +1 -1
  68. package/public/sections/engines/index.ok.html +1 -1
  69. package/public/sections/engines/modals/engine-modal.ok.js +1 -1
  70. package/public/sections/engines/parts/engine-declaration-editor.ok.js +1 -1
  71. package/public/sections/engines/parts/engine-lifecycle-actions.ok.js +1 -1
  72. package/public/sections/engines/parts/engine-panel-shell.ok.js +1 -1
  73. package/public/sections/engines/parts/engine-resource-card.ok.js +1 -1
  74. package/public/sections/engines/parts/engine-row-item.ok.js +1 -1
  75. package/public/sections/engines/parts/generic-engine-panel.ok.js +1 -1
  76. package/public/sections/files/index.ok.html +1 -1
  77. package/public/sections/files/parts/files-blob-status.ok.js +1 -1
  78. package/public/sections/files/parts/files-collection-list.ok.js +1 -1
  79. package/public/sections/files/parts/files-collection-panel.ok.js +1 -1
  80. package/public/sections/files/parts/files-file-list.ok.js +1 -1
  81. package/public/sections/files/parts/files-overview.ok.js +1 -1
  82. package/public/sections/files/parts/files-path-browser.ok.js +1 -1
  83. package/public/sections/files/parts/files-upload-panel.ok.js +1 -1
  84. package/public/sections/functions/index.ok.html +1 -1
  85. package/public/sections/functions/modals/function-modal.ok.js +1 -1
  86. package/public/sections/functions/parts/function-detail.ok.js +1 -1
  87. package/public/sections/functions/parts/function-logs.ok.js +1 -1
  88. package/public/sections/functions/parts/function-runner.ok.js +1 -1
  89. package/public/sections/functions/parts/functions-list.ok.js +1 -1
  90. package/public/sections/license/index.ok.html +1 -1
  91. package/public/sections/license/parts/license-panel.ok.js +1 -1
  92. package/public/sections/processors/index.ok.html +1 -1
  93. package/public/sections/queue/index.ok.html +1 -1
  94. package/public/sections/queue/modals/create-bucket-modal.ok.js +1 -1
  95. package/public/sections/queue/modals/edit-bucket-modal.ok.js +1 -1
  96. package/public/sections/queue/modals/edit-job-modal.ok.js +1 -1
  97. package/public/sections/queue/modals/enqueue-job-modal.ok.js +1 -1
  98. package/public/sections/queue/modals/job-type-modal.ok.js +1 -1
  99. package/public/sections/queue/parts/ok-job-form.ok.js +1 -1
  100. package/public/sections/queue/parts/queue-buckets.ok.js +1 -1
  101. package/public/sections/queue/parts/queue-job-types.ok.js +1 -1
  102. package/public/sections/queue/parts/queue-jobs.ok.js +1 -1
  103. package/public/sections/queue/parts/queue-types.ok.js +1 -1
  104. package/public/sections/queue/parts/queue-workers.ok.js +1 -1
  105. package/public/sections/sync/index.ok.html +1 -1
  106. package/public/sections/sync/parts/sync-node-detail.ok.js +1 -1
  107. package/public/sections/sync/parts/sync-retention.ok.js +1 -1
  108. package/public/sections/sync/parts/sync-topology.ok.js +1 -1
  109. package/public/sections/system/index.ok.html +1 -1
  110. package/public/sections/system/modals/data-ops-modal.ok.js +1 -1
  111. package/public/sections/system/parts/system-api-panel.ok.js +1 -1
  112. package/public/sections/system/parts/system-auth-panel.ok.js +1 -1
  113. package/public/sections/system/parts/system-log-history.ok.js +1 -1
  114. package/public/sections/system/parts/system-log.ok.js +1 -1
  115. package/public/sections/system/parts/system-status.ok.js +1 -1
  116. package/public/sections/system/parts/system-sync-panel.ok.js +1 -1
  117. package/public/sections/views/index.ok.html +1 -1
  118. package/public/sections/views/modals/create-view-modal.ok.js +1 -1
  119. package/public/sections/views/parts/view-detail.ok.js +1 -1
  120. package/public/sections/views/parts/views-list.ok.js +1 -1
  121. package/public/sections/views/parts/views-overview.ok.js +1 -1
  122. package/public/setup-app.js +1 -1
  123. package/public/setup.html +189 -1
  124. package/public/stores/auth-store.js +1 -1
  125. package/public/stores/events-store.js +1 -1
  126. package/public/stores/functions-store.js +1 -1
  127. package/public/stores/okdb-store.js +1 -1
  128. package/public/stores/theme-store.js +1 -1
  129. package/public/test-cron-input.html +53 -3
  130. package/public/test-json-input.html +182 -3
  131. package/public/util/permissions.js +1 -1
  132. package/public/util/sift-schema.js +1 -1
  133. package/public/vendor/okjs/ok.esm.min.js +1 -2
  134. package/public/view-models/type-query-vm.js +1 -1
  135. package/okdb-data/default/data.mdb +0 -0
  136. package/okdb-data/default/lock.mdb +0 -0
  137. package/okdb-data/~log/data.mdb +0 -0
  138. package/okdb-data/~log/lock.mdb +0 -0
  139. package/okdb-data/~system/data.mdb +0 -0
  140. package/okdb-data/~system/lock.mdb +0 -0
  141. package/public/images/logo.png +0 -0
  142. package/public/images/logo.svg +0 -333
package/public/setup.html CHANGED
@@ -1 +1,189 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/png" href="favicon.ico"><link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"><link rel="manifest" href="site.webmanifest"><title>OKDB Setup</title><script>!function(){try{var t=localStorage.getItem("okdbTheme");"dark"!==t&&"light"!==t&&(t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),"light"===t&&document.documentElement.setAttribute("data-theme","light")}catch(t){}}()</script><style>:root{color-scheme:dark;--bg0:#071018;--bg1:#0d1722;--bg2:#142235;--line:#27415f;--text:#e8f2ff;--muted:#9ab2cc;--accent:#4fc1ff;--accent2:#7ee787}:root[data-theme=light]{color-scheme:light;--bg0:#dce8f5;--bg1:#f0f6fc;--bg2:#ffffff;--line:#b0c8e0;--text:#0d1a28;--muted:#3a5870;--accent:#1a7ab8;--accent2:#16a34a}*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--text);background:radial-gradient(circle at top,#16304b 0,var(--bg0) 45%,#05090f 100%);display:flex;align-items:center;justify-content:center;padding:24px}[data-theme=light] body{background:radial-gradient(circle at top,#c8dff5 0,var(--bg0) 45%,#e8f2ff 100%)}.shell{width:min(1000px,100%);display:flex;flex-direction:column;gap:0}.header{margin-bottom:28px;text-align:center}.eyebrow{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:rgba(79,193,255,.12);color:var(--accent);font-size:12px;letter-spacing:.08em;text-transform:uppercase;border:1px solid rgba(79,193,255,.18)}h1{font-size:32px;line-height:1.1;margin:14px 0 6px}.subtitle{color:var(--muted);font-size:15px;margin:0}.panels{display:grid;grid-template-columns:1fr 1fr;gap:16px}.panel{background:rgba(8,16,26,.86);border:1px solid rgba(79,193,255,.16);border-radius:18px;padding:28px;backdrop-filter:blur(10px);display:flex;flex-direction:column;gap:20px}.panel-title{font-size:17px;font-weight:700;margin:0}.panel-desc{font-size:13px;color:var(--muted);margin:0;line-height:1.55}.stack{display:flex;flex-direction:column;gap:12px}.field{display:flex;flex-direction:column;gap:6px}.field label{font-size:12px;color:var(--muted)}.field input{width:100%;background:#0b1420;color:var(--text);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:12px 14px;outline:0;font-size:14px}.field input:focus{border-color:rgba(79,193,255,.45);box-shadow:0 0 0 3px rgba(79,193,255,.12)}.button{display:inline-flex;align-items:center;justify-content:center;width:100%;border:none;cursor:pointer;font-family:inherit;font-weight:700;font-size:15px;border-radius:12px;padding:14px 16px;background:linear-gradient(135deg,var(--accent),#8fdcff);color:#04111f;box-shadow:0 10px 30px rgba(79,193,255,.22)}.button:hover{filter:brightness(1.04)}.button.green{background:linear-gradient(135deg,var(--accent2),#a8f0b4);box-shadow:0 10px 30px rgba(126,231,135,.18)}.error{padding:10px 12px;border-radius:10px;background:rgba(248,113,113,.12);border:1px solid rgba(248,113,113,.25);color:#fecaca;font-size:13px}.success{padding:10px 12px;border-radius:10px;background:rgba(126,231,135,.1);border:1px solid rgba(126,231,135,.25);color:#a8f0b4;font-size:13px}@media (max-width:720px){.panels{grid-template-columns:1fr}}[data-theme=light] .panel{background:rgba(255,255,255,.92);border-color:rgba(26,122,184,.2)}[data-theme=light] .field input{background:var(--bg2);border-color:var(--line)}</style></head><body><main class="shell"><header class="header"><div class="eyebrow">OKDB First-Time Setup</div><h1>Welcome to OKDB</h1><p class="subtitle">This node has no credentials yet. Create an admin token or join an existing cluster.</p></header><div class="panels"><section class="panel" id="createPanel"><div><p class="panel-title">Create first admin token</p><p class="panel-desc">Set up credentials for this node. You'll log in with these after setup.</p></div><form id="createForm" class="stack"><div class="field"><label for="createName">Username</label> <input id="createName" name="name" value="admin" autocomplete="username" placeholder="admin"></div><div class="field"><label for="createPassword">Password</label> <input id="createPassword" name="password" type="password" autocomplete="new-password" placeholder="••••••••"></div><div class="field"><label for="createConfirm">Confirm password</label> <input id="createConfirm" name="confirm" type="password" autocomplete="new-password" placeholder="••••••••"></div><div class="field"><label for="createLabel">Label <span style="color:var(--muted)">(optional)</span></label> <input id="createLabel" name="label" value="Initial admin" placeholder="Initial admin"></div><div id="createError" class="error" hidden></div><button type="submit" class="button">Create admin and continue</button></form></section><section class="panel" id="joinPanel"><div><p class="panel-title">Join an existing cluster</p><p class="panel-desc">Connect to a running OKDB node. The cluster admin provides the sync token out-of-band.</p></div><form id="joinForm" class="stack"><div class="field"><label for="joinAddress">Remote node address</label> <input id="joinAddress" name="address" placeholder="https://node-a.example.com:8484"></div><div class="field"><label for="joinToken">Cluster sync token</label> <input id="joinToken" name="token" type="password" placeholder="cluster sync token"></div><div id="joinError" class="error" hidden></div><button type="submit" class="button green">Join cluster</button></form></section></div></main><script type="module" src="setup-app.js"></script></body></html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <link rel="icon" type="image/png" href="favicon.ico">
7
+ <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
8
+ <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
9
+ <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
10
+ <link rel="manifest" href="site.webmanifest">
11
+ <title>OKDB Setup</title>
12
+ <script>
13
+ (function () {
14
+ try {
15
+ var saved = localStorage.getItem('okdbTheme');
16
+ if (saved !== 'dark' && saved !== 'light') {
17
+ saved = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
18
+ }
19
+ if (saved === 'light') document.documentElement.setAttribute('data-theme', 'light');
20
+ } catch (e) { /* localStorage blocked — default to dark */ }
21
+ })();
22
+ </script>
23
+ <style>
24
+ :root {
25
+ color-scheme: dark;
26
+ --bg0:#071018;
27
+ --bg1:#0d1722;
28
+ --bg2:#142235;
29
+ --line:#27415f;
30
+ --text:#e8f2ff;
31
+ --muted:#9ab2cc;
32
+ --accent:#4fc1ff;
33
+ --accent2:#7ee787;
34
+ }
35
+ :root[data-theme='light'] {
36
+ color-scheme: light;
37
+ --bg0:#dce8f5;
38
+ --bg1:#f0f6fc;
39
+ --bg2:#ffffff;
40
+ --line:#b0c8e0;
41
+ --text:#0d1a28;
42
+ --muted:#3a5870;
43
+ --accent:#1a7ab8;
44
+ --accent2:#16a34a;
45
+ }
46
+ * { box-sizing:border-box; }
47
+ body {
48
+ margin:0;
49
+ min-height:100vh;
50
+ font-family: Inter, Segoe UI, Arial, sans-serif;
51
+ color:var(--text);
52
+ background: radial-gradient(circle at top, #16304b 0%, var(--bg0) 45%, #05090f 100%);
53
+ display:flex;
54
+ align-items:center;
55
+ justify-content:center;
56
+ padding:24px;
57
+ }
58
+ [data-theme='light'] body {
59
+ background: radial-gradient(circle at top, #c8dff5 0%, var(--bg0) 45%, #e8f2ff 100%);
60
+ }
61
+ .shell {
62
+ width:min(1000px, 100%);
63
+ display:flex;
64
+ flex-direction:column;
65
+ gap:0;
66
+ }
67
+ .header {
68
+ margin-bottom:28px;
69
+ text-align:center;
70
+ }
71
+ .eyebrow {
72
+ display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px;
73
+ background:rgba(79,193,255,.12); color:var(--accent); font-size:12px; letter-spacing:.08em; text-transform:uppercase;
74
+ border:1px solid rgba(79,193,255,.18);
75
+ }
76
+ h1 { font-size:32px; line-height:1.1; margin:14px 0 6px; }
77
+ .subtitle { color:var(--muted); font-size:15px; margin:0; }
78
+ .panels {
79
+ display:grid;
80
+ grid-template-columns:1fr 1fr;
81
+ gap:16px;
82
+ }
83
+ .panel {
84
+ background:rgba(8,16,26,.86);
85
+ border:1px solid rgba(79,193,255,.16);
86
+ border-radius:18px;
87
+ padding:28px;
88
+ backdrop-filter: blur(10px);
89
+ display:flex;
90
+ flex-direction:column;
91
+ gap:20px;
92
+ }
93
+ .panel-title { font-size:17px; font-weight:700; margin:0; }
94
+ .panel-desc { font-size:13px; color:var(--muted); margin:0; line-height:1.55; }
95
+ .stack { display:flex; flex-direction:column; gap:12px; }
96
+ .field { display:flex; flex-direction:column; gap:6px; }
97
+ .field label { font-size:12px; color:var(--muted); }
98
+ .field input {
99
+ width:100%; background:#0b1420; color:var(--text); border:1px solid rgba(255,255,255,.08);
100
+ border-radius:12px; padding:12px 14px; outline:none; font-size:14px;
101
+ }
102
+ .field input:focus { border-color: rgba(79,193,255,.45); box-shadow:0 0 0 3px rgba(79,193,255,.12); }
103
+ .button {
104
+ display:inline-flex; align-items:center; justify-content:center;
105
+ width:100%; border:none; cursor:pointer; font-family:inherit; font-weight:700; font-size:15px;
106
+ border-radius:12px; padding:14px 16px; background:linear-gradient(135deg, var(--accent), #8fdcff);
107
+ color:#04111f; box-shadow:0 10px 30px rgba(79,193,255,.22);
108
+ }
109
+ .button:hover { filter:brightness(1.04); }
110
+ .button.green {
111
+ background:linear-gradient(135deg, var(--accent2), #a8f0b4);
112
+ box-shadow:0 10px 30px rgba(126,231,135,.18);
113
+ }
114
+ .error {
115
+ padding:10px 12px; border-radius:10px;
116
+ background:rgba(248,113,113,.12); border:1px solid rgba(248,113,113,.25); color:#fecaca;
117
+ font-size:13px;
118
+ }
119
+ .success {
120
+ padding:10px 12px; border-radius:10px;
121
+ background:rgba(126,231,135,.1); border:1px solid rgba(126,231,135,.25); color:#a8f0b4;
122
+ font-size:13px;
123
+ }
124
+ @media (max-width:720px) {
125
+ .panels { grid-template-columns:1fr; }
126
+ }
127
+ [data-theme='light'] .panel { background: rgba(255,255,255,.92); border-color: rgba(26,122,184,.2); }
128
+ [data-theme='light'] .field input { background: var(--bg2); border-color: var(--line); }
129
+ </style>
130
+ </head>
131
+ <body>
132
+ <main class="shell">
133
+ <header class="header">
134
+ <div class="eyebrow">OKDB First-Time Setup</div>
135
+ <h1>Welcome to OKDB</h1>
136
+ <p class="subtitle">This node has no credentials yet. Create an admin token or join an existing cluster.</p>
137
+ </header>
138
+
139
+ <div class="panels">
140
+ <section class="panel" id="createPanel">
141
+ <div>
142
+ <p class="panel-title">Create first admin token</p>
143
+ <p class="panel-desc">Set up credentials for this node. You'll log in with these after setup.</p>
144
+ </div>
145
+ <form id="createForm" class="stack">
146
+ <div class="field">
147
+ <label for="createName">Username</label>
148
+ <input id="createName" name="name" value="admin" autocomplete="username" placeholder="admin">
149
+ </div>
150
+ <div class="field">
151
+ <label for="createPassword">Password</label>
152
+ <input id="createPassword" name="password" type="password" autocomplete="new-password" placeholder="••••••••">
153
+ </div>
154
+ <div class="field">
155
+ <label for="createConfirm">Confirm password</label>
156
+ <input id="createConfirm" name="confirm" type="password" autocomplete="new-password" placeholder="••••••••">
157
+ </div>
158
+ <div class="field">
159
+ <label for="createLabel">Label <span style="color:var(--muted)">(optional)</span></label>
160
+ <input id="createLabel" name="label" value="Initial admin" placeholder="Initial admin">
161
+ </div>
162
+ <div id="createError" class="error" hidden></div>
163
+ <button type="submit" class="button">Create admin and continue</button>
164
+ </form>
165
+ </section>
166
+
167
+ <section class="panel" id="joinPanel">
168
+ <div>
169
+ <p class="panel-title">Join an existing cluster</p>
170
+ <p class="panel-desc">Connect to a running OKDB node. The cluster admin provides the sync token out-of-band.</p>
171
+ </div>
172
+ <form id="joinForm" class="stack">
173
+ <div class="field">
174
+ <label for="joinAddress">Remote node address</label>
175
+ <input id="joinAddress" name="address" placeholder="https://node-a.example.com:8484">
176
+ </div>
177
+ <div class="field">
178
+ <label for="joinToken">Cluster sync token</label>
179
+ <input id="joinToken" name="token" type="password" placeholder="cluster sync token">
180
+ </div>
181
+ <div id="joinError" class="error" hidden></div>
182
+ <button type="submit" class="button green">Join cluster</button>
183
+ </form>
184
+ </section>
185
+ </div>
186
+ </main>
187
+ <script type="module" src="setup-app.js"></script>
188
+ </body>
189
+ </html>
@@ -1 +1 @@
1
- const _0x503f2c=_0x50fa;function _0x2b32(){const _0x5f3a3b=['files:*','6881DBAIvc','_grantsMatchAny','functions','./api/auth/permissions','44070fGOlAY','/admin/index.html','result','roles','length','config','catalog','771501yUwCGn','openAccess','Open\x20access','loading','join','application/json','can','admin','isArray','data:*','/auth/logout','notices','noticesDismissed','functions:read','queue','getItem','message','location','system:read','schema:read','1008756vZwHce','okdb_notices_dismissed','sync:read','implies','POST','Requires\x20','values','sync','loadNotices','Secure','data','catch','search:query','mode','791100kKLrio','files','system','auth','./api/notices','some','same-origin','\x20permission','2004NIMZvB','proxy','replace','user','files:read','loadConfig','646304ApfETB','queue:read','grants','loadSession','queue:work','./login/config','search:*','engines','canAny','functions:run','json','1727112NFjZmJ','./session','username','session'];_0x2b32=function(){return _0x5f3a3b;};return _0x2b32();}(function(_0x19b16b,_0xcfc4ce){const _0x4e9969=_0x50fa,_0x3c392d=_0x19b16b();while(!![]){try{const _0x51d70c=parseInt(_0x4e9969(0x155))/0x1+-parseInt(_0x4e9969(0x141))/0x2+parseInt(_0x4e9969(0x111))/0x3+parseInt(_0x4e9969(0x125))/0x4+-parseInt(_0x4e9969(0x133))/0x5+-parseInt(_0x4e9969(0x13b))/0x6*(-parseInt(_0x4e9969(0x151))/0x7)+-parseInt(_0x4e9969(0x14c))/0x8;if(_0x51d70c===_0xcfc4ce)break;else _0x3c392d['push'](_0x3c392d['shift']());}catch(_0xbab405){_0x3c392d['push'](_0x3c392d['shift']());}}}(_0x2b32,0x2d0a7));function _0x50fa(_0x43aebc,_0x2edddd){_0x43aebc=_0x43aebc-0x111;const _0x2b3226=_0x2b32();let _0x50faee=_0x2b3226[_0x43aebc];return _0x50faee;}import{ok as _0x2cf251}from'../modules/ok.js';import{hasPermission as _0x87329e,setImpliedBy as _0x4c6b57}from'../util/permissions.js';export default _0x2cf251[_0x503f2c(0x13c)]({'config':null,'session':null,'catalog':null,'loading':!0x1,'error':null,'notices':[],'noticesDismissed':!0x1,get 'mode'(){return this['config']?.['mode']??'open';},get 'openAccess'(){const _0x43d987=_0x503f2c;return!!this[_0x43d987(0x15a)]?.['openAccess'];},get 'isAuthenticated'(){const _0x9b8776=_0x503f2c;return!!this[_0x9b8776(0x14f)]?.['authenticated'];},get 'user'(){const _0x5577bf=_0x503f2c;return this[_0x5577bf(0x14f)]?.['user']??null;},get 'grants'(){const _0x3c9a49=_0x503f2c;return this['session']?.[_0x3c9a49(0x143)]??{};},get 'username'(){const _0x45e42c=_0x503f2c;return this[_0x45e42c(0x13e)]?.[_0x45e42c(0x14e)]??(this['openAccess']?'system':null);},get 'rolesLabel'(){const _0x5a2479=_0x503f2c,_0x45f9e2=this['user']?.['roles'];return Array['isArray'](_0x45f9e2)&&_0x45f9e2['length']?_0x45f9e2[_0x5a2479(0x115)](',\x20'):'';},'can'(_0xfa4e1b){const _0x3347bc=_0x503f2c;if(this[_0x3347bc(0x112)])return!0x0;const _0x28fa3f=this[_0x3347bc(0x13e)]?.[_0x3347bc(0x158)];return!!_0x28fa3f&&_0x87329e(_0x28fa3f,_0xfa4e1b);},'canForEnv'(_0xd97717,_0x553062){const _0x201923=_0x503f2c;if(this[_0x201923(0x112)])return!0x0;if(this[_0x201923(0x117)](_0x553062))return!0x0;const _0xdeab2b=this[_0x201923(0x143)][_0xd97717];return!(!Array[_0x201923(0x119)](_0xdeab2b)||0x0===_0xdeab2b[_0x201923(0x159)])&&_0x87329e(_0xdeab2b,_0x553062);},'_grantsMatchAny'(_0x1cd53d){const _0x25f114=_0x503f2c;for(const _0x46437e of Object[_0x25f114(0x12b)](this[_0x25f114(0x143)]))if(Array[_0x25f114(0x119)](_0x46437e)){for(const _0x438b02 of _0x1cd53d)if(_0x87329e(_0x46437e,_0x438b02))return!0x0;}return!0x1;},'canAny'(_0x572758){const _0x333dc0=_0x503f2c;return Array[_0x333dc0(0x119)](_0x572758)&&_0x572758[_0x333dc0(0x138)](_0x24cc1c=>this[_0x333dc0(0x117)](_0x24cc1c));},'canSection'(_0x36e37f){const _0x388641=_0x503f2c;if(this['openAccess'])return!0x0;switch(_0x36e37f){case'db':return this[_0x388641(0x149)](['data:read',_0x388641(0x124),_0x388641(0x131)])||this[_0x388641(0x152)](['data:read',_0x388641(0x124),'search:query',_0x388641(0x11a),'schema:*',_0x388641(0x147),'*']);case _0x388641(0x148):case _0x388641(0x135):return this['can'](_0x388641(0x123));case _0x388641(0x134):return this[_0x388641(0x117)](_0x388641(0x13f))||this['_grantsMatchAny']([_0x388641(0x13f),_0x388641(0x150),'*']);case _0x388641(0x11f):return this[_0x388641(0x149)]([_0x388641(0x142),_0x388641(0x145)])||this['_grantsMatchAny'](['queue:read',_0x388641(0x145),'queue:*','*']);case _0x388641(0x153):return this['canAny']([_0x388641(0x11e),_0x388641(0x14a)])||this[_0x388641(0x152)](['functions:read',_0x388641(0x14a),'functions:*','*']);case _0x388641(0x136):return this[_0x388641(0x117)]('auth:read');case _0x388641(0x12c):return this[_0x388641(0x117)](_0x388641(0x127));default:return!0x1;}},'permTooltip'(_0x19e6cb){const _0x1be06c=_0x503f2c;return this[_0x1be06c(0x117)](_0x19e6cb)?'':_0x1be06c(0x12a)+_0x19e6cb+_0x1be06c(0x13a);},get 'modeLabel'(){const _0x15bd6b=_0x503f2c;return this[_0x15bd6b(0x112)]?_0x15bd6b(0x113):'secure'===this[_0x15bd6b(0x132)]?_0x15bd6b(0x12e):String(this[_0x15bd6b(0x132)]||'auth');},get 'visibleNotices'(){const _0x42fe25=_0x503f2c;return this[_0x42fe25(0x11d)]?[]:this[_0x42fe25(0x11c)]||[];},'dismissNotices'(){const _0x7805b2=_0x503f2c;this[_0x7805b2(0x11d)]=!0x0;try{sessionStorage['setItem']('okdb_notices_dismissed','1');}catch{}},async 'loadConfig'(){const _0x38836b=_0x503f2c,_0x446b94=await fetch(_0x38836b(0x146),{'credentials':_0x38836b(0x139)}),_0x2c4cf6=await _0x446b94[_0x38836b(0x14b)]()[_0x38836b(0x130)](()=>({}));return this[_0x38836b(0x15a)]=_0x2c4cf6?.[_0x38836b(0x12f)]||{},this['config'];},async 'loadSession'(){const _0x459465=_0x503f2c;if(this[_0x459465(0x112)])return this[_0x459465(0x14f)]={'authenticated':!0x0,'user':{'username':_0x459465(0x135),'roles':[_0x459465(0x118)]},'grants':{}},this[_0x459465(0x14f)];const _0x976df3=await fetch(_0x459465(0x14d),{'credentials':_0x459465(0x139)});if(!_0x976df3['ok'])return this[_0x459465(0x14f)]={'authenticated':!0x1,'user':null,'grants':{}},this[_0x459465(0x14f)];const _0x5af0e5=await _0x976df3[_0x459465(0x14b)]()['catch'](()=>({})),_0x304659=_0x5af0e5?.[_0x459465(0x12f)]||_0x5af0e5?.[_0x459465(0x157)]||{'authenticated':!0x1,'user':null};return this[_0x459465(0x14f)]={'grants':{},..._0x304659},this[_0x459465(0x14f)];},async 'loadCatalog'(){const _0x4db682=_0x503f2c,_0xf0d258=await fetch(_0x4db682(0x154),{'credentials':_0x4db682(0x139)});if(!_0xf0d258['ok'])return null;const _0x1f62a9=await _0xf0d258[_0x4db682(0x14b)]()[_0x4db682(0x130)](()=>({})),_0x244d01=_0x1f62a9?.[_0x4db682(0x12f)]||_0x1f62a9?.[_0x4db682(0x157)]||null;return _0x244d01?.['implies']&&_0x4c6b57(_0x244d01[_0x4db682(0x128)]),this[_0x4db682(0x15b)]=_0x244d01,_0x244d01;},async 'loadNotices'(){const _0x3beebd=_0x503f2c;try{if('1'===sessionStorage[_0x3beebd(0x120)](_0x3beebd(0x126)))return void(this['noticesDismissed']=!0x0);const _0x274803=await fetch(_0x3beebd(0x137),{'credentials':_0x3beebd(0x139)});if(_0x274803['ok']){const _0x19bc36=await _0x274803['json']()[_0x3beebd(0x130)](()=>({}));this['notices']=_0x19bc36?.[_0x3beebd(0x12f)]?.[_0x3beebd(0x11c)]??_0x19bc36?.[_0x3beebd(0x157)]?.[_0x3beebd(0x11c)]??[];}}catch{}},async 'init'(){const _0x566106=_0x503f2c;this[_0x566106(0x114)]=!0x0,this['error']=null;try{await this[_0x566106(0x140)](),await this[_0x566106(0x144)](),await this['loadCatalog'](),await this[_0x566106(0x12d)]();}catch(_0x58db29){throw this['error']=_0x58db29?.[_0x566106(0x121)]||String(_0x58db29),_0x58db29;}finally{this[_0x566106(0x114)]=!0x1;}},async 'logout'(){const _0x2b65e5=_0x503f2c;await fetch(_0x2b65e5(0x11b),{'method':_0x2b65e5(0x129),'credentials':_0x2b65e5(0x139),'headers':{'content-type':_0x2b65e5(0x116)}})['catch'](()=>{}),this[_0x2b65e5(0x14f)]={'authenticated':!0x1,'user':null};const _0x426ca3=encodeURIComponent(_0x2b65e5(0x156));window[_0x2b65e5(0x122)][_0x2b65e5(0x13d)]('/admin/login?redirect='+_0x426ca3);}});
1
+ import{ok as s}from"../modules/ok.js";import{hasPermission as e,setImpliedBy as t}from"../util/permissions.js";export default s.proxy({config:null,session:null,catalog:null,loading:!1,error:null,notices:[],noticesDismissed:!1,get mode(){return this.config?.mode??"open"},get openAccess(){return!!this.config?.openAccess},get isAuthenticated(){return!!this.session?.authenticated},get user(){return this.session?.user??null},get grants(){return this.session?.grants??{}},get username(){return this.user?.username??(this.openAccess?"system":null)},get rolesLabel(){const s=this.user?.roles;return Array.isArray(s)&&s.length?s.join(", "):""},can(s){if(this.openAccess)return!0;const t=this.user?.roles;return!!t&&e(t,s)},canForEnv(s,t){if(this.openAccess)return!0;if(this.can(t))return!0;const n=this.grants[s];return!(!Array.isArray(n)||0===n.length)&&e(n,t)},_grantsMatchAny(s){for(const t of Object.values(this.grants))if(Array.isArray(t))for(const n of s)if(e(t,n))return!0;return!1},canAny(s){return Array.isArray(s)&&s.some(s=>this.can(s))},canSection(s){if(this.openAccess)return!0;switch(s){case"db":return this.canAny(["data:read","schema:read","search:query"])||this._grantsMatchAny(["data:read","schema:read","search:query","data:*","schema:*","search:*","*"]);case"engines":case"system":return this.can("system:read");case"files":return this.can("files:read")||this._grantsMatchAny(["files:read","files:*","*"]);case"queue":return this.canAny(["queue:read","queue:work"])||this._grantsMatchAny(["queue:read","queue:work","queue:*","*"]);case"functions":return this.canAny(["functions:read","functions:run"])||this._grantsMatchAny(["functions:read","functions:run","functions:*","*"]);case"auth":return this.can("auth:read");case"sync":return this.can("sync:read");default:return!1}},permTooltip(s){return this.can(s)?"":`Requires ${s} permission`},get modeLabel(){return this.openAccess?"Open access":"secure"===this.mode?"Secure":String(this.mode||"auth")},get visibleNotices(){return this.noticesDismissed?[]:this.notices||[]},dismissNotices(){this.noticesDismissed=!0;try{sessionStorage.setItem("okdb_notices_dismissed","1")}catch{}},async loadConfig(){const s=await fetch("./login/config",{credentials:"same-origin"}),e=await s.json().catch(()=>({}));return this.config=e?.data||{},this.config},async loadSession(){if(this.openAccess)return this.session={authenticated:!0,user:{username:"system",roles:["admin"]},grants:{}},this.session;const s=await fetch("./session",{credentials:"same-origin"});if(!s.ok)return this.session={authenticated:!1,user:null,grants:{}},this.session;const e=await s.json().catch(()=>({})),t=e?.data||e?.result||{authenticated:!1,user:null};return this.session={grants:{},...t},this.session},async loadCatalog(){const s=await fetch("./api/auth/permissions",{credentials:"same-origin"});if(!s.ok)return null;const e=await s.json().catch(()=>({})),n=e?.data||e?.result||null;return n?.implies&&t(n.implies),this.catalog=n,n},async loadNotices(){try{if("1"===sessionStorage.getItem("okdb_notices_dismissed"))return void(this.noticesDismissed=!0);const s=await fetch("./api/notices",{credentials:"same-origin"});if(s.ok){const e=await s.json().catch(()=>({}));this.notices=e?.data?.notices??e?.result?.notices??[]}}catch{}},async init(){this.loading=!0,this.error=null;try{await this.loadConfig(),await this.loadSession(),await this.loadCatalog(),await this.loadNotices()}catch(s){throw this.error=s?.message||String(s),s}finally{this.loading=!1}},async logout(){await fetch("/auth/logout",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"}}).catch(()=>{}),this.session={authenticated:!1,user:null};const s=encodeURIComponent("/admin/index.html");window.location.replace(`/admin/login?redirect=${s}`)}});
@@ -1 +1 @@
1
- const _0xe47019=_0x53bc;(function(_0xb0e04,_0x2edfb5){const _0x22452e=_0x53bc,_0x1bbfa9=_0xb0e04();while(!![]){try{const _0x54defc=-parseInt(_0x22452e(0x9a))/0x1*(parseInt(_0x22452e(0xa1))/0x2)+-parseInt(_0x22452e(0x87))/0x3+parseInt(_0x22452e(0x98))/0x4+parseInt(_0x22452e(0xb9))/0x5*(-parseInt(_0x22452e(0x94))/0x6)+-parseInt(_0x22452e(0xab))/0x7+-parseInt(_0x22452e(0xb7))/0x8*(parseInt(_0x22452e(0x82))/0x9)+-parseInt(_0x22452e(0x8f))/0xa*(-parseInt(_0x22452e(0x9c))/0xb);if(_0x54defc===_0x2edfb5)break;else _0x1bbfa9['push'](_0x1bbfa9['shift']());}catch(_0x595f4e){_0x1bbfa9['push'](_0x1bbfa9['shift']());}}}(_0x85d9,0x18de3));import{ok as _0x321a4e}from'../modules/ok.js';const t=[_0xe47019(0x9e),_0xe47019(0x8a),_0xe47019(0xb4),'system:poke',_0xe47019(0xad),'system:bus_state_change',_0xe47019(0xb2),_0xe47019(0x91),'item:remove','index:reset','index:ready',_0xe47019(0xbd),'index:drop',_0xe47019(0x9b),'fts:registered','fts:drop',_0xe47019(0xa2),_0xe47019(0x8c),_0xe47019(0x7f),'txn:end',_0xe47019(0x84),_0xe47019(0xb6),_0xe47019(0x85),'env:opened',_0xe47019(0xbf),_0xe47019(0xa8),_0xe47019(0x9d),_0xe47019(0x83),'engine:installed','engine:uninstalled',_0xe47019(0xc4),_0xe47019(0x8e),_0xe47019(0xbe),_0xe47019(0x86),_0xe47019(0x8b),_0xe47019(0xb5),_0xe47019(0x92),_0xe47019(0xc6),_0xe47019(0x89),_0xe47019(0xa3),_0xe47019(0xc0),_0xe47019(0xc1),_0xe47019(0xc5),_0xe47019(0xac),_0xe47019(0x99),_0xe47019(0xbc),_0xe47019(0xa5),'processor:resumed',_0xe47019(0xaf),_0xe47019(0x96)];function _0x53bc(_0xfe1a07,_0x43849f){_0xfe1a07=_0xfe1a07-0x7e;const _0x85d994=_0x85d9();let _0x53bcc0=_0x85d994[_0xfe1a07];return _0x53bcc0;}export{t as ALL_EVENTS};let n=null;const r={};function s(_0x30b15b){const _0x15068f=_0xe47019;try{return JSON[_0x15068f(0xbb)](_0x30b15b);}catch{return null;}}function o(_0x21a324,_0xa05fbf){const _0x4cea4c=_0xe47019,_0x283bc6=r[_0x21a324];if(_0x283bc6){for(const _0x1799a8 of _0x283bc6)try{_0x1799a8(_0xa05fbf);}catch(_0x399686){console[_0x4cea4c(0xc3)](_0x4cea4c(0xa0),_0x399686);}}}function i(_0x50d141,_0x5934ae){const _0x234eb3=_0xe47019;return[..._0x50d141[_0x234eb3(0x88)]>=0x1f4?_0x50d141[_0x234eb3(0x81)](-0x1f3):_0x50d141,_0x5934ae];}const d=_0x321a4e['proxy']({'connected':!0x1,'connecting':!0x1,'error':null,'activity':[],get 'logs'(){const _0x5cf704=_0xe47019;return this[_0x5cf704(0xa4)][_0x5cf704(0x80)](_0x36f013=>_0x5cf704(0x8d)===_0x36f013[_0x5cf704(0xb0)]);},'connect'(_0x54bbcf=null){const _0x50f7d8=_0xe47019;if(n||this[_0x50f7d8(0xba)])return;this['connecting']=!0x0,this['error']=null;let _0x4010c4=__ENV__[_0x50f7d8(0xa9)]+_0x50f7d8(0xc2);_0x54bbcf?.[_0x50f7d8(0x88)]&&(_0x4010c4+=_0x50f7d8(0x90)+encodeURIComponent(_0x54bbcf[_0x50f7d8(0xaa)](',')));const _0x5e7391=new EventSource(_0x4010c4);n=_0x5e7391,_0x5e7391['addEventListener'](_0x50f7d8(0xa6),()=>{const _0x11906d=_0x50f7d8;this[_0x11906d(0xb1)]=!0x0,this[_0x11906d(0xba)]=!0x1,this[_0x11906d(0xc3)]=null;}),_0x5e7391[_0x50f7d8(0x93)](_0x50f7d8(0xc3),()=>{const _0x461464=_0x50f7d8;this[_0x461464(0xb1)]=!0x1,this[_0x461464(0xba)]=!0x1,this[_0x461464(0xc3)]=_0x461464(0xb3);});const _0x48a1b3=_0x2286e7=>{const _0x1fadcc=_0x50f7d8,_0x5ab450=s(_0x2286e7[_0x1fadcc(0xb8)]);if(!_0x5ab450)return;const _0x33fbff={'_kind':_0x1fadcc(0x8d),'_ts':_0x5ab450['_ts']??_0x5ab450['ts']??Date[_0x1fadcc(0x95)](),..._0x5ab450};this[_0x1fadcc(0xa4)]=i(this[_0x1fadcc(0xa4)],_0x33fbff),o(_0x1fadcc(0x8d),_0x5ab450);};_0x5e7391['addEventListener']('log',_0x48a1b3);for(const _0x30823b of t)_0x5e7391[_0x50f7d8(0x93)](_0x30823b,_0xbf2338=>{const _0x5c9348=_0x50f7d8;try{const _0x43a728=s(_0xbf2338[_0x5c9348(0xb8)]);if(!_0x43a728)return;const _0x16db11={'_kind':'event','_event':_0x30823b,'_ts':_0x43a728[_0x5c9348(0x7e)]??Date[_0x5c9348(0x95)](),..._0x43a728};this['activity']=i(this[_0x5c9348(0xa4)],_0x16db11),o(_0x30823b,_0x43a728);}catch{}});_0x5e7391[_0x50f7d8(0xae)]=_0x48a1b3;},'disconnect'(){const _0x3fd1e5=_0xe47019;n?.[_0x3fd1e5(0xa7)](),n=null,this[_0x3fd1e5(0xb1)]=!0x1,this[_0x3fd1e5(0xba)]=!0x1;},'on':(_0x393ccd,_0x464731)=>(r[_0x393ccd]||(r[_0x393ccd]=new Set()),r[_0x393ccd][_0xe47019(0x97)](_0x464731),()=>r[_0x393ccd]?.['delete'](_0x464731)),'clearActivity'(){const _0xbc35c7=_0xe47019;this[_0xbc35c7(0xa4)]=[];},'clearLogs'(){const _0x18d755=_0xe47019;this[_0x18d755(0x9f)]();}});function _0x85d9(){const _0x35073c=['processor:progress','447BeFBog','index:registered','11tCfQPH','engine:stopped','system:ready','clearActivity','events-store\x20handler\x20error','822PMtKdR','fts:reset','queue:failed','activity','processor:paused','open','close','engine:started','API','join','280497QCHPLx','processor:ready','system:drain','onmessage','processor:retry','_kind','connected','item:create','Stream\x20disconnected\x20—\x20reconnecting…','system:clock_change','embeddings:doc:status_change','type:registered','4024cGgAhm','data','4910MVNaNI','connecting','parse','processor:error','index:progress','embeddings:indexer:doc:done','env:removed','queue:retry','queue:removed','/events','error','embeddings:indexer:ready','queue:reconciled','queue:enqueued','_ts','txn:start','filter','slice','1773vpQqdM','engine:error','txn:rollback','type:drop','embeddings:indexer:doc:failed','323769bzeunv','length','queue:done','system:stopped','embeddings:indexer:doc:queued','sync:apply','log','embeddings:indexer:flushed','5628890hqeSFg','?types=','item:update','embeddings:pipeline:ready','addEventListener','1098iFqgMw','now','relay:error','add','597912indoXx'];_0x85d9=function(){return _0x35073c;};return _0x85d9();}export default d;
1
+ import{ok as e}from"../modules/ok.js";const t=["system:ready","system:stopped","system:clock_change","system:poke","system:drain","system:bus_state_change","item:create","item:update","item:remove","index:reset","index:ready","index:progress","index:drop","index:registered","fts:registered","fts:drop","fts:reset","sync:apply","txn:start","txn:end","txn:rollback","type:registered","type:drop","env:opened","env:removed","engine:started","engine:stopped","engine:error","engine:installed","engine:uninstalled","embeddings:indexer:ready","embeddings:indexer:flushed","embeddings:indexer:doc:done","embeddings:indexer:doc:failed","embeddings:indexer:doc:queued","embeddings:doc:status_change","embeddings:pipeline:ready","queue:enqueued","queue:done","queue:failed","queue:retry","queue:removed","queue:reconciled","processor:ready","processor:progress","processor:error","processor:paused","processor:resumed","processor:retry","relay:error"];export{t as ALL_EVENTS};let n=null;const r={};function s(e){try{return JSON.parse(e)}catch{return null}}function o(e,t){const n=r[e];if(n)for(const e of n)try{e(t)}catch(e){console.error("events-store handler error",e)}}function i(e,t){return[...e.length>=500?e.slice(-499):e,t]}const d=e.proxy({connected:!1,connecting:!1,error:null,activity:[],get logs(){return this.activity.filter(e=>"log"===e._kind)},connect(e=null){if(n||this.connecting)return;this.connecting=!0,this.error=null;let r=__ENV__.API+"/events";e?.length&&(r+="?types="+encodeURIComponent(e.join(",")));const d=new EventSource(r);n=d,d.addEventListener("open",()=>{this.connected=!0,this.connecting=!1,this.error=null}),d.addEventListener("error",()=>{this.connected=!1,this.connecting=!1,this.error="Stream disconnected — reconnecting…"});const c=e=>{const t=s(e.data);if(!t)return;const n={_kind:"log",_ts:t._ts??t.ts??Date.now(),...t};this.activity=i(this.activity,n),o("log",t)};d.addEventListener("log",c);for(const e of t)d.addEventListener(e,t=>{try{const n=s(t.data);if(!n)return;const r={_kind:"event",_event:e,_ts:n._ts??Date.now(),...n};this.activity=i(this.activity,r),o(e,n)}catch{}});d.onmessage=c},disconnect(){n?.close(),n=null,this.connected=!1,this.connecting=!1},on:(e,t)=>(r[e]||(r[e]=new Set),r[e].add(t),()=>r[e]?.delete(t)),clearActivity(){this.activity=[]},clearLogs(){this.clearActivity()}});export default d;
@@ -1 +1 @@
1
- const _0x59b7f0=_0x3260;(function(_0x16fb8b,_0xddc102){const _0x19b2b4=_0x3260,_0x35e740=_0x16fb8b();while(!![]){try{const _0x2ca665=parseInt(_0x19b2b4(0x10b))/0x1*(parseInt(_0x19b2b4(0x13e))/0x2)+parseInt(_0x19b2b4(0x12e))/0x3+parseInt(_0x19b2b4(0x120))/0x4+-parseInt(_0x19b2b4(0xe8))/0x5+parseInt(_0x19b2b4(0x14b))/0x6+-parseInt(_0x19b2b4(0x101))/0x7+-parseInt(_0x19b2b4(0xea))/0x8*(parseInt(_0x19b2b4(0xf1))/0x9);if(_0x2ca665===_0xddc102)break;else _0x35e740['push'](_0x35e740['shift']());}catch(_0x562b42){_0x35e740['push'](_0x35e740['shift']());}}}(_0x41c8,0xce38f));import{ok as _0x338a26}from'../modules/ok.js';import _0xbaeb74 from'./okdb-store.js';import _0x44b670 from'./events-store.js';function _0x41c8(){const _0x4fd748=['functionsBase','POST','setModalPayloadDraft','3342078UzWgYX','trim','overview','modalPayloadError','\x20\x20return\x20{\x20ok:\x20true\x20};','Payload\x20JSON\x20is\x20invalid','data','stringify','beginCreateDraft','modalNameDraft','logs','envName','level','import','loading','console','70chkZvF','payloadError','/runs/','now','modalRunning','loadList','modalDescriptionDraft','/functions','create','selectedName','items','modalUnsafeDraft','sourceDraft','6495420vpRcTL','Function\x20script\x20must\x20be\x20an\x20anonymous\x20arrow\x20function\x20of\x20the\x20form\x20[async]\x20(ctx)\x20=>\x20{}','join','modalSourceDraft','dryRunMode','modalPreviewRun','has','modalValidation','encode','detail','FUNCTION_SCRIPT_TOO_LARGE','getLogsForRun','FUNCTION_SCRIPT_REQUIRED','filter','find','finishedAt','code','modalMaterializerContextDraft','/env/','source','resetSelection','reloadList','edit','length','memoryMb','isFinite','worker_threads','sort','selected','return\x20(','select','loadRuns','\x20\x20//\x20ctx.env\x20\x20\x20\x20\x20—\x20env-scoped\x20facade:\x20put,\x20get,\x20query,\x20txn,\x20queue,\x20files,\x20...','Failed\x20to\x20save\x20function','/preview','runs','requestedAt','logsForRun','name','currentView','message','replace','timeoutMs','\x20\x20//\x20ctx.log\x20\x20\x20\x20\x20—\x20structured\x20logger:\x20ctx.log.info(msg,\x20data)','/runs','catch','_ts','7424845sGYTTT','modalAllowFetchDraft','8zvulxc','Function\x20script\x20failed\x20to\x20compile','Function\x20script\x20exceeds\x2065536\x20bytes','\x20\x20//\x20Tip:\x20use\x20the\x20\x22seed\x22\x20template\x20when\x20you\x20want\x20bulk\x20inserts\x20via\x20ctx.env.txn(...)','info','DELETE','\x20\x20//\x20ctx.payload\x20—\x20caller\x20input','17144154xSQjEw','meta','loadOverviewRuns','runId','modalJobContextDraft','{\x0a\x20\x20\x0a}','PUT','hydrateOverview','Function\x20script\x20source\x20is\x20required','latestRun','setModalSourceDraft','test','request','parsePayloadDraft','msg','execution','7179438UjgoXB','proxy','buildModalDefinition','hasEnv','Failed\x20to\x20run\x20function','map','selectedRun','live','setModalPreviewContext','overviewRuns','39747gKujWs','running','saving','isArray','FUNCTION_SCRIPT_INVALID_SHAPE','modalEnabledDraft','title','string','add','runtime','enabled','key','modalMode','value','modalProcessorContextDraft','payloadDraft','modalMemoryMbDraft','json','FUNCTION_SCRIPT_COMPILE_FAILED','/run','application/json','6689820Ffduzy','modalTimeoutMsDraft','modalPayloadDraft','slice','validateSource','error','parse','modalPreviewLogs','push','set','script'];_0x41c8=function(){return _0x4fd748;};return _0x41c8();}const a=['async\x20(ctx)\x20=>\x20{',_0x59b7f0(0xf0),_0x59b7f0(0xd9),_0x59b7f0(0xe4),_0x59b7f0(0xed),'',_0x59b7f0(0x132),'}'][_0x59b7f0(0xbb)]('\x0a'),r=_0x59b7f0(0xf6),i=[{'symbol':'require','pattern':/(^|[^\w$.])require\s*\(/},{'symbol':_0x59b7f0(0x13b),'pattern':/(^|[^\w$.])import\b/},{'symbol':_0x59b7f0(0x13d),'pattern':/(^|[^\w$.])console\b/},{'symbol':'module','pattern':/(^|[^\w$.])module\b/},{'symbol':'exports','pattern':/(^|[^\w$.])exports\b/},{'symbol':'process','pattern':/(^|[^\w$.])process\b/},{'symbol':'child_process','pattern':/child_process/},{'symbol':_0x59b7f0(0xd3),'pattern':/worker_threads/}];function _0x3260(_0x4445f9,_0x2ec482){_0x4445f9=_0x4445f9-0xba;const _0x41c8c2=_0x41c8();let _0x3260f2=_0x41c8c2[_0x4445f9];return _0x3260f2;}function n(_0x33f525){const _0x85f6f5=_0x59b7f0;return null==_0x33f525?_0x33f525:JSON[_0x85f6f5(0x126)](JSON[_0x85f6f5(0x135)](_0x33f525));}function o(_0xa1cb62={},_0x432e04='persisted'){const _0x1ab23b=_0x59b7f0,_0x72aa6c=_0xa1cb62?.['meta']??null,_0xe5bf82=_0xa1cb62?.['msg']??_0xa1cb62?.[_0x1ab23b(0xe1)]??_0xa1cb62?.['content']??_0xa1cb62?.[_0x1ab23b(0x111)]??'';return{'runId':_0xa1cb62?.[_0x1ab23b(0xf4)]??_0x72aa6c?.[_0x1ab23b(0xf4)]??null,'ts':_0xa1cb62?.['ts']??_0xa1cb62?.[_0x1ab23b(0xe7)]??Date[_0x1ab23b(0x141)](),'level':_0xa1cb62?.[_0x1ab23b(0x13a)]??_0x1ab23b(0xee),'msg':'string'==typeof _0xe5bf82?_0xe5bf82:JSON[_0x1ab23b(0x135)](_0xe5bf82??''),'meta':_0x72aa6c,'source':_0x432e04};}export default _0x338a26[_0x59b7f0(0x102)]({'items':[],'selectedName':null,'selected':null,'runs':[],'overviewRuns':[],'selectedRun':null,'sourceDraft':'','payloadDraft':r,'currentView':_0x59b7f0(0x130),'modalMode':_0x59b7f0(0x146),'modalNameDraft':'','modalSourceDraft':a,'modalPayloadDraft':r,'modalJobContextDraft':null,'modalProcessorContextDraft':null,'modalMaterializerContextDraft':null,'modalDescriptionDraft':'','modalEnabledDraft':!0x0,'modalUnsafeDraft':!0x1,'modalTimeoutMsDraft':null,'modalMemoryMbDraft':null,'modalAllowFetchDraft':!0x0,'modalValidation':{'ok':!0x1,'code':'FUNCTION_SCRIPT_REQUIRED','message':_0x59b7f0(0xf9)},'modalPayloadError':null,'modalPreviewRun':null,'modalPreviewLogs':[],'modalRunning':!0x1,'modalDryRunMode':!0x1,'loading':!0x1,'saving':!0x1,'running':!0x1,'dryRunMode':!0x1,'payloadError':null,'error':null,get 'envName'(){return _0xbaeb74['selectedEnv']||null;},get 'isGlobalScope'(){const _0x1d7dbf=_0x59b7f0;return'~system'===this[_0x1d7dbf(0x139)];},get 'hasEnv'(){const _0x2048c8=_0x59b7f0;return!!this[_0x2048c8(0x139)];},get 'functionsBase'(){const _0x5c1ea=_0x59b7f0;return this['envName']?__ENV__['API']+_0x5c1ea(0xcb)+encodeURIComponent(this[_0x5c1ea(0x139)])+_0x5c1ea(0x145):null;},get 'canOpenModal'(){return!!this['functionsBase'];},get 'hasSelected'(){const _0x128e45=_0x59b7f0;return!!this[_0x128e45(0x147)]&&!!this[_0x128e45(0xd5)];},get 'latestRun'(){const _0x24dd9c=_0x59b7f0;return this[_0x24dd9c(0xdc)]?.[0x0]?.[_0x24dd9c(0x118)]||this[_0x24dd9c(0xdc)]?.[0x0]||null;},get 'activeRun'(){return this['selectedRun']||this['latestRun']||null;},get 'functionsOverview'(){const _0xa80b98=_0x59b7f0,_0x53c661=new Map();for(const _0x39bf56 of this[_0xa80b98(0x10a)]||[]){const _0x482b60=_0x39bf56?.['value']||_0x39bf56,_0x51e457=_0x482b60?.['functionName'];_0x51e457&&!_0x53c661[_0xa80b98(0xbf)](_0x51e457)&&_0x53c661[_0xa80b98(0x129)](_0x51e457,_0x482b60);}return(this[_0xa80b98(0x148)]||[])[_0xa80b98(0x106)](_0x50ffea=>({..._0x50ffea,'latestRun':_0x53c661['get'](_0x50ffea?.[_0xa80b98(0x116)])||null}));},get 'selectedFunctionTitle'(){const _0x7a6881=_0x59b7f0;return this['selected']?.[_0x7a6881(0xdf)]||this['selectedName']||null;},get 'selectedLogEntries'(){const _0x43bd95=_0x59b7f0,_0x38a46f=this['selectedRun']?.['id']||this[_0x43bd95(0x107)]?.['runId'];if(_0x38a46f)return this[_0x43bd95(0xde)](_0x38a46f);const _0x14e9d8=this[_0x43bd95(0xfa)]?.['id']||this['latestRun']?.['runId'];return _0x14e9d8?this[_0x43bd95(0xde)](_0x14e9d8):[];},'logsForRun'(_0x57b743){const _0x1f3b36=_0x59b7f0;if(!_0x57b743)return[];const _0x1ee132=[this['selectedRun'],this['latestRun'],...(this[_0x1f3b36(0xdc)]||[])[_0x1f3b36(0x106)](_0x3b79c7=>_0x3b79c7?.[_0x1f3b36(0x118)]||_0x3b79c7)]['find'](_0x27bf25=>(_0x27bf25?.['id']||_0x27bf25?.[_0x1f3b36(0xf4)])===_0x57b743)?.['logs'],_0x1d1323=[...Array[_0x1f3b36(0x10e)](_0x1ee132)?_0x1ee132[_0x1f3b36(0x106)](_0x4847d2=>o(_0x4847d2,'persisted')):[],...(_0x44b670['logs']||[])[_0x1f3b36(0xc6)](_0x3e905c=>(_0x3e905c?.[_0x1f3b36(0xf4)]||_0x3e905c?.[_0x1f3b36(0xf2)]?.[_0x1f3b36(0xf4)])===_0x57b743)[_0x1f3b36(0x106)](_0x3d1600=>o(_0x3d1600,_0x1f3b36(0x108)))],_0x1a7c85=new Set(),_0x11a92f=[];for(const _0x34d004 of _0x1d1323){const _0x4147d6=_0x34d004[_0x1f3b36(0xf4)]+'|'+_0x34d004['ts']+'|'+_0x34d004[_0x1f3b36(0x13a)]+'|'+_0x34d004[_0x1f3b36(0xff)]+'|'+JSON[_0x1f3b36(0x135)](_0x34d004['meta']??null);_0x1a7c85[_0x1f3b36(0xbf)](_0x4147d6)||(_0x1a7c85[_0x1f3b36(0x113)](_0x4147d6),_0x11a92f[_0x1f3b36(0x128)](_0x34d004));}return _0x11a92f['sort']((_0xbdf427,_0x51cdcd)=>(_0xbdf427['ts']??0x0)-(_0x51cdcd['ts']??0x0)),_0x11a92f;},'resetSelection'(){const _0x5848bc=_0x59b7f0;this[_0x5848bc(0x147)]=null,this[_0x5848bc(0xd5)]=null,this[_0x5848bc(0xdc)]=[],this[_0x5848bc(0x10a)]=[],this[_0x5848bc(0x107)]=null,this['sourceDraft']='',this[_0x5848bc(0x11a)]=r,this[_0x5848bc(0x13f)]=null,this['error']=null;},'validateSource'(_0x33f7ed){const _0xf78cf0=_0x59b7f0,_0x5defdf=_0xf78cf0(0x112)==typeof _0x33f7ed?_0x33f7ed[_0xf78cf0(0xe2)](/\r\n/g,'\x0a')[_0xf78cf0(0x12f)]():'';if(!_0x5defdf)return{'ok':!0x1,'code':_0xf78cf0(0xc5),'message':_0xf78cf0(0xf9)};const _0x38c916=new TextEncoder()[_0xf78cf0(0xc1)](_0x5defdf)[_0xf78cf0(0xd0)];if(_0x38c916>0x10000)return{'ok':!0x1,'code':_0xf78cf0(0xc3),'message':_0xf78cf0(0xec)};if(!/^(async\s+)?\(\s*[A-Za-z_$][\w$]*\s*\)\s*=>/[_0xf78cf0(0xfc)](_0x5defdf))return{'ok':!0x1,'code':_0xf78cf0(0x10f),'message':_0xf78cf0(0xba)};for(const {symbol:_0x26988e,pattern:_0x2fea01}of i)if(_0x2fea01[_0xf78cf0(0xfc)](_0x5defdf))return{'ok':!0x1,'code':'FUNCTION_SCRIPT_FORBIDDEN_SYMBOL','message':'Function\x20script\x20may\x20not\x20reference\x20'+_0x26988e};try{new Function(_0xf78cf0(0xd6)+_0x5defdf+');')();}catch(_0x2e45e9){return{'ok':!0x1,'code':_0xf78cf0(0x11d),'message':_0x2e45e9?.['message']||_0xf78cf0(0xeb)};}return{'ok':!0x0,'code':null,'message':'','normalizedSource':_0x5defdf,'bytes':_0x38c916};},'parsePayloadDraft'(_0x241404=this[_0x59b7f0(0x11a)]){const _0x3a25e9=_0x59b7f0,_0x5f6bae=String(_0x241404??'')[_0x3a25e9(0x12f)]();return _0x5f6bae?JSON[_0x3a25e9(0x126)](_0x5f6bae):null;},'setModalSourceDraft'(_0x4f2386){const _0x1e5382=_0x59b7f0;this[_0x1e5382(0xbc)]=_0x4f2386??'',this[_0x1e5382(0xc0)]=this[_0x1e5382(0x124)](this[_0x1e5382(0xbc)]);},'setModalPayloadDraft'(_0x147747){const _0xcf0472=_0x59b7f0;this[_0xcf0472(0x122)]=_0x147747??r;try{this[_0xcf0472(0xfe)](this[_0xcf0472(0x122)]),this[_0xcf0472(0x131)]=null;}catch(_0x38696c){this[_0xcf0472(0x131)]=_0x38696c?.[_0xcf0472(0xe1)]||'Payload\x20JSON\x20is\x20invalid';}},'setModalPreviewContext'({jobContext:_0x319dfa=null,processorContext:_0x529483=null,materializerContext:_0x37f1d4=null}={}){const _0x39bd2e=_0x59b7f0;this[_0x39bd2e(0xf5)]=n(_0x319dfa),this[_0x39bd2e(0x119)]=n(_0x529483),this[_0x39bd2e(0xca)]=n(_0x37f1d4);},'beginCreateDraft'(){const _0x4ce683=_0x59b7f0;this[_0x4ce683(0x117)]=_0x4ce683(0x146),this['modalNameDraft']='',this[_0x4ce683(0x144)]='',this[_0x4ce683(0x110)]=!0x0,this['modalUnsafeDraft']=!0x1,this[_0x4ce683(0x121)]=null,this['modalMemoryMbDraft']=null,this['modalAllowFetchDraft']=!0x0,this[_0x4ce683(0xbe)]=null,this[_0x4ce683(0x127)]=[],this[_0x4ce683(0x109)]({}),this[_0x4ce683(0x12d)](this[_0x4ce683(0x11a)]||r),this[_0x4ce683(0xfb)](a);},'beginEditDraft'(){const _0x307111=_0x59b7f0,_0x41734d=this['selected'];this[_0x307111(0x117)]=_0x307111(0xcf),this[_0x307111(0x137)]=_0x41734d?.[_0x307111(0xdf)]||this['selectedName']||'',this['modalDescriptionDraft']=_0x41734d?.['metadata']?.['description']||'',this[_0x307111(0x110)]=!0x1!==_0x41734d?.[_0x307111(0x115)],this[_0x307111(0x149)]=!0x0===_0x41734d?.['unsafe'],this[_0x307111(0x121)]=_0x41734d?.[_0x307111(0x114)]?.[_0x307111(0xe3)]??null,this['modalMemoryMbDraft']=_0x41734d?.[_0x307111(0x114)]?.[_0x307111(0xd1)]??null,this[_0x307111(0xe9)]=!0x1!==_0x41734d?.['runtime']?.['allowFetch'],this[_0x307111(0xbe)]=null,this['modalPreviewLogs']=[],this[_0x307111(0x109)]({}),this[_0x307111(0x12d)](this[_0x307111(0x11a)]||r),this[_0x307111(0xfb)](_0x41734d?.[_0x307111(0x12a)]?.['source']||this[_0x307111(0x14a)]||a);},'buildModalDefinition'(){const _0x1d2eac=_0x59b7f0,_0x5282ca={};return Number[_0x1d2eac(0xd2)](this[_0x1d2eac(0x121)])&&this[_0x1d2eac(0x121)]>0x0&&(_0x5282ca[_0x1d2eac(0xe3)]=this[_0x1d2eac(0x121)]),Number['isFinite'](this['modalMemoryMbDraft'])&&this[_0x1d2eac(0x11b)]>0x0&&(_0x5282ca['memoryMb']=this['modalMemoryMbDraft']),_0x5282ca['allowFetch']=!0x1!==this[_0x1d2eac(0xe9)],{'name':String(this[_0x1d2eac(0x137)]||'')[_0x1d2eac(0x12f)](),'source':this[_0x1d2eac(0xc0)]?.['normalizedSource']||String(this[_0x1d2eac(0xbc)]||'')[_0x1d2eac(0x12f)](),'metadata':{'description':String(this['modalDescriptionDraft']||'')[_0x1d2eac(0x12f)]()},'enabled':!0x1!==this['modalEnabledDraft'],'unsafe':!0x0===this[_0x1d2eac(0x149)],'runtime':_0x5282ca};},get 'canSaveModal'(){const _0x43da0d=_0x59b7f0;return!(!String(this[_0x43da0d(0x137)]||'')[_0x43da0d(0x12f)]()||!this[_0x43da0d(0xc0)]?.['ok']||this[_0x43da0d(0x131)]||this[_0x43da0d(0x10d)]);},async 'loadList'(){const _0x2fceca=_0x59b7f0;if(!this['functionsBase'])return[];this[_0x2fceca(0x13c)]=!0x0,this['error']=null;try{const _0x700b33=await fetch(this[_0x2fceca(0x12b)]),_0x59d330=await _0x700b33[_0x2fceca(0x11c)]();return this[_0x2fceca(0x148)]=_0x59d330?.[_0x2fceca(0x134)]||[],this['selectedName']&&(this[_0x2fceca(0x148)]['find'](_0x24f3d7=>_0x24f3d7['key']===this[_0x2fceca(0x147)])||this[_0x2fceca(0xcd)]()),this[_0x2fceca(0x148)];}catch(_0x2a28c4){throw this[_0x2fceca(0x125)]=_0x2a28c4?.[_0x2fceca(0xe1)]||'Failed\x20to\x20load\x20functions',_0x2a28c4;}finally{this[_0x2fceca(0x13c)]=!0x1;}},async 'reloadList'(){const _0x501696=_0x59b7f0;return this[_0x501696(0x148)]=[],this[_0x501696(0x143)]();},'setView'(_0x17c4d9='overview'){const _0x398e67=_0x59b7f0;this[_0x398e67(0xe0)]='detail'===_0x17c4d9?_0x398e67(0xc2):_0x398e67(0x130);},async 'loadOverviewRuns'(_0x1208eb=0x18){const _0x38829c=_0x59b7f0;if(!this[_0x38829c(0x12b)])return[];const _0x3185cd=(this[_0x38829c(0x148)]||[])[_0x38829c(0x106)](_0x531e9f=>_0x531e9f?.[_0x38829c(0x116)])['filter'](Boolean),_0x2b1adf=[];for(const _0x140c04 of _0x3185cd){const _0x1d1c37=await fetch(this[_0x38829c(0x12b)]+'/'+encodeURIComponent(_0x140c04)+_0x38829c(0xe5)),_0x2e8ff4=await _0x1d1c37['json'](),_0x2a2655=(_0x2e8ff4?.['data']||[])[_0x38829c(0x106)](_0x30bef7=>_0x30bef7?.[_0x38829c(0x118)]?_0x30bef7:{'key':_0x30bef7?.['id']||_0x30bef7?.[_0x38829c(0xf4)],'value':_0x30bef7});_0x2b1adf[_0x38829c(0x128)](..._0x2a2655);}return _0x2b1adf[_0x38829c(0xd4)]((_0xfed26,_0x47dc89)=>{const _0x1fe66c=_0x38829c,_0x7a3faf=_0xfed26?.['value']?.[_0x1fe66c(0x100)]?.['finishedAt']??_0xfed26?.[_0x1fe66c(0x118)]?.[_0x1fe66c(0xfd)]?.[_0x1fe66c(0xdd)]??0x0;return(_0x47dc89?.['value']?.[_0x1fe66c(0x100)]?.[_0x1fe66c(0xc8)]??_0x47dc89?.[_0x1fe66c(0x118)]?.[_0x1fe66c(0xfd)]?.[_0x1fe66c(0xdd)]??0x0)-_0x7a3faf;}),this[_0x38829c(0x10a)]=_0x2b1adf[_0x38829c(0x123)](0x0,_0x1208eb),this[_0x38829c(0x10a)];},async 'hydrateOverview'(){const _0x41ae5d=_0x59b7f0;await this[_0x41ae5d(0x143)](),await this[_0x41ae5d(0xf3)]();},async 'select'(_0x4ac3e1){const _0x48adfc=_0x59b7f0;if(this[_0x48adfc(0x147)]=_0x4ac3e1||null,this[_0x48adfc(0x107)]=null,this[_0x48adfc(0xe0)]=_0x4ac3e1?_0x48adfc(0xc2):'overview',!_0x4ac3e1)return this[_0x48adfc(0xd5)]=null,this[_0x48adfc(0x14a)]='',this['runs']=[],null;const _0x5e33e0=await fetch(this[_0x48adfc(0x12b)]+'/'+encodeURIComponent(_0x4ac3e1)),_0x25ae78=await _0x5e33e0[_0x48adfc(0x11c)]();if(this[_0x48adfc(0xd5)]=_0x25ae78?.[_0x48adfc(0x134)]||null,this['sourceDraft']=this[_0x48adfc(0xd5)]?.[_0x48adfc(0x12a)]?.[_0x48adfc(0xcc)]||'',this[_0x48adfc(0x13f)]=null,await this[_0x48adfc(0xd8)](_0x4ac3e1),!this[_0x48adfc(0x107)]&&this[_0x48adfc(0xdc)]?.[_0x48adfc(0xd0)]){const _0x1da36a=this['runs'][0x0];this['selectedRun']=_0x1da36a?.[_0x48adfc(0x118)]||_0x1da36a||null;}return this[_0x48adfc(0xd5)];},async 'loadRuns'(_0x53fa1c=this[_0x59b7f0(0x147)]){const _0x485d1c=_0x59b7f0;if(!_0x53fa1c)return this[_0x485d1c(0xdc)]=[],[];const _0x24736f=await fetch(this[_0x485d1c(0x12b)]+'/'+encodeURIComponent(_0x53fa1c)+'/runs'),_0x3e8499=await _0x24736f[_0x485d1c(0x11c)]();if(this[_0x485d1c(0xdc)]=_0x3e8499?.[_0x485d1c(0x134)]||[],this[_0x485d1c(0x107)]){const _0x2d3fe9=this[_0x485d1c(0x107)]?.['id']||this[_0x485d1c(0x107)]?.[_0x485d1c(0xf4)],_0x23089c=this['runs'][_0x485d1c(0x106)](_0x19a3c1=>_0x19a3c1?.[_0x485d1c(0x118)]||_0x19a3c1)[_0x485d1c(0xc7)](_0x211d52=>(_0x211d52?.['id']||_0x211d52?.[_0x485d1c(0xf4)])===_0x2d3fe9);this['selectedRun']=_0x23089c||null;}return this['runs'];},async 'refreshSelected'(){const _0x65a9ec=_0x59b7f0;if(!this['selectedName'])return null;const _0x47e21a=this['selectedRun']?.['id']||this['selectedRun']?.[_0x65a9ec(0xf4)];if(await this[_0x65a9ec(0xd7)](this[_0x65a9ec(0x147)]),_0x47e21a){const _0x91b72d=this['runs'][_0x65a9ec(0x106)](_0x2d71b5=>_0x2d71b5?.['value']||_0x2d71b5)[_0x65a9ec(0xc7)](_0x134489=>(_0x134489?.['id']||_0x134489?.[_0x65a9ec(0xf4)])===_0x47e21a);this[_0x65a9ec(0x107)]=_0x91b72d||this[_0x65a9ec(0x107)];}return await this['loadOverviewRuns'](),this[_0x65a9ec(0xd5)];},'setSourceDraft'(_0x53c97d){const _0x24c64c=_0x59b7f0;this[_0x24c64c(0x14a)]=_0x53c97d??'';},'setPayloadDraft'(_0x55cfd6){const _0x564947=_0x59b7f0;this[_0x564947(0x11a)]=_0x55cfd6??r;try{this['parsePayloadDraft'](this[_0x564947(0x11a)]),this[_0x564947(0x13f)]=null;}catch(_0x9bee41){this[_0x564947(0x13f)]=_0x9bee41?.[_0x564947(0xe1)]||_0x564947(0x133);}},async 'create'(_0x29cf47={}){const _0x399570=_0x59b7f0;this[_0x399570(0x10d)]=!0x0,this[_0x399570(0x125)]=null;try{const _0x48f978={..._0x29cf47},_0x832d01=await fetch(this[_0x399570(0x12b)],{'method':_0x399570(0x12c),'headers':{'content-type':'application/json'},'body':JSON[_0x399570(0x135)](_0x48f978)}),_0x6ada89=await _0x832d01[_0x399570(0x11c)]();if(!_0x832d01['ok'])throw new Error(_0x6ada89?.[_0x399570(0x125)]?.['message']||_0x6ada89?.[_0x399570(0x134)]?.['error']||'Failed\x20to\x20create\x20function');return await this[_0x399570(0xce)](),await this['select'](_0x6ada89?.[_0x399570(0x134)]?.[_0x399570(0xdf)]||_0x29cf47['name']),_0x6ada89?.[_0x399570(0x134)];}finally{this[_0x399570(0x10d)]=!0x1;}},async 'saveSelected'(_0x405189={}){const _0x1faf69=_0x59b7f0;if(!this[_0x1faf69(0x147)])return null;this[_0x1faf69(0x10d)]=!0x0,this[_0x1faf69(0x125)]=null;try{const _0x26d65f={..._0x405189,'source':_0x405189?.[_0x1faf69(0xcc)]??this[_0x1faf69(0x14a)]},_0xe233af=await fetch(this[_0x1faf69(0x12b)]+'/'+encodeURIComponent(this[_0x1faf69(0x147)]),{'method':_0x1faf69(0xf7),'headers':{'content-type':'application/json'},'body':JSON[_0x1faf69(0x135)](_0x26d65f)}),_0xacf1ee=await _0xe233af[_0x1faf69(0x11c)]();if(!_0xe233af['ok'])throw new Error(_0xacf1ee?.['error']?.['message']||_0xacf1ee?.['data']?.[_0x1faf69(0x125)]||_0x1faf69(0xda));return await this['reloadList'](),await this[_0x1faf69(0xd7)](this[_0x1faf69(0x147)]),_0xacf1ee?.[_0x1faf69(0x134)];}finally{this['saving']=!0x1;}},async 'saveModalDefinition'(){const _0x487367=_0x59b7f0,_0x141e17=this[_0x487367(0x103)]();return _0x487367(0xcf)===this[_0x487367(0x117)]&&this['selectedName']?await this['saveSelected'](_0x141e17):this[_0x487367(0x146)](_0x141e17);},async 'remove'(_0x271b10=this[_0x59b7f0(0x147)]){const _0x5236e7=_0x59b7f0;if(!_0x271b10)return!0x1;this[_0x5236e7(0x10d)]=!0x0,this[_0x5236e7(0x125)]=null;try{const _0x45a8d4=await fetch(this[_0x5236e7(0x12b)]+'/'+encodeURIComponent(_0x271b10),{'method':_0x5236e7(0xef)});if(!_0x45a8d4['ok']&&0xcc!==_0x45a8d4['status']){const _0x11e6f0=await _0x45a8d4[_0x5236e7(0x11c)]()[_0x5236e7(0xe6)](()=>({}));throw new Error(_0x11e6f0?.[_0x5236e7(0x125)]?.[_0x5236e7(0xe1)]||_0x11e6f0?.['data']?.[_0x5236e7(0x125)]||'Failed\x20to\x20delete\x20function');}return await this[_0x5236e7(0xce)](),await this['loadOverviewRuns'](),this['selectedName']===_0x271b10&&this['resetSelection'](),!0x0;}finally{this['saving']=!0x1;}},async 'runSelected'(){const _0x15d4cd=_0x59b7f0;if(!this[_0x15d4cd(0x147)])return null;this[_0x15d4cd(0x10c)]=!0x0,this[_0x15d4cd(0x125)]=null;try{let _0x26e9de=null;try{_0x26e9de=this[_0x15d4cd(0xfe)](this[_0x15d4cd(0x11a)]),this['payloadError']=null;}catch(_0x1763b4){throw this[_0x15d4cd(0x13f)]=_0x1763b4?.['message']||'Payload\x20JSON\x20is\x20invalid',_0x1763b4;}const _0x2bb02a=await fetch(this['functionsBase']+'/'+encodeURIComponent(this[_0x15d4cd(0x147)])+_0x15d4cd(0x11e),{'method':_0x15d4cd(0x12c),'headers':{'content-type':_0x15d4cd(0x11f)},'body':JSON[_0x15d4cd(0x135)]({'payload':_0x26e9de,...this['dryRunMode']&&{'dryRun':!0x0}})}),_0x3f9622=await _0x2bb02a[_0x15d4cd(0x11c)]();if(!_0x2bb02a['ok']){const _0x5a9a2d=new Error(_0x3f9622?.[_0x15d4cd(0x125)]?.[_0x15d4cd(0xe1)]||_0x3f9622?.[_0x15d4cd(0x134)]?.[_0x15d4cd(0x125)]||_0x15d4cd(0x105));throw _0x5a9a2d[_0x15d4cd(0xc9)]=_0x3f9622?.[_0x15d4cd(0x125)]?.['code']||null,_0x5a9a2d;}return await this[_0x15d4cd(0xd8)](this[_0x15d4cd(0x147)]),this[_0x15d4cd(0x107)]=n(_0x3f9622?.[_0x15d4cd(0x134)]||null),this[_0x15d4cd(0xbd)]||!this[_0x15d4cd(0x107)]?.['id']&&!this[_0x15d4cd(0x107)]?.[_0x15d4cd(0xf4)]||await this['selectRun'](this[_0x15d4cd(0x107)]['id']||this['selectedRun'][_0x15d4cd(0xf4)]),await this[_0x15d4cd(0xf3)](),this[_0x15d4cd(0x107)];}catch(_0x46579c){throw this[_0x15d4cd(0x125)]=_0x46579c?.['code']?_0x46579c[_0x15d4cd(0xc9)]+':\x20'+_0x46579c[_0x15d4cd(0xe1)]:_0x46579c?.[_0x15d4cd(0xe1)]||'Failed\x20to\x20run\x20function',_0x46579c;}finally{this['running']=!0x1;}},async 'runModalDraft'(){const _0x40f551=_0x59b7f0,_0x455f51=this['buildModalDefinition']();this['modalRunning']=!0x0,this[_0x40f551(0x125)]=null;try{const _0x3bd21a=this[_0x40f551(0xfe)](this[_0x40f551(0x122)]);this[_0x40f551(0x131)]=null,this[_0x40f551(0xbe)]=null,this[_0x40f551(0x127)]=[];const _0xee106d=await fetch(this[_0x40f551(0x12b)]+_0x40f551(0xdb),{'method':'POST','headers':{'content-type':_0x40f551(0x11f)},'body':JSON[_0x40f551(0x135)]({..._0x455f51,'payload':_0x3bd21a,...this['modalDryRunMode']&&{'dryRun':!0x0},...this[_0x40f551(0xf5)]?{'jobContext':n(this[_0x40f551(0xf5)])}:{},...this[_0x40f551(0x119)]?{'processorContext':n(this[_0x40f551(0x119)])}:{},...this[_0x40f551(0xca)]?{'materializerContext':n(this[_0x40f551(0xca)])}:{}})}),_0x17d951=await _0xee106d[_0x40f551(0x11c)]();if(!_0xee106d['ok'])throw new Error(_0x17d951?.[_0x40f551(0x125)]?.[_0x40f551(0xe1)]||_0x17d951?.[_0x40f551(0x134)]?.[_0x40f551(0x125)]||'Failed\x20to\x20run\x20draft');return this[_0x40f551(0xbe)]=n(_0x17d951?.['data']||null),this[_0x40f551(0x127)]=this['getLogsForRun'](this[_0x40f551(0xbe)]?.['id']||this['modalPreviewRun']?.[_0x40f551(0xf4)]),this[_0x40f551(0xbe)];}catch(_0x26d25e){throw _0x26d25e instanceof SyntaxError&&(this[_0x40f551(0x131)]=_0x26d25e?.[_0x40f551(0xe1)]||'Payload\x20JSON\x20is\x20invalid'),_0x26d25e;}finally{this[_0x40f551(0x142)]=!0x1;}},'getLogsForRun':_0x23fb71=>_0x23fb71?(_0x44b670[_0x59b7f0(0x138)]||[])['filter'](_0x472f57=>(_0x472f57?.[_0x59b7f0(0xf4)]||_0x472f57?.[_0x59b7f0(0xf2)]?.['runId'])===_0x23fb71):[],'refreshModalPreviewLogs'(){const _0x20d4b1=_0x59b7f0,_0x456a6d=this[_0x20d4b1(0xbe)]?.['id']||this[_0x20d4b1(0xbe)]?.[_0x20d4b1(0xf4)];return _0x456a6d?(this['modalPreviewLogs']=this[_0x20d4b1(0xc4)](_0x456a6d),this[_0x20d4b1(0x127)]):(this[_0x20d4b1(0x127)]=[],[]);},async 'selectRun'(_0x22ebe1){const _0x583b58=_0x59b7f0;if(!this[_0x583b58(0x147)]||!_0x22ebe1)return this[_0x583b58(0x107)]=null,null;const _0x52ce3c=await fetch(this['functionsBase']+'/'+encodeURIComponent(this[_0x583b58(0x147)])+_0x583b58(0x140)+encodeURIComponent(_0x22ebe1)),_0x53b2b3=await _0x52ce3c[_0x583b58(0x11c)]();return this['selectedRun']=_0x53b2b3?.[_0x583b58(0x134)]||null,this[_0x583b58(0x107)];},async 'onEnvChanged'(){const _0x33fefe=_0x59b7f0;this[_0x33fefe(0xcd)](),this[_0x33fefe(0x136)](),this['currentView']=_0x33fefe(0x130),this[_0x33fefe(0x104)]&&await this[_0x33fefe(0xf8)]();}});
1
+ import{ok as t}from"../modules/ok.js";import e from"./okdb-store.js";import s from"./events-store.js";const a=["async (ctx) => {"," // ctx.payload — caller input"," // ctx.env — env-scoped facade: put, get, query, txn, queue, files, ..."," // ctx.log — structured logger: ctx.log.info(msg, data)",' // Tip: use the "seed" template when you want bulk inserts via ctx.env.txn(...)',""," return { ok: true };","}"].join("\n"),r="{\n \n}",i=[{symbol:"require",pattern:/(^|[^\w$.])require\s*\(/},{symbol:"import",pattern:/(^|[^\w$.])import\b/},{symbol:"console",pattern:/(^|[^\w$.])console\b/},{symbol:"module",pattern:/(^|[^\w$.])module\b/},{symbol:"exports",pattern:/(^|[^\w$.])exports\b/},{symbol:"process",pattern:/(^|[^\w$.])process\b/},{symbol:"child_process",pattern:/child_process/},{symbol:"worker_threads",pattern:/worker_threads/}];function n(t){return null==t?t:JSON.parse(JSON.stringify(t))}function o(t={},e="persisted"){const s=t?.meta??null,a=t?.msg??t?.message??t?.content??t?.title??"";return{runId:t?.runId??s?.runId??null,ts:t?.ts??t?._ts??Date.now(),level:t?.level??"info",msg:"string"==typeof a?a:JSON.stringify(a??""),meta:s,source:e}}export default t.proxy({items:[],selectedName:null,selected:null,runs:[],overviewRuns:[],selectedRun:null,sourceDraft:"",payloadDraft:r,currentView:"overview",modalMode:"create",modalNameDraft:"",modalSourceDraft:a,modalPayloadDraft:r,modalJobContextDraft:null,modalProcessorContextDraft:null,modalMaterializerContextDraft:null,modalDescriptionDraft:"",modalEnabledDraft:!0,modalUnsafeDraft:!1,modalTimeoutMsDraft:null,modalMemoryMbDraft:null,modalAllowFetchDraft:!0,modalValidation:{ok:!1,code:"FUNCTION_SCRIPT_REQUIRED",message:"Function script source is required"},modalPayloadError:null,modalPreviewRun:null,modalPreviewLogs:[],modalRunning:!1,modalDryRunMode:!1,loading:!1,saving:!1,running:!1,dryRunMode:!1,payloadError:null,error:null,get envName(){return e.selectedEnv||null},get isGlobalScope(){return"~system"===this.envName},get hasEnv(){return!!this.envName},get functionsBase(){return this.envName?`${__ENV__.API}/env/${encodeURIComponent(this.envName)}/functions`:null},get canOpenModal(){return!!this.functionsBase},get hasSelected(){return!!this.selectedName&&!!this.selected},get latestRun(){return this.runs?.[0]?.value||this.runs?.[0]||null},get activeRun(){return this.selectedRun||this.latestRun||null},get functionsOverview(){const t=new Map;for(const e of this.overviewRuns||[]){const s=e?.value||e,a=s?.functionName;a&&!t.has(a)&&t.set(a,s)}return(this.items||[]).map(e=>({...e,latestRun:t.get(e?.key)||null}))},get selectedFunctionTitle(){return this.selected?.name||this.selectedName||null},get selectedLogEntries(){const t=this.selectedRun?.id||this.selectedRun?.runId;if(t)return this.logsForRun(t);const e=this.latestRun?.id||this.latestRun?.runId;return e?this.logsForRun(e):[]},logsForRun(t){if(!t)return[];const e=[this.selectedRun,this.latestRun,...(this.runs||[]).map(t=>t?.value||t)].find(e=>(e?.id||e?.runId)===t)?.logs,a=[...Array.isArray(e)?e.map(t=>o(t,"persisted")):[],...(s.logs||[]).filter(e=>(e?.runId||e?.meta?.runId)===t).map(t=>o(t,"live"))],r=new Set,i=[];for(const t of a){const e=`${t.runId}|${t.ts}|${t.level}|${t.msg}|${JSON.stringify(t.meta??null)}`;r.has(e)||(r.add(e),i.push(t))}return i.sort((t,e)=>(t.ts??0)-(e.ts??0)),i},resetSelection(){this.selectedName=null,this.selected=null,this.runs=[],this.overviewRuns=[],this.selectedRun=null,this.sourceDraft="",this.payloadDraft=r,this.payloadError=null,this.error=null},validateSource(t){const e="string"==typeof t?t.replace(/\r\n/g,"\n").trim():"";if(!e)return{ok:!1,code:"FUNCTION_SCRIPT_REQUIRED",message:"Function script source is required"};const s=(new TextEncoder).encode(e).length;if(s>65536)return{ok:!1,code:"FUNCTION_SCRIPT_TOO_LARGE",message:"Function script exceeds 65536 bytes"};if(!/^(async\s+)?\(\s*[A-Za-z_$][\w$]*\s*\)\s*=>/.test(e))return{ok:!1,code:"FUNCTION_SCRIPT_INVALID_SHAPE",message:"Function script must be an anonymous arrow function of the form [async] (ctx) => {}"};for(const{symbol:t,pattern:s}of i)if(s.test(e))return{ok:!1,code:"FUNCTION_SCRIPT_FORBIDDEN_SYMBOL",message:`Function script may not reference ${t}`};try{new Function(`return (${e});`)()}catch(t){return{ok:!1,code:"FUNCTION_SCRIPT_COMPILE_FAILED",message:t?.message||"Function script failed to compile"}}return{ok:!0,code:null,message:"",normalizedSource:e,bytes:s}},parsePayloadDraft(t=this.payloadDraft){const e=String(t??"").trim();return e?JSON.parse(e):null},setModalSourceDraft(t){this.modalSourceDraft=t??"",this.modalValidation=this.validateSource(this.modalSourceDraft)},setModalPayloadDraft(t){this.modalPayloadDraft=t??r;try{this.parsePayloadDraft(this.modalPayloadDraft),this.modalPayloadError=null}catch(t){this.modalPayloadError=t?.message||"Payload JSON is invalid"}},setModalPreviewContext({jobContext:t=null,processorContext:e=null,materializerContext:s=null}={}){this.modalJobContextDraft=n(t),this.modalProcessorContextDraft=n(e),this.modalMaterializerContextDraft=n(s)},beginCreateDraft(){this.modalMode="create",this.modalNameDraft="",this.modalDescriptionDraft="",this.modalEnabledDraft=!0,this.modalUnsafeDraft=!1,this.modalTimeoutMsDraft=null,this.modalMemoryMbDraft=null,this.modalAllowFetchDraft=!0,this.modalPreviewRun=null,this.modalPreviewLogs=[],this.setModalPreviewContext({}),this.setModalPayloadDraft(this.payloadDraft||r),this.setModalSourceDraft(a)},beginEditDraft(){const t=this.selected;this.modalMode="edit",this.modalNameDraft=t?.name||this.selectedName||"",this.modalDescriptionDraft=t?.metadata?.description||"",this.modalEnabledDraft=!1!==t?.enabled,this.modalUnsafeDraft=!0===t?.unsafe,this.modalTimeoutMsDraft=t?.runtime?.timeoutMs??null,this.modalMemoryMbDraft=t?.runtime?.memoryMb??null,this.modalAllowFetchDraft=!1!==t?.runtime?.allowFetch,this.modalPreviewRun=null,this.modalPreviewLogs=[],this.setModalPreviewContext({}),this.setModalPayloadDraft(this.payloadDraft||r),this.setModalSourceDraft(t?.script?.source||this.sourceDraft||a)},buildModalDefinition(){const t={};return Number.isFinite(this.modalTimeoutMsDraft)&&this.modalTimeoutMsDraft>0&&(t.timeoutMs=this.modalTimeoutMsDraft),Number.isFinite(this.modalMemoryMbDraft)&&this.modalMemoryMbDraft>0&&(t.memoryMb=this.modalMemoryMbDraft),t.allowFetch=!1!==this.modalAllowFetchDraft,{name:String(this.modalNameDraft||"").trim(),source:this.modalValidation?.normalizedSource||String(this.modalSourceDraft||"").trim(),metadata:{description:String(this.modalDescriptionDraft||"").trim()},enabled:!1!==this.modalEnabledDraft,unsafe:!0===this.modalUnsafeDraft,runtime:t}},get canSaveModal(){return!(!String(this.modalNameDraft||"").trim()||!this.modalValidation?.ok||this.modalPayloadError||this.saving)},async loadList(){if(!this.functionsBase)return[];this.loading=!0,this.error=null;try{const t=await fetch(this.functionsBase),e=await t.json();return this.items=e?.data||[],this.selectedName&&(this.items.find(t=>t.key===this.selectedName)||this.resetSelection()),this.items}catch(t){throw this.error=t?.message||"Failed to load functions",t}finally{this.loading=!1}},async reloadList(){return this.items=[],this.loadList()},setView(t="overview"){this.currentView="detail"===t?"detail":"overview"},async loadOverviewRuns(t=24){if(!this.functionsBase)return[];const e=(this.items||[]).map(t=>t?.key).filter(Boolean),s=[];for(const t of e){const e=await fetch(`${this.functionsBase}/${encodeURIComponent(t)}/runs`),a=await e.json(),r=(a?.data||[]).map(t=>t?.value?t:{key:t?.id||t?.runId,value:t});s.push(...r)}return s.sort((t,e)=>{const s=t?.value?.execution?.finishedAt??t?.value?.request?.requestedAt??0;return(e?.value?.execution?.finishedAt??e?.value?.request?.requestedAt??0)-s}),this.overviewRuns=s.slice(0,t),this.overviewRuns},async hydrateOverview(){await this.loadList(),await this.loadOverviewRuns()},async select(t){if(this.selectedName=t||null,this.selectedRun=null,this.currentView=t?"detail":"overview",!t)return this.selected=null,this.sourceDraft="",this.runs=[],null;const e=await fetch(`${this.functionsBase}/${encodeURIComponent(t)}`),s=await e.json();if(this.selected=s?.data||null,this.sourceDraft=this.selected?.script?.source||"",this.payloadError=null,await this.loadRuns(t),!this.selectedRun&&this.runs?.length){const t=this.runs[0];this.selectedRun=t?.value||t||null}return this.selected},async loadRuns(t=this.selectedName){if(!t)return this.runs=[],[];const e=await fetch(`${this.functionsBase}/${encodeURIComponent(t)}/runs`),s=await e.json();if(this.runs=s?.data||[],this.selectedRun){const t=this.selectedRun?.id||this.selectedRun?.runId,e=this.runs.map(t=>t?.value||t).find(e=>(e?.id||e?.runId)===t);this.selectedRun=e||null}return this.runs},async refreshSelected(){if(!this.selectedName)return null;const t=this.selectedRun?.id||this.selectedRun?.runId;if(await this.select(this.selectedName),t){const e=this.runs.map(t=>t?.value||t).find(e=>(e?.id||e?.runId)===t);this.selectedRun=e||this.selectedRun}return await this.loadOverviewRuns(),this.selected},setSourceDraft(t){this.sourceDraft=t??""},setPayloadDraft(t){this.payloadDraft=t??r;try{this.parsePayloadDraft(this.payloadDraft),this.payloadError=null}catch(t){this.payloadError=t?.message||"Payload JSON is invalid"}},async create(t={}){this.saving=!0,this.error=null;try{const e={...t},s=await fetch(this.functionsBase,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),a=await s.json();if(!s.ok)throw new Error(a?.error?.message||a?.data?.error||"Failed to create function");return await this.reloadList(),await this.select(a?.data?.name||t.name),a?.data}finally{this.saving=!1}},async saveSelected(t={}){if(!this.selectedName)return null;this.saving=!0,this.error=null;try{const e={...t,source:t?.source??this.sourceDraft},s=await fetch(`${this.functionsBase}/${encodeURIComponent(this.selectedName)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),a=await s.json();if(!s.ok)throw new Error(a?.error?.message||a?.data?.error||"Failed to save function");return await this.reloadList(),await this.select(this.selectedName),a?.data}finally{this.saving=!1}},async saveModalDefinition(){const t=this.buildModalDefinition();return"edit"===this.modalMode&&this.selectedName?await this.saveSelected(t):this.create(t)},async remove(t=this.selectedName){if(!t)return!1;this.saving=!0,this.error=null;try{const e=await fetch(`${this.functionsBase}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok&&204!==e.status){const t=await e.json().catch(()=>({}));throw new Error(t?.error?.message||t?.data?.error||"Failed to delete function")}return await this.reloadList(),await this.loadOverviewRuns(),this.selectedName===t&&this.resetSelection(),!0}finally{this.saving=!1}},async runSelected(){if(!this.selectedName)return null;this.running=!0,this.error=null;try{let t=null;try{t=this.parsePayloadDraft(this.payloadDraft),this.payloadError=null}catch(t){throw this.payloadError=t?.message||"Payload JSON is invalid",t}const e=await fetch(`${this.functionsBase}/${encodeURIComponent(this.selectedName)}/run`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({payload:t,...this.dryRunMode&&{dryRun:!0}})}),s=await e.json();if(!e.ok){const t=new Error(s?.error?.message||s?.data?.error||"Failed to run function");throw t.code=s?.error?.code||null,t}return await this.loadRuns(this.selectedName),this.selectedRun=n(s?.data||null),this.dryRunMode||!this.selectedRun?.id&&!this.selectedRun?.runId||await this.selectRun(this.selectedRun.id||this.selectedRun.runId),await this.loadOverviewRuns(),this.selectedRun}catch(t){throw this.error=t?.code?`${t.code}: ${t.message}`:t?.message||"Failed to run function",t}finally{this.running=!1}},async runModalDraft(){const t=this.buildModalDefinition();this.modalRunning=!0,this.error=null;try{const e=this.parsePayloadDraft(this.modalPayloadDraft);this.modalPayloadError=null,this.modalPreviewRun=null,this.modalPreviewLogs=[];const s=await fetch(`${this.functionsBase}/preview`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...t,payload:e,...this.modalDryRunMode&&{dryRun:!0},...this.modalJobContextDraft?{jobContext:n(this.modalJobContextDraft)}:{},...this.modalProcessorContextDraft?{processorContext:n(this.modalProcessorContextDraft)}:{},...this.modalMaterializerContextDraft?{materializerContext:n(this.modalMaterializerContextDraft)}:{}})}),a=await s.json();if(!s.ok)throw new Error(a?.error?.message||a?.data?.error||"Failed to run draft");return this.modalPreviewRun=n(a?.data||null),this.modalPreviewLogs=this.getLogsForRun(this.modalPreviewRun?.id||this.modalPreviewRun?.runId),this.modalPreviewRun}catch(t){throw t instanceof SyntaxError&&(this.modalPayloadError=t?.message||"Payload JSON is invalid"),t}finally{this.modalRunning=!1}},getLogsForRun:t=>t?(s.logs||[]).filter(e=>(e?.runId||e?.meta?.runId)===t):[],refreshModalPreviewLogs(){const t=this.modalPreviewRun?.id||this.modalPreviewRun?.runId;return t?(this.modalPreviewLogs=this.getLogsForRun(t),this.modalPreviewLogs):(this.modalPreviewLogs=[],[])},async selectRun(t){if(!this.selectedName||!t)return this.selectedRun=null,null;const e=await fetch(`${this.functionsBase}/${encodeURIComponent(this.selectedName)}/runs/${encodeURIComponent(t)}`),s=await e.json();return this.selectedRun=s?.data||null,this.selectedRun},async onEnvChanged(){this.resetSelection(),this.beginCreateDraft(),this.currentView="overview",this.hasEnv&&await this.hydrateOverview()}});
@@ -1 +1 @@
1
- const _0x9b96db=_0x1539;function _0x1539(_0xef15bd,_0x13c675){_0xef15bd=_0xef15bd-0x8a;const _0x2e6138=_0x2e61();let _0x1539b0=_0x2e6138[_0xef15bd];return _0x1539b0;}(function(_0x100e33,_0x498ab7){const _0x4eba5c=_0x1539,_0x5a925=_0x100e33();while(!![]){try{const _0x52b9d8=parseInt(_0x4eba5c(0x8a))/0x1+-parseInt(_0x4eba5c(0xb1))/0x2*(parseInt(_0x4eba5c(0x94))/0x3)+parseInt(_0x4eba5c(0xab))/0x4*(parseInt(_0x4eba5c(0x8b))/0x5)+parseInt(_0x4eba5c(0xa6))/0x6*(parseInt(_0x4eba5c(0x9f))/0x7)+parseInt(_0x4eba5c(0x8d))/0x8+-parseInt(_0x4eba5c(0xb3))/0x9+-parseInt(_0x4eba5c(0x9b))/0xa;if(_0x52b9d8===_0x498ab7)break;else _0x5a925['push'](_0x5a925['shift']());}catch(_0x9fb353){_0x5a925['push'](_0x5a925['shift']());}}}(_0x2e61,0x8e85c));import{ok as _0x2db749}from'../modules/ok.js';export default _0x2db749['proxy']({'selectedEnv':_0x9b96db(0x90),get 'apiBase'(){const _0xd2424d=_0x9b96db,_0x5ee50b=this[_0xd2424d(0xa5)];return _0x5ee50b?__ENV__['API']+_0xd2424d(0xa3)+encodeURIComponent(_0x5ee50b):__ENV__[_0xd2424d(0x9c)]+_0xd2424d(0xac);},'selectEnv'(_0x380916){const _0x34c707=_0x9b96db;this[_0x34c707(0xa5)]!==_0x380916&&(this['selectedEnv']=_0x380916,this[_0x34c707(0xb2)]=null,this[_0x34c707(0x8e)]=null,this[_0x34c707(0xa9)]=null,this[_0x34c707(0xb0)]=null);},'info':null,'_infoPromise':null,async 'loadInfo'(){const _0x88aa1e=_0x9b96db;if(!this[_0x88aa1e(0xa5)])return null;if(null!==this['info'])return this[_0x88aa1e(0xa9)];if(!this[_0x88aa1e(0xb0)]){this[_0x88aa1e(0xb0)]=this['_fetchInfo']();try{this[_0x88aa1e(0xa9)]=await this[_0x88aa1e(0xb0)];}catch(_0x2dc4e9){throw this[_0x88aa1e(0xb0)]=null,_0x2dc4e9;}}return await this[_0x88aa1e(0xb0)],this['info'];},async 'reloadInfo'(){const _0x2f5a16=_0x9b96db;return this[_0x2f5a16(0xa9)]=null,this[_0x2f5a16(0xb0)]=null,this[_0x2f5a16(0x93)]();},async '_fetchInfo'(){const _0x44d84b=_0x9b96db;if(!this[_0x44d84b(0xa5)])return null;const _0x584ab7=await fetch(this[_0x44d84b(0x8f)]+'/info');if(_0x584ab7['ok'])return(await _0x584ab7[_0x44d84b(0x98)]())['data'];if(0x191===_0x584ab7[_0x44d84b(0x9e)]||0x193===_0x584ab7[_0x44d84b(0x9e)])return null;if(0x194===_0x584ab7[_0x44d84b(0x9e)])return null;throw new Error(_0x44d84b(0xa0));},'hasPlugin'(_0x589bca){const _0x1ea40b=_0x9b96db;return this[_0x1ea40b(0xa9)]?.[_0x1ea40b(0x97)]?.[_0x1ea40b(0xa4)](_0x589bca);},'types':null,'_typesPromise':null,async 'loadTypes'(){const _0x7d5065=_0x9b96db;if(!this[_0x7d5065(0xa5)])return[];if(this[_0x7d5065(0xb2)])return this[_0x7d5065(0xb2)];if(!this['_typesPromise']){const _0x47e88d=this[_0x7d5065(0x8f)];this[_0x7d5065(0x8e)]=fetch(_0x47e88d+'/types')['then'](async _0x3317cd=>{const _0x593f3d=_0x7d5065;if(!_0x3317cd['ok']){const _0x27d44d=await _0x3317cd[_0x593f3d(0x98)]()[_0x593f3d(0x9d)](()=>({})),_0x27b6b2=_0x27d44d?.[_0x593f3d(0x9a)],_0x4ce26e=_0x593f3d(0x95)==typeof _0x27b6b2?_0x27b6b2:_0x27b6b2?.['message']||_0x593f3d(0xa8)+_0x3317cd[_0x593f3d(0x9e)]+')',_0xb25bae=new Error(_0x4ce26e);throw _0xb25bae['status']=_0x3317cd[_0x593f3d(0x9e)],_0xb25bae;}const _0x2140fc=await _0x3317cd[_0x593f3d(0x98)]();return this['types']=_0x2140fc?.['data']??_0x2140fc?.[_0x593f3d(0xa2)]??[];})[_0x7d5065(0x9d)](_0x2cd067=>{const _0x40ee03=_0x7d5065;throw this[_0x40ee03(0x8e)]=null,_0x2cd067;});}return this['_typesPromise'];},async 'reloadTypes'(){const _0x4eccd2=_0x9b96db;return this[_0x4eccd2(0xb2)]=null,this['_typesPromise']=null,this[_0x4eccd2(0xae)]();},async 'registerType'(_0x223c72){const _0x41bf8e=_0x9b96db;await fetch(this[_0x41bf8e(0x8f)]+'/type/'+encodeURIComponent(_0x223c72),{'method':_0x41bf8e(0x96)}),await this[_0x41bf8e(0x99)]();},'envs':null,'_envsPromise':null,async 'loadEnvs'(){const _0x54a870=_0x9b96db;return this[_0x54a870(0x92)]?this[_0x54a870(0x92)]:(this[_0x54a870(0xaf)]||(this['_envsPromise']=fetch(__ENV__[_0x54a870(0x9c)]+_0x54a870(0xa7))[_0x54a870(0xad)](async _0x15ccef=>{const _0x271cfc=_0x54a870;if(0x191===_0x15ccef[_0x271cfc(0x9e)]||0x193===_0x15ccef[_0x271cfc(0x9e)])return this[_0x271cfc(0x92)]=[],this[_0x271cfc(0xa5)]=null,[];const {data:_0x1de5c8}=await _0x15ccef['json']();return this[_0x271cfc(0x92)]=_0x1de5c8||[];})['catch'](_0x4c301f=>{throw this['_envsPromise']=null,_0x4c301f;})),this[_0x54a870(0xaf)]);},async 'reloadEnvs'(){const _0x3fe38e=_0x9b96db;return this[_0x3fe38e(0x92)]=null,this['_envsPromise']=null,this[_0x3fe38e(0xb5)]();},'_pickBestEnv'(){const _0x1b3384=_0x9b96db,_0x144b96=(this[_0x1b3384(0x92)]||[])[_0x1b3384(0xa1)](_0x3cbfd3=>!_0x3cbfd3[_0x1b3384(0xb4)]['startsWith']('~')&&!_0x3cbfd3[_0x1b3384(0xaa)]);return _0x144b96['find'](_0x218b60=>_0x218b60[_0x1b3384(0xb4)]===this['selectedEnv'])?this[_0x1b3384(0xa5)]:_0x144b96[0x0]?.['name']??null;},async 'init'(){const _0x4350bb=_0x9b96db;await this['loadEnvs']();const _0x16b956=this[_0x4350bb(0x8c)]();_0x16b956!==this[_0x4350bb(0xa5)]&&this[_0x4350bb(0x91)](_0x16b956),this['selectedEnv']&&await this[_0x4350bb(0x93)]()[_0x4350bb(0x9d)](()=>{const _0x11ff13=_0x4350bb;this[_0x11ff13(0xa9)]=null;});}});function _0x2e61(){const _0x381a85=['reloadTypes','error','11892230ihgzvF','API','catch','status','412279PTzIuJ','Failed\x20to\x20fetch\x20info','filter','result','/env/','includes','selectedEnv','84IxqmHU','/envs','Failed\x20to\x20load\x20types\x20(HTTP\x20','info','orphaned','201388tFGDwM','/env','then','loadTypes','_envsPromise','_infoPromise','152hbQhQA','types','2089908QvOuaH','name','loadEnvs','529190HIUUkh','45BQDhbP','_pickBestEnv','3408864INPNIJ','_typesPromise','apiBase','default','selectEnv','envs','loadInfo','8991gUlalQ','string','POST','plugins','json'];_0x2e61=function(){return _0x381a85;};return _0x2e61();}
1
+ import{ok as s}from"../modules/ok.js";export default s.proxy({selectedEnv:"default",get apiBase(){const s=this.selectedEnv;return s?`${__ENV__.API}/env/${encodeURIComponent(s)}`:`${__ENV__.API}/env`},selectEnv(s){this.selectedEnv!==s&&(this.selectedEnv=s,this.types=null,this._typesPromise=null,this.info=null,this._infoPromise=null)},info:null,_infoPromise:null,async loadInfo(){if(!this.selectedEnv)return null;if(null!==this.info)return this.info;if(!this._infoPromise){this._infoPromise=this._fetchInfo();try{this.info=await this._infoPromise}catch(s){throw this._infoPromise=null,s}}return await this._infoPromise,this.info},async reloadInfo(){return this.info=null,this._infoPromise=null,this.loadInfo()},async _fetchInfo(){if(!this.selectedEnv)return null;const s=await fetch(`${this.apiBase}/info`);if(s.ok)return(await s.json()).data;if(401===s.status||403===s.status)return null;if(404===s.status)return null;throw new Error("Failed to fetch info")},hasPlugin(s){return this.info?.plugins?.includes(s)},types:null,_typesPromise:null,async loadTypes(){if(!this.selectedEnv)return[];if(this.types)return this.types;if(!this._typesPromise){const s=this.apiBase;this._typesPromise=fetch(`${s}/types`).then(async s=>{if(!s.ok){const t=await s.json().catch(()=>({})),e=t?.error,n="string"==typeof e?e:e?.message||`Failed to load types (HTTP ${s.status})`,i=new Error(n);throw i.status=s.status,i}const t=await s.json();return this.types=t?.data??t?.result??[]}).catch(s=>{throw this._typesPromise=null,s})}return this._typesPromise},async reloadTypes(){return this.types=null,this._typesPromise=null,this.loadTypes()},async registerType(s){await fetch(`${this.apiBase}/type/${encodeURIComponent(s)}`,{method:"POST"}),await this.reloadTypes()},envs:null,_envsPromise:null,async loadEnvs(){return this.envs?this.envs:(this._envsPromise||(this._envsPromise=fetch(`${__ENV__.API}/envs`).then(async s=>{if(401===s.status||403===s.status)return this.envs=[],this.selectedEnv=null,[];const{data:t}=await s.json();return this.envs=t||[]}).catch(s=>{throw this._envsPromise=null,s})),this._envsPromise)},async reloadEnvs(){return this.envs=null,this._envsPromise=null,this.loadEnvs()},_pickBestEnv(){const s=(this.envs||[]).filter(s=>!s.name.startsWith("~")&&!s.orphaned);return s.find(s=>s.name===this.selectedEnv)?this.selectedEnv:s[0]?.name??null},async init(){await this.loadEnvs();const s=this._pickBestEnv();s!==this.selectedEnv&&this.selectEnv(s),this.selectedEnv&&await this.loadInfo().catch(()=>{this.info=null})}});
@@ -1 +1 @@
1
- const _0x56e083=_0x1831;function _0x1831(_0x400cf1,_0x56901f){_0x400cf1=_0x400cf1-0x16a;const _0x46dfa2=_0x46df();let _0x1831f4=_0x46dfa2[_0x400cf1];return _0x1831f4;}(function(_0x2494da,_0x16b62e){const _0x367026=_0x1831,_0x3299c1=_0x2494da();while(!![]){try{const _0x523acc=parseInt(_0x367026(0x16e))/0x1*(parseInt(_0x367026(0x179))/0x2)+parseInt(_0x367026(0x185))/0x3+-parseInt(_0x367026(0x16a))/0x4+-parseInt(_0x367026(0x17b))/0x5*(-parseInt(_0x367026(0x17d))/0x6)+-parseInt(_0x367026(0x183))/0x7*(parseInt(_0x367026(0x16c))/0x8)+-parseInt(_0x367026(0x175))/0x9*(-parseInt(_0x367026(0x17c))/0xa)+-parseInt(_0x367026(0x17a))/0xb;if(_0x523acc===_0x16b62e)break;else _0x3299c1['push'](_0x3299c1['shift']());}catch(_0x50e002){_0x3299c1['push'](_0x3299c1['shift']());}}}(_0x46df,0xc6744));function _0x46df(){const _0x2b2a19=['677500dXoXMq','change','matches','(prefers-color-scheme:\x20light)','okdbTheme','light','dark','36BEmuBI','setItem','matchMedia','set','4ZiLHuF','27840406cXYNKL','5iaNVIC','2625670JMAVnz','8316834uoIZCr','addEventListener','getItem','current','isExplicit','undefined','2874235sBjSrT','has','1108635xPJLuk','1626132qEulEs','add','8GlyWhG','data-theme'];_0x46df=function(){return _0x2b2a19;};return _0x46df();}const STORAGE_KEY=_0x56e083(0x172),VALID=new Set([_0x56e083(0x174),_0x56e083(0x173)]);function readSaved(){const _0x128b14=_0x56e083;try{const _0x4f1641=localStorage[_0x128b14(0x17f)]('okdbTheme');return VALID[_0x128b14(0x184)](_0x4f1641)?_0x4f1641:null;}catch{return null;}}function detectPreferred(){const _0x13b8a6=_0x56e083;return _0x13b8a6(0x182)!=typeof window&&window[_0x13b8a6(0x177)]&&window[_0x13b8a6(0x177)]('(prefers-color-scheme:\x20light)')[_0x13b8a6(0x170)]?'light':_0x13b8a6(0x174);}function apply(_0x18672e){const _0x45c7cd=_0x56e083,_0x585ac3=document['documentElement'];'light'===_0x18672e?_0x585ac3['setAttribute']('data-theme',_0x45c7cd(0x173)):_0x585ac3['removeAttribute'](_0x45c7cd(0x16d));}const subscribers=new Set(),themeStore={'current':readSaved()||detectPreferred(),'isExplicit':null!==readSaved(),'set'(_0x951ec5){const _0x4dbd2b=_0x56e083;if(VALID['has'](_0x951ec5)){this[_0x4dbd2b(0x180)]=_0x951ec5,this[_0x4dbd2b(0x181)]=!0x0;try{localStorage[_0x4dbd2b(0x176)](_0x4dbd2b(0x172),_0x951ec5);}catch{}apply(_0x951ec5);for(const _0x3f9c14 of subscribers)_0x3f9c14(_0x951ec5);}},'toggle'(){const _0x4bc8c4=_0x56e083;this[_0x4bc8c4(0x178)](_0x4bc8c4(0x174)===this[_0x4bc8c4(0x180)]?_0x4bc8c4(0x173):_0x4bc8c4(0x174));},'subscribe':_0x35bf3d=>(subscribers[_0x56e083(0x16b)](_0x35bf3d),()=>subscribers['delete'](_0x35bf3d))};if(apply(themeStore[_0x56e083(0x180)]),_0x56e083(0x182)!=typeof window&&window[_0x56e083(0x177)]){const e=window[_0x56e083(0x177)](_0x56e083(0x171)),t=_0xb44100=>{const _0x25be8e=_0x56e083;if(!themeStore[_0x25be8e(0x181)]){themeStore[_0x25be8e(0x180)]=_0xb44100[_0x25be8e(0x170)]?_0x25be8e(0x173):_0x25be8e(0x174),apply(themeStore[_0x25be8e(0x180)]);for(const _0x423c29 of subscribers)_0x423c29(themeStore[_0x25be8e(0x180)]);}};e[_0x56e083(0x17e)]?.(_0x56e083(0x16f),t);}export default themeStore;
1
+ const STORAGE_KEY="okdbTheme",VALID=new Set(["dark","light"]);function readSaved(){try{const e=localStorage.getItem("okdbTheme");return VALID.has(e)?e:null}catch{return null}}function detectPreferred(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function apply(e){const t=document.documentElement;"light"===e?t.setAttribute("data-theme","light"):t.removeAttribute("data-theme")}const subscribers=new Set,themeStore={current:readSaved()||detectPreferred(),isExplicit:null!==readSaved(),set(e){if(VALID.has(e)){this.current=e,this.isExplicit=!0;try{localStorage.setItem("okdbTheme",e)}catch{}apply(e);for(const t of subscribers)t(e)}},toggle(){this.set("dark"===this.current?"light":"dark")},subscribe:e=>(subscribers.add(e),()=>subscribers.delete(e))};if(apply(themeStore.current),"undefined"!=typeof window&&window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: light)"),t=e=>{if(!themeStore.isExplicit){themeStore.current=e.matches?"light":"dark",apply(themeStore.current);for(const e of subscribers)e(themeStore.current)}};e.addEventListener?.("change",t)}export default themeStore;
@@ -1,10 +1,60 @@
1
- <!DOCTYPE html><html lang="en"><head><base href="./"><meta charset="UTF-8"><title>ok-cron-input test</title><link rel="stylesheet" href="styles.css"><script type="importmap">{
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <base href="./">
5
+ <meta charset="UTF-8">
6
+ <title>ok-cron-input test</title>
7
+ <link rel="stylesheet" href="styles.css">
8
+ <script type="importmap">
9
+ {
2
10
  "imports": {
3
11
  "@toolkit/": "./vendor/okjs/toolkit/",
4
12
  "@okjs": "./vendor/okjs/ok.esm.min.js"
5
13
  }
6
- }</script><style>body{padding:40px;display:block;height:auto}.demo{max-width:500px;margin:0 auto;display:flex;flex-direction:column;gap:32px}h1{color:#4fc1ff;font-size:18px;margin:0 0 8px}.row{display:flex;flex-direction:column;gap:6px}label{font-size:12px;color:#6b8a9e}.val{font-family:monospace;font-size:12px;color:#8bb4cc;background:#12171a;padding:4px 8px;border-radius:4px;border:1px solid #2a3035;min-height:22px}</style></head><body><div class="demo"><div><h1>ok-cron-input</h1><p style="color:#89a;font-size:12px;margin:0">Click the ✏ button to open the cron editor panel.</p></div><div class="row"><label>Cron expression (empty start)</label><ok-cron-input id="c1" @change="document.getElementById('v1').textContent = $event.detail"></ok-cron-input><div class="val" id="v1"></div></div><div class="row"><label>Cron expression (pre-populated)</label><ok-cron-input id="c2" value="*/15 9-17 * * 1-5" @change="document.getElementById('v2').textContent = $event.detail"></ok-cron-input><div class="val" id="v2">*/15 9-17 * * 1-5</div></div><div class="row"><label>Cron expression (disabled)</label><ok-cron-input value="0 12 * * *" disabled="disabled"></ok-cron-input></div></div><script type="module">import OK from '@okjs';
14
+ }
15
+ </script>
16
+ <style>
17
+ body { padding: 40px; display:block; height:auto; }
18
+ .demo { max-width:500px; margin:0 auto; display:flex; flex-direction:column; gap:32px; }
19
+ h1 { color:#4FC1FF; font-size:18px; margin:0 0 8px; }
20
+ .row { display:flex; flex-direction:column; gap:6px; }
21
+ label { font-size:12px; color:#6b8a9e; }
22
+ .val { font-family:monospace; font-size:12px; color:#8bb4cc; background:#12171a; padding:4px 8px; border-radius:4px; border:1px solid #2a3035; min-height:22px; }
23
+ </style>
24
+ </head>
25
+ <body>
26
+ <div class="demo">
27
+ <div>
28
+ <h1>ok-cron-input</h1>
29
+ <p style="color:#8899aa;font-size:12px;margin:0">Click the ✏ button to open the cron editor panel.</p>
30
+ </div>
31
+
32
+ <div class="row">
33
+ <label>Cron expression (empty start)</label>
34
+ <ok-cron-input id="c1" @change="document.getElementById('v1').textContent = $event.detail"></ok-cron-input>
35
+ <div class="val" id="v1"></div>
36
+ </div>
37
+
38
+ <div class="row">
39
+ <label>Cron expression (pre-populated)</label>
40
+ <ok-cron-input id="c2" value="*/15 9-17 * * 1-5" @change="document.getElementById('v2').textContent = $event.detail"></ok-cron-input>
41
+ <div class="val" id="v2">*/15 9-17 * * 1-5</div>
42
+ </div>
43
+
44
+ <div class="row">
45
+ <label>Cron expression (disabled)</label>
46
+ <ok-cron-input value="0 12 * * *" disabled></ok-cron-input>
47
+ </div>
48
+ </div>
49
+
50
+ <script type="module">
51
+ import OK from '@okjs';
7
52
  import okCronInput from './components/ok-cron-input.ok.js';
8
53
  const ok = OK({ env: 'dev' });
9
54
  ok.register(okCronInput);
10
- await ok.init(document.body);</script></body></html>
55
+ await ok.init(document.body);
56
+ </script>
57
+ </body>
58
+ </html>
59
+
60
+