@smartkomm/plexus-cli 0.1.21 → 0.1.22
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.
package/README.md
CHANGED
|
@@ -891,8 +891,9 @@ is refused (`FORBIDDEN`, naming the field) when it would create a tenant, use
|
|
|
891
891
|
`_platform.*` right in a group; changing groups needs `administration.permissions.manage`,
|
|
892
892
|
changing `foundation.users` needs `administration.users.manage`, and giving, moving or taking a
|
|
893
893
|
user's group there (a user new to the config, `permissionGroupKey`, `unitKey`, validity,
|
|
894
|
-
`additionalMemberships`) needs `administration.permissions.manage` as well
|
|
895
|
-
|
|
894
|
+
`additionalMemberships`) needs `administration.permissions.manage` as well, for every scope
|
|
895
|
+
the change touches (a tenant-wide membership needs it tenant-wide, one in a unit for that unit
|
|
896
|
+
or tenant-wide) — the rule the Rechteverwaltung asks. `wipe`, `prune-offers`, `--scope platform` and setup mode
|
|
896
897
|
stay platform-only. Recipe:
|
|
897
898
|
[playbooks/users/cli-access-for-tenant-admin.md](./playbooks/users/cli-access-for-tenant-admin.md).
|
|
898
899
|
|
package/dist/cli.mjs
CHANGED
|
@@ -9290,7 +9290,8 @@ plexus-cli --env <env> --tenant <slug> tenant-users invite --first-name <first>
|
|
|
9290
9290
|
- \`--group\` takes the key, the id or the exact label; \`--unit <key>\` (from
|
|
9291
9291
|
\`tenant-users units list\`) only together with \`--group\` \u2014 an unknown key is
|
|
9292
9292
|
refused by the backend. Giving a group needs
|
|
9293
|
-
\`administration.permissions.manage\` as well \u2014
|
|
9293
|
+
\`administration.permissions.manage\` as well \u2014 tenant-wide for a group
|
|
9294
|
+
without \`--unit\`, for that unit (or tenant-wide) with it; without it, invite without
|
|
9294
9295
|
\`--group\` and let someone who has it assign the group in the app.
|
|
9295
9296
|
- \`--language\` (\`de\` or \`en\`) is the language of the letters for a **new**
|
|
9296
9297
|
account; someone who already works at another school keeps their own.
|
|
@@ -9627,7 +9628,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
|
|
|
9627
9628
|
## Related
|
|
9628
9629
|
- Command reference: \`plexus-cli jobs list --help\`, \`plexus-cli workers reap --help\`,
|
|
9629
9630
|
\`plexus-cli imports cleanup-orphaned --help\`.
|
|
9630
|
-
`};var wu="708ba1ab9377bc1246bb097487a57daa2c5c3556d666ec55348d483cd6510733",zh=JT;var Wh=class extends Se{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=A.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:wu,tools:La}),0}},Hh=class extends Se{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=A.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let t=JSON.parse(await Gh(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},QT=[Wh,Hh];var Yh=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],jte=new Set(Yh.map(e=>e.key));function XT(e,t,n,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===t);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${t}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${t} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===n||l.runId===n);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${n}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(XT,"resolveStartTarget");function nB(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(nB,"applicantText");function e$(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:nB(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(e$,"applicationRows");var ZT=Yh.map(e=>e.email);function t$(e,t,n,r){if(n===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(n!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(jh(e,t)&&(r===void 0||!ZT.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${ZT.join(", ")} (--applicant) \u2014 never a real family's`)}s(t$,"assertStartApplicant");function n$(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(n$,"processStoreJson");function rB(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.revisionNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.revisionNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(rB,"refText");function iB(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?rB(e.ref):JSON.stringify(e.value)}s(iB,"holds");function r$(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:iB(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(r$,"storeRows");function bu(e){let t={},n={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);n[o]=a;try{t[o]=JSON.parse(a)}catch{t[o]=a}}return{values:t,raw:n}}s(bu,"parseKv");var i$="started",ku="submitted",o$="submitted",s$="load-scenario:";var a$="(Bewerbung)";function l$(e){return{nodeId:a$,actions:e.map(t=>({id:t.id,label:{de:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`,en:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`},...t.disabledReason===void 0?{}:{disabledReason:t.disabledReason}}))}}s(l$,"sharedAsList");function d$(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(d$,"disabledText");function c$(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:d$(r)})))}s(c$,"actionRows");function u$(e,t,n=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===t));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${t}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${t}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===t);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${t}" on ${i} is disabled: ${d$(a)}`);if(i!==a$)return i;let l=n[0];if(l===void 0)throw new Error(`test-actions run: "${t}" needs a current node \u2014 the application has none`);return l}s(u$,"nodeOfferingAction");function f$(e,t,n){if(e.startsWith(s$)){if(Object.hasOwn(n,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:t,...n}}return Object.keys(n).length===0?void 0:{...n}}s(f$,"runParams");async function oB(e,t){let n=await e.query(S.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(oB,"currentNodeIds");function sB(e,t){switch(t){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${t} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(sB,"refusalText");async function vu(e,t,n){let r=await e.query(S.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${sB(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(S.workflow.listTestActions,{applicationId:t,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,l$(r.actions)]}s(vu,"actionsOf");async function p$(e,t,n){return n!==void 0?[n]:await oB(e,t)}s(p$,"nodesOf");var Jh=class extends C{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=A.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await vu(t,this.application,await p$(t,this.application,this.node));return this.print(n,c$,["node","action","label","disabled"]),0}},Qh=class extends C{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=A.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (upload-signed-document)"});async execute(){let t=f$(this.action,this.autoSubmit,bu(this.param??[]).values),n=await this.caller(),r=this.application,i=await p$(n,this.application,this.node),o=u$(await vu(n,r,i),this.action,i);return await n.mutation(S.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...t===void 0?{}:{params:t}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},m$=[Jh,Qh];var ze=["de","en"];function ts(e,t){return ze.every(n=>e[n]===t[n])}s(ts,"sameText");function wt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!ze.includes(r))?"not-localized":ze.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(wt,"missingLocales");function gi(e){let t=wt(e);return t!=="not-localized"&&t.length===0}s(gi,"isLocalizedText");function qa(e,t){let n={};for(let r of ze){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(qa,"composeTexts");var tr=/^[a-z][A-Za-z0-9]*$/;function Zh(e){return typeof e=="string"&&tr.test(e)}s(Zh,"isNodeId");function ns(e,t){Zh(e)||_(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${tr.source}.`);let n=new Set(t);if(!n.has(e))return e;let r=2;for(;n.has(`${e}${r}`);)r++;return`${e}${r}`}s(ns,"makeNodeId");var yi="$env";function se(e){if(e.scope==="env")return`${yi}.${e.key}`;let t=e.scope==="derived"?`$derived.${e.key}`:`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(se,"formatAddress");var br=/^[a-z][a-zA-Z0-9_]*$/,aB=/^[A-Za-z_][A-Za-z0-9_]*$/;function ro(e){return typeof e=="string"&&e.split(".").every(t=>aB.test(t))}s(ro,"isPath");function Kr(e){if(!e.startsWith("$"))return null;let t=e.slice(1).split("."),[n,...r]=t;switch(n){case"env":{let i=r.join(".");return r.length>0&&ro(i)?{scope:"env",key:i}:null}case"derived":{let[i,...o]=r;return i===void 0||!br.test(i)?null:h$({scope:"derived",key:i},o)}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!br.test(o)||(n==="node"?!tr.test(i):!br.test(i))?null:h$({scope:n,owner:i,key:o},a)}default:return null}}s(Kr,"tryParseAddress");function h$(e,t){if(t.length===0)return e;let n=t.join(".");return ro(n)?{...e,path:n}:null}s(h$,"withPath");function ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:t.scope==="derived"?["scope","key","path"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!ro(t.path))return!1;switch(t.scope){case"env":return ro(t.key);case"derived":return typeof t.key=="string"&&br.test(t.key);case"node":return typeof t.owner=="string"&&tr.test(t.owner)&&typeof t.key=="string"&&br.test(t.key);case"task":return typeof t.owner=="string"&&br.test(t.owner)&&typeof t.key=="string"&&br.test(t.key);default:return!1}}s(ve,"isAddress");var jr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},rs=Object.keys(jr);function is(e){return Object.hasOwn(jr,e)}s(is,"isEnvKey");var lB=["self-service","staff"];function g$(e,t){return{kind:"fixed",values:e,labels:t}}s(g$,"fixedSet");var xu={of:"applicant.language",withoutValue:"de"},Br={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:xu},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:xu},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:xu},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:xu},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:g$(ze,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:g$(lB,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},Su={types:jr,fields:Br},Au=rs.flatMap(e=>Object.keys(jr[e]).map(t=>`${e}.${t}`));function nr(e){return Object.hasOwn(Br,e)}s(nr,"isEnvLeaf");function Eu(e){return`${yi}.${e}`}s(Eu,"envIdentifier");function io(e){let t=Br[e],[n,r]=e.split("."),i=jr[n][r];i===void 0&&_(`[env] leaf "${e}" has no type`);let o=t.valueSet;return{leaf:e,type:i,label:t.label,nullable:t.nullable,...t.absent===void 0?{}:{absent:t.absent},...t.nameLanguage===void 0?{}:{nameLanguage:t.nameLanguage},...t.cohortBound===void 0?{}:{cohortBound:t.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&_(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(io,"envLeaf");var y$="staffInput";var dB=["boolean"],Ma=/^[a-z][A-Za-z0-9]*$/;function Tu(e){return e.staffInputs??[]}s(Tu,"staffInputsOf");function $u(e){return`${y$}.${e}`}s($u,"staffInputLeaf");function w$(e){return`${yi}.${$u(e)}`}s(w$,"staffInputIdentifier");function cB(e){let t=`${y$}.`;return e.startsWith(t)?e.slice(t.length):null}s(cB,"staffInputKeyOfLeaf");function Ka(e,t){let n=cB(t);return n===null?void 0:Tu(e).find(r=>r.key===n)}s(Ka,"declaredStaffInput");function uB(e){return[...Tu(e).map(t=>({leaf:$u(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...Au.map(t=>{let n=io(t);return{leaf:t,type:n.type,label:n.label,valueSet:Br[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(uB,"envLeavesFor");function b$(e){return uB(e).filter(t=>!t.cohortBound)}s(b$,"conditionEnvLeaves");function k$(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of b$(e)){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(k$,"envConditionSchemaFor");function v$(e){let t=e.staffInputs;if(t===void 0)return[];if(!Array.isArray(t))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let n=[],r=new Set;return t.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){n.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};Ma.test(l.key)||n.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&n.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),dB.includes(l.type)||n.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=wt(l.label);c==="not-localized"?n.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&n.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),n}s(v$,"staffInputIssues");var ag={required:!0,description:"Offer slug (its offerKey)"},Xh=class extends C{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=A.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",ag);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(S.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=e$(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},eg=class extends C{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=A.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",ag);async execute(){let t=await this.caller(),n=await t.query(S.admission.getCountsByListForAngebot,{client:this.requireTenant(t),offerKey:this.offer});return this.print(n,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},tg=class extends C{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=A.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(S.admission.get,{applicationId:n});if(r===null)throw new Error(`applications show: no application ${n} (or not visible to you)`);let i=await t.query(S.workflow.getInstance,{applicationId:n});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:n},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerKey},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},ng=class extends C{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=A.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $derived\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(S.processStoreView.get,{applicationId:this.application});return this.print(n$(n),()=>r$(n),["address","state","holds","producer","written"]),0}},rg=class extends C{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=A.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=f.String("--offer",ag);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=f.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let t=await this.caller();t$(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=XT(await t.query(S.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(S.applicants.partyByEmail,{client:n,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await t.mutation(S.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:S$(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(S.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await vu(t,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},ig=class extends C{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=A.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one)"});application=f.String({required:!0});async execute(){return await(await this.caller()).mutation(S.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},n=>[{key:"discarded",value:n.discarded}]),0}},og=class extends C{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=A.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(S.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(n,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},sg=class extends C{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=A.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let t=await this.caller(),[{key:n,value:r}]=S$([this.input]);return await t.mutation(S.admission.correctStaffInput,{applicationId:this.application,key:n,value:r,reason:this.reason}),this.print({application:this.application,key:n,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},x$=[Xh,eg,tg,ng,rg,ig,og,sg];function S$(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!Ma.test(n)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${t}": expected key=true or key=false`);return{key:n,value:r==="true"}})}s(S$,"parseStaffInputs");var dg="bundle.yaml",A$="manifest.json",cg="smartforms",E$="workflow.json";function lg(e){return JSON.parse(ke(e,"utf8"))}s(lg,"readJson");function Pe(e){return JSON.stringify(ug(e),null,2)+`
|
|
9631
|
+
`};var wu="113348d2e8a831c206d554a9b3e963355b521ed9d61fca5ada597cb32c3b42af",zh=JT;var Wh=class extends Se{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=A.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:wu,tools:La}),0}},Hh=class extends Se{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=A.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let t=JSON.parse(await Gh(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},QT=[Wh,Hh];var Yh=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],jte=new Set(Yh.map(e=>e.key));function XT(e,t,n,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===t);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${t}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${t} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===n||l.runId===n);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${n}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(XT,"resolveStartTarget");function nB(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(nB,"applicantText");function e$(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:nB(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(e$,"applicationRows");var ZT=Yh.map(e=>e.email);function t$(e,t,n,r){if(n===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(n!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(jh(e,t)&&(r===void 0||!ZT.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${ZT.join(", ")} (--applicant) \u2014 never a real family's`)}s(t$,"assertStartApplicant");function n$(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(n$,"processStoreJson");function rB(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.revisionNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.revisionNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(rB,"refText");function iB(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?rB(e.ref):JSON.stringify(e.value)}s(iB,"holds");function r$(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:iB(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(r$,"storeRows");function bu(e){let t={},n={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);n[o]=a;try{t[o]=JSON.parse(a)}catch{t[o]=a}}return{values:t,raw:n}}s(bu,"parseKv");var i$="started",ku="submitted",o$="submitted",s$="load-scenario:";var a$="(Bewerbung)";function l$(e){return{nodeId:a$,actions:e.map(t=>({id:t.id,label:{de:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`,en:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`},...t.disabledReason===void 0?{}:{disabledReason:t.disabledReason}}))}}s(l$,"sharedAsList");function d$(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(d$,"disabledText");function c$(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:d$(r)})))}s(c$,"actionRows");function u$(e,t,n=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===t));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${t}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${t}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===t);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${t}" on ${i} is disabled: ${d$(a)}`);if(i!==a$)return i;let l=n[0];if(l===void 0)throw new Error(`test-actions run: "${t}" needs a current node \u2014 the application has none`);return l}s(u$,"nodeOfferingAction");function f$(e,t,n){if(e.startsWith(s$)){if(Object.hasOwn(n,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:t,...n}}return Object.keys(n).length===0?void 0:{...n}}s(f$,"runParams");async function oB(e,t){let n=await e.query(S.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(oB,"currentNodeIds");function sB(e,t){switch(t){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${t} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(sB,"refusalText");async function vu(e,t,n){let r=await e.query(S.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${sB(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(S.workflow.listTestActions,{applicationId:t,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,l$(r.actions)]}s(vu,"actionsOf");async function p$(e,t,n){return n!==void 0?[n]:await oB(e,t)}s(p$,"nodesOf");var Jh=class extends C{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=A.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await vu(t,this.application,await p$(t,this.application,this.node));return this.print(n,c$,["node","action","label","disabled"]),0}},Qh=class extends C{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=A.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (upload-signed-document)"});async execute(){let t=f$(this.action,this.autoSubmit,bu(this.param??[]).values),n=await this.caller(),r=this.application,i=await p$(n,this.application,this.node),o=u$(await vu(n,r,i),this.action,i);return await n.mutation(S.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...t===void 0?{}:{params:t}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},m$=[Jh,Qh];var ze=["de","en"];function ts(e,t){return ze.every(n=>e[n]===t[n])}s(ts,"sameText");function wt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!ze.includes(r))?"not-localized":ze.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(wt,"missingLocales");function gi(e){let t=wt(e);return t!=="not-localized"&&t.length===0}s(gi,"isLocalizedText");function qa(e,t){let n={};for(let r of ze){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(qa,"composeTexts");var tr=/^[a-z][A-Za-z0-9]*$/;function Zh(e){return typeof e=="string"&&tr.test(e)}s(Zh,"isNodeId");function ns(e,t){Zh(e)||_(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${tr.source}.`);let n=new Set(t);if(!n.has(e))return e;let r=2;for(;n.has(`${e}${r}`);)r++;return`${e}${r}`}s(ns,"makeNodeId");var yi="$env";function se(e){if(e.scope==="env")return`${yi}.${e.key}`;let t=e.scope==="derived"?`$derived.${e.key}`:`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(se,"formatAddress");var br=/^[a-z][a-zA-Z0-9_]*$/,aB=/^[A-Za-z_][A-Za-z0-9_]*$/;function ro(e){return typeof e=="string"&&e.split(".").every(t=>aB.test(t))}s(ro,"isPath");function Kr(e){if(!e.startsWith("$"))return null;let t=e.slice(1).split("."),[n,...r]=t;switch(n){case"env":{let i=r.join(".");return r.length>0&&ro(i)?{scope:"env",key:i}:null}case"derived":{let[i,...o]=r;return i===void 0||!br.test(i)?null:h$({scope:"derived",key:i},o)}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!br.test(o)||(n==="node"?!tr.test(i):!br.test(i))?null:h$({scope:n,owner:i,key:o},a)}default:return null}}s(Kr,"tryParseAddress");function h$(e,t){if(t.length===0)return e;let n=t.join(".");return ro(n)?{...e,path:n}:null}s(h$,"withPath");function ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:t.scope==="derived"?["scope","key","path"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!ro(t.path))return!1;switch(t.scope){case"env":return ro(t.key);case"derived":return typeof t.key=="string"&&br.test(t.key);case"node":return typeof t.owner=="string"&&tr.test(t.owner)&&typeof t.key=="string"&&br.test(t.key);case"task":return typeof t.owner=="string"&&br.test(t.owner)&&typeof t.key=="string"&&br.test(t.key);default:return!1}}s(ve,"isAddress");var jr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},rs=Object.keys(jr);function is(e){return Object.hasOwn(jr,e)}s(is,"isEnvKey");var lB=["self-service","staff"];function g$(e,t){return{kind:"fixed",values:e,labels:t}}s(g$,"fixedSet");var xu={of:"applicant.language",withoutValue:"de"},Br={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:xu},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:xu},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:xu},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:xu},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:g$(ze,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:g$(lB,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},Su={types:jr,fields:Br},Au=rs.flatMap(e=>Object.keys(jr[e]).map(t=>`${e}.${t}`));function nr(e){return Object.hasOwn(Br,e)}s(nr,"isEnvLeaf");function Eu(e){return`${yi}.${e}`}s(Eu,"envIdentifier");function io(e){let t=Br[e],[n,r]=e.split("."),i=jr[n][r];i===void 0&&_(`[env] leaf "${e}" has no type`);let o=t.valueSet;return{leaf:e,type:i,label:t.label,nullable:t.nullable,...t.absent===void 0?{}:{absent:t.absent},...t.nameLanguage===void 0?{}:{nameLanguage:t.nameLanguage},...t.cohortBound===void 0?{}:{cohortBound:t.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&_(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(io,"envLeaf");var y$="staffInput";var dB=["boolean"],Ma=/^[a-z][A-Za-z0-9]*$/;function Tu(e){return e.staffInputs??[]}s(Tu,"staffInputsOf");function $u(e){return`${y$}.${e}`}s($u,"staffInputLeaf");function w$(e){return`${yi}.${$u(e)}`}s(w$,"staffInputIdentifier");function cB(e){let t=`${y$}.`;return e.startsWith(t)?e.slice(t.length):null}s(cB,"staffInputKeyOfLeaf");function Ka(e,t){let n=cB(t);return n===null?void 0:Tu(e).find(r=>r.key===n)}s(Ka,"declaredStaffInput");function uB(e){return[...Tu(e).map(t=>({leaf:$u(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...Au.map(t=>{let n=io(t);return{leaf:t,type:n.type,label:n.label,valueSet:Br[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(uB,"envLeavesFor");function b$(e){return uB(e).filter(t=>!t.cohortBound)}s(b$,"conditionEnvLeaves");function k$(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of b$(e)){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(k$,"envConditionSchemaFor");function v$(e){let t=e.staffInputs;if(t===void 0)return[];if(!Array.isArray(t))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let n=[],r=new Set;return t.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){n.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};Ma.test(l.key)||n.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&n.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),dB.includes(l.type)||n.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=wt(l.label);c==="not-localized"?n.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&n.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),n}s(v$,"staffInputIssues");var ag={required:!0,description:"Offer slug (its offerKey)"},Xh=class extends C{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=A.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",ag);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(S.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=e$(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},eg=class extends C{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=A.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",ag);async execute(){let t=await this.caller(),n=await t.query(S.admission.getCountsByListForAngebot,{client:this.requireTenant(t),offerKey:this.offer});return this.print(n,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},tg=class extends C{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=A.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(S.admission.get,{applicationId:n});if(r===null)throw new Error(`applications show: no application ${n} (or not visible to you)`);let i=await t.query(S.workflow.getInstance,{applicationId:n});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:n},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerKey},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},ng=class extends C{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=A.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $derived\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(S.processStoreView.get,{applicationId:this.application});return this.print(n$(n),()=>r$(n),["address","state","holds","producer","written"]),0}},rg=class extends C{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=A.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=f.String("--offer",ag);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=f.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let t=await this.caller();t$(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=XT(await t.query(S.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(S.applicants.partyByEmail,{client:n,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await t.mutation(S.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:S$(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(S.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await vu(t,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},ig=class extends C{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=A.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one)"});application=f.String({required:!0});async execute(){return await(await this.caller()).mutation(S.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},n=>[{key:"discarded",value:n.discarded}]),0}},og=class extends C{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=A.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(S.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(n,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},sg=class extends C{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=A.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let t=await this.caller(),[{key:n,value:r}]=S$([this.input]);return await t.mutation(S.admission.correctStaffInput,{applicationId:this.application,key:n,value:r,reason:this.reason}),this.print({application:this.application,key:n,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},x$=[Xh,eg,tg,ng,rg,ig,og,sg];function S$(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!Ma.test(n)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${t}": expected key=true or key=false`);return{key:n,value:r==="true"}})}s(S$,"parseStaffInputs");var dg="bundle.yaml",A$="manifest.json",cg="smartforms",E$="workflow.json";function lg(e){return JSON.parse(ke(e,"utf8"))}s(lg,"readJson");function Pe(e){return JSON.stringify(ug(e),null,2)+`
|
|
9631
9632
|
`}s(Pe,"canonicalJson");function ug(e){return Array.isArray(e)?e.map(ug):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,ug(e[t])])):e}s(ug,"sortKeys");function Ie(e){let t=H.resolve(e),n=H.join(t,dg);if(!Oe(n))throw new Error(`offer: no ${dg} in ${t}`);let r=eo.load(ke(n,"utf8"));fB(r,n);let i=H.join(t,E$),o,a=Object.keys(r.smartforms??{});if(a.length>0){o={};for(let l of a){let d=H.join(t,cg,`${l}.json`);if(!Oe(d))throw new Error(`offer: bundle.yaml declares smartform "${l}" but ${cg}/${l}.json is missing`);o[l]=lg(d)}}return{dir:t,index:r,manifest:lg(H.join(t,A$)),...o?{smartforms:o}:{},...Oe(i)?{workflow:lg(i)}:{}}}s(Ie,"readBundle");function Ru(e,t,n,r){Oe(e)&&Pe(r(ke(e,"utf8")))===Pe(t)||gt(e,n,"utf8")}s(Ru,"writeIfChanged");function Un(e){if(Wt(e.dir,{recursive:!0}),Ru(H.join(e.dir,dg),e.index,eo.dump(e.index,{lineWidth:100,sortKeys:!1}),t=>eo.load(t)),Ru(H.join(e.dir,A$),e.manifest,Pe(e.manifest),JSON.parse),e.smartforms!==void 0){let t=H.join(e.dir,cg);Wt(t,{recursive:!0});for(let[n,r]of Object.entries(e.smartforms))Ru(H.join(t,`${n}.json`),r,Pe(r),JSON.parse)}e.workflow!==void 0&&Ru(H.join(e.dir,E$),e.workflow,Pe(e.workflow),JSON.parse)}s(Un,"writeBundle");function fB(e,t){let n=[];if(e?.module||n.push("module"),e?.tenant||n.push("tenant"),e?.label||n.push("label"),e?.slugs?.manifest||n.push("slugs.manifest"),n.length>0)throw new Error(`offer: ${t} is missing required keys: ${n.join(", ")}`)}s(fB,"assertIndex");var pB=new Set(["if","else","in","true","false","null"]),mB=new Set(["==","!=","<=",">=","&&","||"]);function hB(e){return e>="0"&&e<="9"}s(hB,"isDigit");function gB(e){return/[a-zA-Z_$]/.test(e)}s(gB,"isIdentStart");function yB(e){return/[a-zA-Z0-9_.$]/.test(e)}s(yB,"isIdentCont");function wB(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(r===" "||r===" "||r===`
|
|
9632
9633
|
`||r==="\r"){n++;continue}if(r==="'"){let o=n+1,a="";for(;o<e.length&&e.charAt(o)!=="'";)e.charAt(o)==="\\"&&o+1<e.length?(a+=e.charAt(o+1),o+=2):(a+=e.charAt(o),o++);o>=e.length&&_(`Unterminated string at ${n}`),t.push({t:"str",v:a}),n=o+1;continue}if(hB(r)){let o=n;for(;o<e.length&&/[0-9.]/.test(e.charAt(o));)o++;t.push({t:"num",v:Number(e.slice(n,o))}),n=o;continue}if(gB(r)){let o=n;for(;o<e.length&&yB(e.charAt(o));)o++;let a=e.slice(n,o);pB.has(a)?t.push({t:"kw",v:a}):t.push({t:"ident",v:a}),n=o;continue}let i=e.slice(n,n+2);if(mB.has(i)){t.push({t:"op",v:i}),n+=2;continue}if("<>!".includes(r)){t.push({t:"op",v:r}),n++;continue}if("()[],".includes(r)){t.push({t:"punct",v:r}),n++;continue}_(`Unexpected char '${r}' at ${n}`)}return t}s(wB,"tokenise");var T$=1e4,$$=128;function os(e){e.depth++,e.depth>$$&&_(`Expression nesting too deep (> ${$$})`)}s(os,"enterDepth");function N$(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(N$,"peek");function Dt(e){let t=e.tokens[e.pos];return t||_(`Unexpected end at ${e.pos}`),e.pos++,t}s(Dt,"take");function Ft(e,t,n){let r=N$(e);return!(!r||r.t!==t||n!==void 0&&r.v!==n)}s(Ft,"match");function oo(e,t,n){return Ft(e,t,n)||_(`Expected ${t}${n?`:${n}`:""} at ${e.pos}`),Dt(e)}s(oo,"expect");function Vr(e){os(e);try{return Ft(e,"kw","if")?bB(e):kB(e)}finally{e.depth--}}s(Vr,"parseExpr");function bB(e){oo(e,"kw","if"),oo(e,"punct","(");let t=Vr(e);oo(e,"punct",")");let n=Vr(e);oo(e,"kw","else");let r=Vr(e);return{kind:"if",cond:t,then:n,else:r}}s(bB,"parseIf");function kB(e){let t=R$(e),n=0;try{for(;Ft(e,"op","||");){Dt(e),os(e),n++;let r=R$(e);t={kind:"binary",op:"||",left:t,right:r}}}finally{e.depth-=n}return t}s(kB,"parseLogicOr");function R$(e){let t=I$(e),n=0;try{for(;Ft(e,"op","&&");){Dt(e),os(e),n++;let r=I$(e);t={kind:"binary",op:"&&",left:t,right:r}}}finally{e.depth-=n}return t}s(R$,"parseLogicAnd");function I$(e){let t=O$(e),n=0;try{for(;Ft(e,"op","==")||Ft(e,"op","!=");){let r=Dt(e).v;os(e),n++;let i=O$(e);t={kind:"binary",op:r,left:t,right:i}}}finally{e.depth-=n}return t}s(I$,"parseEquality");function O$(e){let t=pg(e),n=0;try{for(;Ft(e,"op","<")||Ft(e,"op","<=")||Ft(e,"op",">")||Ft(e,"op",">=")||Ft(e,"kw","in");){let r=Dt(e),i=r.t==="kw"?"in":r.v;os(e),n++;let o=pg(e);t={kind:"binary",op:i,left:t,right:o}}}finally{e.depth-=n}return t}s(O$,"parseCompare");function pg(e){if(Ft(e,"op","!")){Dt(e),os(e);try{return{kind:"unary",op:"!",operand:pg(e)}}finally{e.depth--}}return vB(e)}s(pg,"parseUnary");function vB(e){let t=N$(e);if(t||_("Unexpected end"),t.t==="num")return Dt(e),{kind:"num",value:t.v};if(t.t==="str")return Dt(e),{kind:"str",value:t.v};if(t.t==="kw"&&t.v==="true")return Dt(e),{kind:"bool",value:!0};if(t.t==="kw"&&t.v==="false")return Dt(e),{kind:"bool",value:!1};if(t.t==="kw"&&t.v==="null")return Dt(e),{kind:"null"};if(t.t==="punct"&&t.v==="("){Dt(e);let n=Vr(e);return oo(e,"punct",")"),n}if(t.t==="punct"&&t.v==="["){Dt(e);let n=[];if(!Ft(e,"punct","]"))for(n.push(Vr(e));Ft(e,"punct",",");)Dt(e),n.push(Vr(e));return oo(e,"punct","]"),{kind:"arr",items:n}}if(t.t==="ident"){let n=t.v;if(Dt(e),Ft(e,"punct","(")){Dt(e);let r=[];if(!Ft(e,"punct",")"))for(r.push(Vr(e));Ft(e,"punct",",");)Dt(e),r.push(Vr(e));return oo(e,"punct",")"),{kind:"call",name:n,args:r}}return{kind:"ident",path:n}}_(`Unexpected token at ${e.pos}`)}s(vB,"parsePrimary");function Lt(e){e.length>T$&&_(`Expression too long (${e.length} > ${T$})`);let t={tokens:wB(e),pos:0,depth:0},n=Vr(t);return t.pos<t.tokens.length&&_(`Unexpected trailing token at ${t.pos}`),n}s(Lt,"parseExpression");var xB=new Map([["today",()=>new Date().toISOString().slice(0,10)],["years_between",(e,t)=>{if(typeof e!="string"||typeof t!="string")return null;let n=new Date(e),r=new Date(t);if(isNaN(n.getTime())||isNaN(r.getTime()))return null;let i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return(o<0||o===0&&r.getDate()<n.getDate())&&i--,i}],["length",e=>typeof e=="string"||Array.isArray(e)?e.length:0]]);function ht(e,t){switch(e.kind){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"null":return null;case"ident":{let n=Object.hasOwn(t.values,e.path)?t.values[e.path]:void 0;return n===void 0?null:n}case"arr":return e.items.map(n=>ht(n,t));case"unary":{let n=ht(e.operand,t);return!wi(n)}case"call":{let n=t.functions!==void 0&&Object.hasOwn(t.functions,e.name)?t.functions[e.name]:xB.get(e.name);n||_(`Unknown function '${e.name}'`);let r=e.args.map(i=>ht(i,t));return n(...r)}case"binary":return SB(e.op,e.left,e.right,t);case"if":return wi(ht(e.cond,t))?ht(e.then,t):ht(e.else,t)}}s(ht,"evaluate");function SB(e,t,n,r){if(e==="&&"){let a=ht(t,r);return wi(a)?wi(ht(n,r)):!1}if(e==="||"){let a=ht(t,r);return wi(a)?!0:wi(ht(n,r))}let i=ht(t,r),o=ht(n,r);switch(e){case"==":return fg(i,o);case"!=":return!fg(i,o);case"<":{let[a,l]=Iu(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=Iu(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=Iu(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=Iu(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>fg(a,i)):!1}}s(SB,"evalBinary");function Iu(e,t){return[P$(e),P$(t)]}s(Iu,"orderedOperands");function P$(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"){if(e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}return null}s(P$,"numericOperand");function fg(e,t){return e===t?!0:e==null||t==null?!1:typeof e=="number"&&typeof t=="string"?e===Number(t):typeof e=="string"&&typeof t=="number"?Number(e)===t:!1}s(fg,"looseEq");function wi(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(wi,"truthy");function bt(e){let t=new Set;return Ur(e,t),[...t]}s(bt,"dependencies");function Ur(e,t){switch(e.kind){case"ident":t.add(e.path);return;case"call":e.args.forEach(n=>Ur(n,t));return;case"arr":e.items.forEach(n=>Ur(n,t));return;case"unary":Ur(e.operand,t);return;case"binary":Ur(e.left,t),Ur(e.right,t);return;case"if":Ur(e.cond,t),Ur(e.then,t),Ur(e.else,t);return;default:return}}s(Ur,"walk");var _$=new Map;function rr(e){let t=_$.get(e);return t||(t=Lt(e),_$.set(e,t)),t}s(rr,"parseCached");function AB(e,t){return ht(rr(e),t)}s(AB,"evalExpression");function C$(e,t){return wi(AB(e,t))}s(C$,"evalBoolean");var ss={team:{label:{de:"Team",en:"Team"},optionSource:"tenantTeams",existence:{check:"generic",catalog:"teamKeys"}},roleKey:{label:{de:"Rolle",en:"Role"},optionSource:"tenantRoles",existence:{check:"node",codes:["roleAssign/unknownRoleKey","completenessCheck/unknownRole"]}},article:{label:{de:"Artikel",en:"Article"},optionSource:"programArticles",existence:{check:"node",codes:["collectPayment/unknownArticle"]}},legalEntity:{label:{de:"Tr\xE4ger",en:"Legal entity"},optionSource:"tenantTraeger",existence:{check:"node",codes:["governedDocument/unknownTraeger","collectPayment/unknownPayee"]}},contractGenerator:{label:{de:"Vertragsgenerator",en:"Contract generator"},optionSource:"tenantGenerators",existence:{check:"publish",by:"admittedGeneratorByKey"}},documentTemplate:{label:{de:"Dokumentvorlage",en:"Document template"},optionSource:"tenantDocumentTemplates",existence:{check:"publish",by:"governedDocument/unknownTemplate"}},smartForm:{label:{de:"Formular",en:"Form"},optionSource:"offerSmartForms",existence:{check:"publish",by:"form/unknownSmartForm"}},unit:{label:{de:"Einrichtung",en:"Unit"},optionSource:"tenantUnits",existence:{check:"generic",catalog:"unitKeys"}},formFlag:{label:{de:"Merkmal im Formular",en:"Flag in the form"},optionSource:"targetFormFlags",existence:{check:"node",codes:["setFlag/unknownFlag"]}}};function Ou(e){return typeof e=="string"&&Object.hasOwn(ss,e)}s(Ou,"isResourceType");var Qne=Object.keys(ss).filter(e=>ss[e].existence.check==="generic");var $n="contractGenerator",mg="documentTemplate";function ja(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return(t.kind==="generator"||t.kind==="package")&&typeof t.key=="string"&&t.key.length>0&&(t.revision===void 0||typeof t.revision=="number"&&Number.isInteger(t.revision)&&t.revision>0)&&n.every(r=>r==="kind"||r==="key"||r==="revision")}s(ja,"isGeneratorRef");function D$(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(D$,"literalOf");function Gr(e){let t=D$(e,$n);return ja(t)?t:null}s(Gr,"generatorRefOfNode");function ir(e){let t=D$(e,mg);return typeof t=="string"&&t.length>0?t:null}s(ir,"documentTemplateKeyOfNode");function F$(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(F$,"generatorRefLabel");var L$=/^\d{4}-\d{2}-\d{2}$/;function or(e,t){return{de:e,en:t}}s(or,"issue");function so(e){if(typeof e!="object"||e===null)return or("keine Reduktion","not a reduction");let t=e;if(t.kind==="none")return Object.keys(t).length===1?null:or('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(t.kind!=="amount")return or(`unbekannte Art ${JSON.stringify(t.kind)}`,`unknown kind ${JSON.stringify(t.kind)}`);let{amount:n,activeFrom:r,activeTo:i}=t;return typeof n!="number"||!Number.isFinite(n)||n<=0?or("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((n*100).toFixed(6)))?typeof r!="string"||!L$.test(r)?or("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!L$.test(i)?or("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?or("das Ende liegt vor dem Beginn","the end is before the start"):t.floorTotal!==void 0&&(typeof t.floorTotal!="number"||!Number.isSafeInteger(t.floorTotal)||t.floorTotal<0)?or("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):t.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(t.pricePeriod))?or("ung\xFCltige Preisperiode","invalid price period"):Object.keys(t).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?or("unbekannte Angaben","unknown details"):null:or("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(so,"reductionShapeIssue");function q$(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.groupKey=="string"&&t.groupKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||so(t.reduction)===null&&t.reduction.kind==="amount")&&Object.keys(t).every(n=>n==="groupKey"||n==="grantKeys"||n==="reduction")}s(q$,"isPricedGroupValue");var hg=["street","hausnr","plz","ort","land"];function M$(e){return hg.includes(e)}s(M$,"isAddressPart");var EB=["municipality","municipalityKey","district","districtKey"],gg=[...hg,...EB],yg={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",enum:"option",address:"composite",docRef:"file",party:"edge",personRef:"edge",personList:"edge",roleKey:"roleKey",pricedItem:"pricedItem",pricedGroup:"pricedGroup",reduction:"reduction",article:"article",legalEntity:"legalEntity",contractGenerator:"contractGenerator",documentTemplate:"documentTemplate",localizedText:"localizedText"},as=Object.keys(yg);function bi(e){return typeof e=="string"&&e in yg}s(bi,"isValueType");function mn(e){return e===void 0?void 0:yg[e]}s(mn,"dataTypeOf");function Pu(e,t){let n=mn(e),r=mn(t);return n!==void 0&&n===r}s(Pu,"valueTypesCompatible");function wg(e){return e===null?"null is not a text in both languages":Ba(e,{type:"localizedText"})}s(wg,"completeLocalizedTextIssue");function Ba(e,t){if(Ou(t.type)&&!bi(t.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${t.type} key`;let n=mn(t.type),r=JSON.stringify(e),i=`slot type "${t.type}" takes a binding, not a literal`;if(n===void 0||n==="composite"||n==="file"||n==="edge")return i;if(e===null)return null;switch(n){case"text":return typeof e=="string"?null:`${r} is not a text (slot type "${t.type}")`;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?null:`${r} is not a date YYYY-MM-DD`;case"number":return typeof e=="number"&&Number.isFinite(e)?null:`${r} is not a number`;case"boolean":return typeof e=="boolean"?null:`${r} is not true/false`;case"option":{if(typeof e!="string")return`${r} is not an option value`;let o=(t.enumOptions??[]).map(a=>a.value);return o.length===0||o.includes(e)?null:`${r} is not one of the options ${o.join(", ")}`}case"pricedItem":{let o=e;return typeof o=="object"&&typeof o.itemKey=="string"&&o.itemKey.length>0&&Array.isArray(o.grantKeys)&&o.grantKeys.every(a=>typeof a=="string")?null:`${r} is not a priced item {"itemKey":\u2026,"grantKeys":[\u2026]}`}case"pricedGroup":return q$(e)?null:`${r} is not a priced group {"groupKey":\u2026,"grantKeys":[\u2026]}`;case"article":return typeof e=="string"&&e.length>0?null:`${r} is not an article key`;case"legalEntity":return typeof e=="string"&&e.length>0?null:`${r} is not a legal entity key`;case"contractGenerator":return ja(e)?null:`${r} is not a contract generator {"kind":"generator"|"package","key":\u2026,"revision"?:n}`;case"documentTemplate":return typeof e=="string"&&e.length>0?null:`${r} is not a document template key`;case"roleKey":return typeof e=="string"&&e.length>0?null:`${r} is not a role key`;case"localizedText":{let o=e,a=s(l=>typeof l=="string"&&l.trim().length>0,"filled");return typeof o=="object"&&Object.keys(o).sort().join(",")==="de,en"&&a(o.de)&&a(o.en)?null:`${r} is not a text in both languages {"de":\u2026,"en":\u2026}`}case"reduction":{let o=so(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(Ba,"literalTypeIssue");var K$=yi,ki=`${K$}.`,TB=new Set(["text","number","date","boolean","option","edge"]);function _u(e,t){let n=e[t];return n===void 0&&_(`[env/unknownKey] no environment key '${t}'`),typeof n=="string"?null:Object.keys(n)}s(_u,"contextFields");function j$(e,t){return Object.hasOwn(e,t)}s(j$,"isContextKey");function B$(e){let t=[];for(let n of Object.keys(e)){let r=_u(e,n);if(r===null)t.push(n);else for(let i of r)t.push(`${n}.${i}`)}return t}s(B$,"leafPaths");function Ua(e,t){let[n="",r,...i]=t.split(".");if(!j$(e,n)||i.length>0)return;let o=e[n];if(typeof o=="string")return r===void 0?o:void 0;if(!(r===void 0||!Object.hasOwn(o,r)))return o[r]}s(Ua,"leafType");function U$(e){let t=new Set;for(let n of e){let r=ls(n);r!==null&&t.add(r.split(".")[0])}return[...t]}s(U$,"contextKeysOf");function ls(e){return e.startsWith(ki)?e.slice(ki.length):null}s(ls,"contextPathOf");function Va(e){return e===K$||e.startsWith(ki)}s(Va,"isContextIdentifier");function Nu(e,t){let n=ls(t)??"",[r=""]=n.split("."),i=Object.keys(e);if(!j$(e,r))return{code:"env/unknownKey",message:{de:`'${t}' nennt keinen Umgebungsschl\xFCssel \u2014 bekannt: ${i.join(", ")}.`,en:`'${t}' names no environment key \u2014 known: ${i.join(", ")}.`}};if(Ua(e,n)!==void 0)return null;let o=_u(e,r);return{code:"env/unknownKey",message:o===null?{de:`'${t}': der Umgebungsschl\xFCssel '${r}' ist ein einzelner Wert \u2014 lies ihn als '${ki}${r}'.`,en:`'${t}': environment key '${r}' is a single value \u2014 read it as '${ki}${r}'.`}:{de:`'${t}': der Umgebungsschl\xFCssel '${r}' hat die Felder ${o.join(", ")}.`,en:`'${t}': environment key '${r}' has the fields ${o.join(", ")}.`}}}s(Nu,"identifierIssue");function Cu(e,t,n=Object.keys(e)){let r={};for(let i of n){let o=_u(e,i),a=Object.hasOwn(t,i)?t[i]:void 0;if(a===void 0&&_(`[env/missing] context key '${i}' was not supplied`),o===null){r[`${ki}${i}`]=a;continue}for(let l of o){let d=typeof a=="object"&&a!==null&&Object.hasOwn(a,l)?a[l]:void 0;d===void 0&&_(`[env/missing] context key '${i}' carries no '${l}'`),r[`${ki}${i}.${l}`]=d}}return r}s(Cu,"flatten");function V$(e,t,n){if(n===void 0)return!1;let r=_u(e,t);return r===null?!0:typeof n=="object"&&n!==null&&r.every(i=>n[i]!==void 0)}s(V$,"contextValueComplete");function $B(e,t){switch(t){case"number":return typeof e=="number"&&Number.isFinite(e);case"boolean":return typeof e=="boolean";case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e);default:return typeof e=="string"}}s($B,"valueMatchesDataType");function G$(e,t,n=Object.keys(e.types)){let r=new Set(n);for(let i of B$(e.types)){if(!r.has(i.split(".")[0]))continue;let o=t[`${ki}${i}`];o===void 0&&_(`[env/missing] context path '${i}' was not supplied`);let a=e.fields[i];if(o===null){a.nullable||_(`[env/null] context path '${i}' is not nullable but carries null`);continue}let l=mn(Ua(e.types,i));$B(o,l)||_(`[env/type] context path '${i}' expects ${l}, got ${JSON.stringify(o)}`),a.valueSet.kind==="fixed"&&!a.valueSet.values.includes(o)&&_(`[env/value] context path '${i}' carries '${String(o)}', outside ${a.valueSet.values.join(" | ")}`)}}s(G$,"assertContextValues");function RB(e){let t=[],n=B$(e.types);for(let r of n){let i=Ua(e.types,r),o=mn(i);if(!bi(i)||o===void 0||!TB.has(o)){t.push(`'${r}' has type '${String(i)}', not a scalar value type`);continue}let a=Object.hasOwn(e.fields,r)?e.fields[r]:void 0;if(a===void 0){t.push(`'${r}' has no field spec (value set + nullability)`);continue}a.valueSet.kind==="fixed"&&(a.valueSet.values.length===0&&t.push(`'${r}' has an empty fixed value set`),o!=="text"&&o!=="option"&&t.push(`'${r}' is ${o}; a fixed value set needs a text or option leaf`))}for(let r of Object.keys(e.fields))n.includes(r)||t.push(`field spec '${r}' names no leaf of the schema`);return t}s(RB,"schemaIssues");function ds(e){let t=RB(e);t.length>0&&_(`[env/schema] ${t.join("; ")}`)}s(ds,"assertSchema");var Du={length:{params:["text"],returns:"number"},years_between:{params:["date","date"],returns:"number"}};function vi(e){return JSON.stringify(e)}s(vi,"canonical");function us(e){return e.kind==="binary"&&e.op==="&&"?[...us(e.left),...us(e.right)]:[e]}s(us,"conjuncts");function H$(e,t){let n;try{n=Lt(e)}catch{return!1}let r=vi(Lt(t));return us(n).some(i=>vi(i)===r)}s(H$,"hasConjunct");function Y$(e,t){try{return vi(Lt(e))===vi(Lt(t))}catch{return!1}}s(Y$,"sameCondition");function J$(e){let t=[];for(let n of e)t.push(...bt(rr(n)));return U$(t)}s(J$,"contextKeysRead");function Q$(e){try{return bt(Lt(e)).some(Va)}catch{return!1}}s(Q$,"readsContext");var IB=/^\d{4}-\d{2}-\d{2}$/,OB=new Set(["==","!=","<","<=",">",">=","in"]),PB=new Set(["<","<=",">",">="]);function Lu(e,t,n=[]){ds(t);let r;try{r=Lt(e)}catch(a){let l=a.message;return[qt("condition/parse",`Bedingung '${e}' ist nicht lesbar: ${l}`,`condition '${e}' does not parse: ${l}`)]}let i=[];for(let a of bt(r)){if(!Va(a)){i.push(qt("condition/foreignIdentifier",`'${a}' ist kein Umgebungswert \u2014 Bedingungen lesen nur '$env.*'`,`'${a}' is not a context identifier \u2014 conditions read only '$env.*'`));continue}let l=Nu(t.types,a);l!==null&&i.push(qt("condition/unknownIdentifier",l.message.de,l.message.en))}if(i.length>0)return i;let o=kr(r,t,i);Ga(o)||i.push(qt("condition/notBoolean",`Bedingung '${e}' ist kein Ja/Nein-Ausdruck`,`condition '${e}' is not a yes/no expression`)),DB(r,t,i);for(let{identifier:a,op:l}of vg(r,t))i.push(qt("condition/unguardedNullable",`'${l}' \xFCber '${a}', das leer sein kann, braucht davor eine Absicherung '${a} != null &&'`,`'${l}' over '${a}', which may be null, needs a guard '${a} != null &&' before it`));return i.push(..._B(r,n)),i}s(Lu,"conditionIssues");function _B(e,t){let n=us(e).map(vi);return t.flatMap(r=>{let i=Lt(r),o=NB(i);return o===null||!n.includes(vi(o))?[]:[{severity:"info",code:"condition/guardForm",message:{de:`[condition/guardForm] eine gespiegelte Absicherung z\xE4hlt nicht \u2014 schreibe sie genau als '${r}'`,en:`[condition/guardForm] a mirrored guard does not count \u2014 write it exactly as '${r}'`}}]})}s(_B,"guardFormHints");function NB(e){if(e.kind!=="binary"||e.op!=="=="&&e.op!=="!=")return null;let t={...e,left:e.right,right:e.left};return vi(t)===vi(e)?null:t}s(NB,"mirror");function Ga(e){return e.t==="unknown"||e.t==="data"&&e.dt==="boolean"}s(Ga,"isBooleanish");function Z$(e){let t=ls(e);return t===null&&_(`[condition/invariant] '${e}' reached a pass that only sees $env identifiers`),t}s(Z$,"contextPath");function X$(e,t){let n=ls(t);return n!==null&&e.fields[n]?.nullable===!0}s(X$,"isNullableLeaf");function CB(e,t){let n=mn(Ua(e.types,Z$(t)));return n===void 0?{t:"unknown"}:{t:"data",dt:n}}s(CB,"identType");function Fu(e,t){return e.t==="unknown"||t.t==="unknown"||e.t==="null"||t.t==="null"?!0:e.t==="array"||t.t==="array"?!1:e.t==="str"&&t.t==="str"?!0:e.t==="str"?z$(e.value,t.dt):t.t==="str"?z$(t.value,e.dt):e.dt===t.dt}s(Fu,"fits");function z$(e,t){return t==="text"||t==="option"||t==="edge"?!0:t==="date"?IB.test(e):!1}s(z$,"strFits");function W$(e){return e.t==="unknown"?"unknown":e.t==="data"&&e.dt==="number"?"number":null}s(W$,"orderedCategory");function kr(e,t,n){switch(e.kind){case"num":return{t:"data",dt:"number"};case"bool":return{t:"data",dt:"boolean"};case"str":return{t:"str",value:e.value};case"null":return{t:"null"};case"ident":return CB(t,e.path);case"arr":for(let r of e.items)kr(r,t,n);return{t:"array"};case"unary":{let r=kr(e.operand,t,n);return Ga(r)||n.push(qt("condition/notBoolean","'!' braucht einen Ja/Nein-Operanden","'!' needs a yes/no operand")),{t:"data",dt:"boolean"}}case"call":{let r=Object.hasOwn(Du,e.name)?Du[e.name]:void 0,i=e.args.map(l=>kr(l,t,n));return r===void 0?(n.push(qt("condition/functionNotAllowed",`Funktion '${e.name}' ist nicht erlaubt \u2014 erlaubt: ${Object.keys(Du).join(", ")}`,`function '${e.name}' is not allowed \u2014 allowed: ${Object.keys(Du).join(", ")}`)),{t:"unknown"}):(i.length===r.params.length&&i.every((l,d)=>l.t!=="null"&&Fu(l,{t:"data",dt:r.params[d]}))||n.push(qt("condition/typeMismatch",`'${e.name}' nimmt (${r.params.join(", ")})`,`'${e.name}' takes (${r.params.join(", ")})`)),{t:"data",dt:r.returns})}case"if":{let r=kr(e.cond,t,n);Ga(r)||n.push(qt("condition/notBoolean","'if' braucht eine Ja/Nein-Bedingung","'if' needs a yes/no condition"));let i=kr(e.then,t,n),o=kr(e.else,t,n);return Fu(i,o)||n.push(qt("condition/typeMismatch","die beiden Zweige von 'if' haben verschiedene Typen","the two arms of 'if' differ in type")),i.t==="null"?o:i}case"binary":{let r=kr(e.left,t,n),i=kr(e.right,t,n);if(e.op==="&&"||e.op==="||")(!Ga(r)||!Ga(i))&&n.push(qt("condition/notBoolean",`'${e.op}' braucht Ja/Nein-Operanden`,`'${e.op}' needs yes/no operands`));else if(e.op==="in")e.right.kind!=="arr"?n.push(qt("condition/inWithoutArray","'in' braucht rechts eine Liste, z. B. ['a', 'b']","'in' needs a list on its right, e.g. ['a', 'b']")):e.right.items.every(o=>Fu(r,kr(o,t,[])))||n.push(qt("condition/typeMismatch","ein Listeneintrag von 'in' passt nicht zum Typ des linken Operanden","a list item of 'in' does not match the left operand's type"));else if(PB.has(e.op)){let o=W$(r),a=W$(i);(o===null||a===null||o!=="unknown"&&a!=="unknown"&&o!==a)&&n.push(qt("condition/orderedComparison",`'${e.op}' vergleicht nur Zahlen \u2014 f\xFCr Daten years_between(\u2026) verwenden`,`'${e.op}' compares only numbers \u2014 for dates use years_between(\u2026)`))}else Fu(r,i)||n.push(qt("condition/typeMismatch",`'${e.op}' vergleicht Werte verschiedener Typen`,`'${e.op}' compares values of different types`));return{t:"data",dt:"boolean"}}}}s(kr,"typeOf");function bg(e){return e.kind==="str"||e.kind==="num"||e.kind==="bool"}s(bg,"isLiteral");function eR(e){let t=[],n=s(r=>{if(r.kind==="binary"&&OB.has(r.op)){if(r.left.kind==="ident"){let i=r.op==="in"&&r.right.kind==="arr"?r.right.items.filter(bg):bg(r.right)?[r.right]:[];i.length>0&&t.push({ident:r.left.path,literals:i})}r.right.kind==="ident"&&bg(r.left)&&t.push({ident:r.right.path,literals:[r.left]})}tR(r,n)},"visit");return n(e),t}s(eR,"comparedLiterals");function DB(e,t,n){for(let{ident:r,literals:i}of eR(e)){let o=FB(r,i,t);o!==null&&n.push(o)}}s(DB,"literalIssues");function kg(e,t){let n;try{n=Lt(e)}catch{return[]}let r=[];for(let{ident:i,literals:o}of eR(n)){let a=ls(i);if(!(a===null||t.fields[a]?.valueSet.kind!=="live"))for(let l of o)l.kind==="str"&&r.push({path:a,value:l.value})}return r}s(kg,"liveLiterals");function FB(e,t,n){let r=n.fields[Z$(e)]?.valueSet;if(r?.kind==="unstable")return qt("condition/literalOnUnstable",`'${e}' ist nicht \xFCber Umgebungen stabil \u2014 vergleiche ihn mit keinem festen Wert; verzweige stattdessen \xFCber ein stabiles Merkmal`,`'${e}' is not stable across environments \u2014 compare it to no literal; branch on a stable attribute instead`);if(r?.kind!=="fixed")return null;let i=t.flatMap(a=>a.kind==="str"&&!r.values.includes(a.value)?[`'${a.value}'`]:[]);if(i.length===0)return null;let o=r.values.map(a=>`'${a}'`).join(", ");return qt("condition/literalOutsideSet",`'${e}' kennt nur ${o} \u2014 nicht ${i.join(", ")}`,`'${e}' takes only ${o} \u2014 not ${i.join(", ")}`)}s(FB,"valueSetIssue");function tR(e,t){switch(e.kind){case"binary":t(e.left),t(e.right);return;case"unary":t(e.operand);return;case"call":e.args.forEach(t);return;case"arr":e.items.forEach(t);return;case"if":t(e.cond),t(e.then),t(e.else);return;default:return}}s(tR,"forEachChild");function nR(e){return e.kind==="binary"&&(e.op==="=="||e.op==="!=")&&(e.left.kind==="ident"&&e.right.kind==="null"||e.left.kind==="null"&&e.right.kind==="ident")}s(nR,"isNullTest");function rR(e){return us(e).flatMap(t=>{let n=iR(t);return n===null?[]:[n]})}s(rR,"guardsOf");function za(e,t,n){switch(e.kind){case"ident":return X$(t,e.path)&&!n.has(e.path)?e.path:null;case"call":for(let r of e.args){let i=za(r,t,n);if(i!==null)return i}return null;case"if":return za(e.then,t,new Set([...n,...rR(e.cond)]))??za(e.else,t,n);default:return null}}s(za,"unguardedNullSource");function iR(e){return!nR(e)||e.kind!=="binary"||e.op!=="!="?null:e.left.kind==="ident"?e.left.path:e.right.kind==="ident"?e.right.path:null}s(iR,"guardedIdent");function cs(e,t,n,r){if(e.kind==="binary"&&e.op==="&&"){let i=new Set(n);for(let o of us(e)){cs(o,t,i,r);let a=iR(o);a!==null&&i.add(a)}return}if(e.kind==="if"){cs(e.cond,t,n,r),cs(e.then,t,new Set([...n,...rR(e.cond)]),r),cs(e.else,t,n,r);return}if(e.kind==="binary"&&e.op==="!="&&e.left.kind!=="null"&&e.right.kind!=="null"){let i=za(e.left,t,n)??za(e.right,t,n);i!==null&&r(i,"!=")}if(e.kind==="unary"&&!nR(e.operand)){let i=bt(e.operand).filter(o=>X$(t,o)&&!n.has(o));i.length>0&&r(i[0],"!")}tR(e,i=>cs(i,t,n,r))}s(cs,"nullableReads");function vg(e,t){ds(t);let n=[];return cs(e,t,new Set,(r,i)=>{n.some(o=>o.identifier===r)||n.push({identifier:r,op:i})}),n}s(vg,"unguardedNullableReads");function qt(e,t,n){return{severity:"error",code:e,message:{de:`[${e}] ${t}`,en:`[${e}] ${n}`}}}s(qt,"error");function xi(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.itemKey=="string"&&t.itemKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||so(t.reduction)===null&&t.reduction.kind==="amount")}s(xi,"isPricedItemValue");var fs=["freetext","recommendation","choice","pricedItem","record","reduction"],ps=[...fs,"appointment"];function sR(e){return typeof e=="string"&&ps.includes(e)}s(sR,"isTaskResultKind");function Si(e){return typeof e=="string"&&fs.includes(e)}s(Si,"isRecordedTaskResultKind");function ms(e){return Si(e.kind)}s(ms,"isRecordedTaskResult");var qu=["number","boolean","enum"];function xg(e){return typeof e=="string"&&qu.includes(e)}s(xg,"isRecordFieldType");var Sg=["form","siblingRank"];var zr={freetext:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Freitext",en:"Free text"}},recommendation:{choiceValueType:"enum",valueType:null,textValueType:"string",label:{de:"Empfehlung",en:"Recommendation"}},choice:{choiceValueType:"enum",valueType:"enum",textValueType:"string",label:{de:"Auswahl",en:"Choice"}},pricedItem:{choiceValueType:"enum",valueType:"pricedItem",textValueType:"string",label:{de:"Preisposition",en:"Priced item"}},reduction:{choiceValueType:null,valueType:"reduction",textValueType:"string",label:{de:"Reduktion",en:"Reduction"}},record:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Erfassung",en:"Record"}},appointment:{choiceValueType:null,valueType:null,textValueType:null,label:{de:"Termin",en:"Appointment"}}};function ao(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(ao,"isProseResult");function Mu(e){return e.kind==="record"?(e.fields??[]).filter(t=>typeof t.writes=="string"&&t.writes.length>0&&xg(t.type)).map(t=>({key:t.writes,valueType:t.type,field:t})):LB(e)}s(Mu,"draftResultStoreWrites");function LB(e){let t=zr[e.kind].valueType;return e.writes===void 0||t===null?[]:[{key:e.writes,valueType:t}]}s(LB,"singleStoreWrite");var oR="team:";function hs(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(oR)){let t=e.slice(oR.length);return t.length===0?null:{kind:"team",groupKey:t}}return{kind:"channel",channelKey:e}}s(hs,"parseTaskResultChat");var He={unknownKind:"[taskResult/unknownKind]",onApproval:"[taskResult/onApproval]",unknownField:"[taskResult/unknownField]",choiceOptions:"[taskResult/choiceOptions]",textRequiredOnFreetext:"[taskResult/textRequiredOnFreetext]",chatMissing:"[taskResult/chatMissing]",chatExternal:"[taskResult/chatExternal]",chatUnknownChannel:"[taskResult/chatUnknownChannel]",appointmentMissingTitle:"[taskResult/appointmentMissingTitle]",pricedItemMissingItem:"[taskResult/pricedItemMissingItem]",pricedItemUnknownItem:"[taskResult/pricedItemUnknownItem]",pricedItemNotInProgram:"[taskResult/pricedItemNotInProgram]",pricedItemOfferWithoutProgram:"[taskResult/pricedItemOfferWithoutProgram]",itemOnNonPricedItem:"[taskResult/itemOnNonPricedItem]",writesOnProse:"[taskResult/writesOnProse]",filesOnKind:"[taskResult/filesOnKind]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",reductionPrices:"[taskResult/reductionPrices]",pricesOnNonReduction:"[taskResult/pricesOnNonReduction]"};var gs={"assign{}":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der Knoten-Aufgabe",en:"team of the node task"},consequence:{de:"beim Betreten des Knotens entsteht die Aufgabe f\xFCr niemanden",en:"entering the node creates the task for nobody"}},"tasks[].assign.group":{kind:"team",codec:"key",involves:!0,required:!0,what:{de:"Team der Aufgabe",en:"team of the task"},consequence:{de:"die Aufgabe kann nicht angelegt werden, und der Prozess bleibt stehen",en:"the task cannot be created and the process stops"}},"tasks[].params.revisionGroup":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der \xDCberarbeitung",en:"revision team"},consequence:{de:"eine Ablehnung findet niemanden, der \xFCberarbeitet",en:"a rejection finds nobody to revise"}},"tasks[].result.chat":{kind:"team",codec:"chatTarget",involves:!1,required:!1,what:{de:"Chat des Ergebnisses",en:"chat of the result"},consequence:{de:"das Ergebnis l\xE4sst sich nicht im Chat ablegen",en:"the result cannot be posted to the chat"}},"optionalActions[].trigger":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Aktion ausl\xF6sen darf",en:"team that may trigger the action"},consequence:{de:"niemand au\xDFer der Prozessverantwortung kann die Aktion ausl\xF6sen",en:"nobody but the process owner can trigger the action"}}},Ag=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function aR(e,t){if(typeof t!="string"||t.length===0)return null;if(e==="key")return t;let n=hs(t);return n?.kind==="team"?n.groupKey:null}s(aR,"decodeKey");function qB(e){let t=/^(tasks|optionalActions)\[\](?:\.([a-zA-Z]+))?\.([a-zA-Z]+)$/.exec(e);return t===null&&_(`[resource] unreadable reference leaf "${e}"`),{list:t[1],field:t[2]??null,key:t[3]}}s(qB,"locate");function Ku(e){let t=[],n=e;for(let[r,i]of Object.entries(Ag(n.assign)??{})){let o=aR("key",i);t.push({path:`assign.${r}`,leaf:"assign{}",owner:r,key:o,missing:typeof i!="string"||i.length===0})}for(let r of Object.keys(gs)){if(r==="assign{}")continue;let i=gs[r],{list:o,field:a,key:l}=qB(r);for(let d of Array.isArray(n[o])?n[o]:[]){let c=Ag(d);if(c===null||typeof c.key!="string")continue;let p=(a===null?c:Ag(c[a]))?.[l];if(p===void 0&&!i.required)continue;let m=typeof p!="string"||p.length===0;t.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:aR(i.codec,p),missing:m})}}return t}s(Ku,"nodeResourceReferences");function Wa(e){let t=Array.isArray(e.nodes)?e.nodes:[],n=new Set;for(let r of t)for(let i of Ku(r))i.key!==null&&gs[i.leaf].involves&&n.add(i.key);return n}s(Wa,"declaredGroupKeys");var vt="responsible",Eg="team:";function Tg(e){return`${Eg}${e}`}s(Tg,"teamSlot");function $g(e){return e.startsWith(Eg)?e.slice(Eg.length):null}s($g,"teamKeyOfSlot");var ys=Su;var MB="unit.key",KB="offer.key";function lR(e,t){return e===MB?t.unitKeys:e===KB?t.offerKeys:null}s(lR,"liveKeyUniverse");function ju(e){return[vt,...[...Wa(e)].sort((t,n)=>t.localeCompare(n)).map(Tg)]}s(ju,"requiredSlots");var Ai=`${Eu("applicant.channel")} == 'staff'`;var Ig=["strict","leastLoaded"];var Rg=2;function dR(e){return e.some(t=>t.length===0)?{de:"nennt einen leeren Personenschl\xFCssel",en:"names an empty person key"}:new Set(e).size!==e.length?{de:"nennt eine Person zweimal",en:"names a person twice"}:e.length<Rg?{de:`braucht mindestens ${Rg} Personen`,en:`needs at least ${Rg} people`}:null}s(dR,"rotationPoolProblem");function jB(e,t){let n=t===null?-1:e.indexOf(t);return[...e.slice(n+1),...e.slice(0,n+1)]}s(jB,"strictOrder");function cR(e){let t=jB(e.pool,e.previous).filter(i=>e.eligible.has(i));if(t.length===0)return null;if(e.mode==="strict")return t[0];let n=e.openCounts;n===void 0&&_("[assignment/rotation] leastLoaded needs the open counts");let r=s(i=>{let o=n.get(i);return o===void 0&&_(`[assignment/rotation] no open count for '${i}'`),o},"load");return t.reduce((i,o)=>r(o)<r(i)?o:i)}s(cR,"pickFromPool");function fR(e,t){let n=e?.assignmentRules;n===void 0&&_(`[assignment/noRules] ${t}: the workflow has no assignment rule`);let r=gR(n);return r.length>0&&_(`${r.join("; ")} (${t})`),n}s(fR,"rulesOfGraph");function BB(e){return e===vt?{slot:e,rules:[{when:Ai,assign:{kind:"creator"}},{when:null,assign:{kind:"unassigned"}}]}:{slot:e,rules:[{when:null,assign:{kind:"queue"}}]}}s(BB,"defaultSlotRules");function pR(e,t){let n=new Set(e.map(o=>o.slot)),r=t.filter(o=>!n.has(o)).map(BB);return[...r.filter(o=>o.slot===vt),...e,...r.filter(o=>o.slot!==vt)]}s(pR,"withRequiredSlots");function Tt(e,t){return t===void 0?`slot '${e}'`:`slot '${e}' row #${t+1}`}s(Tt,"where");function Rn(e,t){return t===void 0?`Liste '${e}'`:`Liste '${e}', Zeile #${t+1}`}s(Rn,"whereDe");function hn(e,t,n={},r="error"){return{severity:r,code:e,message:{de:`[${e}] ${t.de}`,en:`[${e}] ${t.en}`},...n}}s(hn,"issue");function uR(e){if(e===vt)return!0;let t=$g(e);return t!==null&&t.length>0}s(uR,"isKnownSlot");function UB(e,t){ds(ys);let n=[],r=new Set;e.forEach((o,a)=>{let{slot:l}=o;uR(l)||n.push(hn("assignment/unknownSlot",{de:`'${l}' ist keine Liste \u2014 'responsible' oder 'team:<teamKey>'`,en:`'${l}' is no slot \u2014 'responsible' or 'team:<teamKey>'`},{slot:l})),r.has(l)&&n.push(hn("assignment/duplicateSlot",{de:`${Rn(l)} steht zweimal da`,en:`${Tt(l)} is listed twice`},{slot:l})),r.add(l),l===vt&&a!==0&&n.push(hn("assignment/responsibleFirst",{de:`'${vt}' muss die erste Liste sein \u2014 Team-Zeilen \xFCbernehmen sie`,en:`'${vt}' must be the first slot \u2014 team rows copy it`},{slot:l})),n.push(...VB(o))});for(let o of t)r.has(o)||n.push(hn("assignment/slotMissing",{de:`${Rn(o)} hat keine Regeln \u2014 der Workflow braucht sie`,en:`${Tt(o)} has no rule list \u2014 the workflow needs it`},{slot:o}));let i=new Set(t);for(let{slot:o}of e)o!==vt&&!i.has(o)&&uR(o)&&n.push(hn("assignment/unusedSlot",{de:`${Rn(o)} wird hier nicht gebraucht \u2014 erlaubt, und nicht ausgewertet`,en:`${Tt(o)} is not needed here \u2014 allowed, and not evaluated`},{slot:o},"info"));return n}s(UB,"validateRules");function VB({slot:e,rules:t}){let n=[];return(t.length===0||t[t.length-1].when!==null)&&n.push(hn("assignment/defaultRowMissing",{de:`${Rn(e)} muss mit einer Zeile ohne Bedingung enden (\u201Esonst\u201C)`,en:`${Tt(e)} must end with a row without condition ("otherwise")`},{slot:e})),t.forEach((r,i)=>{let o={slot:e,row:i},{when:a,assign:l}=r;if(a===null&&i<t.length-1&&n.push(hn("assignment/ruleAfterDefault",{de:`${Rn(e,i)} hat keine Bedingung, aber es folgen Zeilen \u2014 sie treffen nie zu`,en:`${Tt(e,i)} has no condition, but rows follow it \u2014 they can never match`},o)),a!==null){let d=Lu(a,ys,[Ai]);for(let c of d)n.push({...c,message:{de:`${c.message.de} (${Rn(e,i)})`,en:`${c.message.en} (${Tt(e,i)})`},...o});if(d.every(c=>c.severity!=="error")){Q$(a)||n.push(hn("assignment/shadowedRule",{de:`${Rn(e,i)} liest nichts aus dem Vorgang \u2014 sie gilt immer oder nie`,en:`${Tt(e,i)} reads nothing of the application \u2014 it holds for every application or for none`},o));let c=t.slice(0,i).findIndex(u=>u.when!==null&&Y$(u.when,a));c!==-1&&n.push(hn("assignment/shadowedRule",{de:`${Rn(e,i)} wiederholt die Bedingung von Zeile #${c+1} \u2014 sie trifft nie zu`,en:`${Tt(e,i)} repeats the condition of row #${c+1} \u2014 it can never match`},o))}}if(e===vt&&l.kind==="slot"&&n.push(hn("assignment/slotForwardRef",{de:`${Rn(e,i)} \xFCbernimmt '${l.slot}' \u2014 das darf nur eine Team-Liste nach '${vt}'`,en:`${Tt(e,i)} copies '${l.slot}' \u2014 only a team slot after '${vt}' may`},o)),e===vt&&l.kind==="queue"&&n.push(hn("assignment/queueOnProcessSlot",{de:`${Rn(e,i)} weist die Queue zu \u2014 die Prozesszust\xE4ndigkeit ist immer eine Person`,en:`${Tt(e,i)} assigns the queue \u2014 the responsible slot is always a person`},o)),l.kind==="unassigned"&&n.push(hn("assignment/targetMissing",{de:`${Rn(e,i)} nennt noch niemanden \u2014 Person w\xE4hlen`,en:`${Tt(e,i)} names no one yet \u2014 choose a person`},o)),l.kind==="rotation"){let d=dR(l.configKeys);d!==null&&n.push(hn("assignment/rotationPool",{de:`${Rn(e,i)}: die Reihum-Liste ${d.de}`,en:`${Tt(e,i)} rotates over a pool that ${d.en}`},o))}l.kind==="creator"&&(a===null||!H$(a,Ai))&&n.push(hn("assignment/unguardedTarget",{de:`${Rn(e,i)} weist die anlegende Person zu \u2014 die gibt es nur, wenn die Bedingung der Zeile '${Ai}' ist (oder enth\xE4lt)`,en:`${Tt(e,i)} assigns the creator, which exists only when the row's condition is (or has the conjunct) '${Ai}'`},o))}),n}s(VB,"rowIssues");function mR(e,t){for(let r of t)e.some(i=>i.slot===r)||_(`[assignment/slotMissing] ${Tt(r)} has no rule list`);let n=new Set(t);return e.filter(r=>n.has(r.slot))}s(mR,"selectSlots");function GB(e,t){return J$(mR(e,t).flatMap(n=>n.rules.flatMap(r=>r.when===null?[]:[r.when])))}s(GB,"contextKeysOfRules");function hR(e,t,n,r){ds(ys);let i=mR(e,n),o=GB(e,n),a=Cu(ys.types,t,o);G$(ys,a,o);let l=[];for(let{slot:d,rules:c}of i){let u=c.findIndex((m,g)=>{if(m.when===null)return!0;for(let b of bt(rr(m.when)))Object.hasOwn(a,b)||_(`[condition/unknownIdentifier] ${Tt(d,g)} reads '${b}', which the context does not carry`);return C$(m.when,{values:a})});u===-1&&_(`[assignment/defaultRowMissing] ${Tt(d)}: no row matched and there is no default row`);let p=c[u].assign;l.push({slot:d,ruleIndex:u,assign:p,value:zB(d,u,p,l,r)})}return l}s(hR,"evaluateRules");function zB(e,t,n,r,i){switch(n.kind){case"person":return{kind:"value",value:i.person(n.configKey)};case"creator":return{kind:"value",value:i.creator()};case"rotation":return{kind:"value",value:i.rotation(n,{slot:e,row:t})};case"unassigned":return _(`[assignment/targetMissing] ${Tt(e,t)} names no one`);case"queue":return e===vt&&_(`[assignment/queueOnProcessSlot] ${Tt(e,t)} assigns the queue`),{kind:"queue"};case"slot":{let o=e===vt?void 0:r.find(a=>a.slot===n.slot);return o===void 0&&_(`[assignment/slotForwardRef] ${Tt(e,t)} copies '${n.slot}', which is not decided before it`),o.value}}}s(zB,"resolveTarget");var Og={person:["kind","configKey"],creator:["kind"],slot:["kind","slot"],queue:["kind"],rotation:["kind","configKeys","mode"],unassigned:["kind"]};function gR(e){let t=[],n=s((r,i)=>t.push(`[assignment/shape] ${r}: ${i}`),"bad");return Array.isArray(e)?(e.forEach((r,i)=>{let o=`slots[${i}]`;if(typeof r!="object"||r===null)return n(o,"must be { slot, rules }");let{slot:a,rules:l,...d}=r;if(Object.keys(d).length>0&&n(o,`unknown field(s) ${Object.keys(d).join(", ")}`),typeof a!="string"&&n(o,"slot must be a string"),!Array.isArray(l))return n(o,"rules must be a list");l.forEach((c,u)=>{let p=`${o}.rules[${u}]`;if(typeof c!="object"||c===null)return n(p,"must be { when, assign }");let{when:m,assign:g,...b}=c;Object.keys(b).length>0&&n(p,`unknown field(s) ${Object.keys(b).join(", ")}`),m!==null&&typeof m!="string"&&n(p,"when must be a condition string or null (\u201Esonst\u201C)");let y=g?.kind;if(typeof g!="object"||g===null||typeof y!="string"||!Object.hasOwn(Og,y))return n(p,`assign must be one of ${Object.keys(Og).map(O=>`{kind:'${O}'}`).join(", ")}`);let v=Og[y],T=Object.keys(g);(T.some(O=>!v.includes(O))||v.some(O=>!T.includes(O)))&&n(p,`a '${y}' target has exactly the field(s) ${v.join(", ")}`);let $=g;if(y==="person"&&(typeof $.configKey!="string"||$.configKey.length===0)&&n(p,"a 'person' target needs a non-empty configKey"),y==="rotation"){let O=$.configKeys;(!Array.isArray(O)||O.some(N=>typeof N!="string"))&&n(p,"a 'rotation' target needs configKeys, a list of person keys"),Ig.includes($.mode)||n(p,`a 'rotation' target's mode is one of ${Ig.map(N=>`'${N}'`).join(", ")}`)}y==="slot"&&$.slot!==vt&&n(p,`a 'slot' target copies '${vt}' and nothing else`)})}),t):(n("slots","must be a list of { slot, rules }"),t)}s(gR,"ruleShapeIssues");function yR(e){let t=e??{},n=[];if(t.teamOwnerBindings!==void 0&&n.push({de:"[assignment/legacyBindings] der Workflow tr\xE4gt noch teamOwnerBindings \u2014 die Zust\xE4ndigkeitsregel ersetzt sie; das Feld entfernen",en:"[assignment/legacyBindings] the workflow still carries teamOwnerBindings \u2014 the assignment rule replaces them; remove the field"}),t.assignmentRules===void 0)return n.push({de:"[assignment/noRules] der Workflow hat keine Zust\xE4ndigkeitsregel (graph.assignmentRules) \u2014 jeder Workflow muss sagen, wer zust\xE4ndig wird",en:"[assignment/noRules] the workflow has no assignment rule (graph.assignmentRules) \u2014 every workflow must say who becomes responsible"}),n;let r=gR(t.assignmentRules);if(r.length>0)return[...n,...r.map(o=>({de:o,en:o}))];let i=ju({nodes:Array.isArray(t.nodes)?t.nodes:[]});for(let o of UB(t.assignmentRules,i))o.severity==="error"&&n.push(o.message);return n}s(yR,"workflowAssignmentIssues");function wR(e,t,n={}){let r=new Map;return{slots:hR(e,t,n.slots??e.map(o=>o.slot),{person:s(o=>`person:${o}`,"person"),creator:s(()=>(n.creator===void 0&&fe("INVALID",{de:"[assignment/noCreator] Die zutreffende Zeile weist die anlegende Person zu, aber es wurde kein --creator angegeben (ein Selbststart hat keine).",en:"[assignment/noCreator] The matching row assigns the creating person, but no --creator was given (a self-start has none)."}),`creator:${n.creator}`),"creator"),rotation:s((o,{slot:a})=>{let l=n.rotationPrevious?.[a]??null,d=cR({pool:o.configKeys,mode:o.mode,previous:l,eligible:new Set(o.configKeys.filter(c=>!(n.left??[]).includes(c))),openCounts:new Map(o.configKeys.map(c=>[c,n.openCounts?.[c]??0]))});return d===null&&fe("INVALID",{de:`[assignment/rotationEmpty] Platz \u201E${a}\u201C: alle aus dem Pool sind ausgeschieden`,en:`[assignment/rotationEmpty] slot '${a}': everyone in the pool has left`}),r.set(a,{pool:[...o.configKeys],mode:o.mode,previous:l,picked:d}),`person:${d}`},"rotation")}).map(o=>{let a=r.get(o.slot);return{slot:o.slot,row:o.ruleIndex+1,assign:o.assign,value:o.value.kind==="queue"?"queue":o.value.value,...a!==void 0?{rotation:a}:{}}})}}s(wR,"simulateRules");function bR(e,t){let n={};for(let r of t??[]){let i=r.lastIndexOf("=");if(i<=0||i===r.length-1)throw new Error(`assignment simulate: ${e} takes <key>=<value>, got '${r}'`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`assignment simulate: ${e} names '${o}' twice`);n[o]=r.slice(i+1)}return n}s(bR,"parsePairs");function WB(e){let t={};for(let[n,r]of Object.entries(bR("--open",e))){let i=Number(r);if(!Number.isInteger(i)||i<0)throw new Error(`assignment simulate: --open ${n}=${r} is no count`);t[n]=i}return t}s(WB,"parseCounts");function HB(e,t){if(e===void 0==(t===void 0))throw new Error("assignment simulate: pass exactly one of --env-json '<json>' or --env-file <path>");let n=e??ke(t,"utf8"),r=JSON.parse(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new Error("assignment simulate: the environment must be a JSON object");return r}s(HB,"parseEnv");var Pg=class extends Se{static{s(this,"AssignmentSimulateCommand")}static paths=[["assignment","simulate"]];static usage=A.Usage({category:"Admission",description:"Evaluate an offer bundle's assignment rule over an application's environment ($env), offline",details:`
|
|
9633
9634
|
The environment carries every key the rule reads ($env): offer
|
|
@@ -10043,6 +10044,6 @@ ${n.length} unusable ${o}:
|
|
|
10043
10044
|
`),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli users relink-auth <email>
|
|
10044
10045
|
`),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli users provision --tenant <slug> --email <email> --name <name>
|
|
10045
10046
|
`)}else this.context.stdout.write(`No unusable identities.
|
|
10046
|
-
`);return n.length>0?1:0}},fA=class extends An{static{s(this,"UsersRelinkAuthCommand")}static paths=[["users","relink-auth"]];static usage=A.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function $q(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s($q,"requireOnOff");var Rq=[WS,HS,YS,JS,QS,ZS,XS,eA,tA,nA,rA,iA,xc,oA,sA,aA,lA,dA,cA,uA,fA];function Iq(e){return e.de??e.en??Object.values(e)[0]??""}s(Iq,"titleDe");function G4(e){return{id:e._id,kind:e.kind,status:e.status,title:Iq(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(G4,"row");var z4=["id","kind","status","title","assignee","group","outcome"],mA=class extends C{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=A.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(G4),z4),0}},hA=class extends C{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=A.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:Iq(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},gA=class extends C{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=A.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},yA=class extends C{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=A.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},wA=class extends C{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=A.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},Oq=[mA,hA,gA,yA,wA];var Om=[...QT,...qR,...sO,...oO,..._O,...GO,...VO,...Eq,...Rq,...Aq,...P0,...SR,...RO,...mq,...YT,...x$,...kR,...HO,...WO,...QO,...ZO,...TO,...fO,...Oq,...PF,...gL,...I0,...yL,...nq,...cq,..._0,...j0,...V0,...pq,...wq,...m$];var Pq="0.1.21";function _q(){return Om.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=GT[Da(n)];return{path:n,effect:no(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(_q,"plexusCommandCatalog");import qo from"node:path";function W4(e){let t=st()?.workspaceRoot??process.cwd(),n=qo.resolve(t,e),r=qo.relative(t,n);if(qo.isAbsolute(e)||r===".."||r.startsWith(`..${qo.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(W4,"workspacePath");function H4(e){let{absolute:t,relative:n}=W4(e.path??".");if(e.operation==="list"){if(!Oe(t))return{files:[]};let r=[],i=s(o=>{for(let a of Gi(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=qo.join(o,a.name);if(a.isDirectory()?i(l):r.push(qo.relative(t,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=ke(t);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return gt(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Wt(qo.dirname(t),{recursive:!0}),gt(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Bo(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(H4,"plexusWorkspace");function Nq(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=La[n];if(!o||!Object.hasOwn(La,n))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(zh,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:zh[i.path],skillHash:wu}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return H4(i)},"executePlexusAgentTool")}s(Nq,"createPlexusAgentToolExecutor");var Pm=Nq({inspectCommand:Dq,executeCommand:Fq});function _m(){let e=new zo({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:Pq});e.register(ba.HelpCommand),e.register(ba.VersionCommand);for(let n of Om)e.register(n);async function t(n,r){let i;try{i=e.process(n,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return Q4(i,r.stderr??process.stderr),e.run(i,r)}return s(t,"run"),{process(n,r){return e.process(n,r)},run:t,async runExit(n,r){process.exitCode=await t(n,r)}}}s(_m,"createPlexusCli");function Q4(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&Ca[n]===r&&dt(t,n,r),n in Ca&&no(n)==="confirm"&&!Fa(e)&&t.write(`plexus-cli: \`${Ca[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
10047
|
+
`);return n.length>0?1:0}},fA=class extends An{static{s(this,"UsersRelinkAuthCommand")}static paths=[["users","relink-auth"]];static usage=A.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function $q(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s($q,"requireOnOff");var Rq=[WS,HS,YS,JS,QS,ZS,XS,eA,tA,nA,rA,iA,xc,oA,sA,aA,lA,dA,cA,uA,fA];function Iq(e){return e.de??e.en??Object.values(e)[0]??""}s(Iq,"titleDe");function G4(e){return{id:e._id,kind:e.kind,status:e.status,title:Iq(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(G4,"row");var z4=["id","kind","status","title","assignee","group","outcome"],mA=class extends C{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=A.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(G4),z4),0}},hA=class extends C{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=A.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:Iq(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},gA=class extends C{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=A.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},yA=class extends C{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=A.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},wA=class extends C{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=A.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},Oq=[mA,hA,gA,yA,wA];var Om=[...QT,...qR,...sO,...oO,..._O,...GO,...VO,...Eq,...Rq,...Aq,...P0,...SR,...RO,...mq,...YT,...x$,...kR,...HO,...WO,...QO,...ZO,...TO,...fO,...Oq,...PF,...gL,...I0,...yL,...nq,...cq,..._0,...j0,...V0,...pq,...wq,...m$];var Pq="0.1.22";function _q(){return Om.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=GT[Da(n)];return{path:n,effect:no(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(_q,"plexusCommandCatalog");import qo from"node:path";function W4(e){let t=st()?.workspaceRoot??process.cwd(),n=qo.resolve(t,e),r=qo.relative(t,n);if(qo.isAbsolute(e)||r===".."||r.startsWith(`..${qo.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(W4,"workspacePath");function H4(e){let{absolute:t,relative:n}=W4(e.path??".");if(e.operation==="list"){if(!Oe(t))return{files:[]};let r=[],i=s(o=>{for(let a of Gi(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=qo.join(o,a.name);if(a.isDirectory()?i(l):r.push(qo.relative(t,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=ke(t);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return gt(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Wt(qo.dirname(t),{recursive:!0}),gt(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Bo(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(H4,"plexusWorkspace");function Nq(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=La[n];if(!o||!Object.hasOwn(La,n))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(zh,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:zh[i.path],skillHash:wu}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return H4(i)},"executePlexusAgentTool")}s(Nq,"createPlexusAgentToolExecutor");var Pm=Nq({inspectCommand:Dq,executeCommand:Fq});function _m(){let e=new zo({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:Pq});e.register(ba.HelpCommand),e.register(ba.VersionCommand);for(let n of Om)e.register(n);async function t(n,r){let i;try{i=e.process(n,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return Q4(i,r.stderr??process.stderr),e.run(i,r)}return s(t,"run"),{process(n,r){return e.process(n,r)},run:t,async runExit(n,r){process.exitCode=await t(n,r)}}}s(_m,"createPlexusCli");function Q4(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&Ca[n]===r&&dt(t,n,r),n in Ca&&no(n)==="confirm"&&!Fa(e)&&t.write(`plexus-cli: \`${Ca[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
10047
10048
|
`)}s(Q4,"noteRetiredPath");function Dq(e){let t=_m().process(ca(e),{executePlexusAgentTool:Pm}),n=t.path.join(" ");if(n.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=_q().find(l=>l.path===n);if(!r){if(n===""||n==="--help"||n==="--version")return{path:n,writes:!1,host:"shared"};throw new Error(`plexus: command ${n} has no host classification.`)}let i=t,o=r.effect==="callKind"?Ef(As(Es),i.fn??"",i.kind):void 0,a=gu(n,{confirm:Fa(t),callKind:o});return{...r,writes:a}}s(Dq,"inspectPlexusCommand");async function Fq(e,t){if(t)return vA(t,()=>Fq(e));if(!Array.isArray(e.argv)||e.argv.length===0||e.argv.length>128||e.argv.some(l=>typeof l!="string"||l.length>128e3)||(e.stdin?.length??0)>1e6)throw new Error("plexus: invalid command invocation.");let n="",r="",i=_m();if(st()){let l=Dq(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(ca(e.argv),{executePlexusAgentTool:Pm,stdin:J4.from(e.stdin===void 0?[]:[e.stdin]),stdout:new Cq({write(l,d,c){n+=String(l),c()}}),stderr:new Cq({write(l,d,c){r+=String(l),c()}})}),stdout:n,stderr:r}}s(Fq,"executePlexusCommand");TA({source:Z4.join(import.meta.dirname,"skill")});_m().runExit(ca(process.argv.slice(2)),{executePlexusAgentTool:Pm});
|
|
10048
10049
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
113348d2e8a831c206d554a9b3e963355b521ed9d61fca5ada597cb32c3b42af
|
|
@@ -77,7 +77,8 @@ plexus-cli --env <env> --tenant <slug> tenant-users invite --first-name <first>
|
|
|
77
77
|
- `--group` takes the key, the id or the exact label; `--unit <key>` (from
|
|
78
78
|
`tenant-users units list`) only together with `--group` — an unknown key is
|
|
79
79
|
refused by the backend. Giving a group needs
|
|
80
|
-
`administration.permissions.manage` as well —
|
|
80
|
+
`administration.permissions.manage` as well — tenant-wide for a group
|
|
81
|
+
without `--unit`, for that unit (or tenant-wide) with it; without it, invite without
|
|
81
82
|
`--group` and let someone who has it assign the group in the app.
|
|
82
83
|
- `--language` (`de` or `en`) is the language of the letters for a **new**
|
|
83
84
|
account; someone who already works at another school keeps their own.
|