@soimy/dingtalk 3.6.5 → 3.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +2 -0
  2. package/dist/index.js +773 -136
  3. package/dist/index.js.map +4 -4
  4. package/dist/src/card/ask-user-question-context.d.ts +5 -2
  5. package/dist/src/card/ask-user-question-context.d.ts.map +1 -1
  6. package/dist/src/card/ask-user-question-store.d.ts +42 -0
  7. package/dist/src/card/ask-user-question-store.d.ts.map +1 -0
  8. package/dist/src/card/ask-user-question.d.ts +20 -0
  9. package/dist/src/card/ask-user-question.d.ts.map +1 -1
  10. package/dist/src/card/card-action-handler.d.ts +1 -0
  11. package/dist/src/card/card-action-handler.d.ts.map +1 -1
  12. package/dist/src/card/card-template.d.ts +1 -1
  13. package/dist/src/card/task-model-metadata.d.ts +11 -0
  14. package/dist/src/card/task-model-metadata.d.ts.map +1 -0
  15. package/dist/src/gateway/channel-gateway.d.ts.map +1 -1
  16. package/dist/src/inbound-handler.d.ts.map +1 -1
  17. package/dist/src/reply-strategy-card.d.ts.map +1 -1
  18. package/dist/src/reply-strategy-types.d.ts +1 -0
  19. package/dist/src/reply-strategy-types.d.ts.map +1 -1
  20. package/dist/src/session-state.d.ts +11 -5
  21. package/dist/src/session-state.d.ts.map +1 -1
  22. package/dist/src/targeting/agent-routing.d.ts +8 -1
  23. package/dist/src/targeting/agent-routing.d.ts.map +1 -1
  24. package/dist/src/types.d.ts +13 -0
  25. package/dist/src/types.d.ts.map +1 -1
  26. package/docs/assets/dingtalk-ask-user-card-template.json +6 -0
  27. package/package.json +2 -1
  28. package/src/access-control.ts +1 -1
  29. package/src/card/ask-user-question-context.ts +9 -1
  30. package/src/card/ask-user-question-store.ts +294 -0
  31. package/src/card/ask-user-question.ts +380 -34
  32. package/src/card/card-action-handler.ts +2 -0
  33. package/src/card/card-template.ts +1 -1
  34. package/src/card/task-model-metadata.ts +51 -0
  35. package/src/gateway/channel-gateway.ts +19 -0
  36. package/src/inbound-handler.ts +131 -49
  37. package/src/reply-strategy-card.ts +30 -6
  38. package/src/reply-strategy-types.ts +1 -0
  39. package/src/session-state.ts +44 -13
  40. package/src/targeting/agent-routing.ts +67 -19
  41. package/src/types.ts +14 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "editorData": "{\"schemaVersion\":\"3.0.0\",\"schema\":{\"componentsMap\":[{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"Tag\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"Tag\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"Grid\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"Grid\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"CardHeaderV2\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"CardHeaderV2\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"BaseText\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"BaseText\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"SingleButton\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"SingleButton\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"Form\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"Form\"},{\"package\":\"@ali/dxComponent\",\"version\":\"1.0.0\",\"exportName\":\"Card\",\"main\":\"./src/index.tsx\",\"destructuring\":false,\"subName\":\"\",\"componentName\":\"Card\"}],\"componentsTree\":[{\"componentName\":\"Card\",\"id\":\"node_dockcviv8fo1\",\"props\":{\"url\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"linkCondition\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"enableClickEvent\":true,\"transformToEventChain\":true,\"disabledWhileForward\":false,\"enableStatPoint\":false,\"statPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"statPointParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"enableOnAppear\":false,\"autoFoldConfig\":{\"needFold\":false,\"heightLimit\":480,\"foldStatusLocalDataKey\":\"_cardFoldStatusLocalDataKey\"},\"summaryContent\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"enableEngineUpgrade\":false,\"enableExposeStatPoint\":false,\"enableDebugTool\":false,\"enableCustomBorderRadius\":false,\"customBorderRadius\":0,\"paddingLeft\":0,\"paddingRight\":0,\"paddingTop\":6,\"paddingBottom\":6,\"hasCardHeader\":true,\"isLinkToCard\":false,\"actionType\":\"eventChain\",\"actionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"copyType\":\"common\",\"copyValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"actionSheetTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"actionSheetMessage\":{\"type\":\"dynamicString\",\"content\":\"面板描述\",\"i18n\":false},\"actionSheetItems\":[],\"confirmTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"confirmMessage\":{\"type\":\"dynamicString\",\"content\":\"内容\",\"i18n\":false},\"confirmOkText\":{\"type\":\"dynamicString\",\"content\":\"确认\",\"i18n\":false},\"confirmOkAction\":\"request\",\"confirmOkReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmOkReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmOkReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelText\":{\"type\":\"dynamicString\",\"content\":\"取消\",\"i18n\":false},\"confirmCancelAction\":\"none\",\"confirmCancelReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmCancelReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastType\":1,\"toastActionText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastActionUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"customHandler\":\"\",\"customDurboHandler\":\"\",\"enableCustomLocalData\":false,\"localVarAction\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"keyOfDynamicObject\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"booleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"numberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"stringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"customLocalData\":\"{}\",\"openModalTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"openModalHeight\":500,\"openModalWidth\":400,\"events\":[{\"event\":{\"actionType\":\"request\",\"actionId\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${question_id}\"},\"params\":[{\"type\":\"variable\",\"variable\":\"formConfig\",\"value\":\"\",\"name\":\"fromConfig\",\"variableType\":\"global\",\"id\":\"1\"}]},\"callbacks\":{\"success\":{},\"failure\":{}}}],\"apiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"apiParams\":[{\"type\":\"variable\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"apiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectActionType\":\"setLocalState\",\"selectDataKey\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectParams\":[],\"selectOptions\":{\"type\":\"dynamicSelectOptions\",\"valueType\":\"fixed\",\"value\":[],\"variable\":\"\",\"variableType\":\"global\"},\"selectIndex\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fixWidth\":false,\"fixedWidth\":0,\"autoWidth\":false,\"dataSources\":[],\"updateTargetVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"updateTargetValue\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"jsapiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"jsapiParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"jsapiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"videoUrl\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"dynamicEventVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fold\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"commentData\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"commentMode\":\"predefine\",\"commentContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"commentExtraParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"urlType\":\"all\",\"androidUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"pcUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"iosUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"isDtmd\":false,\"copyVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"callAPIName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"callAPIType\":\"jsapi\",\"callAPIParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"isCallAPIParamsVariable\":false,\"callAPIVariableParams\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupCreateResult\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupName\":{\"type\":\"dynamicString\",\"content\":\"群名称\",\"i18n\":false},\"groupTemplateID\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false}},\"fileName\":\"test\",\"dataSource\":{\"list\":[]},\"state\":{},\"lifeCycles\":{},\"methods\":{},\"hidden\":false,\"title\":\"\",\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\",\"children\":[{\"componentName\":\"CardHeaderV2\",\"id\":\"node_ocmr4cahw26\",\"props\":{\"title\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${question_title}\"},\"icon\":{\"value\":\"$iQElAqNwbmcDBgTMkAXMkAbaACGEAaQhK2wZAqqarYgS0sdoKLoFA88AAAGO4hz0WQTNEMkHAAgACbdpbnRlcmFjdGl2ZS1jYXJkLWVkaXRvcg\",\"valueType\":\"fixed\",\"type\":\"dynamicImage\"},\"titleAfterSlot\":{\"type\":\"JSSlot\",\"value\":[{\"componentName\":\"Grid\",\"id\":\"node_ocmr4oe67a7\",\"props\":{\"isAutoHeight\":true,\"height\":100,\"direction\":\"vertical\",\"isAutoWidth\":false,\"width\":50,\"isFixedWidth\":false,\"enableColSpan\":false,\"colSpan\":0,\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"childGravity\":\"rightTop\",\"hasBackground\":false,\"hasHoverBackground\":false,\"hoverBackgroundColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"common_overlay_hover_color\",\"variable\":\"\",\"variableType\":\"global\"},\"hoverText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"hasBorder\":false,\"borderWidth\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":1,\"variable\":\"\",\"variableType\":\"global\"},\"borderColor\":\"#F6F6F6\",\"darkModeBorderColor\":\"#3C3C3C\",\"margin\":0,\"marginLeft\":0,\"marginRight\":0,\"marginTop\":0,\"marginBottom\":0,\"paddingBottom\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":8,\"variable\":\"\",\"variableType\":\"global\"},\"paddingLeft\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":8,\"variable\":\"\",\"variableType\":\"global\"},\"paddingRight\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":8,\"variable\":\"\",\"variableType\":\"global\"},\"paddingTop\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":8,\"variable\":\"\",\"variableType\":\"global\"},\"standardGradientBackground\":\"AIGradient\",\"hasGradientBackground\":false,\"gradientBackgroundType\":\"Standard\",\"backgroundType\":\"Standard\",\"standardBackgroundColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"common_bg_color\",\"variable\":\"\",\"variableType\":\"global\"},\"backgroundGradientStartColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"},\"enableGradientMiddleColor\":false,\"backgroundGradientMiddleColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"},\"backgroundGradientEndColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"},\"backgroundGradientDirection\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"toBottom\",\"variable\":\"\",\"variableType\":\"global\"},\"backgroundColor\":\"#F6F6F6\",\"darkModeBackgroundColor\":\"#3C3C3C\",\"cornerRadius\":4,\"cornerRadiusLeftTop\":4,\"cornerRadiusRightTop\":4,\"cornerRadiusRightBottom\":4,\"cornerRadiusLeftBottom\":4,\"blur\":false,\"isFullHeight\":false,\"exposeStatPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"exposeStatPointParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"bgGradient\":[{\"type\":\"linear\",\"direction\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"toBottom\",\"variable\":\"\",\"variableType\":\"global\"},\"colors\":[{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"},{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"}]}],\"enableDarkBgGradient\":false,\"darkBgGradient\":[{\"type\":\"linear\",\"direction\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"toBottom\",\"variable\":\"\",\"variableType\":\"global\"},\"colors\":[{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"},{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#ffffff\",\"variable\":\"\",\"variableType\":\"global\"}]}],\"actionType\":\"url\",\"statPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"statPointParams\":[],\"disabledWhileForward\":false,\"urlType\":\"all\",\"url\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"androidUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"pcUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"iosUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"isDtmd\":false,\"actionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"copyValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"copyVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"copyType\":\"common\",\"customHandler\":\"\",\"customDurboHandler\":\"\",\"confirmTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"confirmMessage\":{\"type\":\"dynamicString\",\"content\":\"内容\",\"i18n\":false},\"confirmOkText\":{\"type\":\"dynamicString\",\"content\":\"确认\",\"i18n\":false},\"confirmOkAction\":\"request\",\"confirmOkReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmOkReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmOkReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelText\":{\"type\":\"dynamicString\",\"content\":\"取消\",\"i18n\":false},\"confirmCancelAction\":\"none\",\"confirmCancelReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmCancelReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"actionSheetTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"actionSheetMessage\":{\"type\":\"dynamicString\",\"content\":\"面板描述\",\"i18n\":false},\"actionSheetItems\":[],\"toastContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastType\":1,\"toastActionText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastActionUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"localVarAction\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"booleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"numberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"stringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableCustomLocalData\":false,\"customLocalData\":\"{}\",\"keyOfDynamicObject\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"openModalTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"openModalHeight\":500,\"openModalWidth\":400,\"events\":[],\"selectActionType\":\"setLocalState\",\"selectDataKey\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectOptions\":{\"type\":\"dynamicSelectOptions\",\"valueType\":\"fixed\",\"value\":[],\"variable\":\"\",\"variableType\":\"global\"},\"selectParams\":[],\"selectIndex\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fixWidth\":false,\"fixedWidth\":0,\"autoWidth\":false,\"dataSources\":[],\"updateTargetValue\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"updateTargetVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"apiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"apiParams\":[{\"type\":\"variable\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"apiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"jsapiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"jsapiParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"jsapiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"callAPIName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"callAPIType\":\"jsapi\",\"callAPIParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"isCallAPIParamsVariable\":false,\"callAPIVariableParams\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"videoUrl\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"dynamicEventVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fold\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"commentData\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"commentContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"commentMode\":\"predefine\",\"commentExtraParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"groupCreateResult\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupName\":{\"type\":\"dynamicString\",\"content\":\"群名称\",\"i18n\":false},\"groupTemplateID\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableOnAppear\":false,\"onAppear\":{\"actionType\":\"url\",\"statPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"statPointParams\":[],\"disabledWhileForward\":false,\"urlType\":\"all\",\"url\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"androidUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"pcUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"iosUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"isDtmd\":false,\"actionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"copyValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"copyVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"copyType\":\"common\",\"customHandler\":\"\",\"customDurboHandler\":\"\",\"confirmTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"confirmMessage\":{\"type\":\"dynamicString\",\"content\":\"内容\",\"i18n\":false},\"confirmOkText\":{\"type\":\"dynamicString\",\"content\":\"确认\",\"i18n\":false},\"confirmOkAction\":\"request\",\"confirmOkReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmOkReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmOkReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelText\":{\"type\":\"dynamicString\",\"content\":\"取消\",\"i18n\":false},\"confirmCancelAction\":\"none\",\"confirmCancelReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmCancelReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"actionSheetTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"actionSheetMessage\":{\"type\":\"dynamicString\",\"content\":\"面板描述\",\"i18n\":false},\"actionSheetItems\":[],\"toastContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastType\":1,\"toastActionText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastActionUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"localVarAction\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"booleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"numberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"stringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableCustomLocalData\":false,\"customLocalData\":\"{}\",\"keyOfDynamicObject\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"openModalTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"openModalHeight\":500,\"openModalWidth\":400,\"events\":[],\"selectActionType\":\"setLocalState\",\"selectDataKey\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectOptions\":{\"type\":\"dynamicSelectOptions\",\"valueType\":\"fixed\",\"value\":[],\"variable\":\"\",\"variableType\":\"global\"},\"selectParams\":[],\"selectIndex\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fixWidth\":false,\"fixedWidth\":0,\"autoWidth\":false,\"dataSources\":[],\"updateTargetValue\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"updateTargetVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"apiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"apiParams\":[{\"type\":\"variable\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"apiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"jsapiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"jsapiParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"jsapiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"callAPIName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"callAPIType\":\"jsapi\",\"callAPIParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"isCallAPIParamsVariable\":false,\"callAPIVariableParams\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"videoUrl\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"dynamicEventVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fold\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"commentData\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"commentContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"commentMode\":\"predefine\",\"commentExtraParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"groupCreateResult\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupName\":{\"type\":\"dynamicString\",\"content\":\"群名称\",\"i18n\":false},\"groupTemplateID\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false}},\"enableMouseEvent\":false,\"onMouseEnterActionType\":\"setLocalState\",\"onMouseEnterLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"onMouseEnterBooleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"onMouseEnterNumberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"onMouseEnterStringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"onMouseLeaveActionType\":\"setLocalState\",\"onMouseLeaveLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"onMouseLeaveBooleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"onMouseLeaveNumberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"onMouseLeaveStringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableExposeStatPoint\":false,\"enableClickEvent\":false,\"minHeight\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"maxHeight\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"transformToEventChain\":false,\"enableStatPoint\":false,\"innerOffset\":0},\"title\":\"布局容器\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\",\"children\":[{\"componentName\":\"Tag\",\"id\":\"node_ocmr4oe67a8\",\"props\":{\"text\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${form_btn_text}\"},\"color\":{\"type\":\"dynamicSelect\",\"valueType\":\"variable\",\"value\":\"blue\",\"variable\":\"status_color\",\"variableType\":\"global\"},\"tagStyle\":\"hollow\",\"maxWidth\":{\"type\":\"dynamicWidth\",\"valueType\":\"adaptive\",\"value\":100,\"variableType\":\"global\",\"variable\":\"\",\"full\":false,\"adaptive\":true},\"marginLeft\":0,\"marginRight\":0,\"marginTop\":0,\"marginBottom\":0,\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"size\":\"small\",\"margin\":-2,\"innerOffset\":0},\"title\":\"标签\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\"}]}],\"title\":\"标题后内容\",\"id\":\"node_ocmr4oe67a4\"},\"marginLeft\":12,\"marginRight\":12,\"marginTop\":6,\"marginBottom\":6,\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"darkIcon\":{\"value\":\"\",\"valueType\":\"fixed\",\"type\":\"dynamicImage\"},\"color\":{\"type\":\"dynamicSelect\",\"valueType\":\"variable\",\"value\":\"red\",\"variable\":\"status_color\",\"variableType\":\"global\"},\"margin\":-2,\"innerOffset\":0},\"title\":\"卡片头部\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\"},{\"componentName\":\"BaseText\",\"id\":\"node_ocmr4cahw29\",\"props\":{\"text\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${question_desc}\"},\"hoverText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"iconType\":\"iconCode\",\"iconFont\":{\"type\":\"icon\",\"icon\":\"\",\"iconType\":\"ddIcon\"},\"icon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"darkIcon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"widthMode\":\"match_parent\",\"maxWidth\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"fixedWidth\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"marginLeft\":12,\"marginRight\":12,\"marginTop\":6,\"marginBottom\":6,\"fontColorType\":\"Standard\",\"enableHighlight\":false,\"maxLine\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":2,\"variable\":\"\",\"variableType\":\"global\"},\"color\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"common_level1_base_color\",\"variable\":\"\",\"variableType\":\"global\"},\"customLightColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#35404b\",\"variable\":\"\",\"variableType\":\"global\"},\"customDarkColor\":{\"type\":\"dynamicColor\",\"valueType\":\"fixed\",\"value\":\"#f6f6f6\",\"variable\":\"\",\"variableType\":\"global\"},\"gravity\":\"left\",\"fontSizeType\":\"Standard\",\"styleType\":\"standard\",\"styleToken\":\"common_body_text_style\",\"size\":\"middle\",\"customFontSize\":15,\"customFontLineHeight\":22,\"bold\":false,\"italic\":false,\"strikeThrough\":false,\"lineHeight\":\"normal\",\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"autoMaxWidth\":false,\"enableIcon\":false,\"margin\":-2,\"innerOffset\":0},\"title\":\"基础文本\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\"},{\"componentName\":\"Form\",\"id\":\"node_ocmr4cahw21\",\"props\":{\"id\":\"form\",\"formSchema\":{\"variable\":\"form\",\"variableType\":\"global\",\"type\":\"variableValue\"},\"inlineMode\":true,\"submitText\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"提交\"},\"customSubmitEvent\":true,\"status\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"normal\",\"variable\":\"\",\"variableType\":\"global\"},\"actionType\":\"request\",\"params\":[],\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"condition\",\"condition\":{\"op\":\"and\",\"conditions\":[{\"value\":\"\",\"op\":\"isTrue\",\"variable\":\"is_pending\",\"variableType\":\"global\",\"type\":\"variable\",\"valueType\":\"fixed\",\"valueVariableType\":\"global\"}]}},\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"marginLeft\":12,\"marginRight\":12,\"marginTop\":6,\"marginBottom\":6,\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"margin\":-2,\"innerOffset\":0},\"title\":\"表单\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\",\"children\":[{\"componentName\":\"SingleButton\",\"id\":\"node_ocmr4pivut1\",\"props\":{\"text\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"确定\"},\"status\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"normal\",\"variable\":\"\",\"variableType\":\"global\"},\"color\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"blue\",\"variable\":\"\",\"variableType\":\"global\"},\"icon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"darkModeIcon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"enableIcon\":false,\"iconPosition\":\"left\",\"iconType\":\"iconCode\",\"iconFont\":{\"type\":\"dynamicIcon\",\"valueType\":\"fixed\",\"value\":{\"type\":\"icon\",\"icon\":\"\",\"iconType\":\"ddIcon\"},\"variable\":\"\",\"variableType\":\"global\"},\"enableCornerMark\":false,\"cornerMarkPosition\":\"right\",\"cornerMarkText\":{\"type\":\"dynamicString\",\"content\":\"按钮角标文案\",\"i18n\":false},\"cornerMarkTextColor\":\"white\",\"cornerBackgroundColorType\":\"standard\",\"standardCornerBackgroundColor\":\"RedGradient\",\"customCornerBackgroundColor\":\"#FF6A00\",\"customCornerDarkModeBackgroundColor\":\"#FF6A00\",\"actionType\":\"eventChain\",\"statPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"statPointParams\":[],\"disabledWhileForward\":false,\"urlType\":\"all\",\"url\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"androidUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"pcUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"iosUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"isDtmd\":false,\"actionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"copyValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"copyVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"copyType\":\"common\",\"customHandler\":\"\",\"customDurboHandler\":\"\",\"confirmTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"confirmMessage\":{\"type\":\"dynamicString\",\"content\":\"内容\",\"i18n\":false},\"confirmOkText\":{\"type\":\"dynamicString\",\"content\":\"确认\",\"i18n\":false},\"confirmOkAction\":\"request\",\"confirmOkReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmOkReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmOkReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelText\":{\"type\":\"dynamicString\",\"content\":\"取消\",\"i18n\":false},\"confirmCancelAction\":\"none\",\"confirmCancelReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmCancelReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"actionSheetTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"actionSheetMessage\":{\"type\":\"dynamicString\",\"content\":\"面板描述\",\"i18n\":false},\"actionSheetItems\":[],\"toastContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastType\":1,\"toastActionText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastActionUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"localVarAction\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"booleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"numberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"stringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableCustomLocalData\":false,\"customLocalData\":\"{}\",\"keyOfDynamicObject\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"openModalTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"openModalHeight\":500,\"openModalWidth\":400,\"events\":[{\"event\":{\"actionType\":\"request\",\"actionId\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${question_id}\"},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"form_update\",\"name\":\"form\",\"variableType\":\"global\",\"id\":\"1\"}]},\"callbacks\":{\"success\":{},\"failure\":{}}}],\"selectActionType\":\"setLocalState\",\"selectDataKey\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectOptions\":{\"type\":\"dynamicSelectOptions\",\"valueType\":\"fixed\",\"value\":[],\"variable\":\"\",\"variableType\":\"global\"},\"selectParams\":[],\"selectIndex\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fixWidth\":false,\"fixedWidth\":0,\"autoWidth\":false,\"dataSources\":[],\"updateTargetValue\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"updateTargetVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"apiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"apiParams\":[{\"type\":\"variable\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"apiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"jsapiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"jsapiParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"jsapiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"callAPIName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"callAPIType\":\"jsapi\",\"callAPIParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"isCallAPIParamsVariable\":false,\"callAPIVariableParams\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"videoUrl\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"dynamicEventVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fold\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"commentData\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"commentContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"commentMode\":\"predefine\",\"commentExtraParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"groupCreateResult\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupName\":{\"type\":\"dynamicString\",\"content\":\"群名称\",\"i18n\":false},\"groupTemplateID\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableClickEvent\":true,\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"condition\",\"condition\":{\"op\":\"and\",\"conditions\":[{\"value\":\"\",\"op\":\"isTrue\",\"variable\":\"is_pending\",\"variableType\":\"global\",\"type\":\"variable\",\"valueType\":\"fixed\",\"valueVariableType\":\"global\"}]}},\"widthMode\":\"match_parent\",\"width\":200,\"margin\":-1,\"marginLeft\":12,\"marginRight\":12,\"marginTop\":6,\"marginBottom\":6,\"cornerMarkVisible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"enablePadButtonText\":false,\"transformToEventChain\":true,\"enableStatPoint\":false,\"innerOffset\":0},\"title\":\"单个按钮\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\"},{\"componentName\":\"SingleButton\",\"id\":\"node_ocmr4pivut2\",\"props\":{\"text\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"取消\"},\"status\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"normal\",\"variable\":\"\",\"variableType\":\"global\"},\"color\":{\"type\":\"dynamicSelect\",\"valueType\":\"fixed\",\"value\":\"red\",\"variable\":\"\",\"variableType\":\"global\"},\"icon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"darkModeIcon\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"enableIcon\":false,\"iconPosition\":\"left\",\"iconType\":\"iconCode\",\"iconFont\":{\"type\":\"dynamicIcon\",\"valueType\":\"fixed\",\"value\":{\"type\":\"icon\",\"icon\":\"\",\"iconType\":\"ddIcon\"},\"variable\":\"\",\"variableType\":\"global\"},\"enableCornerMark\":false,\"cornerMarkPosition\":\"right\",\"cornerMarkText\":{\"type\":\"dynamicString\",\"content\":\"按钮角标文案\",\"i18n\":false},\"cornerMarkTextColor\":\"white\",\"cornerBackgroundColorType\":\"standard\",\"standardCornerBackgroundColor\":\"RedGradient\",\"customCornerBackgroundColor\":\"#FF6A00\",\"customCornerDarkModeBackgroundColor\":\"#FF6A00\",\"actionType\":\"request\",\"statPoint\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"statPointParams\":[],\"disabledWhileForward\":false,\"urlType\":\"all\",\"url\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"androidUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"pcUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"iosUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"isDtmd\":false,\"actionId\":{\"i18n\":false,\"type\":\"dynamicString\",\"content\":\"${question_id}\"},\"params\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"true\",\"name\":\"user_cancel\",\"variableType\":\"global\",\"id\":\"1\"}],\"successToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"failureToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"successCondition\":{\"op\":\"and\",\"conditions\":[]},\"copyValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"copyVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"copyType\":\"common\",\"customHandler\":\"\",\"customDurboHandler\":\"\",\"confirmTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"confirmMessage\":{\"type\":\"dynamicString\",\"content\":\"内容\",\"i18n\":false},\"confirmOkText\":{\"type\":\"dynamicString\",\"content\":\"确认\",\"i18n\":false},\"confirmOkAction\":\"request\",\"confirmOkReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmOkReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmOkReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelText\":{\"type\":\"dynamicString\",\"content\":\"取消\",\"i18n\":false},\"confirmCancelAction\":\"none\",\"confirmCancelReqActionActionId\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"confirmCancelReqActionParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"confirmCancelReqActionToast\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"actionSheetTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"actionSheetMessage\":{\"type\":\"dynamicString\",\"content\":\"面板描述\",\"i18n\":false},\"actionSheetItems\":[],\"toastContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastType\":1,\"toastActionText\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"toastActionUrl\":{\"type\":\"dynamicLink\",\"value\":\"\",\"valueType\":\"fixed\",\"variable\":\"\",\"variableType\":\"global\"},\"localVarAction\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"booleanLocalValue\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"numberLocalValue\":{\"type\":\"dynamicNumber\",\"valueType\":\"fixed\",\"value\":0,\"variable\":\"\",\"variableType\":\"global\"},\"stringLocalValue\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableCustomLocalData\":false,\"customLocalData\":\"{}\",\"keyOfDynamicObject\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"openModalTitle\":{\"type\":\"dynamicString\",\"content\":\"标题\",\"i18n\":false},\"openModalHeight\":500,\"openModalWidth\":400,\"events\":[],\"selectActionType\":\"setLocalState\",\"selectDataKey\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"selectOptions\":{\"type\":\"dynamicSelectOptions\",\"valueType\":\"fixed\",\"value\":[],\"variable\":\"\",\"variableType\":\"global\"},\"selectParams\":[],\"selectIndex\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fixWidth\":false,\"fixedWidth\":0,\"autoWidth\":false,\"dataSources\":[],\"updateTargetValue\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"updateTargetVariable\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"apiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"apiParams\":[{\"type\":\"variable\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"apiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"jsapiName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"jsapiParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"jsapiRetLocalVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"callAPIName\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"callAPIType\":\"jsapi\",\"callAPIParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"isCallAPIParamsVariable\":false,\"callAPIVariableParams\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"videoUrl\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"dynamicEventVar\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"fold\":{\"type\":\"dynamicBoolean\",\"valueType\":\"fixed\",\"value\":false,\"variable\":\"\",\"variableType\":\"global\"},\"commentData\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"commentContent\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"commentMode\":\"predefine\",\"commentExtraParams\":[{\"type\":\"fixed\",\"variable\":\"\",\"value\":\"\",\"name\":\"\",\"variableType\":\"global\",\"id\":\"1\"}],\"groupCreateResult\":{\"type\":\"variableValue\",\"variableType\":\"global\",\"variable\":\"\"},\"groupName\":{\"type\":\"dynamicString\",\"content\":\"群名称\",\"i18n\":false},\"groupTemplateID\":{\"type\":\"dynamicString\",\"content\":\"\",\"i18n\":false},\"enableClickEvent\":true,\"visible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"condition\",\"condition\":{\"op\":\"and\",\"conditions\":[{\"value\":\"\",\"op\":\"isTrue\",\"variable\":\"is_pending\",\"variableType\":\"global\",\"type\":\"variable\",\"valueType\":\"fixed\",\"valueVariableType\":\"global\"}]}},\"widthMode\":\"match_parent\",\"width\":200,\"margin\":-1,\"marginLeft\":12,\"marginRight\":12,\"marginTop\":6,\"marginBottom\":6,\"cornerMarkVisible\":{\"type\":\"dynamicVisible\",\"value\":true,\"valueType\":\"fixed\",\"condition\":{\"op\":\"and\",\"conditions\":[]}},\"enablePadButtonText\":false,\"transformToEventChain\":false,\"enableStatPoint\":false,\"innerOffset\":0},\"title\":\"单个按钮\",\"hidden\":false,\"isLocked\":false,\"condition\":true,\"conditionGroup\":\"\"}]}]}],\"i18n\":{},\"version\":\"1.0.0\"},\"mockData\":{\"cardData\":{\"form\":{\"fields\":[{\"name\":\"system_params_1\",\"type\":\"TEXT\",\"hidden\":true,\"defaultValue\":\"asdf\"},{\"name\":\"text_readonly\",\"label\":\"只读文本\",\"type\":\"TEXT\",\"readOnly\":true,\"defaultValue\":\"只读文本\"},{\"name\":\"text\",\"label\":\"必填文本输入\",\"type\":\"TEXT\",\"required\":true,\"placeholder\":\"请输入文本\",\"requiredMsg\":\"自定义必填错误提示\",\"defaultValue\":\"文本默认值\"},{\"name\":\"textarea\",\"label\":\"多行文本\",\"type\":\"TEXT_AREA\",\"required\":true,\"placeholder\":\"请输入多行文本\",\"defaultValue\":\"多行文本默认值\"},{\"name\":\"date\",\"label\":\"必填日期选择\",\"type\":\"DATE\",\"required\":true,\"placeholder\":\"请选择日期\",\"defaultValue\":\"2024-05-27\"},{\"defaultValue\":[\"中餐\",\"日料\",\"火锅\"],\"name\":\"text_array\",\"label\":\"聚餐类型\",\"type\":\"TEXT_ARRAY\",\"required\":true},{\"name\":\"checkbox_group\",\"label\":\"单选列表\",\"type\":\"CHECKBOX_GROUP\",\"required\":true,\"defaultValue\":\"1\",\"options\":[{\"value\":\"1\",\"text\":\"选项1\"},{\"value\":\"2\",\"text\":\"选项2\"},{\"value\":\"3\",\"text\":\"选项3\"}]},{\"name\":\"multi_checkbox_group\",\"label\":\"多选列表\",\"type\":\"MULTI_CHECKBOX_GROUP\",\"required\":true,\"defaultValue\":[\"1\",\"2\"],\"options\":[{\"value\":\"1\",\"text\":\"选项1\"},{\"value\":\"2\",\"text\":\"选项2\"},{\"value\":\"3\",\"text\":\"选项3\"}]},{\"name\":\"select\",\"label\":\"下拉单选\",\"type\":\"SELECT\",\"required\":true,\"placeholder\":\"单选请选择\",\"defaultValue\":{\"index\":1,\"value\":\"2\"},\"options\":[{\"value\":\"1\",\"text\":\"选项1\"},{\"value\":\"2\",\"text\":\"选项2\"},{\"value\":\"3\",\"text\":\"选项3\"}]},{\"name\":\"multi_select\",\"label\":\"下拉多选\",\"type\":\"MULTI_SELECT\",\"required\":true,\"placeholder\":\"多选请选择\",\"defaultValue\":{\"index\":[1,2],\"value\":[\"2\",\"3\"]},\"options\":[{\"value\":\"1\",\"text\":\"选项1\"},{\"value\":\"2\",\"text\":\"选项2\"},{\"value\":\"3\",\"text\":\"选项3\"}]},{\"name\":\"checkbox\",\"label\":\"独立的复选框\",\"type\":\"CHECKBOX\"},{\"name\":\"switch\",\"label\":\"开关\",\"type\":\"SWITCH\"}]},\"question_id\":\"q_single_001\",\"question_title\":\"问题已失效\",\"question_desc\":\"该问题已失效,请以最新卡片为准。\",\"card_status\":\"\",\"form_btn_text\":\"已失效\",\"formConfig\":{\"fields\":[{\"name\":\"answer\",\"label\":\"实例列表\",\"type\":\"CHECKBOX_GROUP\",\"required\":true,\"readOnly\":true,\"options\":[{\"value\":\"400291952729\",\"text\":\"mysql_to_odps_挂着\"},{\"value\":\"400291928487\",\"text\":\"mysql_to_odps_1106_copy\"},{\"value\":\"400291853741\",\"text\":\"mysql_odps\"}]}]}},\"cardPrivateData\":{},\"localData\":{},\"richTextData\":{}},\"renderContext\":{\"regenerateEnabled\":\"1\",\"regenerateIndex\":\"2\",\"regenerateTotal\":\"5\"},\"editVersion\":0,\"customWidgetInfo\":\"\",\"useCustomWidgetInfo\":false,\"variableList\":[{\"name\":\"form\",\"private\":false,\"type\":\"form\",\"id\":\"form\",\"description\":\"表单配置\",\"editorVarType\":\"variables\",\"disabled\":false,\"schema\":[{\"id\":\"form.fields\",\"type\":\"loopArray\",\"name\":\"fields\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"\",\"schema\":[{\"id\":\"form.fields[0].name\",\"type\":\"string\",\"name\":\"name\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项的唯一 key\"},{\"id\":\"form.fields[0].label\",\"type\":\"string\",\"name\":\"label\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项的标题\"},{\"id\":\"form.fields[0].type\",\"type\":\"string\",\"name\":\"type\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项的类型,支持有 TEXT, TEXT_AREA, TEXT_ARRAY, NUMBER, SWITCH, SELECT, MULTI_SELECT, DATE, TIME, DATETIME, CHECKBOX, CHECKBOX_GROUP, MULTI_CHECKBOX_GROUP\"},{\"id\":\"form.fields[0].hidden\",\"type\":\"boolean\",\"name\":\"hidden\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项是否隐藏\"},{\"id\":\"form.fields[0].required\",\"type\":\"boolean\",\"name\":\"required\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项是否必填\"},{\"id\":\"form.fields[0].requiredMsg\",\"type\":\"string\",\"name\":\"requiredMsg\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项必填提示文案\"},{\"id\":\"form.fields[0].readOnly\",\"type\":\"boolean\",\"name\":\"readOnly\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项是否只读\"},{\"id\":\"form.fields[0].placeholder\",\"type\":\"string\",\"name\":\"placeholder\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项为空时候的文案提示\"},{\"id\":\"form.fields[0].defaultValue\",\"type\":\"string\",\"name\":\"defaultValue\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"表单项默认值,可以是字符串、数字、布尔值、对象类型\"},{\"id\":\"form.fields[0].options\",\"type\":\"loopArray\",\"name\":\"options\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"\",\"schema\":[{\"id\":\"form.fields[0].options[0].value\",\"type\":\"string\",\"name\":\"value\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"选项实际值\"},{\"id\":\"form.fields[0].options[0].text\",\"type\":\"string\",\"name\":\"text\",\"private\":false,\"editorVarType\":\"variables\",\"disabled\":true,\"description\":\"选项显示值\"}]}]}]},{\"name\":\"question_id\",\"private\":false,\"type\":\"string\",\"id\":\"question_id\",\"description\":\"回调id\",\"editorVarType\":\"variables\"},{\"name\":\"question_title\",\"private\":false,\"type\":\"string\",\"id\":\"question_title\",\"description\":\"提问标题\",\"editorVarType\":\"variables\"},{\"name\":\"question_desc\",\"private\":false,\"type\":\"string\",\"id\":\"question_desc\",\"description\":\"问题描述\",\"editorVarType\":\"variables\"},{\"name\":\"form_btn_text\",\"private\":false,\"type\":\"string\",\"id\":\"form_btn_text\",\"description\":\"表单提交按钮值\",\"editorVarType\":\"variables\"},{\"name\":\"card_status\",\"private\":false,\"type\":\"string\",\"id\":\"card_status\",\"description\":\"当前卡片状态 \\\"pending | processing | submitted | cancelled | expired\\\"\",\"editorVarType\":\"variables\"}],\"formList\":[],\"customContextList\":[],\"expList\":[{\"private\":false,\"type\":\"string\",\"id\":\"status_color\",\"name\":\"status_color\",\"expContent\":\"card_status == 'pending' ? 'blue' :\\n(card_status == 'processing' ? 'purple' :\\n(card_status == 'submitted' ? 'green' :\\n(card_status == 'cancelled' ? 'orange' :\\n(card_status == 'expired' ? 'red' : 'water'))))\",\"editorVarType\":\"expList\",\"description\":\"头部状态值\"},{\"private\":false,\"type\":\"boolean\",\"id\":\"is_pending\",\"name\":\"is_pending\",\"expContent\":\"card_status == 'pending'\",\"editorVarType\":\"expList\"},{\"private\":false,\"type\":\"boolean\",\"id\":\"is_processing\",\"name\":\"is_processing\",\"expContent\":\"card_status == 'processing'\",\"editorVarType\":\"expList\"},{\"private\":false,\"type\":\"boolean\",\"id\":\"is_submitted\",\"name\":\"is_submitted\",\"expContent\":\"card_status == 'submitted'\",\"editorVarType\":\"expList\"},{\"private\":false,\"type\":\"boolean\",\"id\":\"is_cancelled\",\"name\":\"is_cancelled\",\"expContent\":\"card_status == 'cancelled'\",\"editorVarType\":\"expList\"},{\"private\":false,\"type\":\"boolean\",\"id\":\"is_expired\",\"name\":\"is_expired\",\"expContent\":\"card_status == 'expired'\",\"editorVarType\":\"expList\"}],\"localList\":[],\"hsfList\":[],\"lwpList\":[],\"pageData\":{},\"extension\":{\"extendType\":\"NORMAL\",\"fileTypeList\":[{\"fileName\":\"event_chain\",\"fileSource\":\"{\\\"card_node_dockcviv8fo1\\\":{\\\"main\\\":{\\\"type\\\":\\\"dtSendOutData\\\",\\\"params\\\":{\\\"actionType\\\":\\\"0\\\",\\\"cardInstanceId\\\":\\\"@data{data.cardInstanceId}\\\",\\\"actionId\\\":\\\"@toStr{@data{data.cardData.question_id}}\\\",\\\"dataKey\\\":\\\"main\\\",\\\"actionData\\\":{\\\"context\\\":\\\"@dtMapAppend{@data{data.renderContext},'platform','im','platformBizId',@data{data.renderContext.mid}}\\\",\\\"cardPrivateData\\\":{\\\"params\\\":{\\\"fromConfig\\\":\\\"''\\\"},\\\"actionIds\\\":[\\\"@toStr{@data{data.cardData.question_id}}\\\"]}},\\\"dd_ctx_data\\\":true},\\\"callback\\\":{}}}}\",\"fileType\":\"json\"}]}}",
3
+ "widgetInfo": "<LinearLayout\n width=\"@data{width}\"\n height=\"match_content\"\n userId=\"node_dockcviv8fo1\"\n orientation=\"vertical\"\n cornerRadius=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@concat{@dtDesignTokenParser{&#039;common_border_radius_xl&#039;, &#039;12&#039;},&#039;np&#039;},&#039;6np&#039;}\"\n backgroundColor=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{&#039;common_fg_z10_color&#039;},@dtDarkModeAdapter{&#039;#FFFFFF&#039;, &#039;#1E1E1E&#039;}}\"\n paddingBottom=\"6np\"\n onTap=\"@dtUtStat{@dtMapAppend{null,&#039;gmKey&#039;,logTrack_autolog,&#039;goKey&#039;,@dtMapAppend{null,&#039;currentLoggedUserId&#039;,@triple{@data{data.renderContext.currentLoggedUserId},@data{data.renderContext.currentLoggedUserId},&#039;&#039;},&#039;logTrack_key&#039;,logTrack_autolog,&#039;logTrack_text&#039;,@triple{@substr{@toStr{&#039;&#039;},0,20},@substr{@toStr{&#039;&#039;},0,20},&#039;&#039;},&#039;logTrack_componentType&#039;,Card,&#039;logTrack_nodeId&#039;,node_dockcviv8fo1,&#039;logTrack_templateId&#039;,c2a6355b-9724-4f7e-9653-d33fcb3311bb.schema,&#039;logTrack_cardJson&#039;,@triple{@toStr{@data{data.cardData.logTrack_cardJson}},@toStr{@data{data.cardData.logTrack_cardJson}},&#039;&#039;},&#039;logTrack_itemJson&#039;,@triple{@toStr{@subdata{logTrack_itemJson}},@toStr{@subdata{logTrack_itemJson}},&#039;&#039;}}}},@dxEventHandler{&#039;card_node_dockcviv8fo1&#039;}\">\n <LinearLayout\n orientation=\"horizontal\"\n childGravity=\"leftCenter\"\n marginLeft=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;0np&#039;,&#039;12np&#039;}\"\n marginRight=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;0np&#039;,&#039;12np&#039;}\"\n marginTop=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;0np&#039;,&#039;12np&#039;}\"\n marginBottom=\"6np\"\n backgroundColor=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{@concat{&#039;common_&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},&#039;3_color&#039;}, @dtDesignTokenParser{&#039;common_blue3_color&#039;}},&#039;#00000000&#039;}\"\n paddingTop=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;12np&#039;,&#039;0np&#039;}\"\n paddingRight=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;12np&#039;,&#039;0np&#039;}\"\n paddingBottom=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;12np&#039;,&#039;0np&#039;}\"\n paddingLeft=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;12np&#039;,&#039;0np&#039;}\"\n userId=\"node_ocmr4cahw26\">\n <ImageView\n imageUrl=\"@dtDarkModeAdapter{@concat{&#039;$iQElAqNwbmcDBgTMkAXMkAbaACGEAaQhK2wZAqqarYgS0sdoKLoFA88AAAGO4hz0WQTNEMkHAAgACbdpbnRlcmFjdGl2ZS1jYXJkLWVkaXRvcg&#039;, &#039;&#039;},@triple{&#039;&#039;,&#039;&#039;,@concat{&#039;$iQElAqNwbmcDBgTMkAXMkAbaACGEAaQhK2wZAqqarYgS0sdoKLoFA88AAAGO4hz0WQTNEMkHAAgACbdpbnRlcmFjdGl2ZS1jYXJkLWVkaXRvcg&#039;, &#039;&#039;}}}\"\n visibility=\"@triple{@or{@not{@concat{&#039;$iQElAqNwbmcDBgTMkAXMkAbaACGEAaQhK2wZAqqarYgS0sdoKLoFA88AAAGO4hz0WQTNEMkHAAgACbdpbnRlcmFjdGl2ZS1jYXJkLWVkaXRvcg&#039;, &#039;&#039;}},@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;}},&#039;gone&#039;,&#039;visible&#039;}\"\n width=\"16np\"\n height=\"16np\"\n marginRight=\"8np\"\n gravity=\"leftCenter\">\n\n </ImageView>\n <FastTextView\n text=\"@toStr{@data{data.cardData.question_title}}\"\n lineBreakMode=\"end\"\n width=\"match_content\"\n maxLines=\"2\"\n textColor=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{@concat{&#039;common_&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},&#039;1_color&#039;}, @dtDesignTokenParser{&#039;common_blue1_color&#039;}},@dtDarkModeAdapter{&#039;#171A1D&#039;, &#039;#EEF2F8&#039;}}\"\n lineHeight=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;22np&#039;,&#039;18np&#039;}\"\n isBold=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;true&#039;,&#039;false&#039;}\"\n textSize=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{@concat{&#039;common_subhead_text_style&#039;,__font_size}},&#039;15np&#039;}\">\n\n </FastTextView>\n <LinearLayout\n orientation=\"horizontal\"\n marginLeft=\"6np\"\n width=\"match_content\"\n weight=\"1\">\n <LinearLayout\n width=\"match_parent\"\n height=\"match_content\"\n orientation=\"vertical\"\n userId=\"node_ocmr4oe67a4\">\n <LinearLayout\n width=\"match_parent\"\n height=\"match_content\"\n orientation=\"vertical\"\n userId=\"node_ocmr4oe67a7\"\n childGravity=\"rightTop\">\n <LinearLayout\n orientation=\"horizontal\"\n width=\"match_content\"\n height=\"match_content\"\n paddingTop=\"2np\"\n paddingBottom=\"2np\"\n backgroundColor=\"#00000000\"\n paddingLeft=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;6np&#039;,&#039;4np&#039;}\"\n paddingRight=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;6np&#039;,&#039;4np&#039;}\"\n cornerRadius=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},&#039;10np&#039;,&#039;4np&#039;}\"\n borderWidth=\"1np\"\n borderColor=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{@concat{&#039;common_&#039;,@triple{@equal{@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},black},line_hard_color,@concat{@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},&#039;3_color&#039;}}}},@dict_get{@dtMapAppend{null,&#039;black&#039;,@dtDarkModeAdapter{&#039;#3D171A1D&#039;,&#039;#3DEEF2F8&#039;},&#039;gray&#039;,&#039;#3D7E868E&#039;,&#039;red&#039;,&#039;#7AFF5219&#039;,&#039;orange&#039;,&#039;#7AFF9200&#039;,&#039;green&#039;,&#039;#7A00B042&#039;,&#039;blue&#039;,&#039;#7A007FFF&#039;},@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}}}}\"\n userId=\"node_ocmr4oe67a8\">\n <FastTextView\n lineBreakMode=\"end\"\n width=\"match_content\"\n height=\"match_content\"\n text=\"@toStr{@data{data.cardData.form_btn_text}}\"\n maxLines=\"1\"\n textColor=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{@concat{&#039;common_&#039;,@triple{@equal{@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},black},level1_base_color,@concat{@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}},&#039;1_color&#039;}}}},@dict_get{@dtMapAppend{null,&#039;black&#039;,@dtDarkModeAdapter{&#039;#171A1D&#039;,&#039;#EEF2F8&#039;},&#039;gray&#039;,@dtDarkModeAdapter{&#039;#66171A1D&#039;,&#039;#66EEF2F8&#039;},&#039;red&#039;,&#039;#FF5219&#039;,&#039;orange&#039;,&#039;#FF9200&#039;,&#039;green&#039;,&#039;#00B042&#039;,&#039;blue&#039;,&#039;#007FFF&#039;},@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;},&#039;blue&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;processing&#039;},&#039;purple&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;submitted&#039;},&#039;green&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;cancelled&#039;},&#039;orange&#039;,@triple{@equal{@data{data.cardData.card_status},&#039;expired&#039;},&#039;red&#039;,&#039;water&#039;}}}}}}}\"\n textSize=\"@triple{@equal{@data{data.renderContext.isVersion8Style},&#039;1&#039;},@dtDesignTokenParser{&#039;common_footnote_text_style__font_size&#039;, &#039;12np&#039;},&#039;12np&#039;}\"\n lineHeight=\"14np\">\n\n </FastTextView>\n\n </LinearLayout>\n\n </LinearLayout>\n\n </LinearLayout>\n\n </LinearLayout>\n\n </LinearLayout>\n <LinearLayout\n marginLeft=\"12np\"\n marginBottom=\"6np\"\n marginTop=\"6np\"\n marginRight=\"12np\"\n width=\"match_parent\"\n height=\"match_content\"\n orientation=\"horizontal\"\n childGravity=\"leftTop\"\n userId=\"node_ocmr4cahw29\">\n <FastTextView\n text=\"@toStr{@data{data.cardData.question_desc}}\"\n width=\"@triple{@greater{@toLong{&#039;0&#039;},0},&#039;0np&#039;,match_content}\"\n height=\"match_content\"\n lineBreakMode=\"end\"\n textGravity=\"left\"\n maxLines=\"2\"\n textSize=\"@triple{@dtParserAvailable{&#039;dtDesignTokenParser&#039;},@concat{@toStr{@dtDesignTokenParser{&#039;common_body_text_style__font_size&#039;, &#039;15&#039;}},&#039;np&#039;},14np}\"\n lineHeight=\"@triple{@dtParserAvailable{&#039;dtDesignTokenParser&#039;},@concat{@toStr{@mul{@dtDesignTokenParser{&#039;common_body_text_style__line_height&#039;, &#039;1.5&#039;},@dtDesignTokenParser{&#039;common_body_text_style__font_size&#039;, &#039;15&#039;}}},&#039;np&#039;},21np}\"\n isBold=\"@triple{@equal{@toLong{@triple{@dtParserAvailable{&#039;dtDesignTokenParser&#039;},@dtDesignTokenParser{&#039;common_body_text_style__bold&#039;},@toLong{0}}},@toLong{1}},true,false}\"\n isItalic=\"false\"\n isStrikeThrough=\"false\"\n textColor=\"@triple{@triple{@dtParserAvailable{&#039;dtDesignTokenParser&#039;},@dtDesignTokenParser{&#039;common_level1_base_color&#039;},@dtDarkModeAdapter{&#039;#181C1F&#039;,&#039;#EEF1F5&#039;}},@triple{@dtParserAvailable{&#039;dtDesignTokenParser&#039;},@dtDesignTokenParser{&#039;common_level1_base_color&#039;},@dtDarkModeAdapter{&#039;#181C1F&#039;,&#039;#EEF1F5&#039;}},@dtDarkModeAdapter{&#039;#181C1F&#039;,&#039;#EEF1F5&#039;}}\"\n weight=\"@triple{@equal{@triple{@greater{@toLong{&#039;0&#039;},0},&#039;0np&#039;,match_content},match_content},&#039;1&#039;,&#039;&#039;}\">\n\n </FastTextView>\n\n </LinearLayout>\n <LinearLayout\n width=\"match_parent\"\n height=\"match_content\"\n marginTop=\"12np\"\n marginLeft=\"12np\"\n marginRight=\"12np\"\n marginBottom=\"12np\"\n userId=\"node_ocmr4cahw21\"\n visibility=\"@triple{@equal{@data{data.cardData.card_status},&#039;pending&#039;}, &#039;visible&#039;, &#039;gone&#039;}\">\n <FastTextView\n width=\"match_parent\"\n height=\"match_content\"\n text=\"当前客户端环境不支持表单组件\"\n textGravity=\"center\"\n textSize=\"14np\"\n textColor=\"@dtDarkModeAdapter{&#039;#66171A1D&#039;,&#039;#7affffff&#039;}\">\n\n </FastTextView>\n\n </LinearLayout>\n\n</LinearLayout>\n",
4
+ "type": "im",
5
+ "mode": "card"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soimy/dingtalk",
3
- "version": "3.6.5",
3
+ "version": "3.6.7",
4
4
  "description": "DingTalk (钉钉) channel plugin for OpenClaw",
5
5
  "keywords": [
6
6
  "bot",
@@ -25,6 +25,7 @@
25
25
  "dist/**/*.d.ts.map",
26
26
  "index.ts",
27
27
  "src/**/*.ts",
28
+ "docs/assets/dingtalk-ask-user-card-template.json",
28
29
  "openclaw.plugin.json",
29
30
  "README.md",
30
31
  "LICENSE"
@@ -32,7 +32,7 @@ export function isSenderAllowed(params: {
32
32
  }): boolean {
33
33
  const { allow, senderId } = params;
34
34
  if (!allow.hasEntries) {
35
- return true;
35
+ return false;
36
36
  }
37
37
  if (allow.hasWildcard) {
38
38
  return true;
@@ -4,6 +4,8 @@ import type {
4
4
  DingTalkInboundMessage,
5
5
  HandleDingTalkMessageParams,
6
6
  Logger,
7
+ ResolvedDingTalkRoute,
8
+ SubAgentOptions,
7
9
  } from "../types";
8
10
 
9
11
  export type DingTalkQuestionContext = {
@@ -13,8 +15,14 @@ export type DingTalkQuestionContext = {
13
15
  sessionWebhook: string;
14
16
  log?: Logger;
15
17
  dingtalkConfig: DingTalkConfig;
18
+ storePath?: string;
16
19
  questionScopeKey?: string;
17
- onQuestionCardSent?: (event: { questionId: string; outTrackId: string }) => void | Promise<void>;
20
+ resolvedRoute?: ResolvedDingTalkRoute;
21
+ continuationSubAgentOptions?: Omit<SubAgentOptions, "commandText">;
22
+ onQuestionCardSent?: (event: {
23
+ questionId: string;
24
+ outTrackId: string;
25
+ }) => boolean | void | Promise<boolean | void>;
18
26
  };
19
27
 
20
28
  const questionContextStorage = new AsyncLocalStorage<DingTalkQuestionContext>();
@@ -0,0 +1,294 @@
1
+ import { readNamespaceJson, writeNamespaceJsonAtomic } from "../persistence-store";
2
+ import type { Logger } from "../types";
3
+
4
+ const ASK_USER_LIFECYCLE_NAMESPACE = "cards.ask-user.lifecycle";
5
+ const ACTIVE_TTL_MS = 5 * 60 * 1_000;
6
+ const TOMBSTONE_TTL_MS = 30 * 60 * 1_000;
7
+
8
+ export type AskUserActiveState = "reserved" | "pending" | "dispatching";
9
+
10
+ export type AskUserTerminalReason =
11
+ | "delivery_failed"
12
+ | "superseded_by_question"
13
+ | "superseded_by_message"
14
+ | "expired"
15
+ | "cancelled"
16
+ | "empty"
17
+ | "submitted"
18
+ | "pause_failed"
19
+ | "restart_invalidated"
20
+ | "restart_during_dispatch"
21
+ | "dispatch_failed";
22
+
23
+ export interface AskUserLifecycleRecord {
24
+ questionId: string;
25
+ accountId: string;
26
+ questionScopeKey: string;
27
+ outTrackId: string;
28
+ title: string;
29
+ state: AskUserActiveState | "terminal";
30
+ terminalReason?: AskUserTerminalReason;
31
+ createdAt: number;
32
+ updatedAt: number;
33
+ expiresAt: number;
34
+ }
35
+
36
+ interface AskUserLifecycleState {
37
+ version: 1;
38
+ updatedAt: number;
39
+ records: AskUserLifecycleRecord[];
40
+ }
41
+
42
+ export interface AskUserStoreOptions {
43
+ storePath: string;
44
+ accountId: string;
45
+ log?: Logger;
46
+ now?: () => number;
47
+ }
48
+
49
+ export interface ReserveAskUserQuestionInput {
50
+ questionId: string;
51
+ questionScopeKey: string;
52
+ outTrackId: string;
53
+ title: string;
54
+ }
55
+
56
+ export interface AskUserQuestionIdentifier {
57
+ questionId?: string;
58
+ outTrackId?: string;
59
+ }
60
+
61
+ function now(options: AskUserStoreOptions): number {
62
+ return options.now?.() ?? Date.now();
63
+ }
64
+
65
+ function emptyState(timestamp: number): AskUserLifecycleState {
66
+ return { version: 1, updatedAt: timestamp, records: [] };
67
+ }
68
+
69
+ function isActiveState(state: AskUserLifecycleRecord["state"]): state is AskUserActiveState {
70
+ return state === "reserved" || state === "pending" || state === "dispatching";
71
+ }
72
+
73
+ function isAnswerableState(state: AskUserLifecycleRecord["state"]): boolean {
74
+ return state === "reserved" || state === "pending";
75
+ }
76
+
77
+ function loadState(options: AskUserStoreOptions): AskUserLifecycleState {
78
+ const timestamp = now(options);
79
+ const state = readNamespaceJson<AskUserLifecycleState>(ASK_USER_LIFECYCLE_NAMESPACE, {
80
+ storePath: options.storePath,
81
+ scope: { accountId: options.accountId },
82
+ fallback: emptyState(timestamp),
83
+ log: options.log,
84
+ });
85
+ if (state.version !== 1 || !Array.isArray(state.records)) {
86
+ return emptyState(timestamp);
87
+ }
88
+ return state;
89
+ }
90
+
91
+ function persistState(options: AskUserStoreOptions, state: AskUserLifecycleState): void {
92
+ state.updatedAt = now(options);
93
+ writeNamespaceJsonAtomic(ASK_USER_LIFECYCLE_NAMESPACE, {
94
+ storePath: options.storePath,
95
+ scope: { accountId: options.accountId },
96
+ data: state,
97
+ log: options.log,
98
+ });
99
+ }
100
+
101
+ function toTerminal(
102
+ record: AskUserLifecycleRecord,
103
+ reason: AskUserTerminalReason,
104
+ timestamp: number,
105
+ ): AskUserLifecycleRecord {
106
+ record.state = "terminal";
107
+ record.terminalReason = reason;
108
+ record.updatedAt = timestamp;
109
+ record.expiresAt = timestamp + TOMBSTONE_TTL_MS;
110
+ return record;
111
+ }
112
+
113
+ function cleanupState(state: AskUserLifecycleState, timestamp: number): boolean {
114
+ let changed = false;
115
+ for (const record of state.records) {
116
+ if (isAnswerableState(record.state) && record.expiresAt <= timestamp) {
117
+ toTerminal(record, "expired", timestamp);
118
+ changed = true;
119
+ }
120
+ }
121
+ const retained = state.records.filter(
122
+ (record) => record.state !== "terminal" || record.expiresAt > timestamp,
123
+ );
124
+ if (retained.length !== state.records.length) {
125
+ state.records = retained;
126
+ changed = true;
127
+ }
128
+ return changed;
129
+ }
130
+
131
+ function readCleanState(options: AskUserStoreOptions): AskUserLifecycleState {
132
+ const state = loadState(options);
133
+ if (cleanupState(state, now(options))) {
134
+ persistState(options, state);
135
+ }
136
+ return state;
137
+ }
138
+
139
+ function findRecord(
140
+ state: AskUserLifecycleState,
141
+ identifier: AskUserQuestionIdentifier,
142
+ ): AskUserLifecycleRecord | undefined {
143
+ if (identifier.outTrackId) {
144
+ const byTrackId = state.records.find((record) => record.outTrackId === identifier.outTrackId);
145
+ if (byTrackId) {
146
+ return byTrackId;
147
+ }
148
+ }
149
+ if (identifier.questionId) {
150
+ return state.records.find((record) => record.questionId === identifier.questionId);
151
+ }
152
+ return undefined;
153
+ }
154
+
155
+ export function reserveAskUserQuestion(
156
+ options: AskUserStoreOptions,
157
+ input: ReserveAskUserQuestionInput,
158
+ ): AskUserLifecycleRecord {
159
+ const timestamp = now(options);
160
+ const state = readCleanState(options);
161
+ const record: AskUserLifecycleRecord = {
162
+ questionId: input.questionId,
163
+ accountId: options.accountId,
164
+ questionScopeKey: input.questionScopeKey,
165
+ outTrackId: input.outTrackId,
166
+ title: input.title,
167
+ state: "reserved",
168
+ createdAt: timestamp,
169
+ updatedAt: timestamp,
170
+ expiresAt: timestamp + ACTIVE_TTL_MS,
171
+ };
172
+ state.records = state.records.filter(
173
+ (item) => item.questionId !== input.questionId && item.outTrackId !== input.outTrackId,
174
+ );
175
+ state.records.push(record);
176
+ persistState(options, state);
177
+ return { ...record };
178
+ }
179
+
180
+ export function activateAskUserQuestion(
181
+ options: AskUserStoreOptions,
182
+ questionId: string,
183
+ ): { record?: AskUserLifecycleRecord; superseded: AskUserLifecycleRecord[] } {
184
+ const timestamp = now(options);
185
+ const state = readCleanState(options);
186
+ const record = findRecord(state, { questionId });
187
+ if (!record || record.state !== "reserved") {
188
+ return { record: record ? { ...record } : undefined, superseded: [] };
189
+ }
190
+
191
+ const superseded: AskUserLifecycleRecord[] = [];
192
+ for (const candidate of state.records) {
193
+ if (
194
+ candidate !== record &&
195
+ isAnswerableState(candidate.state) &&
196
+ candidate.questionScopeKey === record.questionScopeKey
197
+ ) {
198
+ toTerminal(candidate, "superseded_by_question", timestamp);
199
+ superseded.push({ ...candidate });
200
+ }
201
+ }
202
+ record.state = "pending";
203
+ record.updatedAt = timestamp;
204
+ record.expiresAt = timestamp + ACTIVE_TTL_MS;
205
+ persistState(options, state);
206
+ return { record: { ...record }, superseded };
207
+ }
208
+
209
+ export function claimAskUserQuestion(
210
+ options: AskUserStoreOptions,
211
+ identifier: AskUserQuestionIdentifier,
212
+ ): AskUserLifecycleRecord | undefined {
213
+ const timestamp = now(options);
214
+ const state = readCleanState(options);
215
+ const record = findRecord(state, identifier);
216
+ if (!record || record.state !== "pending") {
217
+ return undefined;
218
+ }
219
+ record.state = "dispatching";
220
+ record.updatedAt = timestamp;
221
+ record.expiresAt = timestamp + ACTIVE_TTL_MS;
222
+ persistState(options, state);
223
+ return { ...record };
224
+ }
225
+
226
+ export function terminateAskUserQuestion(
227
+ options: AskUserStoreOptions,
228
+ questionId: string,
229
+ reason: AskUserTerminalReason,
230
+ ): AskUserLifecycleRecord | undefined {
231
+ const timestamp = now(options);
232
+ const state = readCleanState(options);
233
+ const record = findRecord(state, { questionId });
234
+ if (!record || !isActiveState(record.state)) {
235
+ return undefined;
236
+ }
237
+ toTerminal(record, reason, timestamp);
238
+ persistState(options, state);
239
+ return { ...record };
240
+ }
241
+
242
+ export function invalidateAskUserQuestionsInScope(
243
+ options: AskUserStoreOptions,
244
+ questionScopeKey: string,
245
+ reason: AskUserTerminalReason,
246
+ ): AskUserLifecycleRecord[] {
247
+ const timestamp = now(options);
248
+ const state = readCleanState(options);
249
+ const invalidated: AskUserLifecycleRecord[] = [];
250
+ for (const record of state.records) {
251
+ if (isAnswerableState(record.state) && record.questionScopeKey === questionScopeKey) {
252
+ toTerminal(record, reason, timestamp);
253
+ invalidated.push({ ...record });
254
+ }
255
+ }
256
+ if (invalidated.length > 0) {
257
+ persistState(options, state);
258
+ }
259
+ return invalidated;
260
+ }
261
+
262
+ export function resolveAskUserQuestion(
263
+ options: AskUserStoreOptions,
264
+ identifier: AskUserQuestionIdentifier,
265
+ ): AskUserLifecycleRecord | undefined {
266
+ const record = findRecord(readCleanState(options), identifier);
267
+ return record ? { ...record } : undefined;
268
+ }
269
+
270
+ export function recoverAskUserQuestionsAfterRestart(
271
+ options: AskUserStoreOptions,
272
+ ): AskUserLifecycleRecord[] {
273
+ const timestamp = now(options);
274
+ const state = loadState(options);
275
+ const retained = state.records.filter(
276
+ (record) => record.state !== "terminal" || record.expiresAt > timestamp,
277
+ );
278
+ const removedExpiredTombstones = retained.length !== state.records.length;
279
+ state.records = retained;
280
+ const recovered: AskUserLifecycleRecord[] = [];
281
+ for (const record of state.records) {
282
+ if (!isActiveState(record.state)) {
283
+ continue;
284
+ }
285
+ const reason =
286
+ record.state === "dispatching" ? "restart_during_dispatch" : "restart_invalidated";
287
+ toTerminal(record, reason, timestamp);
288
+ recovered.push({ ...record });
289
+ }
290
+ if (recovered.length > 0 || removedExpiredTombstones) {
291
+ persistState(options, state);
292
+ }
293
+ return recovered;
294
+ }