Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"clean": "rm -rf .objectstack/marketplace-packages dist"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
21 changes: 13 additions & 8 deletions packages/all/scripts/compile-marketplace.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,17 @@ const DEDUP_BY_NAME = ['roles', 'permissions'];
const log = (msg) => process.stdout.write(`${msg}\n`);

/**
* `install` — populate `.objectstack/installed-packages/` from the workspace
* templates, in the runtime's wrapper format. No-op for templates already
* present (so a real marketplace install is never clobbered).
* `install` — populate `.objectstack/marketplace-packages/` from the workspace
* templates, in the runtime's wrapper format.
*
* The workspace template is the source of truth for its own manifestId, so we
* ALWAYS refresh its cache entry from the current `dist/objectstack.json`.
* Earlier this skipped any entry that already existed, which silently served a
* STALE artifact after `pnpm -r build` (e.g. dashboards in the pre-ADR-0021
* `object`/`aggregate` shape that newer runtimes reject) — the compile would
* never pick up rebuilt templates. Genuine marketplace-UI installs are NOT in
* the workspace loop (they live under a different id with no workspace `dist`),
* so refreshing here never clobbers them.
*/
function installFromWorkspace() {
mkdirSync(INSTALLED_DIR, { recursive: true });
Expand All @@ -118,10 +126,7 @@ function installFromWorkspace() {
const artifact = JSON.parse(readFileSync(artifactPath, 'utf8'));
const manifestId = artifact?.manifest?.id ?? `app.objectstack.template.${name}`;
const dest = join(INSTALLED_DIR, safeFilename(manifestId));
if (existsSync(dest)) {
installed.push(`${name} (already installed)`);
continue;
}
const refreshed = existsSync(dest);
const entry = {
packageId: manifestId,
versionId: artifact?.manifest?.version ?? '0.0.0',
Expand All @@ -133,7 +138,7 @@ function installFromWorkspace() {
withSampleData: false,
};
writeFileSync(dest, `${JSON.stringify(entry, null, 2)}\n`, 'utf8');
installed.push(name);
installed.push(refreshed ? `${name} (refreshed)` : name);
}
return installed;
}
Expand Down
22 changes: 11 additions & 11 deletions packages/compliance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/expense/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/helpdesk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
37 changes: 21 additions & 16 deletions packages/helpdesk/src/objects/helpdesk_ticket.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,13 @@ import type { Hook, HookContext } from '@objectstack/spec/data';
* `ai_triage_on_create.flow.ts` for richer triage; the field shapes stay.
*
* beforeUpdate stamps `resolved_at` when a ticket reaches the resolved status.
*
* IMPORTANT — the handler runs body-only in the QuickJS sandbox, so the SLA
* minute maps are defined INSIDE the handler. Module-scope consts are not in
* scope at runtime and throw ReferenceError when referenced (only bites tickets
* created without pre-set SLA fields — e.g. from the UI/portal; seed rows
* pre-fill them and skip the lookup).
*/

// First-response / resolution targets in minutes, mirroring the SLA policy
// defaults. Keyed by ticket priority.
const FIRST_RESPONSE_MIN: Record<string, number> = {
low: 1440,
normal: 480,
high: 120,
urgent: 30,
};
const RESOLUTION_MIN: Record<string, number> = {
low: 10080,
normal: 2880,
high: 1440,
urgent: 240,
};

const ticketHook: Hook = {
name: 'helpdesk_ticket_automation',
object: 'helpdesk_ticket',
Expand All @@ -47,6 +37,21 @@ const ticketHook: Hook = {
previous?: Record<string, unknown>;
};

// First-response / resolution targets in minutes (mirror the SLA policy
// defaults), keyed by ticket priority.
const FIRST_RESPONSE_MIN: Record<string, number> = {
low: 1440,
normal: 480,
high: 120,
urgent: 30,
};
const RESOLUTION_MIN: Record<string, number> = {
low: 10080,
normal: 2880,
high: 1440,
urgent: 240,
};

if (event === 'beforeInsert') {
if (!input.ticket_number) {
const ts = new Date();
Expand Down
22 changes: 11 additions & 11 deletions packages/hr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"test:qa": "node ../../scripts/run-qa.mjs --url http://localhost:4009 --file qa/business-workflow.test.json"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/procurement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
22 changes: 11 additions & 11 deletions packages/project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"test": "objectstack build"
},
"dependencies": {
"@objectstack/account": "^9.4.0",
"@objectstack/cli": "^9.4.0",
"@objectstack/driver-memory": "^9.4.0",
"@objectstack/driver-sql": "^9.4.0",
"@objectstack/driver-sqlite-wasm": "^9.4.0",
"@objectstack/metadata": "^9.4.0",
"@objectstack/objectql": "^9.4.0",
"@objectstack/runtime": "^9.4.0",
"@objectstack/service-analytics": "^9.4.0",
"@objectstack/service-automation": "^9.4.0",
"@objectstack/spec": "^9.4.0",
"@objectstack/account": "^9.5.1",
"@objectstack/cli": "^9.5.1",
"@objectstack/driver-memory": "^9.5.1",
"@objectstack/driver-sql": "^9.5.1",
"@objectstack/driver-sqlite-wasm": "^9.5.1",
"@objectstack/metadata": "^9.5.1",
"@objectstack/objectql": "^9.5.1",
"@objectstack/runtime": "^9.5.1",
"@objectstack/service-analytics": "^9.5.1",
"@objectstack/service-automation": "^9.5.1",
"@objectstack/spec": "^9.5.1",
"sql.js": "^1.14.1"
},
"optionalDependencies": {
Expand Down
Loading
Loading