カタログJSONの仕様
このページは npm run docs:reference でコードから生成しています。手で編集しないでください。
DBのJSON列はform_schema、route、action、cost_modelです。以下はJSONの形と、コード内の型を示します。CatalogFormFieldはフォーム用の変換結果であり、保存するJSONそのものではありません。
| キー | 型 | 必須か | 例 |
|---|---|---|---|
form_schema.type |
"object" |
必須 | "object" |
form_schema.properties |
object |
必須 | {"name":{"type":"string"}} |
form_schema.required |
string[] |
任意 | ["name"] |
route |
object[] |
必須 | [{"step":1,"approver_kind":"manager"}] |
action.executor |
string |
必須 | "manual" |
action.template |
object |
任意 | {"summary":"Example","op":"manual"} |
action.template.changes |
PlanChange[] |
任意 | [{"op":"create_user","resource":"example","params":{}}] |
cost_model |
object | null |
任意 | {"monthly":100,"currency":"JPY","note":"seat"} |
catalog.ts
Section titled “catalog.ts”| 型とキー | 型 | 必須か | 例(形) |
|---|---|---|---|
CatalogVisibleWhen.field |
string |
必須 | "example" |
CatalogVisibleWhen.op |
VisibleWhenOperator |
必須 | "==" |
CatalogVisibleWhen.value |
number | string | boolean | string[] |
必須 | "example" |
CatalogFieldValidation.pattern |
string |
任意 | "example" |
CatalogFieldValidation.minLength |
number |
任意 | 1 |
CatalogFieldValidation.maxLength |
number |
任意 | 1 |
CatalogFieldValidation.minimum |
number |
任意 | 1 |
CatalogFieldValidation.maximum |
number |
任意 | 1 |
CatalogFormField.key |
string |
必須 | "example" |
CatalogFormField.title |
string |
必須 | "example" |
CatalogFormField.titleI18n |
unknown |
任意 | {} |
CatalogFormField.kind |
CatalogFieldKind |
必須 | "text" |
CatalogFormField.required |
boolean |
必須 | true |
CatalogFormField.options |
string[] |
任意 | [] |
CatalogFormField.currency |
string |
任意 | "example" |
CatalogFormField.text |
string |
任意 | "example" |
CatalogFormField.textI18n |
unknown |
任意 | {} |
CatalogFormField.visibleWhen |
CatalogVisibleWhen |
任意 | {} |
CatalogFormField.validation |
CatalogFieldValidation |
任意 | {} |
JsonSchemaProperty.type |
unknown |
任意 | {} |
JsonSchemaProperty.title |
unknown |
任意 | {} |
JsonSchemaProperty.format |
unknown |
任意 | {} |
JsonSchemaProperty.enum |
unknown |
任意 | {} |
JsonSchemaProperty.items |
unknown |
任意 | {} |
JsonSchemaProperty.pattern |
unknown |
任意 | {} |
JsonSchemaProperty.minLength |
unknown |
任意 | {} |
JsonSchemaProperty.maxLength |
unknown |
任意 | {} |
JsonSchemaProperty.minimum |
unknown |
任意 | {} |
JsonSchemaProperty.maximum |
unknown |
任意 | {} |
JsonSchemaProperty.x-actagate |
unknown |
任意 | {} |
route.ts
Section titled “route.ts”| 型とキー | 型 | 必須か | 例(形) |
|---|---|---|---|
RouteCondition.field |
string |
必須 | "example" |
RouteCondition.op |
RouteConditionOperator |
必須 | "==" |
RouteCondition.value |
number | string | string[] |
必須 | "example" |
RouteEntry.step |
number |
必須 | 1 |
RouteEntry.approverKind |
"manager" | "usergroup" | "user" |
必須 | "manager" |
RouteEntry.ref |
string |
任意 | "example" |
RouteEntry.when |
RouteCondition |
任意 | {} |
RouteEntry.escalateAfterHours |
number |
任意 | 1 |
RouteEntry.escalateTo |
string |
任意 | "example" |
plan.ts
Section titled “plan.ts”| 型とキー | 型 | 必須か | 例(形) |
|---|---|---|---|
PlanChange.runbook |
PlanRunbookStep[] |
任意 | [] |
PlanChange.op |
string |
必須 | "example" |
PlanChange.resource |
string |
必須 | "example" |
PlanChange.params |
Record<string, JsonValue> |
必須 | {} |
PlanChange.summary |
string |
任意 | "example" |
PlanChange.executor |
string |
任意 | "example" |
PlanChange.fallback |
string | null |
任意 | "example" |
PlanChange.manual_group |
string |
任意 | "example" |
PlanChange.manual_instructions |
string | null |
任意 | "example" |
PlanChange.catalog_key |
string |
任意 | "example" |
PlanChange.cost |
PlanCost | null |
任意 | {} |
PlanChange.expires_at |
string | null |
任意 | "example" |
PlanCost.monthly |
number |
必須 | 1 |
PlanCost.currency |
string |
必須 | "example" |
PlanCost.note |
string |
必須 | "example" |
経路のJSONではapprover_kind、escalate_after_hours、escalate_toを使います。無条件の承認段が最低1つ必要です。whenの数値比較はnumber項目、==とinは選択肢のある項目に使います。フォームのvisibleWhenはbooleanも参照できます。
CatalogFieldKind: \| "text" \| "select" \| "number" \| "date" \| "multiselect" \| "boolean" \| "money" \| "user" \| "description" \| "section"
VisibleWhenOperator: ">" \| ">=" \| "<" \| "<=" \| "==" \| "in"
RouteConditionOperator: ">" \| ">=" \| "<" \| "<=" \| "==" \| "in"
保存するフォームJSONでは、textはstring、selectはstringとenum、dateはstringとformat: date、multiselectはarrayとitems.enum、booleanはboolean、numberはnumberで表します。moneyとuserはx-actagate.widgetを指定します。descriptionとsectionはtype: nullで値を持ちません。moneyのcurrencyの既定値はJPYです。title_i18nとtext_i18nはx-actagate内に保存します。
action.templateは省略できます。changesを指定する場合は1件以上必要です。未指定の場合はop、resource、paramsから1件を生成します。paramsの未指定時はフォーム値を使います。action.fallback、action.manual_group、action.runbookは任意です。cost_modelはmonthlyとcurrencyが必要で、noteまたはperを説明に使います。テンプレートのフォーム参照は{{field}}です。