57 lines
2.6 KiB
TypeScript
57 lines
2.6 KiB
TypeScript
// The archive module's manifest: a client of the platform's Archive business service (B-wave contract
|
|
// §3.14, docs/business-services.md). It keeps no table of its own -- documents, their immutable versions
|
|
// and their retention are the service's, in the deployment's organization, and the bytes stay in the
|
|
// platform's Blob store through the files module -- so it has procedures, permissions, pages and
|
|
// messages, and no repository, migration, job or event.
|
|
//
|
|
// The template ships it off: `kit module:on archive` adds it to the list in modules/index.ts and asks the
|
|
// deployment token for the service scopes it needs (`archive.documents:read|write`,
|
|
// `archive.holds:write`, `archive.retention:read|write`, `archive.disposal:read|write`) in conusai.json.
|
|
|
|
import { defineModule } from "@conusai-kit/core"
|
|
import { ARCHIVE_PROCEDURES } from "./adapters/procedures.js"
|
|
import { en, lt } from "./i18n/index.js"
|
|
|
|
export const archiveModule = defineModule({
|
|
id: "archive",
|
|
// A business module is its service, which this app reaches on these profiles (test/module-profiles.test.ts).
|
|
profiles: ["postgres", "mariadb", "mongodb"],
|
|
version: "0.1.0",
|
|
kit: "^0.1.0",
|
|
requires: ["tenancy", "files"],
|
|
permissions: {
|
|
"archive.document.read": "viewer",
|
|
"archive.document.write": "editor",
|
|
// A hold, a disposal and a retention policy change what the organization keeps: an administrative act.
|
|
"archive.retention.manage": "admin",
|
|
},
|
|
procedures: ARCHIVE_PROCEDURES,
|
|
serviceRequirements: [
|
|
{
|
|
transport: "business",
|
|
service: "archive",
|
|
apiRange: "^1.1.0",
|
|
profiles: ["postgres", "mariadb", "mongodb"],
|
|
operations: {
|
|
"archive.document.list": ["archive.documents:read"],
|
|
"archive.document.get": ["archive.documents:read"],
|
|
"archive.document.register": ["archive.documents:write"],
|
|
"archive.version.add": ["archive.documents:write"],
|
|
"archive.document.hold": ["archive.holds:write"],
|
|
"archive.document.dispose": ["archive.disposal:write"],
|
|
"archive.retention.list": ["archive.retention:read"],
|
|
"archive.retention.create": ["archive.retention:write"],
|
|
"archive.disposal.list": ["archive.disposal:read"],
|
|
},
|
|
configuration: [],
|
|
dependencies: [],
|
|
dataClasses: ["personal", "document"],
|
|
partitionRequired: true,
|
|
remediation: "/docs/business-services.md",
|
|
},
|
|
],
|
|
// `archive` is the segment the web shell's module mount routes to `archivePage` (ui/pages.tsx).
|
|
ui: { nav: [{ scope: "project", label: "archive.title", href: "archive", permission: "archive.document.read" }] },
|
|
i18n: { en, lt },
|
|
})
|