@lovrabet/rabetbase-cli 2.3.7 → 2.3.8-beta.1

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 (245) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/notification/config-list.js +1 -1
  115. package/lib/commands/notification/index.js +1 -1
  116. package/lib/commands/page/generate-start.js +1 -1
  117. package/lib/commands/page/generate-status.js +1 -1
  118. package/lib/commands/page/index.js +1 -1
  119. package/lib/commands/page/pull.js +1 -1
  120. package/lib/commands/page/push.js +1 -1
  121. package/lib/commands/page/relation-audit.js +1 -1
  122. package/lib/commands/page/shared.js +1 -1
  123. package/lib/commands/page/standard-page-status.js +1 -1
  124. package/lib/commands/page/sync.js +1 -1
  125. package/lib/commands/permit/index.js +1 -1
  126. package/lib/commands/permit/page-get.js +1 -1
  127. package/lib/commands/permit/page-set.js +1 -1
  128. package/lib/commands/permit/role-apis-set.js +1 -1
  129. package/lib/commands/permit/role-menus-set.js +1 -1
  130. package/lib/commands/permit/role-menus.js +1 -1
  131. package/lib/commands/permit/shared.js +1 -1
  132. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  133. package/lib/commands/project/create/format-elapsed.js +1 -1
  134. package/lib/commands/project/create/main.js +1 -1
  135. package/lib/commands/project/create/non-interactive.js +1 -1
  136. package/lib/commands/project/create/project-template-path.js +1 -1
  137. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  138. package/lib/commands/project/create/use-format-code.js +1 -1
  139. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  140. package/lib/commands/project/index.js +1 -1
  141. package/lib/commands/project/init.js +1 -1
  142. package/lib/commands/project/upgrade.js +1 -1
  143. package/lib/commands/registry.js +1 -1
  144. package/lib/commands/role/create.js +1 -1
  145. package/lib/commands/role/delete.js +1 -1
  146. package/lib/commands/role/detail.js +1 -1
  147. package/lib/commands/role/index.js +1 -1
  148. package/lib/commands/role/list.js +1 -1
  149. package/lib/commands/role/shared.js +1 -1
  150. package/lib/commands/role/update.js +1 -1
  151. package/lib/commands/role/user-add.js +1 -1
  152. package/lib/commands/role/user-remove.js +1 -1
  153. package/lib/commands/role/user-resolve.js +1 -1
  154. package/lib/commands/run/index.js +1 -1
  155. package/lib/commands/schema.js +1 -1
  156. package/lib/commands/sql/create.js +1 -1
  157. package/lib/commands/sql/delete.js +1 -1
  158. package/lib/commands/sql/detail.js +1 -1
  159. package/lib/commands/sql/exec.js +1 -1
  160. package/lib/commands/sql/index.js +1 -1
  161. package/lib/commands/sql/list.js +1 -1
  162. package/lib/commands/sql/pull.js +1 -1
  163. package/lib/commands/sql/push.js +1 -1
  164. package/lib/commands/sql/save.js +1 -1
  165. package/lib/commands/sql/shared.js +1 -1
  166. package/lib/commands/sql/status.js +1 -1
  167. package/lib/commands/sql/validate.js +1 -1
  168. package/lib/commands/workspace/add.js +1 -1
  169. package/lib/commands/workspace/index.js +1 -1
  170. package/lib/commands/workspace/remove.js +1 -1
  171. package/lib/config/schema.js +1 -1
  172. package/lib/constant/cdn.js +1 -1
  173. package/lib/constant/cli.js +1 -1
  174. package/lib/constant/defaults.js +1 -1
  175. package/lib/constant/domain.js +1 -1
  176. package/lib/constant/env.js +1 -1
  177. package/lib/constant/output.js +1 -1
  178. package/lib/constant/paths.js +1 -1
  179. package/lib/constant/risk.js +1 -1
  180. package/lib/context/app-resolver.js +1 -1
  181. package/lib/context/auth-resolver.js +1 -1
  182. package/lib/context/config-loader.js +1 -1
  183. package/lib/context.js +1 -1
  184. package/lib/core/alias-resolver.js +1 -1
  185. package/lib/core/api-client.js +1 -1
  186. package/lib/core/bff/config.js +1 -1
  187. package/lib/core/bff/file-system.js +1 -1
  188. package/lib/core/bff/hash.js +1 -1
  189. package/lib/core/bff/lock.js +1 -1
  190. package/lib/core/bff/utils.js +1 -1
  191. package/lib/core/db-resolver.js +1 -1
  192. package/lib/core/page/file-system.js +1 -1
  193. package/lib/core/page/hash.js +1 -1
  194. package/lib/core/page/lock.js +1 -1
  195. package/lib/core/sql-sync/config.js +1 -1
  196. package/lib/core/sql-sync/file-system.js +1 -1
  197. package/lib/core/sql-sync/hash.js +1 -1
  198. package/lib/core/sql-sync/lock.js +1 -1
  199. package/lib/core/sql-sync/utils.js +1 -1
  200. package/lib/core/sql-validator.js +1 -1
  201. package/lib/errors.js +1 -1
  202. package/lib/framework/build-all-flags.js +1 -1
  203. package/lib/framework/flags.js +1 -1
  204. package/lib/framework/help.js +1 -1
  205. package/lib/framework/index.js +1 -1
  206. package/lib/framework/output.js +1 -1
  207. package/lib/framework/response.js +1 -1
  208. package/lib/framework/runner-alias.js +1 -1
  209. package/lib/framework/runner.js +1 -1
  210. package/lib/framework/schema-export.js +1 -1
  211. package/lib/framework/types.js +1 -1
  212. package/lib/generated/build-info.js +1 -1
  213. package/lib/help.js +1 -1
  214. package/lib/skills/main.js +1 -1
  215. package/lib/skills/npx-skills-add.js +1 -1
  216. package/lib/telemetry/cli-command-trace.js +1 -1
  217. package/lib/telemetry/cli-help-trace.js +1 -1
  218. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  219. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  220. package/lib/telemetry/send-cli-trace-log.js +1 -1
  221. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  222. package/lib/utils/ai_config.js +1 -1
  223. package/lib/utils/apply-jq-filter.js +1 -1
  224. package/lib/utils/cdn-config.js +1 -1
  225. package/lib/utils/check-sdk-version.js +1 -1
  226. package/lib/utils/cli-version-check.js +1 -1
  227. package/lib/utils/cli-version-policy.js +1 -1
  228. package/lib/utils/config.js +1 -1
  229. package/lib/utils/copy-directory.js +1 -1
  230. package/lib/utils/entity-with-id.js +1 -1
  231. package/lib/utils/file-utils.js +1 -1
  232. package/lib/utils/guides-cdn.js +1 -1
  233. package/lib/utils/http-client.js +1 -1
  234. package/lib/utils/is-non-interactive.js +1 -1
  235. package/lib/utils/logger.js +1 -1
  236. package/lib/utils/params.js +1 -1
  237. package/lib/utils/platform.js +1 -1
  238. package/lib/utils/rules-cdn.js +1 -1
  239. package/lib/utils/sleep.js +1 -1
  240. package/lib/utils/template-replacer.js +1 -1
  241. package/lib/utils/update-notice.js +1 -1
  242. package/lib/utils/version.js +1 -1
  243. package/lib/utils/with-active-cookie.js +1 -1
  244. package/lib/utils/write-cli-side-channel.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x331bd5,_0x3affcd){const _0x542c39=a185_0x569b,_0x5ef0e1=_0x331bd5();while(!![]){try{const _0x9d4e54=-parseInt(_0x542c39(0x143))/0x1+parseInt(_0x542c39(0xac))/0x2*(-parseInt(_0x542c39(0x112))/0x3)+-parseInt(_0x542c39(0xe0))/0x4+parseInt(_0x542c39(0x9a))/0x5+parseInt(_0x542c39(0x134))/0x6+parseInt(_0x542c39(0x142))/0x7*(parseInt(_0x542c39(0x12a))/0x8)+-parseInt(_0x542c39(0xa2))/0x9*(-parseInt(_0x542c39(0xf6))/0xa);if(_0x9d4e54===_0x3affcd)break;else _0x5ef0e1['push'](_0x5ef0e1['shift']());}catch(_0x976af5){_0x5ef0e1['push'](_0x5ef0e1['shift']());}}}(a185_0x4a41,0xa5a6f));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x36a13b){_activeCookie=_0x36a13b||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x7adb8f,_0x557afe){const _0x4bb130=a185_0x569b,_0x3d7d83=_0x557afe instanceof Error?_0x557afe[_0x4bb130(0x17f)]:String(_0x557afe);return CliErrors[_0x4bb130(0xb8)](_0x4bb130(0xe6)+_0x7adb8f+(_0x3d7d83?'\x20('+_0x3d7d83+')':''),_0x4bb130(0xc8));}async function apiRequest(_0x514403,_0x2e01e5={}){const _0x4af15d=a185_0x569b,{method:method='GET',body:_0x538ec2,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x2e01e5,_0x68d2e0=useRuntime?getRuntimeDomain():getApiDomain(),_0x1d802c=_activeCookie||getCookie(),_0x20e2f6=''+_0x68d2e0+_0x514403,_0x53d948=new AbortController(),_0x509ca2=setTimeout(()=>_0x53d948[_0x4af15d(0x169)](),timeout);try{const _0x462594=await fetch(_0x20e2f6,{'method':method,'headers':{'Content-Type':_0x4af15d(0x11d),'Cookie':_0x1d802c,'X-Invoke-Source':_0x4af15d(0x176),...headers},'body':_0x538ec2?JSON[_0x4af15d(0x173)](_0x538ec2):undefined,'signal':_0x53d948[_0x4af15d(0x165)]});let _0x25059b;try{_0x25059b=await _0x462594[_0x4af15d(0x97)]();}catch(_0x331ae2){if(_0x331ae2 instanceof Error&&_0x331ae2[_0x4af15d(0x106)]===_0x4af15d(0xe5))throw CliErrors[_0x4af15d(0xb8)](_0x4af15d(0x14e)+_0x20e2f6);if(_0x462594['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x4af15d(0xb8)](_0x4af15d(0xf2)+_0x462594['status']+')',_0x462594['status']>=0x190?_0x4af15d(0x120):undefined);}if(!_0x462594['ok']||_0x25059b[_0x4af15d(0x149)]===![])throw CliErrors['apiError'](_0x25059b[_0x4af15d(0xe2)]||_0x25059b[_0x4af15d(0x17f)]||_0x4af15d(0x10b)+_0x462594[_0x4af15d(0xef)],_0x25059b[_0x4af15d(0x170)]?_0x4af15d(0x156)+_0x25059b[_0x4af15d(0x170)]:undefined);return _0x25059b;}catch(_0x24db35){if(_0x24db35 instanceof CliError)throw _0x24db35;if(_0x24db35 instanceof Error&&_0x24db35[_0x4af15d(0x106)]===_0x4af15d(0xe5))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x20e2f6);throw createFetchFailureError(_0x20e2f6,_0x24db35);}finally{clearTimeout(_0x509ca2);}}function a185_0x4a41(){const _0x2eb867=['tableList','type','50kfCljj','/smartapi/permit/user-role/get-user-list','set','/smartapi/permit/page/save','/smartapi/app/getList','totalCount','/smartapi/question/er-config','requirementDescription','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','\x20\x20return\x20rows;','/smartapi/dataset/text-generate/status?','value','/smartapi/permit/page/get-one','find','API\x20error\x20code:\x20306','/smartapi/question/er-config/business-group/edit','name','/smartapi/question/er-config/cli/update-single','/smartapi/dataset/get-dataset-list','/smartapi/dataset/update-driven-data','/standard-page-status?appCode=','API\x20error:\x20','authRequired','\x20\x20pageSize:\x2020,','length','(/*\x20params\x20*/);','\x20\x20sqlCode:\x20\x27','Dataset\x20not\x20found:\x20','68631iePDfb','/smartapi/permit/resource/get-menu-list','SQL\x20query\x20not\x20found:\x20id=','):\x20missing\x20data.markdown\x20field','entries','includes','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','getOne','//\x20SQL:\x20','tableName','/smartapi/db-analysis/jobs/cancel','application/json','/smartapi/lovrabet/detail?pageId=','appCode','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/smartapi/question/er-config/cli/erCreate','/smartapi/dataset/text-generate/start','operationId','fetch-model-list','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','map','info','/userTenant/getByTenantCode','/smartapi/menu/create','80jSZleU','roleName','\x20\x20currentPage:\x201,','});','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/permit/role/get-one','code','&type=','object','functionName','4160262dxfxSz','isFinite','scriptName','string','/notification/channel-config/list','dataset_','version','/smartapi/dblink/update','scriptType','POST','create','/smartapi/question/er-config/cli/delete-single','body','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','113631lkKWvF','1081450naZzOW','/smartapi/custom/queryUserCustomSqlList','filter','/smartapi/permit/role/create','/smartapi/menu/find?','push','success','/api/management/library/scripts/delete','enabled','userTenantRelationList','/smartapi/custom/getUserCustomSql?id=','Request\x20timeout:\x20','pageSize','replace','data','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','.filter({','needSelf','API\x20error\x20code:\x20','/smartapi/db-analysis/start','operations','\x20failed,\x20HTTP\x20','/smartapi/question/er-config/cli/detail?','/smartapi/custom/updateUserCustomSql','/smartapi/dblink/create','.remove(id);','/smartapi/custom/saveUserCustomSql','relation','array','validation','modelCode','username','/smartapi/menu/update','signal','/api/node-toolbox/dataset/model-list?','Fetch\x20doc\x20(','requestFields','abort','path','/smartapi/dataset/delete-dataset','method','const\x20result\x20=\x20await\x20client.models.','.getOne(id);','dbtableConfig','errorCode','/smartapi/permit/resource/get-api-list','/smartapi/dblink/getAllTableList','stringify','.create({\x20/*\x20fields\x20*/\x20});','/generate-standard-pages/status?','cli:rabetbase','/smartapi/app-config/create','download','/smartapi/dataset/restore-dataset','join','/smartapi/dataset/get-driven-data?','/api/custom/executeSql','sdk','Fetch\x20menu\x20list','message','Unauthorized','isArray','Page\x20not\x20found:\x20','json','remark','正在从服务器拉取模型列表...\x20(环境:\x20','962585qxFAKw','\x20\x20});','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','physicalTableCount','/sync-to-pages','max','/smartapi/dblink/testConnect','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','4287339iUREIj','userId','test','/smartapi/permit/user-role/update-user-list','BFF\x20save\x20returned\x20no\x20valid\x20id','/smartapi/dblink/getTableDiffV2ByPage','Invalid\x20response\x20format\x20(','/smartapi/dblink/delete','GET','delete','114VmMZLC','api_error','needPublic','toString','401','/api/','SQL\x20query\x20not\x20found:\x20','add','hint','/smartapi/permit/role/get-permit-list','operationName','/smartapi/dataset/get-dataset-operation','apiError','has','errorMessage','tags','ER\x20relation\x20does\x20not\x20exist','description','mobile','startsWith','dbId','/smartapi/common/uploadFile','planId','list','tableData','permits','nickname','UNAUTHORIZED','Check\x20network\x20connectivity\x20and\x20try\x20again.','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','trim','deleted','/smartapi/custom/getUserCustomSql','configArray','responseFields','sqlName','markdown','/smartapi/lovrabet/dataset/','Warning:\x20showing\x20first\x20','toLowerCase','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/common/queryFileUrl','longTerm','const\x20results\x20=\x20data.execResult\x20||\x20[];','/smartapi/app-config/delete','summary','table','/smartapi/permit/role/update','min','modelId','/api/management/library/scripts/info?id=','/api/management/library/scripts/statistics?appCode=','1464516oZQcrY','currentPage','errorMsg','clientOperationId','label','AbortError','Request\x20failed:\x20','/smartapi/app-config/update','target','\x20apps.\x20','/smartapi/app-config/list','sqlCode','/smartapi/dataset/text-generate/preview','displayName','error','status','/smartapi/dblink/getOne','roleType','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','append'];a185_0x4a41=function(){return _0x2eb867;};return a185_0x4a41();}async function apiFormRequest(_0x4b01a4,_0x15104e,_0x41df98={}){const _0x53be6f=a185_0x569b,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x41df98,_0x3a0cda=_activeCookie||getCookie(),_0x2617d8=''+getApiDomain()+_0x4b01a4,_0x59cdca=new AbortController(),_0x2d2ccf=setTimeout(()=>_0x59cdca[_0x53be6f(0x169)](),timeout);try{const _0x5297a0=await fetch(_0x2617d8,{'method':_0x53be6f(0x13d),'headers':{'Cookie':_0x3a0cda,'X-Invoke-Source':_0x53be6f(0x176)},'body':_0x15104e,'signal':_0x59cdca[_0x53be6f(0x165)]});let _0x10d0e0;try{_0x10d0e0=await _0x5297a0[_0x53be6f(0x97)]();}catch(_0x204bb8){if(_0x204bb8 instanceof Error&&_0x204bb8[_0x53be6f(0x106)]===_0x53be6f(0xe5))throw CliErrors[_0x53be6f(0xb8)](_0x53be6f(0x14e)+_0x2617d8);throw CliErrors[_0x53be6f(0xb8)](_0x53be6f(0xf2)+_0x5297a0[_0x53be6f(0xef)]+')',_0x5297a0['status']>=0x190?_0x53be6f(0x120):undefined);}if(!_0x5297a0['ok']||_0x10d0e0[_0x53be6f(0x149)]===![])throw CliErrors[_0x53be6f(0xb8)](_0x10d0e0[_0x53be6f(0xe2)]||_0x10d0e0[_0x53be6f(0x17f)]||_0x53be6f(0x10b)+_0x5297a0[_0x53be6f(0xef)],_0x10d0e0[_0x53be6f(0x170)]?_0x53be6f(0x156)+_0x10d0e0['errorCode']:undefined);return _0x10d0e0;}catch(_0x28279c){if(_0x28279c instanceof CliError)throw _0x28279c;if(_0x28279c instanceof Error&&_0x28279c['name']===_0x53be6f(0xe5))throw CliErrors['apiError'](_0x53be6f(0x14e)+_0x2617d8);throw createFetchFailureError(_0x2617d8,_0x28279c);}finally{clearTimeout(_0x2d2ccf);}}export async function uploadDevelopmentFile(_0x47993c,_0x143fae){const _0x1fa561=a185_0x569b,_0x3187b8=await readFile(_0x143fae),_0x14279e=new FormData();_0x14279e[_0x1fa561(0xf3)](_0x1fa561(0x11f),_0x47993c),_0x14279e['append']('file',new Blob([new Uint8Array(_0x3187b8)]),basename(_0x143fae));const _0xe3b834=await apiFormRequest(_0x1fa561(0xc1),_0x14279e);return _0xe3b834[_0x1fa561(0x151)];}export async function queryDevelopmentFileUrl(_0x318c28,_0x15f9a8={}){const _0x3002f2=a185_0x569b,_0x3ae3c4=await apiRequest(_0x3002f2(0xd5),{'method':_0x3002f2(0x13d),'body':{'filePath':_0x318c28,'downloadFlag':_0x15f9a8[_0x3002f2(0x178)]??![],..._0x15f9a8[_0x3002f2(0xd6)]?{'longTerm':!![]}:{}}});return _0x3ae3c4[_0x3002f2(0x151)];}function isAuthFailure(_0x4f5161){const _0x157a48=a185_0x569b,_0xfcdd4f=_0x4f5161['errorMsg']||_0x4f5161[_0x157a48(0x17f)]||_0x4f5161[_0x157a48(0x151)]?.[_0x157a48(0x17f)]||_0x4f5161[_0x157a48(0xba)]||_0x4f5161[_0x157a48(0xee)]||'';return _0x4f5161[_0x157a48(0x170)]===_0x157a48(0xc7)||_0x4f5161['code']===0x191||_0x4f5161[_0x157a48(0x130)]==='401'||_0xfcdd4f[_0x157a48(0x117)](_0x157a48(0xb0))||_0xfcdd4f[_0x157a48(0x117)](_0x157a48(0x180))||_0xfcdd4f[_0x157a48(0x117)]('登录')||_0xfcdd4f['includes']('认证');}export async function platformFetch(_0x21afdc,_0x1bca17){const _0x17a76d=a185_0x569b;let _0x4da45d;try{_0x4da45d=await fetch(_0x21afdc,{'method':_0x1bca17['method']??_0x17a76d(0xaa),'headers':{'Content-Type':'application/json','Cookie':_0x1bca17['cookie'],'X-Invoke-Source':_0x17a76d(0x176)},..._0x1bca17[_0x17a76d(0x140)]&&{'body':JSON['stringify'](_0x1bca17[_0x17a76d(0x140)])}});}catch(_0x3523aa){throw createFetchFailureError(_0x21afdc,_0x3523aa);}if(!_0x4da45d['ok']){if(_0x4da45d[_0x17a76d(0xef)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x17a76d(0xb8)](_0x1bca17[_0x17a76d(0xe4)]+_0x17a76d(0x159)+_0x4da45d[_0x17a76d(0xef)]);}const _0x36d9b7=await _0x4da45d[_0x17a76d(0x97)]();if(_0x36d9b7[_0x17a76d(0x149)]===![]){if(isAuthFailure(_0x36d9b7))throw CliErrors[_0x17a76d(0x10c)]();throw CliErrors[_0x17a76d(0xb8)](_0x36d9b7[_0x17a76d(0xe2)]||_0x36d9b7[_0x17a76d(0x17f)]||_0x1bca17[_0x17a76d(0xe4)]+'\x20failed');}return _0x36d9b7[_0x17a76d(0x151)];}export async function platformRequest(_0x4d9992,_0xce795e){const _0x53bb7d=a185_0x569b;if(/^https?:\/\//i[_0x53bb7d(0xa4)](_0x4d9992))throw CliErrors[_0x53bb7d(0x161)](_0x53bb7d(0x118)+_0x4d9992,_0x53bb7d(0xd4));const _0x25b33a=_0x4d9992[_0x53bb7d(0xbf)]('/')?_0x4d9992:'/'+_0x4d9992;return platformFetch(''+getApiDomain()+_0x25b33a,_0xce795e);}function cleanNewlines(_0x98140d){const _0x3bd53b=a185_0x569b;return _0x98140d[_0x3bd53b(0x150)](/[\r\n]+/g,'\x20')[_0x3bd53b(0xca)]();}function cleanDatasetName(_0x5d47dd){const _0x51f21d=a185_0x569b;if(!_0x5d47dd[_0x51f21d(0x106)])return _0x5d47dd;return{..._0x5d47dd,'name':cleanNewlines(_0x5d47dd[_0x51f21d(0x106)])};}export async function fetchModelList(_0x305049,_0x81e6b0){const _0x36848f=a185_0x569b,_0x280e6c=getEnv(),_0x3fdca6=new URLSearchParams({'appcode':_0x305049,'otype':_0x36848f(0x160)}),_0xee1ffe=_0x36848f(0x166)+_0x3fdca6[_0x36848f(0xaf)]();logger[_0x36848f(0x127)](_0x36848f(0x124),_0x36848f(0x99)+_0x280e6c+')',{'apiPath':_0xee1ffe});const _0x31df84=await platformRequest(_0xee1ffe,{'cookie':_0x81e6b0,'label':'Fetch\x20datasets'}),_0x1a9e2f=(_0x31df84[_0x36848f(0xcd)]??[])['map'](cleanDatasetName);return{'configArray':_0x1a9e2f,'count':_0x1a9e2f['length']};}export async function fetchDatasetDoc(_0x25f669){const _0x1f896b=a185_0x569b,{appCode:_0x424c4c,cookie:_0x139a51,datasetCode:_0x5508a3,datasetId:_0x173270,extraParams:_0x311dc5}=_0x25f669,_0x3080ac=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':_0x1f896b(0x13d),'body':{'appCode':_0x424c4c,'datasetCode':_0x5508a3,'datasetId':_0x173270,..._0x311dc5||{}},'cookie':_0x139a51,'label':_0x1f896b(0x167)+_0x5508a3+')'});if(!_0x3080ac||typeof _0x3080ac[_0x1f896b(0xd0)]!==_0x1f896b(0x137))throw new Error(_0x1f896b(0xa8)+_0x5508a3+_0x1f896b(0x115));return _0x3080ac['markdown'];}export async function getMenuTree(_0x37aa94,_0x4dec4c){const _0x5d8dbe=a185_0x569b,_0x19326e=new URLSearchParams({'appCode':_0x37aa94});return platformRequest(_0x5d8dbe(0x147)+_0x19326e[_0x5d8dbe(0xaf)](),{'cookie':_0x4dec4c,'label':_0x5d8dbe(0x17e)});}export async function createMenuRecord(_0x5de459,_0x543158,_0x4d8c8f){const _0x203f97=a185_0x569b;return platformRequest(_0x203f97(0x129),{'method':_0x203f97(0x13d),'body':_0x5de459,'cookie':_0x543158,'label':_0x4d8c8f});}export async function updateMenuRecord(_0x52c342,_0xcdcd8,_0x35e3b5){const _0x4e5084=a185_0x569b;return platformRequest(_0x4e5084(0x164),{'method':'POST','body':_0x52c342,'cookie':_0xcdcd8,'label':_0x35e3b5});}export async function listBffScripts(_0x169cc6,_0x71ecb,_0x52f7ae){const _0xf51d1e=a185_0x569b;let _0x17cc68='/api/management/library/scripts/list?appCode='+_0x169cc6;if(_0x71ecb)_0x17cc68+=_0xf51d1e(0x131)+_0x71ecb;const _0x1a3a01=await apiRequest(_0x17cc68);let _0xe849e0=extractList(_0x1a3a01['data']);if(_0x52f7ae?.[_0xf51d1e(0x136)]){const _0x453507=_0x52f7ae[_0xf51d1e(0x136)][_0xf51d1e(0xd3)]();_0xe849e0=_0xe849e0[_0xf51d1e(0x145)](_0x4e76b5=>_0x4e76b5[_0xf51d1e(0x133)]?.['toLowerCase']()['includes'](_0x453507)||_0x4e76b5[_0xf51d1e(0xbd)]?.[_0xf51d1e(0xd3)]()[_0xf51d1e(0x117)](_0x453507));}return _0xe849e0;}export async function getBffScriptInfo(_0x2c0e9d){const _0x53d302=a185_0x569b,_0x5791c4=await apiRequest(_0x53d302(0xde)+_0x2c0e9d);if(!_0x5791c4[_0x53d302(0x151)])throw CliErrors[_0x53d302(0x161)]('BFF\x20script\x20not\x20found:\x20id='+_0x2c0e9d);return _0x5791c4['data'];}export async function saveBffScript(_0x463502){const _0x3077e7=a185_0x569b,_0x36817c=await apiRequest('/api/management/library/scripts/save',{'method':_0x3077e7(0x13d),'body':_0x463502}),{id:_0x1bbed4,entity:_0x31268d}=normalizeEntityWithIdResponse(_0x36817c[_0x3077e7(0x151)]);if(_0x1bbed4!==undefined){const _0x1e1afd=typeof _0x31268d[_0x3077e7(0x133)]==='string'||typeof _0x31268d[_0x3077e7(0x13c)]===_0x3077e7(0x137)?_0x31268d:undefined;return{'id':_0x1bbed4,'script':_0x1e1afd};}throw CliErrors[_0x3077e7(0xb8)](_0x3077e7(0xa6));}export async function deleteBffScript(_0x4961aa){const _0x3756b1=a185_0x569b;await apiRequest(_0x3756b1(0x14a),{'method':_0x3756b1(0x13d),'body':{'id':_0x4961aa}});}export async function getBffScriptStatistics(_0x39ac07){const _0x179067=a185_0x569b,_0x1adbc3=await apiRequest(_0x179067(0xdf)+_0x39ac07);return extractList(_0x1adbc3['data']);}function a185_0x569b(_0x551927,_0x3c72e5){_0x551927=_0x551927-0x95;const _0x4a413b=a185_0x4a41();let _0x569b93=_0x4a413b[_0x551927];return _0x569b93;}export async function clearBffScriptCache(){const _0x1bc231=a185_0x569b,_0x905066=await apiRequest('/api/management/script/cache/clear',{'method':_0x1bc231(0x13d),'useRuntime':!![]});return typeof _0x905066[_0x1bc231(0x151)]===_0x1bc231(0x137)?_0x905066[_0x1bc231(0x151)]:'';}export async function listBffDatasetOperations(_0x26014d,_0x5a1906){const _0x3ea6bf=a185_0x569b,_0x15234b=await apiRequest(_0x3ea6bf(0xb7),{'method':_0x3ea6bf(0x13d),'body':{'appCode':_0x26014d,'datasetId':_0x5a1906}});return _0x15234b['data'];}export async function listSqlQueries(_0x2a98b6,_0x53875e){const _0x2f08c6=a185_0x569b,_0x3a6c40=await apiRequest(_0x2f08c6(0x144),{'method':_0x2f08c6(0x13d),'body':{'appCode':_0x2a98b6,'currentPage':_0x53875e?.[_0x2f08c6(0xe1)]??0x1,'pageSize':_0x53875e?.[_0x2f08c6(0x14f)]??0x32,'sqlCode':_0x53875e?.['sqlCode'],'sqlName':_0x53875e?.[_0x2f08c6(0xcf)]}});return _0x3a6c40[_0x2f08c6(0x151)];}export async function getSqlQueryInfo(_0x4cb462,_0x59e152){const _0x2fc352=a185_0x569b,_0x1e5edb=await listSqlQueries(_0x4cb462,{'sqlCode':_0x59e152}),_0x1bd5ed=_0x1e5edb[_0x2fc352(0xc4)]?.[0x0];if(!_0x1bd5ed)throw CliErrors[_0x2fc352(0x161)](_0x2fc352(0xb2)+_0x59e152);return _0x1bd5ed;}export async function getSqlQueryDetail(_0x1f443e){const _0x29acbd=a185_0x569b,_0x3d7686=await apiRequest(_0x29acbd(0xcc)+('?sqlCode='+encodeURIComponent(_0x1f443e)));if(!_0x3d7686[_0x29acbd(0x151)])throw CliErrors[_0x29acbd(0x161)]('SQL\x20query\x20not\x20found:\x20'+_0x1f443e);return _0x3d7686[_0x29acbd(0x151)];}export async function getSqlQueryDetailById(_0x3b57da){const _0xf84dad=a185_0x569b,_0x413f95=await apiRequest(_0xf84dad(0x14d)+_0x3b57da);if(!_0x413f95[_0xf84dad(0x151)])throw CliErrors[_0xf84dad(0x161)](_0xf84dad(0x114)+_0x3b57da);return _0x413f95['data'];}export async function createSqlQuery(_0x1ec0ee){const _0x3a834f=a185_0x569b,_0x1e4e0c=await apiRequest(_0x3a834f(0x15e),{'method':_0x3a834f(0x13d),'body':_0x1ec0ee}),{id:_0x2dd4c8,entity:_0x266087}=normalizeEntityWithIdResponse(_0x1e4e0c[_0x3a834f(0x151)]);if(!(_0x3a834f(0xeb)in _0x266087)&&_0x2dd4c8)return getSqlQueryDetailById(_0x2dd4c8);return normalizeSqlQueryEntity(_0x266087);}export async function updateSqlQuery(_0x57d59b){const _0x137955=a185_0x569b,_0x236795=await apiRequest(_0x137955(0x15b),{'method':_0x137955(0x13d),'body':_0x57d59b}),{id:_0x3a840c,entity:_0x195f67}=normalizeEntityWithIdResponse(_0x236795[_0x137955(0x151)]);if(!(_0x137955(0xeb)in _0x195f67)){if(_0x57d59b[_0x137955(0xeb)])return getSqlQueryDetail(_0x57d59b[_0x137955(0xeb)]);if(_0x3a840c)return getSqlQueryDetailById(_0x3a840c);}return normalizeSqlQueryEntity(_0x195f67);}export async function deleteSqlQuery(_0x4cd308){const _0x154bb8=a185_0x569b;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x154bb8(0x13d),'body':_0x4cd308});}export async function saveSqlQuery(_0x2264ca){const _0x2711d2=a185_0x569b,_0x37bf6a=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x2711d2(0x13d),'body':_0x2264ca});return _0x37bf6a[_0x2711d2(0x151)];}function normalizeSqlQueryEntity(_0x9b7770){const _0x468ecb=a185_0x569b;return{..._0x9b7770,'id':Number(_0x9b7770['id']),'dbId':_0x9b7770[_0x468ecb(0xc0)]==null?undefined:Number(_0x9b7770[_0x468ecb(0xc0)]),'version':_0x9b7770[_0x468ecb(0x13a)]==null?undefined:Number(_0x9b7770['version'])};}export async function executeSql(_0x1a2880,_0x404d32,_0x5b464e){const _0x5e3988=a185_0x569b,_0x2d9dca=await apiRequest(_0x5e3988(0x17c),{'method':'POST','body':{'appCode':_0x1a2880,'sqlCode':_0x404d32,..._0x5b464e&&{'params':_0x5b464e}},'useRuntime':!![]});return _0x2d9dca[_0x5e3988(0x151)];}export async function executeDatasetDataOperation(_0x1e1953,_0x2cdcbe,_0x444447,_0x430c4d={}){const _0x2cb924=a185_0x569b;try{const _0x3afb92=await apiRequest('/api/'+_0x1e1953+'/'+_0x2cdcbe+'/'+_0x444447,{'method':_0x2cb924(0x13d),'body':_0x430c4d,'useRuntime':!![]});return _0x3afb92[_0x2cb924(0x151)];}catch(_0x3866a8){if(_0x444447===_0x2cb924(0x119)&&_0x3866a8 instanceof CliError&&_0x3866a8['code']===_0x2cb924(0xad)&&_0x430c4d['id']!==undefined&&_0x430c4d['id']!==null&&_0x430c4d['id']!==''){const _0x4e7906=await apiRequest(_0x2cb924(0xb1)+_0x1e1953+'/'+_0x2cdcbe+'/filter',{'method':_0x2cb924(0x13d),'body':{'where':{'id':{'$eq':_0x430c4d['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x381161=Array[_0x2cb924(0x95)](_0x4e7906['data']?.[_0x2cb924(0xc4)])?_0x4e7906['data'][_0x2cb924(0xc4)]:[];return _0x381161[0x0]??null;}throw _0x3866a8;}}export async function listDatasets(_0x401737,_0x5d203a){const _0x5e8072=a185_0x569b,_0x145375={'appCode':_0x401737,'deleted':_0x5d203a?.[_0x5e8072(0xcb)]??![]};if(_0x5d203a?.['code'])_0x145375['code']=_0x5d203a[_0x5e8072(0x130)];if(_0x5d203a?.[_0x5e8072(0x106)])_0x145375[_0x5e8072(0x106)]=_0x5d203a['name'];const _0x11d332=await apiRequest(_0x5e8072(0x108),{'method':_0x5e8072(0x13d),'body':_0x145375});return extractList(_0x11d332[_0x5e8072(0x151)]);}export async function deleteDataset(_0xf8f6ca,_0x47c0f7){const _0x240fef=a185_0x569b;await apiRequest(_0x240fef(0x16b),{'method':_0x240fef(0x13d),'body':{'appCode':_0xf8f6ca,'datasetId':_0x47c0f7}});}export async function restoreDataset(_0x21328b,_0x480515){const _0x64985b=a185_0x569b;await apiRequest(_0x64985b(0x179),{'method':_0x64985b(0x13d),'body':{'appCode':_0x21328b,'datasetId':_0x480515}});}export async function previewTextGeneratedDataset(_0x2eeef6,_0x3545cc){const _0x49cada=a185_0x569b,_0x37f8f4=await apiRequest(_0x49cada(0xec),{'method':'POST','body':{'appCode':_0x2eeef6,'datasetName':_0x3545cc['datasetName'],'requirementDescription':_0x3545cc[_0x49cada(0xfd)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x37f8f4['data'];}export async function startTextGeneratedDataset(_0x198fb5,_0x4dfb66,_0xd7e3a7){const _0x4b4161=a185_0x569b,_0x5cd4a3=await apiRequest(_0x4b4161(0x122),{'method':_0x4b4161(0x13d),'body':{'appCode':_0x198fb5,..._0xd7e3a7?.[_0x4b4161(0xe3)]?{'clientOperationId':_0xd7e3a7[_0x4b4161(0xe3)]}:{},'design':_0x4dfb66},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x5cd4a3['data'];}export async function getTextGeneratedDatasetStatus(_0x4ee823,_0x21b904){const _0x2e3cb0=a185_0x569b,_0x36e1c0=new URLSearchParams({'appCode':_0x4ee823});_0x21b904[_0x2e3cb0(0x123)]&&_0x36e1c0[_0x2e3cb0(0xf8)](_0x2e3cb0(0x123),_0x21b904[_0x2e3cb0(0x123)]);_0x21b904[_0x2e3cb0(0xe3)]&&_0x36e1c0[_0x2e3cb0(0xf8)](_0x2e3cb0(0xe3),_0x21b904[_0x2e3cb0(0xe3)]);const _0x250b21=await apiRequest(_0x2e3cb0(0x100)+_0x36e1c0[_0x2e3cb0(0xaf)]());return _0x250b21[_0x2e3cb0(0x151)];}export async function searchDatasets(_0x4e6861,_0x2f3955){const _0x5e08ec=a185_0x569b,_0x49559a=await listDatasets(_0x4e6861,{'name':_0x2f3955}),_0x555333=_0x2f3955[_0x5e08ec(0xd3)](),_0x1d223d=new Set(_0x49559a['map'](_0x34066c=>_0x34066c['id'])),_0x51b9ed=_0x49559a['filter'](_0x11507c=>_0x11507c[_0x5e08ec(0x16f)]?.['tableName']?.[_0x5e08ec(0xd3)]()[_0x5e08ec(0x117)](_0x555333)||_0x11507c[_0x5e08ec(0xbd)]?.[_0x5e08ec(0xd3)]()[_0x5e08ec(0x117)](_0x555333)),_0x254902=await listDatasets(_0x4e6861,{'code':_0x2f3955});for(const _0x1d3b18 of _0x254902){!_0x1d223d[_0x5e08ec(0xb9)](_0x1d3b18['id'])&&(_0x49559a[_0x5e08ec(0x148)](_0x1d3b18),_0x1d223d[_0x5e08ec(0xb3)](_0x1d3b18['id']));}return _0x49559a;}export function normalizeDatasetOperations(_0x1cc8e4){const _0x52fbef=a185_0x569b;if(Array[_0x52fbef(0x95)](_0x1cc8e4))return _0x1cc8e4[_0x52fbef(0x145)](_0x53289f=>_0x53289f!=null&&typeof _0x53289f===_0x52fbef(0x132));if(_0x1cc8e4&&typeof _0x1cc8e4===_0x52fbef(0x132))return Object[_0x52fbef(0x116)](_0x1cc8e4)[_0x52fbef(0x145)](([,_0x4f6a6e])=>_0x4f6a6e!=null&&typeof _0x4f6a6e===_0x52fbef(0x132))[_0x52fbef(0x126)](([_0x4b3741,_0x29b9a1])=>({..._0x29b9a1,'name':_0x29b9a1[_0x52fbef(0x106)]??_0x29b9a1[_0x52fbef(0xb6)]??_0x4b3741}));return[];}export async function getDatasetDetail(_0x100066){const _0x50f3db=a185_0x569b,_0x1ae3a3=/^\d+$/['test'](_0x100066)?'id':'code',_0xe400b0=await apiRequest(_0x50f3db(0x17b)+_0x1ae3a3+'='+_0x100066);return _0xe400b0[_0x50f3db(0x151)];}export async function updateDrivenData(_0x2abb68){const _0xb9531d=a185_0x569b,_0x39a48c=await apiRequest(_0xb9531d(0x109),{'method':_0xb9531d(0x13d),'body':_0x2abb68});return _0x39a48c['data'];}export async function getDatasetOperations(_0x592485){const _0x4924a4=a185_0x569b,_0xceeae9=await getDatasetDetail(_0x592485),_0x58c0ec=normalizeDatasetOperations(_0xceeae9['operations'])[_0x4924a4(0x126)](_0x428bd7=>({'name':_0x428bd7[_0x4924a4(0x106)]||_0x428bd7[_0x4924a4(0xb6)],'displayName':_0x428bd7[_0x4924a4(0xed)]||_0x428bd7['name'],'type':_0x428bd7[_0x4924a4(0xf5)],'method':_0x428bd7[_0x4924a4(0x16c)],'path':_0x428bd7[_0x4924a4(0x16a)],'enabled':_0x428bd7[_0x4924a4(0x14b)]??!![],'requestFields':_0x428bd7[_0x4924a4(0x168)],'responseFields':_0x428bd7[_0x4924a4(0xce)]}));return{'dataset':{'id':_0xceeae9['id']??_0xceeae9['modelId'],'name':_0xceeae9[_0x4924a4(0x106)],'code':_0xceeae9[_0x4924a4(0x130)]||_0xceeae9[_0x4924a4(0x162)],'tableName':_0xceeae9['tableName']||_0xceeae9[_0x4924a4(0x16f)]?.['tableName']},'operations':_0x58c0ec};}export async function getOperationDetail(_0x36e2c6,_0x588181,_0x239431){const _0x563166=a185_0x569b;let _0x1ad389=_0x588181;if(!/^\d+$/[_0x563166(0xa4)](_0x588181)){const _0x52e7f8=await listDatasets(_0x36e2c6,{'code':_0x588181}),_0x2fb5a2=_0x52e7f8[_0x563166(0x103)](_0x300ea4=>_0x300ea4[_0x563166(0x130)]===_0x588181||String(_0x300ea4['id'])===_0x588181);if(!_0x2fb5a2)throw CliErrors[_0x563166(0x161)](_0x563166(0x111)+_0x588181);_0x1ad389=String(_0x2fb5a2['id']);}const _0x409bae=await getDatasetDetail(_0x1ad389),_0x1eea15=normalizeDatasetOperations(_0x409bae[_0x563166(0x158)])[_0x563166(0x103)](_0x3ccb3d=>(_0x3ccb3d['name']||_0x3ccb3d[_0x563166(0xb6)])===_0x239431);if(!_0x1eea15)throw CliErrors[_0x563166(0x161)]('Operation\x20\x22'+_0x239431+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x588181);return{'dataset':{'id':_0x409bae['id']??_0x409bae[_0x563166(0xdd)],'name':_0x409bae[_0x563166(0x106)],'code':_0x409bae[_0x563166(0x130)]||_0x409bae[_0x563166(0x162)],'tableName':_0x409bae[_0x563166(0x11b)]||_0x409bae['dbtableConfig']?.['tableName']},'operation':_0x1eea15};}export async function startGenerateStandardPages(_0x4e6f69,_0x51082c,_0x2970eb){const _0x36e01c=a185_0x569b,_0x1adc72=await apiRequest(_0x36e01c(0xd1)+_0x51082c+'/generate-standard-pages/start',{'method':_0x36e01c(0x13d),'body':{'appCode':_0x4e6f69,..._0x2970eb?.['clientOperationId']?{'clientOperationId':_0x2970eb[_0x36e01c(0xe3)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x1adc72[_0x36e01c(0x151)];}export async function getGenerateStandardPagesStatus(_0x322148,_0x7093e4,_0x1ffb63){const _0x564912=a185_0x569b,_0x2e0112=new URLSearchParams({'appCode':_0x322148});_0x1ffb63[_0x564912(0x123)]&&_0x2e0112[_0x564912(0xf8)](_0x564912(0x123),_0x1ffb63[_0x564912(0x123)]);_0x1ffb63['clientOperationId']&&_0x2e0112['set'](_0x564912(0xe3),_0x1ffb63[_0x564912(0xe3)]);const _0x373c42=await apiRequest(_0x564912(0xd1)+_0x7093e4+_0x564912(0x175)+_0x2e0112['toString']());return _0x373c42[_0x564912(0x151)];}export async function getStandardPageStatus(_0x4a2e58,_0xb7024e){const _0x528f22=a185_0x569b,_0x442922=await apiRequest(_0x528f22(0xd1)+_0xb7024e+_0x528f22(0x10a)+encodeURIComponent(_0x4a2e58));return _0x442922['data'];}export async function tryGetStandardPageStatus(_0x164e0f,_0x536fc2){const _0x494138=a185_0x569b;try{return await getStandardPageStatus(_0x164e0f,_0x536fc2);}catch(_0xd4b549){if(_0xd4b549 instanceof CliError&&_0xd4b549[_0x494138(0x130)]===_0x494138(0xad)&&/404|not found|non-json response/i[_0x494138(0xa4)](_0xd4b549[_0x494138(0x17f)]))return null;throw _0xd4b549;}}export async function syncStandardPages(_0x24de57,_0x4a7922){const _0x10e56c=a185_0x569b,_0x9a08=await apiRequest('/smartapi/lovrabet/dataset/'+_0x4a7922+_0x10e56c(0x9e),{'method':_0x10e56c(0x13d),'body':{'appCode':_0x24de57}});return _0x9a08[_0x10e56c(0x151)];}export async function getPageDetail(_0x2d1be0){const _0x290083=a185_0x569b,_0x4f1b0e=await apiRequest(_0x290083(0x11e)+_0x2d1be0);if(!_0x4f1b0e[_0x290083(0x151)])throw CliErrors[_0x290083(0x161)](_0x290083(0x96)+_0x2d1be0);return _0x4f1b0e[_0x290083(0x151)];}export async function updatePage(_0xc4c4f3,_0xd9575e,_0x362ded,_0x8a2dcf){const _0x5ebcef=a185_0x569b,_0x57da59=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x5ebcef(0x13d),'body':{'appCode':_0xc4c4f3,'pageId':_0xd9575e,'code':_0x362ded,'datasetIds':_0x8a2dcf}});return _0x57da59[_0x5ebcef(0x151)];}export function generateSdkCode(_0x3db657,_0x4d47ac,_0x1131c6){const _0x16b1b4=a185_0x569b,_0x5d787a=_0x1131c6?.['includeImports']??!![],_0x39558=_0x16b1b4(0x139)+_0x3db657[_0x16b1b4(0x130)]?.['replace'](/-/g,'_'),_0x40e1a1=_0x4d47ac[_0x16b1b4(0x106)]||_0x4d47ac[_0x16b1b4(0xb6)]||'filter',_0x3dc0fa=[];_0x5d787a&&_0x3dc0fa[_0x16b1b4(0x148)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x16b1b4(0x141),'');_0x3dc0fa[_0x16b1b4(0x148)]('//\x20'+_0x3db657[_0x16b1b4(0x106)]+'\x20('+(_0x3db657['tableName']||_0x16b1b4(0xda))+')');if(_0x40e1a1==='filter')_0x3dc0fa['push']('const\x20result\x20=\x20await\x20client.models.'+_0x39558+_0x16b1b4(0x154),'\x20\x20where:\x20{},',_0x16b1b4(0x10d),_0x16b1b4(0x12c),_0x16b1b4(0x12d));else{if(_0x40e1a1===_0x16b1b4(0x119))_0x3dc0fa[_0x16b1b4(0x148)]('const\x20result\x20=\x20await\x20client.models.'+_0x39558+_0x16b1b4(0x16e));else{if(_0x40e1a1===_0x16b1b4(0x13e))_0x3dc0fa[_0x16b1b4(0x148)](_0x16b1b4(0x16d)+_0x39558+_0x16b1b4(0x174));else{if(_0x40e1a1==='update')_0x3dc0fa[_0x16b1b4(0x148)](_0x16b1b4(0x16d)+_0x39558+_0x16b1b4(0xa1));else _0x40e1a1===_0x16b1b4(0xab)||_0x40e1a1==='remove'?_0x3dc0fa[_0x16b1b4(0x148)](_0x16b1b4(0x16d)+_0x39558+_0x16b1b4(0x15d)):_0x3dc0fa['push'](_0x16b1b4(0x16d)+_0x39558+'.'+_0x40e1a1+_0x16b1b4(0x10f));}}}return _0x3dc0fa['join']('\x0a');}export function generateSqlCodeTemplate(_0x49bf9f,_0x271ebd){const _0x2987ff=a185_0x569b,_0x4e9bc7=_0x271ebd?.[_0x2987ff(0xe8)]??'sdk',_0x2d78b0=_0x271ebd?.['includeImports']??!![],_0x5ecadd=[];return _0x5ecadd[_0x2987ff(0x148)](_0x2987ff(0x11a)+_0x49bf9f[_0x2987ff(0xcf)]+'\x20('+_0x49bf9f[_0x2987ff(0xeb)]+')'),_0x4e9bc7===_0x2987ff(0x17d)?(_0x2d78b0&&_0x5ecadd[_0x2987ff(0x148)](_0x2987ff(0x153),'',_0x2987ff(0x141),''),_0x5ecadd[_0x2987ff(0x148)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x2987ff(0x110)+_0x49bf9f['sqlCode']+'\x27,',_0x2987ff(0x9c),_0x2987ff(0x12d),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x2987ff(0xd7))):_0x5ecadd['push'](_0x2987ff(0x125),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x2987ff(0xfe),_0x2987ff(0x12e)+_0x49bf9f[_0x2987ff(0xeb)]+'\x27,',_0x2987ff(0x152),_0x2987ff(0x9b),_0x2987ff(0xff),'}'),_0x5ecadd[_0x2987ff(0x17a)]('\x0a');}export async function getErConfig(_0x28cdf1,_0xb78bd6){const _0x5c2a08=a185_0x569b,_0x21a783=await apiRequest(_0x5c2a08(0xfc),{'method':_0x5c2a08(0x13d),'body':{'appCode':_0x28cdf1,'dblinkId':_0xb78bd6},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x21a783['data'];}export async function getErRelationDetail(_0x2548c1,_0x57b0c3){const _0x16c5ad=a185_0x569b,_0x562138=new URLSearchParams({'appCode':_0x2548c1,'relationId':String(_0x57b0c3)});try{const _0x415b42=await apiRequest(_0x16c5ad(0x15a)+_0x562138[_0x16c5ad(0xaf)]());return _0x415b42[_0x16c5ad(0x151)]?.[_0x16c5ad(0x15f)]??null;}catch(_0x54f47f){if(_0x54f47f instanceof CliError&&_0x54f47f[_0x16c5ad(0x130)]===_0x16c5ad(0xad)&&(_0x54f47f[_0x16c5ad(0xb4)]?.[_0x16c5ad(0x117)]('DATA_NOT_EXIST')||_0x54f47f[_0x16c5ad(0xb4)]===_0x16c5ad(0x104)&&_0x54f47f['message']===_0x16c5ad(0xbc)))return null;throw _0x54f47f;}}export async function createErRelation(_0x167505){const _0x1224e7=a185_0x569b,_0x2e495d=await apiRequest(_0x1224e7(0x121),{'method':_0x1224e7(0x13d),'body':_0x167505,'allowNonJsonSuccess':!![]});return _0x2e495d['data'];}export async function updateErRelation(_0x3bce75){const _0x1d8a5f=a185_0x569b,_0xed66e9=await apiRequest(_0x1d8a5f(0x107),{'method':'POST','body':_0x3bce75,'allowNonJsonSuccess':!![]});return _0xed66e9[_0x1d8a5f(0x151)];}export async function deleteErRelation(_0x880dfb){const _0x567de3=a185_0x569b,_0x1e423c=await apiRequest(_0x567de3(0x13f),{'method':'POST','body':_0x880dfb,'allowNonJsonSuccess':!![]});return _0x1e423c[_0x567de3(0x151)];}export async function updateErBusinessGroup(_0x1433ef){const _0x3fff34=a185_0x569b,_0x4ff9df=await apiRequest(_0x3fff34(0x105),{'method':_0x3fff34(0x13d),'body':_0x1433ef,'allowNonJsonSuccess':!![]});return _0x4ff9df[_0x3fff34(0x151)];}function buildQuery(_0x50470b){const _0x3f5bdd=a185_0x569b,_0x4d1f95=new URLSearchParams();for(const [_0x13c9a4,_0x2aadf4]of Object[_0x3f5bdd(0x116)](_0x50470b)){if(_0x2aadf4===undefined||_0x2aadf4==='')continue;_0x4d1f95[_0x3f5bdd(0xf8)](_0x13c9a4,String(_0x2aadf4));}const _0x4660d7=_0x4d1f95[_0x3f5bdd(0xaf)]();return _0x4660d7?'?'+_0x4660d7:'';}export async function listNotificationChannelConfigs(_0x715629,_0x45bdeb){const _0x412509=a185_0x569b,_0x20f767=await apiRequest(_0x412509(0x138)+buildQuery({'appCode':_0x715629,'channelType':_0x45bdeb}));return Array[_0x412509(0x95)](_0x20f767[_0x412509(0x151)])?_0x20f767[_0x412509(0x151)]:[];}export async function listAppConfigs(_0x33e6a1,_0x208a30){const _0x1b3ef7=a185_0x569b,_0x317f8f=await apiRequest(_0x1b3ef7(0xea),{'method':'POST','body':{'appCode':_0x33e6a1,..._0x208a30?.['key']?{'key':_0x208a30['key']}:{},..._0x208a30?.[_0x1b3ef7(0xbb)]?{'tags':_0x208a30[_0x1b3ef7(0xbb)]}:{}}});return extractAppConfigList(_0x317f8f[_0x1b3ef7(0x151)]);}export async function getAppConfigByKey(_0x211a8a,_0x128f69){const _0x26ab86=await apiRequest('/smartapi/app-config/getByKey'+buildQuery({'appCode':_0x211a8a,'key':_0x128f69}));return _0x26ab86['data']??null;}export async function createAppConfig(_0x204477){const _0x6d81e7=a185_0x569b,_0x28841c=await apiRequest(_0x6d81e7(0x177),{'method':'POST','body':{'appCode':_0x204477['appCode'],'key':_0x204477['key'],'value':_0x204477['value'],..._0x204477[_0x6d81e7(0xbb)]?{'tags':_0x204477['tags']}:{}}});return _0x28841c[_0x6d81e7(0x151)];}export async function updateAppConfig(_0x252dac){const _0x3dd2f2=a185_0x569b;await apiRequest(_0x3dd2f2(0xe7),{'method':_0x3dd2f2(0x13d),'body':{'id':_0x252dac['id'],'appCode':_0x252dac[_0x3dd2f2(0x11f)],'key':_0x252dac['key'],'value':_0x252dac[_0x3dd2f2(0x101)],..._0x252dac[_0x3dd2f2(0xbb)]?{'tags':_0x252dac[_0x3dd2f2(0xbb)]}:{}}});}export async function deleteAppConfig(_0x5cf327){const _0x3861a=a185_0x569b;await apiRequest(_0x3861a(0xd8),{'method':_0x3861a(0x13d),'body':_0x5cf327});}function extractAppConfigList(_0xd1f822){const _0x314ad7=a185_0x569b;if(Array['isArray'](_0xd1f822))return _0xd1f822;if(_0xd1f822&&typeof _0xd1f822===_0x314ad7(0x132)&&Array['isArray'](_0xd1f822[_0x314ad7(0xc3)]))return _0xd1f822['list'];return extractList(_0xd1f822);}export async function listDbLinks(_0xf4ff09,_0x450da8){const _0x165f1f=a185_0x569b,_0x47e235=await apiRequest('/smartapi/dblink/getList',{'method':_0x165f1f(0x13d),'body':{'appCode':_0xf4ff09,'currentPage':_0x450da8?.['currentPage']??0x1,'pageSize':_0x450da8?.[_0x165f1f(0x14f)]??0x64}});return{'items':extractList(_0x47e235[_0x165f1f(0x151)]),'paging':extractPaging(_0x47e235[_0x165f1f(0x151)])};}export async function getDbLinkInfo(_0x5c1310){const _0x183495=a185_0x569b,_0x440cad=await apiRequest(_0x183495(0xf0)+buildQuery({'id':_0x5c1310}));return _0x440cad[_0x183495(0x151)];}export async function createDbLink(_0x57725f){const _0x25b82d=a185_0x569b,_0x9db737=await apiRequest(_0x25b82d(0x15c),{'method':_0x25b82d(0x13d),'body':_0x57725f});return _0x9db737[_0x25b82d(0x151)];}export async function updateDbLink(_0x7201eb){const _0x4a08e5=a185_0x569b,_0xa20bfe=await apiRequest(_0x4a08e5(0x13b),{'method':_0x4a08e5(0x13d),'body':_0x7201eb});return _0xa20bfe[_0x4a08e5(0x151)];}export async function deleteDbLink(_0x1f0b25){const _0x20ec20=a185_0x569b;await apiRequest(_0x20ec20(0xa9),{'method':'POST','body':{'id':_0x1f0b25}});}export async function testDbLinkConnect(_0x18863b){const _0x33a1c9=a185_0x569b,_0x5a1978=await apiRequest(_0x33a1c9(0xa0)+buildQuery({'id':_0x18863b}));return _0x5a1978['data'];}export async function startDbAnalysis(_0x132294,_0x4dc092){const _0x5541cd=a185_0x569b,_0x595ec0=await apiRequest(_0x5541cd(0x157),{'method':_0x5541cd(0x13d),'body':{'dbLinkId':_0x132294,..._0x4dc092&&_0x4dc092[_0x5541cd(0x10e)]>0x0?{'tableNames':_0x4dc092}:{}}}),_0x501887=_0x595ec0[_0x5541cd(0x151)];if(typeof _0x501887===_0x5541cd(0x137))return _0x501887;if(_0x501887&&typeof _0x501887===_0x5541cd(0x132)&&typeof _0x501887[_0x5541cd(0xc2)]===_0x5541cd(0x137))return _0x501887[_0x5541cd(0xc2)];return _0x501887!=null?String(_0x501887):'';}export async function cancelDbAnalysis(_0x265466){const _0xcc2023=a185_0x569b;await apiRequest(_0xcc2023(0x11c)+buildQuery({'planId':_0x265466}),{'method':_0xcc2023(0x13d)});}export async function getDbAnalysisStatus(_0x4961ff){const _0x411ce2=a185_0x569b,_0x4fedf7=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x4961ff));return _0x4fedf7[_0x411ce2(0x151)];}export async function getDbAllTableList(_0x5a76d7,_0x44d657){const _0xab03cb=a185_0x569b,_0x2ae742=await apiRequest(_0xab03cb(0x172)+buildQuery({'appCode':_0x5a76d7,'dbLinkId':_0x44d657})),_0xee4eec=_0x2ae742[_0xab03cb(0x151)];if(Array[_0xab03cb(0x95)](_0xee4eec))return _0xee4eec;return extractList(_0xee4eec);}export async function getDbTableDiff(_0x43fb85,_0x370ed9,_0x3dead2){const _0x2a91b8=a185_0x569b,_0x2108d3=await apiRequest(_0x2a91b8(0xa7)+buildQuery({'appCode':_0x43fb85,'dbLinkId':_0x370ed9,'pageIndex':_0x3dead2?.['pageIndex']??0x1,'pageSize':_0x3dead2?.[_0x2a91b8(0x14f)]??0x14,'tableName':_0x3dead2?.[_0x2a91b8(0x11b)]})),_0x1727b5=_0x2108d3['data'];return{'totalCount':_0x1727b5?.[_0x2a91b8(0xfb)]??0x0,'physicalTableCount':_0x1727b5?.[_0x2a91b8(0x9d)]??0x0,'datasetTableCount':_0x1727b5?.['datasetTableCount']??0x0,..._0x1727b5?.[_0x2a91b8(0xd9)]?{'summary':_0x1727b5[_0x2a91b8(0xd9)]}:{},'tableList':Array[_0x2a91b8(0x95)](_0x1727b5?.[_0x2a91b8(0xf4)])?_0x1727b5[_0x2a91b8(0xf4)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x156864=a185_0x569b,_0x6f6577=await apiRequest(_0x156864(0xfa),{'method':_0x156864(0x13d),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x221726=extractList(_0x6f6577[_0x156864(0x151)]),_0x104165=extractPaging(_0x6f6577['data']);return _0x104165&&_0x104165[_0x156864(0xfb)]>REMOTE_APP_PAGE_SIZE&&console['warn'](_0x156864(0xd2)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x104165[_0x156864(0xfb)]+_0x156864(0xe9)+_0x156864(0xc9)),_0x221726;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x205d25,_0x56ff82){const _0x48b590=a185_0x569b,_0x590d0d=Math[_0x48b590(0xdc)](Math[_0x48b590(0x9f)](_0x56ff82?.[_0x48b590(0x14f)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x47366a=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x48b590(0x13d),'body':{'appCode':_0x205d25,'currentPage':_0x56ff82?.[_0x48b590(0xe1)]??0x1,'pageSize':_0x590d0d}});return{'items':extractList(_0x47366a[_0x48b590(0x151)]),'paging':extractPaging(_0x47366a[_0x48b590(0x151)])};}export async function getAppRole(_0x4f8fb2){const _0x3832aa=a185_0x569b,_0x683952=await apiRequest(_0x3832aa(0x12f)+buildQuery({'id':_0x4f8fb2}));return _0x683952[_0x3832aa(0x151)];}export async function createAppRole(_0x5c9fac){const _0x444924=a185_0x569b,_0x539c24=await apiRequest(_0x444924(0x146),{'method':_0x444924(0x13d),'body':{'appCode':_0x5c9fac['appCode'],'roleName':_0x5c9fac['roleName'],'roleType':'CUSTOM',..._0x5c9fac[_0x444924(0x98)]?{'remark':_0x5c9fac[_0x444924(0x98)]}:{}}});return _0x539c24[_0x444924(0x151)];}export async function updateAppRole(_0x1709c1){const _0x482e70=a185_0x569b,_0x339e1c=await apiRequest(_0x482e70(0xdb),{'method':_0x482e70(0x13d),'body':{'id':_0x1709c1['id'],'appCode':_0x1709c1['appCode'],..._0x1709c1[_0x482e70(0xf1)]?{'roleType':_0x1709c1[_0x482e70(0xf1)]}:{},..._0x1709c1[_0x482e70(0x12b)]!==undefined?{'roleName':_0x1709c1[_0x482e70(0x12b)]}:{},..._0x1709c1[_0x482e70(0x98)]!==undefined?{'remark':_0x1709c1[_0x482e70(0x98)]}:{},..._0x1709c1[_0x482e70(0xc5)]?{'permits':_0x1709c1['permits']}:{}}});return _0x339e1c[_0x482e70(0x151)];}export async function deleteAppRole(_0x1116cd){const _0x3261a8=a185_0x569b;await apiRequest('/smartapi/permit/role/delete',{'method':_0x3261a8(0x13d),'body':{'id':_0x1116cd}});}export async function listPermitRoles(_0x376d53,_0xd00b82){const _0x29a8ce=a185_0x569b,_0x55f1f0=await apiRequest(_0x29a8ce(0xb5),{'method':_0x29a8ce(0x13d),'body':{'appCode':_0x376d53,..._0xd00b82?.[_0x29a8ce(0x155)]!==undefined?{'needSelf':_0xd00b82['needSelf']}:{},..._0xd00b82?.[_0x29a8ce(0xae)]!==undefined?{'needPublic':_0xd00b82[_0x29a8ce(0xae)]}:{}}});return extractList(_0x55f1f0[_0x29a8ce(0x151)]);}export async function getRoleMenuResources(_0x41f20d,_0x4bf55c){const _0x5b91c3=a185_0x569b,_0x214ee2=await apiRequest(_0x5b91c3(0x113),{'method':_0x5b91c3(0x13d),'body':{'appCode':_0x41f20d,'roleId':_0x4bf55c}});return extractList(_0x214ee2[_0x5b91c3(0x151)]);}export async function getRoleApiResources(_0x465490,_0xd53b56){const _0x2bfeb9=a185_0x569b,_0x14179e=await apiRequest(_0x2bfeb9(0x171),{'method':_0x2bfeb9(0x13d),'body':{'appCode':_0x465490,'roleId':_0xd53b56}});return extractList(_0x14179e[_0x2bfeb9(0x151)]);}export async function listRoleUsers(_0x29f9d4){const _0x4ae9f9=a185_0x569b,_0x29bbee=await apiRequest(_0x4ae9f9(0xf7),{'method':_0x4ae9f9(0x13d),'body':{'appCode':_0x29f9d4}});return extractList(_0x29bbee[_0x4ae9f9(0x151)]);}export async function updateRoleUsers(_0x35603a,_0x58e84c){const _0x462bc7=a185_0x569b;await apiRequest(_0x462bc7(0xa5),{'method':_0x462bc7(0x13d),'body':{'appCode':_0x35603a,'roleList':_0x58e84c}});}export async function getPagePermit(_0x277694){const _0x9b3f5e=a185_0x569b,_0x45806b=await apiRequest(_0x9b3f5e(0x102)+buildQuery({'menuId':_0x277694}));return _0x45806b[_0x9b3f5e(0x151)];}export async function savePagePermit(_0x32a6c1){const _0xd40034=a185_0x569b,_0x32ca34=await apiRequest(_0xd40034(0xf9),{'method':_0xd40034(0x13d),'body':_0x32a6c1});return _0x32ca34['data'];}export async function getTenantMembers(_0x4516fc){const _0xe5b2fd=a185_0x569b,_0x3d3b5a=await apiRequest(_0xe5b2fd(0x128)+buildQuery({'code':_0x4516fc})),_0x3526a4=_0x3d3b5a['data']??{},_0x4f8607=Array[_0xe5b2fd(0x95)](_0x3526a4?.[_0xe5b2fd(0x14c)])?_0x3526a4[_0xe5b2fd(0x14c)]:[];return _0x4f8607[_0xe5b2fd(0x145)](_0x38defd=>_0x38defd?.[_0xe5b2fd(0xef)]==='ENABLE'||_0x38defd?.[_0xe5b2fd(0xef)]===undefined)[_0xe5b2fd(0x126)](_0x58b65d=>({'userId':Number(_0x58b65d[_0xe5b2fd(0xa3)]??_0x58b65d['id']),'username':_0x58b65d[_0xe5b2fd(0x163)],'nickname':_0x58b65d[_0xe5b2fd(0xc6)],'status':_0x58b65d[_0xe5b2fd(0xef)],'email':_0x58b65d['email'],'mobile':_0x58b65d[_0xe5b2fd(0xbe)],'avatar':_0x58b65d['avatar']}))[_0xe5b2fd(0x145)](_0x3c5d28=>Number[_0xe5b2fd(0x135)](_0x3c5d28[_0xe5b2fd(0xa3)])&&_0x3c5d28['userId']>0x0);}
1
+ (function(_0xd0f9cc,_0x353b5c){const _0x10fc48=a185_0x163b,_0x195b67=_0xd0f9cc();while(!![]){try{const _0x462697=-parseInt(_0x10fc48(0x1c5))/0x1*(-parseInt(_0x10fc48(0x1f3))/0x2)+-parseInt(_0x10fc48(0x206))/0x3*(-parseInt(_0x10fc48(0x1ce))/0x4)+parseInt(_0x10fc48(0x176))/0x5*(parseInt(_0x10fc48(0x138))/0x6)+parseInt(_0x10fc48(0x173))/0x7*(-parseInt(_0x10fc48(0x204))/0x8)+parseInt(_0x10fc48(0x1ad))/0x9*(parseInt(_0x10fc48(0x1e8))/0xa)+parseInt(_0x10fc48(0x15e))/0xb+-parseInt(_0x10fc48(0x1af))/0xc;if(_0x462697===_0x353b5c)break;else _0x195b67['push'](_0x195b67['shift']());}catch(_0x1c87b2){_0x195b67['push'](_0x195b67['shift']());}}}(a185_0x1e9e,0x687de));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x1ebe75){_activeCookie=_0x1ebe75||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x2bf20;function createFetchFailureError(_0x3e76e9,_0x4db773){const _0xd766ce=a185_0x163b,_0xf78be4=_0x4db773 instanceof Error?_0x4db773[_0xd766ce(0x1db)]:String(_0x4db773);return CliErrors[_0xd766ce(0x171)](_0xd766ce(0x1e1)+_0x3e76e9+(_0xf78be4?'\x20('+_0xf78be4+')':''),_0xd766ce(0x13d));}async function apiRequest(_0x305518,_0x50479c={}){const _0x45b1aa=a185_0x163b,{method:method=_0x45b1aa(0x18d),body:_0x17113b,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x50479c,_0x1c6ca3=useRuntime?getRuntimeDomain():getApiDomain(),_0x262c35=_activeCookie||getCookie(),_0x4e5ce1=''+_0x1c6ca3+_0x305518,_0x48326e=new AbortController(),_0x23a715=setTimeout(()=>_0x48326e[_0x45b1aa(0x1e0)](),timeout);try{const _0x33beb8=await fetch(_0x4e5ce1,{'method':method,'headers':{'Content-Type':_0x45b1aa(0x196),'Cookie':_0x262c35,'X-Invoke-Source':_0x45b1aa(0x1eb),...headers},'body':_0x17113b?JSON[_0x45b1aa(0x187)](_0x17113b):undefined,'signal':_0x48326e[_0x45b1aa(0x168)]});let _0x4505ed;try{_0x4505ed=await _0x33beb8[_0x45b1aa(0x14f)]();}catch(_0x3b4a23){if(_0x3b4a23 instanceof Error&&_0x3b4a23[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors[_0x45b1aa(0x171)](_0x45b1aa(0x169)+_0x4e5ce1);if(_0x33beb8['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError'](_0x45b1aa(0x1bd)+_0x33beb8[_0x45b1aa(0x167)]+')',_0x33beb8['status']>=0x190?_0x45b1aa(0x137):undefined);}if(!_0x33beb8['ok']||_0x4505ed[_0x45b1aa(0x1d8)]===![])throw CliErrors['apiError'](_0x4505ed[_0x45b1aa(0x17f)]||_0x4505ed[_0x45b1aa(0x1db)]||_0x45b1aa(0x172)+_0x33beb8[_0x45b1aa(0x167)],_0x4505ed[_0x45b1aa(0x179)]?_0x45b1aa(0x141)+_0x4505ed[_0x45b1aa(0x179)]:undefined);return _0x4505ed;}catch(_0x31ebda){if(_0x31ebda instanceof CliError)throw _0x31ebda;if(_0x31ebda instanceof Error&&_0x31ebda[_0x45b1aa(0x1b5)]===_0x45b1aa(0x1a2))throw CliErrors['apiError'](_0x45b1aa(0x169)+_0x4e5ce1);throw createFetchFailureError(_0x4e5ce1,_0x31ebda);}finally{clearTimeout(_0x23a715);}}async function apiFormRequest(_0x4038b5,_0x483183,_0x123ee4={}){const _0x4c71d9=a185_0x163b,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x123ee4,_0x3af7da=_activeCookie||getCookie(),_0x3d98b4=''+getApiDomain()+_0x4038b5,_0x32b3a3=new AbortController(),_0x1a22e6=setTimeout(()=>_0x32b3a3['abort'](),timeout);try{const _0x5f3b7e=await fetch(_0x3d98b4,{'method':_0x4c71d9(0x158),'headers':{'Cookie':_0x3af7da,'X-Invoke-Source':_0x4c71d9(0x1eb)},'body':_0x483183,'signal':_0x32b3a3[_0x4c71d9(0x168)]});let _0x510294;try{_0x510294=await _0x5f3b7e[_0x4c71d9(0x14f)]();}catch(_0x4bb727){if(_0x4bb727 instanceof Error&&_0x4bb727[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x3d98b4);throw CliErrors['apiError'](_0x4c71d9(0x1bd)+_0x5f3b7e[_0x4c71d9(0x167)]+')',_0x5f3b7e[_0x4c71d9(0x167)]>=0x190?_0x4c71d9(0x137):undefined);}if(!_0x5f3b7e['ok']||_0x510294['success']===![])throw CliErrors['apiError'](_0x510294[_0x4c71d9(0x17f)]||_0x510294[_0x4c71d9(0x1db)]||_0x4c71d9(0x172)+_0x5f3b7e[_0x4c71d9(0x167)],_0x510294['errorCode']?_0x4c71d9(0x141)+_0x510294[_0x4c71d9(0x179)]:undefined);return _0x510294;}catch(_0x13cdf5){if(_0x13cdf5 instanceof CliError)throw _0x13cdf5;if(_0x13cdf5 instanceof Error&&_0x13cdf5[_0x4c71d9(0x1b5)]===_0x4c71d9(0x1a2))throw CliErrors[_0x4c71d9(0x171)](_0x4c71d9(0x169)+_0x3d98b4);throw createFetchFailureError(_0x3d98b4,_0x13cdf5);}finally{clearTimeout(_0x1a22e6);}}export async function uploadDevelopmentFile(_0x16e318,_0x3d1dd9){const _0x170f7b=a185_0x163b,_0x8d0573=await readFile(_0x3d1dd9),_0xe2b822=new FormData();_0xe2b822['append'](_0x170f7b(0x133),_0x16e318),_0xe2b822['append'](_0x170f7b(0x1e2),new Blob([new Uint8Array(_0x8d0573)]),basename(_0x3d1dd9));const _0x382206=await apiFormRequest('/smartapi/common/uploadFile',_0xe2b822);return _0x382206[_0x170f7b(0x208)];}export async function queryDevelopmentFileUrl(_0x42a17f,_0x2b3ca2={}){const _0x51573a=a185_0x163b,_0x476268=await apiRequest(_0x51573a(0x134),{'method':_0x51573a(0x158),'body':{'filePath':_0x42a17f,'downloadFlag':_0x2b3ca2['download']??![],..._0x2b3ca2[_0x51573a(0x18e)]?{'longTerm':!![]}:{}}});return _0x476268['data'];}function isAuthFailure(_0x345950){const _0x157e49=a185_0x163b,_0x587559=_0x345950['errorMsg']||_0x345950[_0x157e49(0x1db)]||_0x345950['data']?.[_0x157e49(0x1db)]||_0x345950[_0x157e49(0x14c)]||_0x345950[_0x157e49(0x1d9)]||'';return _0x345950['errorCode']===_0x157e49(0x1cf)||_0x345950[_0x157e49(0x193)]===0x191||_0x345950[_0x157e49(0x193)]===_0x157e49(0x1f9)||_0x587559['includes'](_0x157e49(0x1f9))||_0x587559['includes']('Unauthorized')||_0x587559['includes']('登录')||_0x587559[_0x157e49(0x16d)]('认证');}export async function platformFetch(_0x94d6f6,_0x584a1e){const _0xca14ca=a185_0x163b;let _0x123575;try{_0x123575=await fetch(_0x94d6f6,{'method':_0x584a1e[_0xca14ca(0x188)]??_0xca14ca(0x18d),'headers':{'Content-Type':_0xca14ca(0x196),'Cookie':_0x584a1e[_0xca14ca(0x153)],'X-Invoke-Source':'cli:rabetbase'},..._0x584a1e[_0xca14ca(0x1b1)]&&{'body':JSON[_0xca14ca(0x187)](_0x584a1e['body'])}});}catch(_0xce7993){throw createFetchFailureError(_0x94d6f6,_0xce7993);}if(!_0x123575['ok']){if(_0x123575[_0xca14ca(0x167)]===0x191)throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x156)+_0x123575[_0xca14ca(0x167)]);}const _0x276a11=await _0x123575[_0xca14ca(0x14f)]();if(_0x276a11['success']===![]){if(isAuthFailure(_0x276a11))throw CliErrors[_0xca14ca(0x17c)]();throw CliErrors[_0xca14ca(0x171)](_0x276a11[_0xca14ca(0x17f)]||_0x276a11[_0xca14ca(0x1db)]||_0x584a1e[_0xca14ca(0x16f)]+_0xca14ca(0x128));}return _0x276a11['data'];}export async function platformRequest(_0x56138e,_0x5e4235){const _0x518f2a=a185_0x163b;if(/^https?:\/\//i[_0x518f2a(0x13a)](_0x56138e))throw CliErrors[_0x518f2a(0x1aa)](_0x518f2a(0x150)+_0x56138e,_0x518f2a(0x1f6));const _0x5d8c76=_0x56138e[_0x518f2a(0x1be)]('/')?_0x56138e:'/'+_0x56138e;return platformFetch(''+getApiDomain()+_0x5d8c76,_0x5e4235);}function cleanNewlines(_0x15bb60){const _0x574efd=a185_0x163b;return _0x15bb60[_0x574efd(0x1c2)](/[\r\n]+/g,'\x20')[_0x574efd(0x1ac)]();}function cleanDatasetName(_0x44e195){const _0x1ec60b=a185_0x163b;if(!_0x44e195['name'])return _0x44e195;return{..._0x44e195,'name':cleanNewlines(_0x44e195[_0x1ec60b(0x1b5)])};}export async function fetchModelList(_0x249ceb,_0x22988e){const _0x49c354=a185_0x163b,_0x5e1119=getEnv(),_0x1af3aa=new URLSearchParams({'appcode':_0x249ceb,'otype':'array'}),_0x1f9da7='/api/node-toolbox/dataset/model-list?'+_0x1af3aa[_0x49c354(0x1e5)]();logger[_0x49c354(0x1f0)](_0x49c354(0x175),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x5e1119+')',{'apiPath':_0x1f9da7});const _0x3dc0f8=await platformRequest(_0x1f9da7,{'cookie':_0x22988e,'label':_0x49c354(0x1a7)}),_0x5b02f5=(_0x3dc0f8[_0x49c354(0x1f5)]??[])[_0x49c354(0x1d0)](cleanDatasetName);return{'configArray':_0x5b02f5,'count':_0x5b02f5[_0x49c354(0x1d5)]};}export async function fetchDatasetDoc(_0x168ec1){const _0x305b69=a185_0x163b,{appCode:_0xc345b9,cookie:_0x3218b8,datasetCode:_0x4f2478,datasetId:_0x42cf64,extraParams:_0x25fc3b}=_0x168ec1,_0x2e5511=await platformRequest(_0x305b69(0x194),{'method':_0x305b69(0x158),'body':{'appCode':_0xc345b9,'datasetCode':_0x4f2478,'datasetId':_0x42cf64,..._0x25fc3b||{}},'cookie':_0x3218b8,'label':_0x305b69(0x164)+_0x4f2478+')'});if(!_0x2e5511||typeof _0x2e5511[_0x305b69(0x1ae)]!==_0x305b69(0x1b0))throw new Error(_0x305b69(0x12d)+_0x4f2478+_0x305b69(0x13e));return _0x2e5511['markdown'];}export async function getMenuTree(_0x2c0706,_0x24e2b8){const _0x512312=a185_0x163b,_0x198ff5=new URLSearchParams({'appCode':_0x2c0706});return platformRequest(_0x512312(0x186)+_0x198ff5[_0x512312(0x1e5)](),{'cookie':_0x24e2b8,'label':_0x512312(0x1c8)});}export async function createMenuRecord(_0x369898,_0x1d89be,_0x66a067){const _0x54b8e6=a185_0x163b;return platformRequest(_0x54b8e6(0x1dd),{'method':_0x54b8e6(0x158),'body':_0x369898,'cookie':_0x1d89be,'label':_0x66a067});}export async function updateMenuRecord(_0x50a422,_0x162aa9,_0x5266ca){return platformRequest('/smartapi/menu/update',{'method':'POST','body':_0x50a422,'cookie':_0x162aa9,'label':_0x5266ca});}export async function listBffScripts(_0x36214a,_0x1e9ff5,_0x37520a){const _0x98fbe5=a185_0x163b;let _0x240dc8=_0x98fbe5(0x19f)+_0x36214a;if(_0x1e9ff5)_0x240dc8+='&type='+_0x1e9ff5;const _0x2cdbf0=await apiRequest(_0x240dc8);let _0x144291=extractList(_0x2cdbf0[_0x98fbe5(0x208)]);if(_0x37520a?.['scriptName']){const _0x2da6d8=_0x37520a[_0x98fbe5(0x203)]['toLowerCase']();_0x144291=_0x144291[_0x98fbe5(0x190)](_0x39696d=>_0x39696d[_0x98fbe5(0x16e)]?.[_0x98fbe5(0x1a8)]()[_0x98fbe5(0x16d)](_0x2da6d8)||_0x39696d['description']?.[_0x98fbe5(0x1a8)]()['includes'](_0x2da6d8));}return _0x144291;}export async function getBffScriptInfo(_0x1e919b){const _0x2a3930=a185_0x163b,_0x5a43de=await apiRequest('/api/management/library/scripts/info?id='+_0x1e919b);if(!_0x5a43de[_0x2a3930(0x208)])throw CliErrors[_0x2a3930(0x1aa)]('BFF\x20script\x20not\x20found:\x20id='+_0x1e919b);return _0x5a43de[_0x2a3930(0x208)];}export async function saveBffScript(_0x2787ad){const _0x41b304=a185_0x163b,_0x58cce4=await apiRequest(_0x41b304(0x12f),{'method':'POST','body':_0x2787ad}),{id:_0x4d80d8,entity:_0x3ad8cd}=normalizeEntityWithIdResponse(_0x58cce4[_0x41b304(0x208)]);if(_0x4d80d8!==undefined){const _0x2806ae=typeof _0x3ad8cd['functionName']===_0x41b304(0x1b0)||typeof _0x3ad8cd[_0x41b304(0x161)]===_0x41b304(0x1b0)?_0x3ad8cd:undefined;return{'id':_0x4d80d8,'script':_0x2806ae};}throw CliErrors['apiError'](_0x41b304(0x148));}export async function deleteBffScript(_0x3e0e32){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x3e0e32}});}export async function getBffScriptStatistics(_0x225170){const _0x54e38d=a185_0x163b,_0x4bf7bf=await apiRequest(_0x54e38d(0x18b)+_0x225170);return extractList(_0x4bf7bf['data']);}export async function clearBffScriptCache(){const _0x402ca7=a185_0x163b,_0x37b275=await apiRequest(_0x402ca7(0x19e),{'method':'POST','useRuntime':!![]});return typeof _0x37b275[_0x402ca7(0x208)]===_0x402ca7(0x1b0)?_0x37b275[_0x402ca7(0x208)]:'';}export async function listBffDatasetOperations(_0x1054f1,_0x8a232b){const _0x3d9496=a185_0x163b,_0xb3e3a3=await apiRequest(_0x3d9496(0x12b),{'method':_0x3d9496(0x158),'body':{'appCode':_0x1054f1,'datasetId':_0x8a232b}});return _0xb3e3a3[_0x3d9496(0x208)];}export async function listSqlQueries(_0x317e5f,_0x30d65f){const _0x3b9f3c=a185_0x163b,_0x4281fc=await apiRequest(_0x3b9f3c(0x192),{'method':_0x3b9f3c(0x158),'body':{'appCode':_0x317e5f,'currentPage':_0x30d65f?.[_0x3b9f3c(0x1e3)]??0x1,'pageSize':_0x30d65f?.['pageSize']??0x32,'sqlCode':_0x30d65f?.[_0x3b9f3c(0x1a4)],'sqlName':_0x30d65f?.[_0x3b9f3c(0x1e9)]}});return _0x4281fc['data'];}export async function getSqlQueryInfo(_0x1b9382,_0x1d5fdf){const _0x51e43d=a185_0x163b,_0x11fcb5=await listSqlQueries(_0x1b9382,{'sqlCode':_0x1d5fdf}),_0x2619cb=_0x11fcb5[_0x51e43d(0x146)]?.[0x0];if(!_0x2619cb)throw CliErrors[_0x51e43d(0x1aa)](_0x51e43d(0x147)+_0x1d5fdf);return _0x2619cb;}export async function getSqlQueryDetail(_0x18912a){const _0x2e86d7=a185_0x163b,_0x578db5=await apiRequest(_0x2e86d7(0x183)+(_0x2e86d7(0x1d4)+encodeURIComponent(_0x18912a)));if(!_0x578db5[_0x2e86d7(0x208)])throw CliErrors['validation'](_0x2e86d7(0x147)+_0x18912a);return _0x578db5[_0x2e86d7(0x208)];}export async function getSqlQueryDetailById(_0x261e7c){const _0x29feb5=a185_0x163b,_0x2d224a=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x261e7c);if(!_0x2d224a['data'])throw CliErrors[_0x29feb5(0x1aa)]('SQL\x20query\x20not\x20found:\x20id='+_0x261e7c);return _0x2d224a['data'];}export async function createSqlQuery(_0x521290){const _0x3a31f6=a185_0x163b,_0x358fbe=await apiRequest(_0x3a31f6(0x15f),{'method':'POST','body':_0x521290}),{id:_0x366f73,entity:_0x1c5921}=normalizeEntityWithIdResponse(_0x358fbe['data']);if(!(_0x3a31f6(0x1a4)in _0x1c5921)&&_0x366f73)return getSqlQueryDetailById(_0x366f73);return normalizeSqlQueryEntity(_0x1c5921);}export async function updateSqlQuery(_0x5cd4e7){const _0x43e222=a185_0x163b,_0x2ac89e=await apiRequest(_0x43e222(0x144),{'method':_0x43e222(0x158),'body':_0x5cd4e7}),{id:_0x11bce8,entity:_0x4aee80}=normalizeEntityWithIdResponse(_0x2ac89e[_0x43e222(0x208)]);if(!(_0x43e222(0x1a4)in _0x4aee80)){if(_0x5cd4e7[_0x43e222(0x1a4)])return getSqlQueryDetail(_0x5cd4e7['sqlCode']);if(_0x11bce8)return getSqlQueryDetailById(_0x11bce8);}return normalizeSqlQueryEntity(_0x4aee80);}export async function deleteSqlQuery(_0x124283){const _0x657ebb=a185_0x163b;await apiRequest('/smartapi/custom/deleteUserCustomSql',{'method':_0x657ebb(0x158),'body':_0x124283});}function a185_0x163b(_0x40b67a,_0xdd4c5f){_0x40b67a=_0x40b67a-0x126;const _0x1e9e38=a185_0x1e9e();let _0x163ba4=_0x1e9e38[_0x40b67a];return _0x163ba4;}export async function saveSqlQuery(_0x1e246b){const _0x44cc88=a185_0x163b,_0xd4140b=await apiRequest(_0x44cc88(0x1a5),{'method':_0x44cc88(0x158),'body':_0x1e246b});return _0xd4140b[_0x44cc88(0x208)];}function normalizeSqlQueryEntity(_0x1178b2){const _0x249f92=a185_0x163b;return{..._0x1178b2,'id':Number(_0x1178b2['id']),'dbId':_0x1178b2[_0x249f92(0x15d)]==null?undefined:Number(_0x1178b2[_0x249f92(0x15d)]),'version':_0x1178b2[_0x249f92(0x19a)]==null?undefined:Number(_0x1178b2[_0x249f92(0x19a)])};}export async function executeSql(_0x6cadd6,_0x548030,_0x26b14a){const _0x15388f=a185_0x163b,_0x3e98e8=await apiRequest(_0x15388f(0x1d6),{'method':_0x15388f(0x158),'body':{'appCode':_0x6cadd6,'sqlCode':_0x548030,..._0x26b14a&&{'params':_0x26b14a}},'useRuntime':!![]});return _0x3e98e8['data'];}export async function executeDatasetDataOperation(_0x2e0e9a,_0x286587,_0x31a140,_0x1cc752={}){const _0x11f47d=a185_0x163b;try{const _0x1329c0=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+'/'+_0x31a140,{'method':_0x11f47d(0x158),'body':_0x1cc752,'useRuntime':!![]});return _0x1329c0['data'];}catch(_0x481d4d){if(_0x31a140===_0x11f47d(0x1da)&&_0x481d4d instanceof CliError&&_0x481d4d[_0x11f47d(0x193)]==='api_error'&&_0x1cc752['id']!==undefined&&_0x1cc752['id']!==null&&_0x1cc752['id']!==''){const _0x2c7b6a=await apiRequest(_0x11f47d(0x149)+_0x2e0e9a+'/'+_0x286587+_0x11f47d(0x1c9),{'method':_0x11f47d(0x158),'body':{'where':{'id':{'$eq':_0x1cc752['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x54a9b7=Array['isArray'](_0x2c7b6a['data']?.['tableData'])?_0x2c7b6a[_0x11f47d(0x208)][_0x11f47d(0x146)]:[];return _0x54a9b7[0x0]??null;}throw _0x481d4d;}}export async function listDatasets(_0x5dff09,_0x48abf5){const _0x585f56=a185_0x163b,_0x5a463a={'appCode':_0x5dff09,'deleted':_0x48abf5?.[_0x585f56(0x16c)]??![]};if(_0x48abf5?.[_0x585f56(0x193)])_0x5a463a['code']=_0x48abf5[_0x585f56(0x193)];if(_0x48abf5?.['name'])_0x5a463a[_0x585f56(0x1b5)]=_0x48abf5[_0x585f56(0x1b5)];const _0x364123=await apiRequest(_0x585f56(0x1f8),{'method':_0x585f56(0x158),'body':_0x5a463a});return extractList(_0x364123[_0x585f56(0x208)]);}export async function deleteDataset(_0x35b8e3,_0x3f2a51){const _0x4cc886=a185_0x163b;await apiRequest(_0x4cc886(0x1c6),{'method':'POST','body':{'appCode':_0x35b8e3,'datasetId':_0x3f2a51}});}export async function restoreDataset(_0x4a56ab,_0x2fece4){const _0x4278d2=a185_0x163b;await apiRequest(_0x4278d2(0x1e4),{'method':_0x4278d2(0x158),'body':{'appCode':_0x4a56ab,'datasetId':_0x2fece4}});}export async function previewTextGeneratedDataset(_0x1a0b81,_0x353206){const _0x4d8db1=a185_0x163b,_0x4dc941=await apiRequest(_0x4d8db1(0x16a),{'method':_0x4d8db1(0x158),'body':{'appCode':_0x1a0b81,'datasetName':_0x353206[_0x4d8db1(0x1f2)],'requirementDescription':_0x353206['requirementDescription']},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x4dc941['data'];}export async function startTextGeneratedDataset(_0x152006,_0x60a48d,_0x614d0c){const _0x105054=a185_0x163b,_0x572d10=await apiRequest(_0x105054(0x1ed),{'method':_0x105054(0x158),'body':{'appCode':_0x152006,..._0x614d0c?.[_0x105054(0x1b4)]?{'clientOperationId':_0x614d0c['clientOperationId']}:{},'design':_0x60a48d},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x572d10[_0x105054(0x208)];}export async function getTextGeneratedDatasetStatus(_0x13a508,_0x140776){const _0xc58936=a185_0x163b,_0xcacd56=new URLSearchParams({'appCode':_0x13a508});_0x140776[_0xc58936(0x1fb)]&&_0xcacd56[_0xc58936(0x197)]('operationId',_0x140776[_0xc58936(0x1fb)]);_0x140776[_0xc58936(0x1b4)]&&_0xcacd56[_0xc58936(0x197)](_0xc58936(0x1b4),_0x140776[_0xc58936(0x1b4)]);const _0xe343ec=await apiRequest(_0xc58936(0x20a)+_0xcacd56[_0xc58936(0x1e5)]());return _0xe343ec[_0xc58936(0x208)];}export async function searchDatasets(_0x521985,_0x4d8e00){const _0x5e6c15=a185_0x163b,_0x65a2e0=await listDatasets(_0x521985,{'name':_0x4d8e00}),_0x50688b=_0x4d8e00['toLowerCase'](),_0x56bfed=new Set(_0x65a2e0[_0x5e6c15(0x1d0)](_0x23b15e=>_0x23b15e['id'])),_0x40b18b=_0x65a2e0['filter'](_0x5c9483=>_0x5c9483['dbtableConfig']?.[_0x5e6c15(0x165)]?.['toLowerCase']()['includes'](_0x50688b)||_0x5c9483[_0x5e6c15(0x1a6)]?.[_0x5e6c15(0x1a8)]()[_0x5e6c15(0x16d)](_0x50688b)),_0x39329e=await listDatasets(_0x521985,{'code':_0x4d8e00});for(const _0x522faa of _0x39329e){!_0x56bfed['has'](_0x522faa['id'])&&(_0x65a2e0[_0x5e6c15(0x17d)](_0x522faa),_0x56bfed[_0x5e6c15(0x181)](_0x522faa['id']));}return _0x65a2e0;}export function normalizeDatasetOperations(_0x3e97d4){const _0x2f4660=a185_0x163b;if(Array[_0x2f4660(0x189)](_0x3e97d4))return _0x3e97d4['filter'](_0x172a78=>_0x172a78!=null&&typeof _0x172a78===_0x2f4660(0x182));if(_0x3e97d4&&typeof _0x3e97d4===_0x2f4660(0x182))return Object[_0x2f4660(0x12e)](_0x3e97d4)[_0x2f4660(0x190)](([,_0x58e0db])=>_0x58e0db!=null&&typeof _0x58e0db===_0x2f4660(0x182))['map'](([_0x5aec1f,_0x4a9c9])=>({..._0x4a9c9,'name':_0x4a9c9[_0x2f4660(0x1b5)]??_0x4a9c9[_0x2f4660(0x180)]??_0x5aec1f}));return[];}export async function getDatasetDetail(_0x434e7b){const _0x1ae7ae=a185_0x163b,_0x4ea690=/^\d+$/[_0x1ae7ae(0x13a)](_0x434e7b)?'id':_0x1ae7ae(0x193),_0x241cdb=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x4ea690+'='+_0x434e7b);return _0x241cdb['data'];}function a185_0x1e9e(){const _0x26b779=['label','/smartapi/question/er-config/business-group/edit','apiError','API\x20error:\x20','15148HBmWAq','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','fetch-model-list','10lyQekw','create','ER\x20relation\x20does\x20not\x20exist','errorCode','/smartapi/db-analysis/jobs/cancel','.getOne(id);','authRequired','push','Operation\x20\x22','errorMsg','operationName','add','object','/smartapi/custom/getUserCustomSql','/smartapi/question/er-config/cli/update-single','/smartapi/question/er-config/cli/delete-single','/smartapi/menu/find?','stringify','method','isArray','/smartapi/dblink/testConnect','/api/management/library/scripts/statistics?appCode=','/smartapi/permit/resource/get-menu-list','GET','longTerm','avatar','filter','modelCode','/smartapi/custom/queryUserCustomSqlList','code','/api/node-toolbox/api-doc-generator','ENABLE','application/json','set','userTenantRelationList','const\x20results\x20=\x20data.execResult\x20||\x20[];','version','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','email','warn','/api/management/script/cache/clear','/api/management/library/scripts/list?appCode=','enabled','CUSTOM','AbortError','min','sqlCode','/api/node-toolbox/sql/save','description','Fetch\x20datasets','toLowerCase','remark','validation','/smartapi/lovrabet/detail?pageId=','trim','5904CQBieP','markdown','19016436rPBRmp','string','body','update','table','clientOperationId','name','tags','pageSize','join','.create({\x20/*\x20fields\x20*/\x20});','value','/userTenant/getByTenantCode','/smartapi/permit/user-role/get-user-list','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','startsWith','/smartapi/permit/role/delete','/smartapi/app-config/getByKey','/smartapi/lovrabet/dataset/','replace','list','/smartapi/app-config/update','830353OlFxYs','/smartapi/dataset/delete-dataset','remove','Fetch\x20menu\x20list','/filter','isFinite','\x20\x20currentPage:\x201,','/smartapi/dataset/update-driven-data','/smartapi/app-config/delete','95540jvxdoW','UNAUTHORIZED','map','//\x20SQL:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','hint','?sqlCode=','length','/api/custom/executeSql','totalCount','success','error','getOne','message','summary','/smartapi/menu/create','/notification/channel-config/list','/smartapi/permit/role/get-permit-list','abort','Request\x20failed:\x20','file','currentPage','/smartapi/dataset/restore-dataset','toString','type','nickname','7150IBpdfG','sqlName','dataset_','cli:rabetbase','\x20\x20where:\x20{},','/smartapi/dataset/text-generate/start','/smartapi/db-analysis/status/','/smartapi/question/er-config/cli/detail?','info','modelId','datasetName','2ONWsEb','needPublic','configArray','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','\x20of\x20','/smartapi/dataset/get-dataset-list','401','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','operationId','//\x20','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/dblink/update','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','includeImports','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','username','scriptName','856QNIquV','/smartapi/dblink/getList','57LNLusU','requestFields','data','tableList','/smartapi/dataset/text-generate/status?','/smartapi/permit/role/update','key','\x20failed','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','dbtableConfig','/smartapi/dataset/get-dataset-operation','physicalTableCount','Invalid\x20response\x20format\x20(','entries','/api/management/library/scripts/save','/smartapi/app-config/create','sdk','.remove(id);','appCode','/smartapi/common/queryFileUrl','Dataset\x20not\x20found:\x20','DATA_NOT_EXIST','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','363174fqxflj','const\x20result\x20=\x20await\x20client.models.','test','needSelf','datasetTableCount','Check\x20network\x20connectivity\x20and\x20try\x20again.','):\x20missing\x20data.markdown\x20field','relation','\x20\x20sqlCode:\x20\x27','API\x20error\x20code:\x20','\x20apps.\x20','roleType','/smartapi/custom/updateUserCustomSql','.filter({','tableData','SQL\x20query\x20not\x20found:\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','/api/','/smartapi/question/er-config','/smartapi/permit/resource/get-api-list','errorMessage','/standard-page-status?appCode=','operations','json','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','permits','Page\x20not\x20found:\x20','cookie','\x20\x20});','\x20\x20return\x20rows;','\x20failed,\x20HTTP\x20','roleName','POST','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','userId','/smartapi/app/getList','/smartapi/dblink/delete','dbId','4069813WeMLVP','/smartapi/custom/saveUserCustomSql','(/*\x20params\x20*/);','scriptType','/generate-standard-pages/start','mobile','Fetch\x20doc\x20(','tableName','\x20\x20\x20\x20sqlCode:\x20\x27','status','signal','Request\x20timeout:\x20','/smartapi/dataset/text-generate/preview','/smartapi/lovrabet/update-page','deleted','includes','functionName'];a185_0x1e9e=function(){return _0x26b779;};return a185_0x1e9e();}export async function updateDrivenData(_0x18a21a){const _0x1cc4b7=a185_0x163b,_0x1ef8c6=await apiRequest(_0x1cc4b7(0x1cc),{'method':_0x1cc4b7(0x158),'body':_0x18a21a});return _0x1ef8c6['data'];}export async function getDatasetOperations(_0x3cf590){const _0x1133ed=a185_0x163b,_0x614f9a=await getDatasetDetail(_0x3cf590),_0x1524ce=normalizeDatasetOperations(_0x614f9a[_0x1133ed(0x14e)])[_0x1133ed(0x1d0)](_0xa105c6=>({'name':_0xa105c6['name']||_0xa105c6['operationName'],'displayName':_0xa105c6['displayName']||_0xa105c6[_0x1133ed(0x1b5)],'type':_0xa105c6[_0x1133ed(0x1e6)],'method':_0xa105c6[_0x1133ed(0x188)],'path':_0xa105c6['path'],'enabled':_0xa105c6[_0x1133ed(0x1a0)]??!![],'requestFields':_0xa105c6[_0x1133ed(0x207)],'responseFields':_0xa105c6['responseFields']}));return{'dataset':{'id':_0x614f9a['id']??_0x614f9a[_0x1133ed(0x1f1)],'name':_0x614f9a['name'],'code':_0x614f9a[_0x1133ed(0x193)]||_0x614f9a[_0x1133ed(0x191)],'tableName':_0x614f9a[_0x1133ed(0x165)]||_0x614f9a[_0x1133ed(0x12a)]?.[_0x1133ed(0x165)]},'operations':_0x1524ce};}export async function getOperationDetail(_0x549cc1,_0x3b2305,_0x1a80ab){const _0x495265=a185_0x163b;let _0x404ca0=_0x3b2305;if(!/^\d+$/['test'](_0x3b2305)){const _0x118d9d=await listDatasets(_0x549cc1,{'code':_0x3b2305}),_0x115ebd=_0x118d9d['find'](_0x1b2c1c=>_0x1b2c1c[_0x495265(0x193)]===_0x3b2305||String(_0x1b2c1c['id'])===_0x3b2305);if(!_0x115ebd)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x135)+_0x3b2305);_0x404ca0=String(_0x115ebd['id']);}const _0x47b61d=await getDatasetDetail(_0x404ca0),_0x4e2a42=normalizeDatasetOperations(_0x47b61d[_0x495265(0x14e)])['find'](_0x16bd4e=>(_0x16bd4e[_0x495265(0x1b5)]||_0x16bd4e[_0x495265(0x180)])===_0x1a80ab);if(!_0x4e2a42)throw CliErrors[_0x495265(0x1aa)](_0x495265(0x17e)+_0x1a80ab+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x3b2305);return{'dataset':{'id':_0x47b61d['id']??_0x47b61d['modelId'],'name':_0x47b61d[_0x495265(0x1b5)],'code':_0x47b61d[_0x495265(0x193)]||_0x47b61d[_0x495265(0x191)],'tableName':_0x47b61d['tableName']||_0x47b61d['dbtableConfig']?.['tableName']},'operation':_0x4e2a42};}export async function startGenerateStandardPages(_0x691121,_0x57af6d,_0x521357){const _0x454e05=a185_0x163b,_0x940f62=await apiRequest(_0x454e05(0x1c1)+_0x57af6d+_0x454e05(0x162),{'method':_0x454e05(0x158),'body':{'appCode':_0x691121,..._0x521357?.['clientOperationId']?{'clientOperationId':_0x521357['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x940f62[_0x454e05(0x208)];}export async function getGenerateStandardPagesStatus(_0x4d172e,_0x5d41d8,_0x52e891){const _0x18c02d=a185_0x163b,_0x1423f1=new URLSearchParams({'appCode':_0x4d172e});_0x52e891[_0x18c02d(0x1fb)]&&_0x1423f1[_0x18c02d(0x197)]('operationId',_0x52e891['operationId']);_0x52e891['clientOperationId']&&_0x1423f1[_0x18c02d(0x197)]('clientOperationId',_0x52e891[_0x18c02d(0x1b4)]);const _0x2e2c5f=await apiRequest(_0x18c02d(0x1c1)+_0x5d41d8+'/generate-standard-pages/status?'+_0x1423f1[_0x18c02d(0x1e5)]());return _0x2e2c5f['data'];}export async function getStandardPageStatus(_0x23b7c0,_0xd4ff26){const _0x1bef78=a185_0x163b,_0x2af3d0=await apiRequest('/smartapi/lovrabet/dataset/'+_0xd4ff26+_0x1bef78(0x14d)+encodeURIComponent(_0x23b7c0));return _0x2af3d0[_0x1bef78(0x208)];}export async function tryGetStandardPageStatus(_0x383167,_0x154c7c){const _0x26e2cb=a185_0x163b;try{return await getStandardPageStatus(_0x383167,_0x154c7c);}catch(_0x286ad7){if(_0x286ad7 instanceof CliError&&_0x286ad7[_0x26e2cb(0x193)]==='api_error'&&/404|not found|non-json response/i[_0x26e2cb(0x13a)](_0x286ad7[_0x26e2cb(0x1db)]))return null;throw _0x286ad7;}}export async function syncStandardPages(_0x3aad2b,_0x15bba6){const _0x1f4a87=a185_0x163b,_0x9bc83d=await apiRequest('/smartapi/lovrabet/dataset/'+_0x15bba6+'/sync-to-pages',{'method':'POST','body':{'appCode':_0x3aad2b}});return _0x9bc83d[_0x1f4a87(0x208)];}export async function getPageDetail(_0x1428f1){const _0x42f686=a185_0x163b,_0x20a647=await apiRequest(_0x42f686(0x1ab)+_0x1428f1);if(!_0x20a647[_0x42f686(0x208)])throw CliErrors[_0x42f686(0x1aa)](_0x42f686(0x152)+_0x1428f1);return _0x20a647['data'];}export async function updatePage(_0x14f7e3,_0x553edf,_0x4de5b3,_0x40c803){const _0x11d9e5=a185_0x163b,_0x3cf66f=await apiRequest(_0x11d9e5(0x16b),{'method':'POST','body':{'appCode':_0x14f7e3,'pageId':_0x553edf,'code':_0x4de5b3,'datasetIds':_0x40c803}});return _0x3cf66f['data'];}export function generateSdkCode(_0x3fe3ae,_0x37d290,_0x44a1a4){const _0x191757=a185_0x163b,_0x186060=_0x44a1a4?.['includeImports']??!![],_0x2a28bd=_0x191757(0x1ea)+_0x3fe3ae[_0x191757(0x193)]?.[_0x191757(0x1c2)](/-/g,'_'),_0x134057=_0x37d290['name']||_0x37d290[_0x191757(0x180)]||_0x191757(0x190),_0x31a521=[];_0x186060&&_0x31a521[_0x191757(0x17d)](_0x191757(0x1d2),'',_0x191757(0x1ff),'');_0x31a521[_0x191757(0x17d)](_0x191757(0x1fc)+_0x3fe3ae[_0x191757(0x1b5)]+'\x20('+(_0x3fe3ae['tableName']||_0x191757(0x1b3))+')');if(_0x134057===_0x191757(0x190))_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x145),_0x191757(0x1ec),'\x20\x20pageSize:\x2020,',_0x191757(0x1cb),'});');else{if(_0x134057==='getOne')_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x17b));else{if(_0x134057===_0x191757(0x177))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x1b9));else{if(_0x134057===_0x191757(0x1b2))_0x31a521[_0x191757(0x17d)]('const\x20result\x20=\x20await\x20client.models.'+_0x2a28bd+_0x191757(0x201));else _0x134057==='delete'||_0x134057===_0x191757(0x1c7)?_0x31a521['push'](_0x191757(0x139)+_0x2a28bd+_0x191757(0x132)):_0x31a521[_0x191757(0x17d)](_0x191757(0x139)+_0x2a28bd+'.'+_0x134057+_0x191757(0x160));}}}return _0x31a521[_0x191757(0x1b8)]('\x0a');}export function generateSqlCodeTemplate(_0x1da46d,_0x5a9849){const _0x219715=a185_0x163b,_0x264e22=_0x5a9849?.['target']??_0x219715(0x131),_0x4c24ab=_0x5a9849?.[_0x219715(0x200)]??!![],_0x3d7c19=[];return _0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d1)+_0x1da46d[_0x219715(0x1e9)]+'\x20('+_0x1da46d[_0x219715(0x1a4)]+')'),_0x264e22===_0x219715(0x131)?(_0x4c24ab&&_0x3d7c19[_0x219715(0x17d)](_0x219715(0x1d2),'',_0x219715(0x1ff),''),_0x3d7c19[_0x219715(0x17d)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x219715(0x140)+_0x1da46d['sqlCode']+'\x27,',_0x219715(0x129),'});',_0x219715(0x159),_0x219715(0x199))):_0x3d7c19[_0x219715(0x17d)](_0x219715(0x174),_0x219715(0x19b),_0x219715(0x1fa),_0x219715(0x166)+_0x1da46d[_0x219715(0x1a4)]+'\x27,',_0x219715(0x1fd),_0x219715(0x154),_0x219715(0x155),'}'),_0x3d7c19[_0x219715(0x1b8)]('\x0a');}export async function getErConfig(_0x1b16dc,_0xbbf09e){const _0x2244af=a185_0x163b,_0x298fae=await apiRequest(_0x2244af(0x14a),{'method':_0x2244af(0x158),'body':{'appCode':_0x1b16dc,'dblinkId':_0xbbf09e},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x298fae[_0x2244af(0x208)];}export async function getErRelationDetail(_0x308428,_0x12e9d4){const _0x2b8958=a185_0x163b,_0x2e04c1=new URLSearchParams({'appCode':_0x308428,'relationId':String(_0x12e9d4)});try{const _0xea7fbb=await apiRequest(_0x2b8958(0x1ef)+_0x2e04c1[_0x2b8958(0x1e5)]());return _0xea7fbb[_0x2b8958(0x208)]?.[_0x2b8958(0x13f)]??null;}catch(_0xbb912){if(_0xbb912 instanceof CliError&&_0xbb912[_0x2b8958(0x193)]==='api_error'&&(_0xbb912[_0x2b8958(0x1d3)]?.['includes'](_0x2b8958(0x136))||_0xbb912[_0x2b8958(0x1d3)]==='API\x20error\x20code:\x20306'&&_0xbb912[_0x2b8958(0x1db)]===_0x2b8958(0x178)))return null;throw _0xbb912;}}export async function createErRelation(_0x462772){const _0x3d3354=await apiRequest('/smartapi/question/er-config/cli/erCreate',{'method':'POST','body':_0x462772,'allowNonJsonSuccess':!![]});return _0x3d3354['data'];}export async function updateErRelation(_0x3025ca){const _0xd3c203=a185_0x163b,_0x3abd3f=await apiRequest(_0xd3c203(0x184),{'method':_0xd3c203(0x158),'body':_0x3025ca,'allowNonJsonSuccess':!![]});return _0x3abd3f[_0xd3c203(0x208)];}export async function deleteErRelation(_0x29a8e9){const _0xb85b54=a185_0x163b,_0x3abbe1=await apiRequest(_0xb85b54(0x185),{'method':_0xb85b54(0x158),'body':_0x29a8e9,'allowNonJsonSuccess':!![]});return _0x3abbe1[_0xb85b54(0x208)];}export async function updateErBusinessGroup(_0x13fe38){const _0xc2a04=a185_0x163b,_0x13ac86=await apiRequest(_0xc2a04(0x170),{'method':'POST','body':_0x13fe38,'allowNonJsonSuccess':!![]});return _0x13ac86[_0xc2a04(0x208)];}function buildQuery(_0x4af873){const _0x510377=a185_0x163b,_0x2846f4=new URLSearchParams();for(const [_0x2b9ff0,_0x486b88]of Object[_0x510377(0x12e)](_0x4af873)){if(_0x486b88===undefined||_0x486b88==='')continue;_0x2846f4['set'](_0x2b9ff0,String(_0x486b88));}const _0x3ee393=_0x2846f4[_0x510377(0x1e5)]();return _0x3ee393?'?'+_0x3ee393:'';}export async function listNotificationChannelConfigs(_0x2ff84c,_0x5f3522){const _0x1933d2=a185_0x163b,_0x53bb53=await apiRequest(_0x1933d2(0x1de)+buildQuery({'appCode':_0x2ff84c,'channelType':_0x5f3522}));return Array[_0x1933d2(0x189)](_0x53bb53[_0x1933d2(0x208)])?_0x53bb53['data']:[];}export async function listAppConfigs(_0xf4cec6,_0x1ecdfb){const _0x18ea54=a185_0x163b,_0xf76945=await apiRequest('/smartapi/app-config/list',{'method':_0x18ea54(0x158),'body':{'appCode':_0xf4cec6,..._0x1ecdfb?.[_0x18ea54(0x127)]?{'key':_0x1ecdfb[_0x18ea54(0x127)]}:{},..._0x1ecdfb?.[_0x18ea54(0x1b6)]?{'tags':_0x1ecdfb[_0x18ea54(0x1b6)]}:{}}});return extractAppConfigList(_0xf76945[_0x18ea54(0x208)]);}export async function getAppConfigByKey(_0xe675bd,_0x228010){const _0x162180=a185_0x163b,_0x147e5b=await apiRequest(_0x162180(0x1c0)+buildQuery({'appCode':_0xe675bd,'key':_0x228010}));return _0x147e5b[_0x162180(0x208)]??null;}export async function createAppConfig(_0x204dc3){const _0x3efd60=a185_0x163b,_0x54fa7a=await apiRequest(_0x3efd60(0x130),{'method':'POST','body':{'appCode':_0x204dc3[_0x3efd60(0x133)],'key':_0x204dc3[_0x3efd60(0x127)],'value':_0x204dc3['value'],..._0x204dc3[_0x3efd60(0x1b6)]?{'tags':_0x204dc3[_0x3efd60(0x1b6)]}:{}}});return _0x54fa7a[_0x3efd60(0x208)];}export async function updateAppConfig(_0x17b8d1){const _0x196ac0=a185_0x163b;await apiRequest(_0x196ac0(0x1c4),{'method':_0x196ac0(0x158),'body':{'id':_0x17b8d1['id'],'appCode':_0x17b8d1[_0x196ac0(0x133)],'key':_0x17b8d1[_0x196ac0(0x127)],'value':_0x17b8d1[_0x196ac0(0x1ba)],..._0x17b8d1[_0x196ac0(0x1b6)]?{'tags':_0x17b8d1[_0x196ac0(0x1b6)]}:{}}});}export async function deleteAppConfig(_0x2c0099){const _0x5e5bd9=a185_0x163b;await apiRequest(_0x5e5bd9(0x1cd),{'method':_0x5e5bd9(0x158),'body':_0x2c0099});}function extractAppConfigList(_0x2a08f6){const _0x45c16b=a185_0x163b;if(Array[_0x45c16b(0x189)](_0x2a08f6))return _0x2a08f6;if(_0x2a08f6&&typeof _0x2a08f6===_0x45c16b(0x182)&&Array['isArray'](_0x2a08f6[_0x45c16b(0x1c3)]))return _0x2a08f6[_0x45c16b(0x1c3)];return extractList(_0x2a08f6);}export async function listDbLinks(_0x51bed4,_0x53bbc9){const _0x30cdc=a185_0x163b,_0x1bc4d4=await apiRequest(_0x30cdc(0x205),{'method':'POST','body':{'appCode':_0x51bed4,'currentPage':_0x53bbc9?.[_0x30cdc(0x1e3)]??0x1,'pageSize':_0x53bbc9?.[_0x30cdc(0x1b7)]??0x64}});return{'items':extractList(_0x1bc4d4[_0x30cdc(0x208)]),'paging':extractPaging(_0x1bc4d4[_0x30cdc(0x208)])};}export async function getDbLinkInfo(_0x1d07c3){const _0x431820=a185_0x163b,_0x2383bd=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x1d07c3}));return _0x2383bd[_0x431820(0x208)];}export async function createDbLink(_0x5480d5){const _0x9d53d3=a185_0x163b,_0x3fede7=await apiRequest('/smartapi/dblink/create',{'method':_0x9d53d3(0x158),'body':_0x5480d5});return _0x3fede7[_0x9d53d3(0x208)];}export async function updateDbLink(_0x36c4a1){const _0x261f66=a185_0x163b,_0x162261=await apiRequest(_0x261f66(0x1fe),{'method':'POST','body':_0x36c4a1});return _0x162261[_0x261f66(0x208)];}export async function deleteDbLink(_0x4d01f5){const _0x421c6b=a185_0x163b;await apiRequest(_0x421c6b(0x15c),{'method':_0x421c6b(0x158),'body':{'id':_0x4d01f5}});}export async function testDbLinkConnect(_0x557958){const _0x1956f8=a185_0x163b,_0x2ef4dd=await apiRequest(_0x1956f8(0x18a)+buildQuery({'id':_0x557958}));return _0x2ef4dd[_0x1956f8(0x208)];}export async function startDbAnalysis(_0x4dbd5e,_0x313ece){const _0x5385fa=a185_0x163b,_0x1add33=await apiRequest('/smartapi/db-analysis/start',{'method':_0x5385fa(0x158),'body':{'dbLinkId':_0x4dbd5e,..._0x313ece&&_0x313ece[_0x5385fa(0x1d5)]>0x0?{'tableNames':_0x313ece}:{}}});return _0x1add33[_0x5385fa(0x208)];}export async function cancelDbAnalysis(_0x41bf77){const _0x492ff7=a185_0x163b;await apiRequest(_0x492ff7(0x17a)+buildQuery({'planId':_0x41bf77}),{'method':_0x492ff7(0x158)});}export async function getDbAnalysisStatus(_0x9d3d1d){const _0xd3cad7=a185_0x163b,_0x198ab7=await apiRequest(_0xd3cad7(0x1ee)+encodeURIComponent(_0x9d3d1d));return _0x198ab7[_0xd3cad7(0x208)];}export async function getDbAllTableList(_0x2ceec8,_0x18eae0){const _0x2f8d45=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x2ceec8,'dbLinkId':_0x18eae0})),_0x3ab394=_0x2f8d45['data'];if(Array['isArray'](_0x3ab394))return _0x3ab394;return extractList(_0x3ab394);}export async function getDbTableDiff(_0x2976dc,_0x3fd853,_0x5bed7c){const _0x3be7fe=a185_0x163b,_0x11389c=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x2976dc,'dbLinkId':_0x3fd853,'pageIndex':_0x5bed7c?.['pageIndex']??0x1,'pageSize':_0x5bed7c?.[_0x3be7fe(0x1b7)]??0x14,'tableName':_0x5bed7c?.['tableName']})),_0x4792e6=_0x11389c[_0x3be7fe(0x208)];return{'totalCount':_0x4792e6?.[_0x3be7fe(0x1d7)]??0x0,'physicalTableCount':_0x4792e6?.[_0x3be7fe(0x12c)]??0x0,'datasetTableCount':_0x4792e6?.[_0x3be7fe(0x13c)]??0x0,..._0x4792e6?.[_0x3be7fe(0x1dc)]?{'summary':_0x4792e6[_0x3be7fe(0x1dc)]}:{},'tableList':Array[_0x3be7fe(0x189)](_0x4792e6?.[_0x3be7fe(0x209)])?_0x4792e6['tableList']:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x595f11=a185_0x163b,_0x229f8c=await apiRequest(_0x595f11(0x15b),{'method':_0x595f11(0x158),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x56b1b6=extractList(_0x229f8c[_0x595f11(0x208)]),_0x4e6a19=extractPaging(_0x229f8c[_0x595f11(0x208)]);return _0x4e6a19&&_0x4e6a19['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x595f11(0x19d)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x595f11(0x1f7)+_0x4e6a19[_0x595f11(0x1d7)]+_0x595f11(0x142)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x56b1b6;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x120e58,_0x100dcd){const _0x330aad=a185_0x163b,_0x1d4dfd=Math[_0x330aad(0x1a3)](Math['max'](_0x100dcd?.['pageSize']??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x27fb2e=await apiRequest('/smartapi/permit/role/get-list',{'method':_0x330aad(0x158),'body':{'appCode':_0x120e58,'currentPage':_0x100dcd?.[_0x330aad(0x1e3)]??0x1,'pageSize':_0x1d4dfd}});return{'items':extractList(_0x27fb2e[_0x330aad(0x208)]),'paging':extractPaging(_0x27fb2e[_0x330aad(0x208)])};}export async function getAppRole(_0x67770){const _0x1a6ec4=a185_0x163b,_0x4edada=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x67770}));return _0x4edada[_0x1a6ec4(0x208)];}export async function createAppRole(_0x1bc6d1){const _0x56c1a9=a185_0x163b,_0x4333f0=await apiRequest('/smartapi/permit/role/create',{'method':_0x56c1a9(0x158),'body':{'appCode':_0x1bc6d1[_0x56c1a9(0x133)],'roleName':_0x1bc6d1[_0x56c1a9(0x157)],'roleType':_0x56c1a9(0x1a1),..._0x1bc6d1[_0x56c1a9(0x1a9)]?{'remark':_0x1bc6d1[_0x56c1a9(0x1a9)]}:{}}});return _0x4333f0['data'];}export async function updateAppRole(_0x39e6bc){const _0x33f61d=a185_0x163b,_0x2faf37=await apiRequest(_0x33f61d(0x126),{'method':_0x33f61d(0x158),'body':{'id':_0x39e6bc['id'],'appCode':_0x39e6bc[_0x33f61d(0x133)],..._0x39e6bc[_0x33f61d(0x143)]?{'roleType':_0x39e6bc['roleType']}:{},..._0x39e6bc[_0x33f61d(0x157)]!==undefined?{'roleName':_0x39e6bc['roleName']}:{},..._0x39e6bc['remark']!==undefined?{'remark':_0x39e6bc[_0x33f61d(0x1a9)]}:{},..._0x39e6bc[_0x33f61d(0x151)]?{'permits':_0x39e6bc['permits']}:{}}});return _0x2faf37[_0x33f61d(0x208)];}export async function deleteAppRole(_0x5edf84){const _0x20a15b=a185_0x163b;await apiRequest(_0x20a15b(0x1bf),{'method':'POST','body':{'id':_0x5edf84}});}export async function listPermitRoles(_0x198462,_0x129ddb){const _0x51ec6c=a185_0x163b,_0x162348=await apiRequest(_0x51ec6c(0x1df),{'method':_0x51ec6c(0x158),'body':{'appCode':_0x198462,..._0x129ddb?.[_0x51ec6c(0x13b)]!==undefined?{'needSelf':_0x129ddb[_0x51ec6c(0x13b)]}:{},..._0x129ddb?.[_0x51ec6c(0x1f4)]!==undefined?{'needPublic':_0x129ddb[_0x51ec6c(0x1f4)]}:{}}});return extractList(_0x162348[_0x51ec6c(0x208)]);}export async function getRoleMenuResources(_0xe5738b,_0x1d7923){const _0x144e5d=a185_0x163b,_0xde9890=await apiRequest(_0x144e5d(0x18c),{'method':_0x144e5d(0x158),'body':{'appCode':_0xe5738b,'roleId':_0x1d7923}});return extractList(_0xde9890[_0x144e5d(0x208)]);}export async function getRoleApiResources(_0x3808e9,_0x2ecda9){const _0x309b4f=a185_0x163b,_0x231f31=await apiRequest(_0x309b4f(0x14b),{'method':'POST','body':{'appCode':_0x3808e9,'roleId':_0x2ecda9}});return extractList(_0x231f31['data']);}export async function listRoleUsers(_0x2ec5e5){const _0x562d93=a185_0x163b,_0xf257b5=await apiRequest(_0x562d93(0x1bc),{'method':_0x562d93(0x158),'body':{'appCode':_0x2ec5e5}});return extractList(_0xf257b5[_0x562d93(0x208)]);}export async function updateRoleUsers(_0x5c1a11,_0x1e4ce5){const _0x5dfc00=a185_0x163b;await apiRequest('/smartapi/permit/user-role/update-user-list',{'method':_0x5dfc00(0x158),'body':{'appCode':_0x5c1a11,'roleList':_0x1e4ce5}});}export async function getPagePermit(_0x4af800){const _0x42e471=a185_0x163b,_0x4111d9=await apiRequest('/smartapi/permit/page/get-one'+buildQuery({'menuId':_0x4af800}));return _0x4111d9[_0x42e471(0x208)];}export async function savePagePermit(_0xb6af92){const _0x4f776b=a185_0x163b,_0xf768af=await apiRequest('/smartapi/permit/page/save',{'method':_0x4f776b(0x158),'body':_0xb6af92});return _0xf768af[_0x4f776b(0x208)];}export async function getTenantMembers(_0x284437){const _0x12b119=a185_0x163b,_0x3bda99=await apiRequest(_0x12b119(0x1bb)+buildQuery({'code':_0x284437})),_0x18e550=_0x3bda99['data']??{},_0x4fb3b9=Array[_0x12b119(0x189)](_0x18e550?.[_0x12b119(0x198)])?_0x18e550[_0x12b119(0x198)]:[];return _0x4fb3b9[_0x12b119(0x190)](_0x3745ed=>_0x3745ed?.[_0x12b119(0x167)]===_0x12b119(0x195)||_0x3745ed?.[_0x12b119(0x167)]===undefined)['map'](_0x172de9=>({'userId':Number(_0x172de9[_0x12b119(0x15a)]??_0x172de9['id']),'username':_0x172de9[_0x12b119(0x202)],'nickname':_0x172de9[_0x12b119(0x1e7)],'status':_0x172de9[_0x12b119(0x167)],'email':_0x172de9[_0x12b119(0x19c)],'mobile':_0x172de9[_0x12b119(0x163)],'avatar':_0x172de9[_0x12b119(0x18f)]}))[_0x12b119(0x190)](_0x26bb7d=>Number[_0x12b119(0x1ca)](_0x26bb7d['userId'])&&_0x26bb7d[_0x12b119(0x15a)]>0x0);}
@@ -1 +1 @@
1
- function a186_0xf436(_0x115d27,_0x4ea3ce){_0x115d27=_0x115d27-0x84;const _0x24b3a8=a186_0x24b3();let _0xf436db=_0x24b3a8[_0x115d27];return _0xf436db;}const a186_0x562ba2=a186_0xf436;(function(_0x113e0b,_0x3a21dc){const _0x3391b4=a186_0xf436,_0xd0be49=_0x113e0b();while(!![]){try{const _0x487fb2=-parseInt(_0x3391b4(0x85))/0x1+parseInt(_0x3391b4(0x89))/0x2+parseInt(_0x3391b4(0x86))/0x3*(parseInt(_0x3391b4(0x84))/0x4)+-parseInt(_0x3391b4(0x8c))/0x5+-parseInt(_0x3391b4(0x8a))/0x6+-parseInt(_0x3391b4(0x8d))/0x7+-parseInt(_0x3391b4(0x8b))/0x8*(-parseInt(_0x3391b4(0x88))/0x9);if(_0x487fb2===_0x3a21dc)break;else _0xd0be49['push'](_0xd0be49['shift']());}catch(_0x4589de){_0xd0be49['push'](_0xd0be49['shift']());}}}(a186_0x24b3,0xe5ba9));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a186_0x562ba2(0x87),LOCK_FILE_NAME=a186_0x562ba2(0x8e),TRASH_DIR_NAME='bff-trash';export function loadBffProjectConfig(_0x446d2a,_0xb0ce2c){const _0xfa0067=a186_0x562ba2,_0x5b5467=resolve(_0xb0ce2c??findProjectRootDirectory()),_0x3aa5ea=DOT_DIR+_0xfa0067(0x8f),_0x372360=_0x3aa5ea+'/'+_0x446d2a;return{'projectRoot':_0x5b5467,'appCode':_0x446d2a,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3aa5ea,'scriptsRoot':_0x372360,'scriptsRootDir':resolve(_0x5b5467,DOT_DIR,'bff',_0x446d2a),'lockFilePath':resolve(_0x5b5467,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5b5467,DOT_DIR,TRASH_DIR_NAME)};}function a186_0x24b3(){const _0x2eb082=['/bff','508vPRKpM','469549VWPvhM','26787LTeYHR','.rabetbase','9SjOyOh','3295728kWilaq','7274412hFtQqP','12425912OCQhYl','5635075lgMxFd','4096057cIWBRq','bff.lock.json'];a186_0x24b3=function(){return _0x2eb082;};return a186_0x24b3();}
1
+ const a186_0x58f6e6=a186_0x37ec;function a186_0x37ec(_0x58bd16,_0x1d402e){_0x58bd16=_0x58bd16-0xa1;const _0x121fe3=a186_0x121f();let _0x37ec88=_0x121fe3[_0x58bd16];return _0x37ec88;}(function(_0x55e236,_0x2397b5){const _0x9ac464=a186_0x37ec,_0x1a3f09=_0x55e236();while(!![]){try{const _0x1e99dc=parseInt(_0x9ac464(0xa7))/0x1*(parseInt(_0x9ac464(0xab))/0x2)+-parseInt(_0x9ac464(0xac))/0x3*(parseInt(_0x9ac464(0xa5))/0x4)+parseInt(_0x9ac464(0xa9))/0x5+parseInt(_0x9ac464(0xa2))/0x6*(-parseInt(_0x9ac464(0xaa))/0x7)+parseInt(_0x9ac464(0xa6))/0x8*(parseInt(_0x9ac464(0xaf))/0x9)+parseInt(_0x9ac464(0xa4))/0xa+-parseInt(_0x9ac464(0xb0))/0xb*(parseInt(_0x9ac464(0xad))/0xc);if(_0x1e99dc===_0x2397b5)break;else _0x1a3f09['push'](_0x1a3f09['shift']());}catch(_0x55ada3){_0x1a3f09['push'](_0x1a3f09['shift']());}}}(a186_0x121f,0x71854));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';function a186_0x121f(){const _0x113bba=['2209976NbmJmE','36071YdUWmc','bff.lock.json','3492595zQCavw','2422YZkkIY','30rsflOR','1155849fzTzwn','24idlqdA','.rabetbase','9ZFcAdf','4706746jGcwOh','bff','10626RjWrdt','bff-trash','8029700WTOvkp','4OVrcbx'];a186_0x121f=function(){return _0x113bba;};return a186_0x121f();}const DOT_DIR=a186_0x58f6e6(0xae),LOCK_FILE_NAME=a186_0x58f6e6(0xa8),TRASH_DIR_NAME=a186_0x58f6e6(0xa3);export function loadBffProjectConfig(_0x9e1442,_0x158114){const _0x2fa4e6=a186_0x58f6e6,_0x30de13=resolve(_0x158114??findProjectRootDirectory()),_0x38087e=DOT_DIR+'/bff',_0x4c91cb=_0x38087e+'/'+_0x9e1442;return{'projectRoot':_0x30de13,'appCode':_0x9e1442,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x38087e,'scriptsRoot':_0x4c91cb,'scriptsRootDir':resolve(_0x30de13,DOT_DIR,_0x2fa4e6(0xa1),_0x9e1442),'lockFilePath':resolve(_0x30de13,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x30de13,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a187_0x18db72=a187_0x2f79;function a187_0x2f79(_0x19f567,_0x746e31){_0x19f567=_0x19f567-0x1ac;const _0x287b8a=a187_0x287b();let _0x2f7945=_0x287b8a[_0x19f567];return _0x2f7945;}(function(_0x264bcf,_0x59ddba){const _0x1f3c0d=a187_0x2f79,_0x370f53=_0x264bcf();while(!![]){try{const _0x33c788=-parseInt(_0x1f3c0d(0x1d3))/0x1*(-parseInt(_0x1f3c0d(0x1ce))/0x2)+parseInt(_0x1f3c0d(0x1b1))/0x3*(parseInt(_0x1f3c0d(0x1ba))/0x4)+parseInt(_0x1f3c0d(0x1bc))/0x5*(-parseInt(_0x1f3c0d(0x1c6))/0x6)+parseInt(_0x1f3c0d(0x1be))/0x7+parseInt(_0x1f3c0d(0x1c0))/0x8+-parseInt(_0x1f3c0d(0x1c9))/0x9*(-parseInt(_0x1f3c0d(0x1c3))/0xa)+-parseInt(_0x1f3c0d(0x1b8))/0xb*(parseInt(_0x1f3c0d(0x1b9))/0xc);if(_0x33c788===_0x59ddba)break;else _0x370f53['push'](_0x370f53['shift']());}catch(_0x10efd9){_0x370f53['push'](_0x370f53['shift']());}}}(a187_0x287b,0x82a64));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a187_0x18db72(0x1c4),a187_0x18db72(0x1b2),'HOOK'];export function normalizeBffType(_0x59cead){const _0x2be6fd=a187_0x18db72;if(!_0x59cead)return undefined;const _0x2098e6=_0x59cead[_0x2be6fd(0x1cf)]()[_0x2be6fd(0x1b0)]();return SUPPORTED_BFF_TYPES[_0x2be6fd(0x1b7)](_0x2098e6)?_0x2098e6:undefined;}async function scanJsFilesRecursively(_0x3a3598,_0x3d622d){const _0xfc1307=a187_0x18db72,_0x66dcb4=[];try{const _0x29c44e=await readdir(_0x3a3598,{'withFileTypes':!![]});for(const _0x2bed7a of _0x29c44e){const _0x36114c=join(_0x3a3598,_0x2bed7a['name']);if(_0x2bed7a[_0xfc1307(0x1d1)]())_0x66dcb4[_0xfc1307(0x1d2)](...await scanJsFilesRecursively(_0x36114c,_0x3d622d+'/'+_0x2bed7a[_0xfc1307(0x1c1)]));else _0x2bed7a[_0xfc1307(0x1d0)]()&&_0x2bed7a[_0xfc1307(0x1c1)]['endsWith'](_0xfc1307(0x1ad))&&_0x66dcb4[_0xfc1307(0x1d2)]({'lockKey':_0x3d622d+'/'+_0x2bed7a['name'][_0xfc1307(0x1ae)](/\.js$/,''),'filePath':_0x36114c});}}catch(_0x48bb17){if(_0x48bb17[_0xfc1307(0x1cc)]!==_0xfc1307(0x1b6))throw _0x48bb17;}return _0x66dcb4;}async function scanFlatFunctions(_0x5421d6,_0x5dd794){const _0x39444d=a187_0x18db72,_0x457610=join(_0x5421d6[_0x39444d(0x1d5)],_0x5dd794),_0x298164=await scanJsFilesRecursively(_0x457610,_0x5dd794);return _0x298164[_0x39444d(0x1c7)](({lockKey:_0x23a744,filePath:_0x2ec41b})=>({'type':_0x5dd794,'name':_0x23a744['split']('/')['at'](-0x1)??'','filePath':_0x2ec41b,'lockKey':_0x23a744}));}async function scanHookFunctions(_0xe337fc){const _0x4fdf51=a187_0x18db72,_0x5d25e2=join(_0xe337fc[_0x4fdf51(0x1d5)],_0x4fdf51(0x1b4)),_0x2e19b9=[];try{const _0x6799=await readdir(_0x5d25e2,{'withFileTypes':!![]});for(const _0x53f78a of _0x6799){if(!_0x53f78a[_0x4fdf51(0x1d1)]())continue;const _0x254ec6=_0x53f78a['name'],_0x2f0f35=join(_0x5d25e2,_0x254ec6),_0xbd6ae7=await readdir(_0x2f0f35,{'withFileTypes':!![]});for(const _0xa1e3cc of _0xbd6ae7){if(!_0xa1e3cc[_0x4fdf51(0x1d1)]())continue;const _0x3d0793=_0xa1e3cc[_0x4fdf51(0x1c1)],_0x5ad53c=join(_0x2f0f35,_0x3d0793),_0xa61403=await readdir(_0x5ad53c,{'withFileTypes':!![]});for(const _0x52ff51 of _0xa61403){if(!_0x52ff51['isDirectory']())continue;const _0x4599a1=_0x52ff51[_0x4fdf51(0x1c1)],_0x4caec5=join(_0x5ad53c,_0x4599a1),_0x51ae68=await readdir(_0x4caec5,{'withFileTypes':!![]});for(const _0x2269c1 of _0x51ae68){if(!_0x2269c1[_0x4fdf51(0x1d0)]()||!_0x2269c1[_0x4fdf51(0x1c1)]['endsWith'](_0x4fdf51(0x1ad)))continue;const _0x3147ca=_0x2269c1['name'][_0x4fdf51(0x1ae)](/\.js$/,'');_0x2e19b9[_0x4fdf51(0x1d2)]({'type':_0x4fdf51(0x1b4),'name':_0x3147ca,'filePath':join(_0x4caec5,_0x2269c1[_0x4fdf51(0x1c1)]),'lockKey':'HOOK/'+_0x254ec6+'/'+_0x3d0793+'/'+_0x4599a1+'/'+_0x3147ca,'alias':_0x254ec6,'operationType':_0x3d0793,'functionNode':_0x4599a1});}}}}}catch(_0x5848db){if(_0x5848db[_0x4fdf51(0x1cc)]!==_0x4fdf51(0x1b6))throw _0x5848db;}return _0x2e19b9;}export async function scanLocalBffFunctions(_0x3ee468,_0x3a84c1){const _0x382bcb=a187_0x18db72;if(_0x3a84c1===_0x382bcb(0x1c4)||_0x3a84c1===_0x382bcb(0x1b2))return scanFlatFunctions(_0x3ee468,_0x3a84c1);if(_0x3a84c1===_0x382bcb(0x1b4))return scanHookFunctions(_0x3ee468);const [_0x5c74ef,_0xf19741,_0x1a7a15]=await Promise[_0x382bcb(0x1cd)]([scanFlatFunctions(_0x3ee468,_0x382bcb(0x1c4)),scanFlatFunctions(_0x3ee468,'ENDPOINT'),scanHookFunctions(_0x3ee468)]);return[..._0x5c74ef,..._0xf19741,..._0x1a7a15];}export function resolveLocalFilePathFromLockKey(_0x5cf9de,_0x31bd2d){const _0x169db9=a187_0x18db72;return join(_0x5cf9de[_0x169db9(0x1d5)],..._0x31bd2d[_0x169db9(0x1b3)]('/'))+'.js';}export function createHookLocationMap(_0x219144){const _0x12ec04=a187_0x18db72,_0xedb0f7=new Map();for(const _0x36ef8a of _0x219144){_0x36ef8a[_0x12ec04(0x1c2)]&&_0xedb0f7[_0x12ec04(0x1cb)](_0x36ef8a[_0x12ec04(0x1c2)],{'datasetCode':_0x36ef8a[_0x12ec04(0x1ac)],'operationType':snakeToCamel(_0x36ef8a['operationType']),'functionNode':_0x12ec04(0x1af)}),_0x36ef8a[_0x12ec04(0x1b5)]&&_0xedb0f7[_0x12ec04(0x1cb)](_0x36ef8a['afterScriptId'],{'datasetCode':_0x36ef8a['datasetCode'],'operationType':snakeToCamel(_0x36ef8a['operationType']),'functionNode':_0x12ec04(0x1bf)});}return _0xedb0f7;}export function resolveRemoteScriptTarget(_0x18e481,_0xfd4431,_0x2492ed,_0x56068e,_0x1dea7c){const _0x28acaf=a187_0x18db72,_0x1c67d4=normalizeBffType(_0xfd4431[_0x28acaf(0x1ca)]);if(!_0x1c67d4||!_0xfd4431[_0x28acaf(0x1c8)])return null;if(_0x1c67d4==='HOOK'){const _0x19b282=(_0xfd4431['id']?_0x2492ed['get'](_0xfd4431['id']):undefined)??findHookLocationByRemoteId(_0x56068e,_0xfd4431['id']);if(!_0x19b282)return null;const _0x15bdbc=_0x19b282[_0x28acaf(0x1bd)]||_0x1dea7c['get'](_0x19b282[_0x28acaf(0x1ac)]),_0xd8afd8=_0x15bdbc??_0x19b282[_0x28acaf(0x1ac)],_0x2b0f60={..._0x19b282,'alias':_0x15bdbc},_0x40fa25=_0x28acaf(0x1bb)+_0xd8afd8+'/'+_0x2b0f60['operationType']+'/'+_0x2b0f60[_0x28acaf(0x1c5)]+'/'+_0xfd4431[_0x28acaf(0x1c8)];return{'lockKey':_0x40fa25,'filePath':resolveLocalFilePathFromLockKey(_0x18e481,_0x40fa25),'type':'HOOK','hookLocation':_0x2b0f60};}const _0x5bd0e7=_0x1c67d4+'/'+_0xfd4431[_0x28acaf(0x1c8)];return{'lockKey':_0x5bd0e7,'filePath':resolveLocalFilePathFromLockKey(_0x18e481,_0x5bd0e7),'type':_0x1c67d4};}export async function ensureParentDirectory(_0x18457e){await mkdir(dirname(_0x18457e),{'recursive':!![]});}function a187_0x287b(){const _0x560f7c=['set','code','all','8962hmlchQ','trim','isFile','isDirectory','push','221oriLDB','F_OK','scriptsRootDir','datasetCode','.js','replace','before','toUpperCase','84RWCwUj','ENDPOINT','split','HOOK','afterScriptId','ENOENT','includes','22034067FvNMdY','12hfQpgH','63316gfYDvn','HOOK/','16955BtYtZW','alias','4663309pHXUyI','after','8045712CAxlJD','name','beforeScriptId','10qKuWuV','COMMON','functionNode','1542iztWBz','map','functionName','2738790SDRhQx','scriptType'];a187_0x287b=function(){return _0x560f7c;};return a187_0x287b();}export async function fileExists(_0x497a5a){const _0x22e28d=a187_0x18db72;try{return await access(_0x497a5a,constants[_0x22e28d(0x1d4)]),!![];}catch{return![];}}export async function directoryExists(_0x223f0a){const _0x5e81c2=a187_0x18db72;try{const _0x1d93bc=await stat(_0x223f0a);return _0x1d93bc[_0x5e81c2(0x1d1)]();}catch{return![];}}
1
+ const a187_0x1f997c=a187_0xef5f;(function(_0x423d6a,_0x267dd8){const _0x39cfe5=a187_0xef5f,_0x1ea220=_0x423d6a();while(!![]){try{const _0x438a65=parseInt(_0x39cfe5(0x7a))/0x1+-parseInt(_0x39cfe5(0x90))/0x2*(-parseInt(_0x39cfe5(0x95))/0x3)+-parseInt(_0x39cfe5(0x99))/0x4+parseInt(_0x39cfe5(0x7c))/0x5+parseInt(_0x39cfe5(0x94))/0x6*(-parseInt(_0x39cfe5(0x9b))/0x7)+parseInt(_0x39cfe5(0x92))/0x8*(parseInt(_0x39cfe5(0x7d))/0x9)+-parseInt(_0x39cfe5(0x78))/0xa*(parseInt(_0x39cfe5(0x91))/0xb);if(_0x438a65===_0x267dd8)break;else _0x1ea220['push'](_0x1ea220['shift']());}catch(_0x1813b8){_0x1ea220['push'](_0x1ea220['shift']());}}}(a187_0x4cf5,0x59ca9));function a187_0x4cf5(){const _0x58f83f=['319FKzbgD','16oFhokb','COMMON','27138jcuSrO','63hjhnLw','ENDPOINT','ENOENT','push','2860168QdWMyp','includes','14SAPYiq','scriptType','code','after','split','map','138290RpTkPS','trim','229837GLBGqi','isDirectory','3413420eVRquk','137853vbAKRH','HOOK','alias','all','beforeScriptId','toUpperCase','functionName','.js','endsWith','get','HOOK/','replace','set','operationType','afterScriptId','isFile','name','scriptsRootDir','datasetCode','52358vYmCDl'];a187_0x4cf5=function(){return _0x58f83f;};return a187_0x4cf5();}import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a187_0xef5f(_0x4635ec,_0xcd6af4){_0x4635ec=_0x4635ec-0x78;const _0x4cf508=a187_0x4cf5();let _0xef5f18=_0x4cf508[_0x4635ec];return _0xef5f18;}export const SUPPORTED_BFF_TYPES=[a187_0x1f997c(0x93),a187_0x1f997c(0x96),a187_0x1f997c(0x7e)];export function normalizeBffType(_0x4f710a){const _0x18f5f9=a187_0x1f997c;if(!_0x4f710a)return undefined;const _0x73c223=_0x4f710a[_0x18f5f9(0x79)]()[_0x18f5f9(0x82)]();return SUPPORTED_BFF_TYPES[_0x18f5f9(0x9a)](_0x73c223)?_0x73c223:undefined;}async function scanJsFilesRecursively(_0x33a18b,_0x29551b){const _0x52c009=a187_0x1f997c,_0x21a365=[];try{const _0x52d557=await readdir(_0x33a18b,{'withFileTypes':!![]});for(const _0x32d1a4 of _0x52d557){const _0x1da90c=join(_0x33a18b,_0x32d1a4[_0x52c009(0x8d)]);if(_0x32d1a4[_0x52c009(0x7b)]())_0x21a365[_0x52c009(0x98)](...await scanJsFilesRecursively(_0x1da90c,_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)]));else _0x32d1a4['isFile']()&&_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x85)](_0x52c009(0x84))&&_0x21a365[_0x52c009(0x98)]({'lockKey':_0x29551b+'/'+_0x32d1a4[_0x52c009(0x8d)][_0x52c009(0x88)](/\.js$/,''),'filePath':_0x1da90c});}}catch(_0x4e64a6){if(_0x4e64a6[_0x52c009(0x9d)]!==_0x52c009(0x97))throw _0x4e64a6;}return _0x21a365;}async function scanFlatFunctions(_0x3195f3,_0x1eb66f){const _0x42c88e=a187_0x1f997c,_0xa13f09=join(_0x3195f3[_0x42c88e(0x8e)],_0x1eb66f),_0x13795b=await scanJsFilesRecursively(_0xa13f09,_0x1eb66f);return _0x13795b[_0x42c88e(0xa0)](({lockKey:_0x1291cc,filePath:_0x54a39d})=>({'type':_0x1eb66f,'name':_0x1291cc['split']('/')['at'](-0x1)??'','filePath':_0x54a39d,'lockKey':_0x1291cc}));}async function scanHookFunctions(_0x741bed){const _0x1bed4f=a187_0x1f997c,_0xf90343=join(_0x741bed['scriptsRootDir'],_0x1bed4f(0x7e)),_0x4f327e=[];try{const _0x4cc463=await readdir(_0xf90343,{'withFileTypes':!![]});for(const _0x53cdb7 of _0x4cc463){if(!_0x53cdb7['isDirectory']())continue;const _0x24ae9e=_0x53cdb7[_0x1bed4f(0x8d)],_0x561299=join(_0xf90343,_0x24ae9e),_0x2112af=await readdir(_0x561299,{'withFileTypes':!![]});for(const _0x3510d7 of _0x2112af){if(!_0x3510d7[_0x1bed4f(0x7b)]())continue;const _0x43f660=_0x3510d7['name'],_0x40f6bb=join(_0x561299,_0x43f660),_0x5fd6f7=await readdir(_0x40f6bb,{'withFileTypes':!![]});for(const _0x233752 of _0x5fd6f7){if(!_0x233752[_0x1bed4f(0x7b)]())continue;const _0x241c8b=_0x233752[_0x1bed4f(0x8d)],_0x4b2fa0=join(_0x40f6bb,_0x241c8b),_0x544c8b=await readdir(_0x4b2fa0,{'withFileTypes':!![]});for(const _0x5d5f9f of _0x544c8b){if(!_0x5d5f9f[_0x1bed4f(0x8c)]()||!_0x5d5f9f[_0x1bed4f(0x8d)]['endsWith']('.js'))continue;const _0x30cec0=_0x5d5f9f[_0x1bed4f(0x8d)][_0x1bed4f(0x88)](/\.js$/,'');_0x4f327e[_0x1bed4f(0x98)]({'type':_0x1bed4f(0x7e),'name':_0x30cec0,'filePath':join(_0x4b2fa0,_0x5d5f9f['name']),'lockKey':'HOOK/'+_0x24ae9e+'/'+_0x43f660+'/'+_0x241c8b+'/'+_0x30cec0,'alias':_0x24ae9e,'operationType':_0x43f660,'functionNode':_0x241c8b});}}}}}catch(_0x9f3a64){if(_0x9f3a64[_0x1bed4f(0x9d)]!=='ENOENT')throw _0x9f3a64;}return _0x4f327e;}export async function scanLocalBffFunctions(_0x38f4bb,_0x4d454b){const _0x4d233f=a187_0x1f997c;if(_0x4d454b===_0x4d233f(0x93)||_0x4d454b===_0x4d233f(0x96))return scanFlatFunctions(_0x38f4bb,_0x4d454b);if(_0x4d454b===_0x4d233f(0x7e))return scanHookFunctions(_0x38f4bb);const [_0x467051,_0x5296e5,_0x42ecee]=await Promise[_0x4d233f(0x80)]([scanFlatFunctions(_0x38f4bb,_0x4d233f(0x93)),scanFlatFunctions(_0x38f4bb,_0x4d233f(0x96)),scanHookFunctions(_0x38f4bb)]);return[..._0x467051,..._0x5296e5,..._0x42ecee];}export function resolveLocalFilePathFromLockKey(_0x7f2fb6,_0x548657){const _0x3ae176=a187_0x1f997c;return join(_0x7f2fb6[_0x3ae176(0x8e)],..._0x548657[_0x3ae176(0x9f)]('/'))+'.js';}export function createHookLocationMap(_0x59540c){const _0x21bb34=a187_0x1f997c,_0x1f00b2=new Map();for(const _0x4ecc40 of _0x59540c){_0x4ecc40[_0x21bb34(0x81)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40['beforeScriptId'],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40[_0x21bb34(0x8a)]),'functionNode':'before'}),_0x4ecc40[_0x21bb34(0x8b)]&&_0x1f00b2[_0x21bb34(0x89)](_0x4ecc40[_0x21bb34(0x8b)],{'datasetCode':_0x4ecc40[_0x21bb34(0x8f)],'operationType':snakeToCamel(_0x4ecc40['operationType']),'functionNode':_0x21bb34(0x9e)});}return _0x1f00b2;}export function resolveRemoteScriptTarget(_0x5dd399,_0xe82ee6,_0x424c94,_0x38c167,_0xb43ba0){const _0x52ab08=a187_0x1f997c,_0x361a9e=normalizeBffType(_0xe82ee6[_0x52ab08(0x9c)]);if(!_0x361a9e||!_0xe82ee6['functionName'])return null;if(_0x361a9e===_0x52ab08(0x7e)){const _0x4bd72e=(_0xe82ee6['id']?_0x424c94[_0x52ab08(0x86)](_0xe82ee6['id']):undefined)??findHookLocationByRemoteId(_0x38c167,_0xe82ee6['id']);if(!_0x4bd72e)return null;const _0x23b1d3=_0x4bd72e[_0x52ab08(0x7f)]||_0xb43ba0[_0x52ab08(0x86)](_0x4bd72e[_0x52ab08(0x8f)]),_0xec217b=_0x23b1d3??_0x4bd72e['datasetCode'],_0xe1d413={..._0x4bd72e,'alias':_0x23b1d3},_0x3779dd=_0x52ab08(0x87)+_0xec217b+'/'+_0xe1d413[_0x52ab08(0x8a)]+'/'+_0xe1d413['functionNode']+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x3779dd,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x3779dd),'type':_0x52ab08(0x7e),'hookLocation':_0xe1d413};}const _0x5d9ed8=_0x361a9e+'/'+_0xe82ee6[_0x52ab08(0x83)];return{'lockKey':_0x5d9ed8,'filePath':resolveLocalFilePathFromLockKey(_0x5dd399,_0x5d9ed8),'type':_0x361a9e};}export async function ensureParentDirectory(_0x1644ec){await mkdir(dirname(_0x1644ec),{'recursive':!![]});}export async function fileExists(_0x357a51){try{return await access(_0x357a51,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x23a83c){try{const _0x85dcdb=await stat(_0x23a83c);return _0x85dcdb['isDirectory']();}catch{return![];}}
@@ -1 +1 @@
1
- function a188_0x2824(_0x1995df,_0x582ceb){_0x1995df=_0x1995df-0x1a8;const _0x66c30d=a188_0x66c3();let _0x282403=_0x66c30d[_0x1995df];return _0x282403;}function a188_0x66c3(){const _0x29f93c=['md5','154044DljKhC','utf8','digest','1765800QwOCsn','72GBdwEI','createHash','4OkWFFo','update','129897nyzHxM','3385030wamxit','1927135JJYKce','707398sVJajR','1oQOYfZ','2777222CwClgK'];a188_0x66c3=function(){return _0x29f93c;};return a188_0x66c3();}(function(_0x183b65,_0x3a52b5){const _0x225c33=a188_0x2824,_0x1d952e=_0x183b65();while(!![]){try{const _0x1fe086=parseInt(_0x225c33(0x1b0))/0x1*(parseInt(_0x225c33(0x1af))/0x2)+-parseInt(_0x225c33(0x1b3))/0x3+parseInt(_0x225c33(0x1aa))/0x4*(parseInt(_0x225c33(0x1ae))/0x5)+-parseInt(_0x225c33(0x1b6))/0x6+-parseInt(_0x225c33(0x1b1))/0x7+-parseInt(_0x225c33(0x1a8))/0x8*(parseInt(_0x225c33(0x1ac))/0x9)+parseInt(_0x225c33(0x1ad))/0xa;if(_0x1fe086===_0x3a52b5)break;else _0x1d952e['push'](_0x1d952e['shift']());}catch(_0xc4aa5b){_0x1d952e['push'](_0x1d952e['shift']());}}}(a188_0x66c3,0x3221a));import{readFile}from'node:fs/promises';import a188_0x37c884 from'node:crypto';export function computeContentHash(_0x28a346){const _0x3c9ddd=a188_0x2824;return a188_0x37c884[_0x3c9ddd(0x1a9)](_0x3c9ddd(0x1b2))[_0x3c9ddd(0x1ab)](_0x28a346)[_0x3c9ddd(0x1b5)]('hex');}export async function computeFileHash(_0x58e0c8){const _0x3e29a7=a188_0x2824,_0xfec901=await readFile(_0x58e0c8,_0x3e29a7(0x1b4));return computeContentHash(_0xfec901);}
1
+ (function(_0x2179a9,_0x28d9bc){const _0x2d7b88=a188_0x2868,_0x476c25=_0x2179a9();while(!![]){try{const _0x5a2849=parseInt(_0x2d7b88(0xef))/0x1*(-parseInt(_0x2d7b88(0xee))/0x2)+parseInt(_0x2d7b88(0xf0))/0x3*(-parseInt(_0x2d7b88(0xf8))/0x4)+parseInt(_0x2d7b88(0xf4))/0x5+-parseInt(_0x2d7b88(0xfc))/0x6*(parseInt(_0x2d7b88(0xf5))/0x7)+parseInt(_0x2d7b88(0xf3))/0x8+parseInt(_0x2d7b88(0xf7))/0x9+-parseInt(_0x2d7b88(0xf2))/0xa*(-parseInt(_0x2d7b88(0xfd))/0xb);if(_0x5a2849===_0x28d9bc)break;else _0x476c25['push'](_0x476c25['shift']());}catch(_0x1c88e1){_0x476c25['push'](_0x476c25['shift']());}}}(a188_0x211b,0x5ee50));function a188_0x2868(_0xc77b2e,_0x13b93a){_0xc77b2e=_0xc77b2e-0xee;const _0x211b2a=a188_0x211b();let _0x2868cc=_0x211b2a[_0xc77b2e];return _0x2868cc;}import{readFile}from'node:fs/promises';function a188_0x211b(){const _0x310741=['1812340EofUsG','4579864NDIYFy','3828280EdOBHk','763kycteb','digest','2484171RLPcdd','1309972SQTVrX','hex','createHash','update','14874WcShdT','11HxAwOw','74078yTBvPf','13TJWrdv','6wSVaiu','md5'];a188_0x211b=function(){return _0x310741;};return a188_0x211b();}import a188_0x2b2288 from'node:crypto';export function computeContentHash(_0x4a0a89){const _0x3493d2=a188_0x2868;return a188_0x2b2288[_0x3493d2(0xfa)](_0x3493d2(0xf1))[_0x3493d2(0xfb)](_0x4a0a89)[_0x3493d2(0xf6)](_0x3493d2(0xf9));}export async function computeFileHash(_0x5e95ea){const _0x1a5d98=await readFile(_0x5e95ea,'utf8');return computeContentHash(_0x1a5d98);}
@@ -1 +1 @@
1
- function a189_0x4bdf(_0x42aabe,_0x71add5){_0x42aabe=_0x42aabe-0xcb;const _0x5bb9c1=a189_0x5bb9();let _0x4bdf93=_0x5bb9c1[_0x42aabe];return _0x4bdf93;}(function(_0x57abd7,_0x8ccc99){const _0x35e78f=a189_0x4bdf,_0x25e3d0=_0x57abd7();while(!![]){try{const _0xd0d481=parseInt(_0x35e78f(0xde))/0x1*(parseInt(_0x35e78f(0xcd))/0x2)+-parseInt(_0x35e78f(0xcc))/0x3+-parseInt(_0x35e78f(0xd2))/0x4+-parseInt(_0x35e78f(0xd5))/0x5+-parseInt(_0x35e78f(0xda))/0x6*(parseInt(_0x35e78f(0xdf))/0x7)+-parseInt(_0x35e78f(0xd4))/0x8+-parseInt(_0x35e78f(0xcf))/0x9*(-parseInt(_0x35e78f(0xcb))/0xa);if(_0xd0d481===_0x8ccc99)break;else _0x25e3d0['push'](_0x25e3d0['shift']());}catch(_0xcb2213){_0x25e3d0['push'](_0x25e3d0['shift']());}}}(a189_0x5bb9,0x495a9));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a189_0x5bb9(){const _0x414f33=['2839160GJqPYy','apps','parse','code','lastSync','362778nOSDcj','object','functions',':\x20scriptsRoot\x20mismatch\x20—\x20','535033cVUhTY','7kiMoMQ','utf8','10oRsqke','1710702rskPiv','2UCBZNR','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','12944898pYCmaG','current\x20\x22','\x22.\x20','154984ieXluP','scriptsRoot','3484984JcIofd'];a189_0x5bb9=function(){return _0x414f33;};return a189_0x5bb9();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x3fab0b,_0x43cd51,_0x37ae30,_0x386a81){const _0x182e94=a189_0x4bdf,_0x2824bb={'apps':_0x3fab0b[_0x182e94(0xd6)]&&typeof _0x3fab0b[_0x182e94(0xd6)]===_0x182e94(0xdb)?_0x3fab0b[_0x182e94(0xd6)]:{}};let _0x4345a8=_0x2824bb[_0x182e94(0xd6)][_0x43cd51];if(!_0x4345a8)return _0x4345a8={'scriptsRoot':_0x37ae30,'lastSync':'','functions':{}},_0x2824bb[_0x182e94(0xd6)][_0x43cd51]=_0x4345a8,{'lockData':_0x2824bb,'appLock':_0x4345a8};if(!_0x4345a8[_0x182e94(0xd3)])_0x4345a8[_0x182e94(0xd3)]=_0x37ae30;else{if(_0x4345a8[_0x182e94(0xd3)]!==_0x37ae30)throw new Error(_0x386a81+_0x182e94(0xdd)+(_0x182e94(0xd0)+_0x37ae30+'\x22\x20vs\x20lock\x20\x22'+_0x4345a8[_0x182e94(0xd3)]+_0x182e94(0xd1))+_0x182e94(0xce));}return!_0x4345a8['functions']&&(_0x4345a8[_0x182e94(0xdc)]={}),!_0x4345a8[_0x182e94(0xd9)]&&(_0x4345a8['lastSync']=''),{'lockData':_0x2824bb,'appLock':_0x4345a8};}export async function readBffLockFile(_0x52eb){const _0x35cfc3=a189_0x4bdf;try{const _0x47c0b7=await readFile(_0x52eb,_0x35cfc3(0xe0)),_0x2afeb9=JSON[_0x35cfc3(0xd7)](_0x47c0b7);return{'apps':_0x2afeb9['apps']&&typeof _0x2afeb9[_0x35cfc3(0xd6)]===_0x35cfc3(0xdb)?_0x2afeb9[_0x35cfc3(0xd6)]:{}};}catch(_0x2b6779){if(_0x2b6779[_0x35cfc3(0xd8)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x2b6779));}}export async function writeBffLockFile(_0x2aefae,_0x1f404b){const _0x3b7220=a189_0x4bdf;await mkdir(dirname(_0x2aefae),{'recursive':!![]}),await writeFile(_0x2aefae,JSON['stringify'](_0x1f404b,null,0x2),_0x3b7220(0xe0));}
1
+ (function(_0x48168f,_0x2a7c7c){const _0x432232=a189_0x5901,_0x426cd1=_0x48168f();while(!![]){try{const _0x4ab67d=-parseInt(_0x432232(0x99))/0x1+parseInt(_0x432232(0x93))/0x2*(-parseInt(_0x432232(0x8a))/0x3)+-parseInt(_0x432232(0x94))/0x4*(-parseInt(_0x432232(0x8e))/0x5)+parseInt(_0x432232(0x91))/0x6*(-parseInt(_0x432232(0x9a))/0x7)+parseInt(_0x432232(0x9b))/0x8+parseInt(_0x432232(0x9c))/0x9+parseInt(_0x432232(0x86))/0xa;if(_0x4ab67d===_0x2a7c7c)break;else _0x426cd1['push'](_0x426cd1['shift']());}catch(_0xbaa5e6){_0x426cd1['push'](_0x426cd1['shift']());}}}(a189_0x41a7,0xb665e));import{mkdir,readFile,writeFile}from'node:fs/promises';function a189_0x41a7(){const _0x1eed24=['utf8','code','scriptsRoot','940085pFmQtR','240562GCxkeB','10099904sfWDiM','2453175YmoRwn','current\x20\x22','6490480kdyOYR',':\x20scriptsRoot\x20mismatch\x20—\x20','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','\x22.\x20','6cJlgIV','apps','object','lastSync','20JNRmpi','ENOENT','functions','186XoPkGT','parse','870518Dctktj','1438940MPCDMP','stringify'];a189_0x41a7=function(){return _0x1eed24;};return a189_0x41a7();}import{dirname}from'node:path';function a189_0x5901(_0x5f3a67,_0x739e3d){_0x5f3a67=_0x5f3a67-0x86;const _0x41a7d3=a189_0x41a7();let _0x5901a2=_0x41a7d3[_0x5f3a67];return _0x5901a2;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x51313e,_0x21ca8d,_0x2b20c7,_0x3d22e2){const _0x34f57c=a189_0x5901,_0x35b987={'apps':_0x51313e[_0x34f57c(0x8b)]&&typeof _0x51313e['apps']===_0x34f57c(0x8c)?_0x51313e[_0x34f57c(0x8b)]:{}};let _0x67081c=_0x35b987[_0x34f57c(0x8b)][_0x21ca8d];if(!_0x67081c)return _0x67081c={'scriptsRoot':_0x2b20c7,'lastSync':'','functions':{}},_0x35b987[_0x34f57c(0x8b)][_0x21ca8d]=_0x67081c,{'lockData':_0x35b987,'appLock':_0x67081c};if(!_0x67081c[_0x34f57c(0x98)])_0x67081c[_0x34f57c(0x98)]=_0x2b20c7;else{if(_0x67081c[_0x34f57c(0x98)]!==_0x2b20c7)throw new Error(_0x3d22e2+_0x34f57c(0x87)+(_0x34f57c(0x9d)+_0x2b20c7+'\x22\x20vs\x20lock\x20\x22'+_0x67081c[_0x34f57c(0x98)]+_0x34f57c(0x89))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x67081c['functions']&&(_0x67081c[_0x34f57c(0x90)]={}),!_0x67081c[_0x34f57c(0x8d)]&&(_0x67081c[_0x34f57c(0x8d)]=''),{'lockData':_0x35b987,'appLock':_0x67081c};}export async function readBffLockFile(_0x58e064){const _0x17ca76=a189_0x5901;try{const _0x226a97=await readFile(_0x58e064,_0x17ca76(0x96)),_0x5e5f9a=JSON[_0x17ca76(0x92)](_0x226a97);return{'apps':_0x5e5f9a[_0x17ca76(0x8b)]&&typeof _0x5e5f9a[_0x17ca76(0x8b)]===_0x17ca76(0x8c)?_0x5e5f9a['apps']:{}};}catch(_0x267b67){if(_0x267b67[_0x17ca76(0x97)]===_0x17ca76(0x8f))return null;throw new Error(_0x17ca76(0x88)+String(_0x267b67));}}export async function writeBffLockFile(_0x1cf1ba,_0x4cac96){const _0x214b8d=a189_0x5901;await mkdir(dirname(_0x1cf1ba),{'recursive':!![]}),await writeFile(_0x1cf1ba,JSON[_0x214b8d(0x95)](_0x4cac96,null,0x2),_0x214b8d(0x96));}
@@ -1 +1 @@
1
- function a191_0x526d(_0x1395b7,_0x22f46e){_0x1395b7=_0x1395b7-0x1ae;const _0x409b82=a191_0x409b();let _0x526d09=_0x409b82[_0x1395b7];return _0x526d09;}(function(_0x7e20ed,_0x3ff583){const _0x501c9f=a191_0x526d,_0x469653=_0x7e20ed();while(!![]){try{const _0x4502ee=parseInt(_0x501c9f(0x1c3))/0x1+-parseInt(_0x501c9f(0x1b8))/0x2*(parseInt(_0x501c9f(0x1b6))/0x3)+-parseInt(_0x501c9f(0x1bb))/0x4*(parseInt(_0x501c9f(0x1b9))/0x5)+parseInt(_0x501c9f(0x1be))/0x6*(parseInt(_0x501c9f(0x1bd))/0x7)+parseInt(_0x501c9f(0x1af))/0x8*(parseInt(_0x501c9f(0x1b0))/0x9)+parseInt(_0x501c9f(0x1c5))/0xa*(parseInt(_0x501c9f(0x1bc))/0xb)+parseInt(_0x501c9f(0x1bf))/0xc*(-parseInt(_0x501c9f(0x1b7))/0xd);if(_0x4502ee===_0x3ff583)break;else _0x469653['push'](_0x469653['shift']());}catch(_0x380c6c){_0x469653['push'](_0x469653['shift']());}}}(a191_0x409b,0x80354));function a191_0x409b(){const _0x9f30c6=['28PtOJsK','22XDdwEu','77zJgVpC','540552TgoLli','12oilhYq','match','toUpperCase','test','760638xJbCbr','values','1096630lWTWun','datasetCode','11128MUEGPb','288qItOZH','operationType','after','replace','trim','toLowerCase','85695UGuiIJ','1155193OjhHzO','32OZOHcg','674605ijJQve','functionNode'];a191_0x409b=function(){return _0x9f30c6;};return a191_0x409b();}export function snakeToCamel(_0x55664d){const _0x2ed15a=a191_0x526d;return _0x55664d[_0x2ed15a(0x1b5)]()[_0x2ed15a(0x1b3)](/_([a-z])/g,(_0x403ae3,_0xbfa379)=>_0xbfa379[_0x2ed15a(0x1c1)]());}export function findHookLocationByRemoteId(_0x17f0bd,_0x747cf4){const _0x7e6cb6=a191_0x526d;if(!_0x747cf4)return undefined;for(const _0xfe6a88 of Object[_0x7e6cb6(0x1c4)](_0x17f0bd)){if(_0xfe6a88['remoteId']===_0x747cf4&&_0xfe6a88['datasetCode']&&_0xfe6a88[_0x7e6cb6(0x1b1)]&&_0xfe6a88[_0x7e6cb6(0x1ba)])return{'datasetCode':_0xfe6a88[_0x7e6cb6(0x1ae)],'operationType':_0xfe6a88[_0x7e6cb6(0x1b1)],'functionNode':_0xfe6a88['functionNode']};}return undefined;}export function extractScriptDescription(_0x3d1db7){const _0x1f9908=a191_0x526d,_0x25eb21=_0x3d1db7[_0x1f9908(0x1c0)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x25eb21?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x3389a0){const _0x2425fd=a191_0x526d;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x2425fd(0x1c2)](_0x3389a0);}export function normalizeHookFunctionNode(_0x461374){const _0x118f99=a191_0x526d;if(!_0x461374)return undefined;const _0x3d4380=_0x461374[_0x118f99(0x1b4)]()[_0x118f99(0x1b5)]();if(_0x3d4380==='before'||_0x3d4380===_0x118f99(0x1b2))return _0x3d4380;return undefined;}
1
+ (function(_0x36bdbe,_0xcec665){const _0x11206e=a191_0x230a,_0x33892e=_0x36bdbe();while(!![]){try{const _0x243770=-parseInt(_0x11206e(0x161))/0x1*(parseInt(_0x11206e(0x15f))/0x2)+parseInt(_0x11206e(0x160))/0x3+-parseInt(_0x11206e(0x15b))/0x4*(parseInt(_0x11206e(0x158))/0x5)+parseInt(_0x11206e(0x16c))/0x6+parseInt(_0x11206e(0x16e))/0x7*(parseInt(_0x11206e(0x168))/0x8)+parseInt(_0x11206e(0x166))/0x9*(parseInt(_0x11206e(0x15d))/0xa)+-parseInt(_0x11206e(0x159))/0xb*(parseInt(_0x11206e(0x15e))/0xc);if(_0x243770===_0xcec665)break;else _0x33892e['push'](_0x33892e['shift']());}catch(_0x4d2686){_0x33892e['push'](_0x33892e['shift']());}}}(a191_0x23ea,0x97ac2));export function snakeToCamel(_0x40e152){const _0x222f38=a191_0x230a;return _0x40e152[_0x222f38(0x167)]()[_0x222f38(0x15a)](/_([a-z])/g,(_0x3245a3,_0x874d7e)=>_0x874d7e[_0x222f38(0x165)]());}function a191_0x230a(_0x243242,_0x8bf18e){_0x243242=_0x243242-0x157;const _0x23ea82=a191_0x23ea();let _0x230aa0=_0x23ea82[_0x243242];return _0x230aa0;}export function findHookLocationByRemoteId(_0x530d33,_0x162a45){const _0x32d6d7=a191_0x230a;if(!_0x162a45)return undefined;for(const _0x4fbb8b of Object[_0x32d6d7(0x15c)](_0x530d33)){if(_0x4fbb8b[_0x32d6d7(0x16d)]===_0x162a45&&_0x4fbb8b['datasetCode']&&_0x4fbb8b[_0x32d6d7(0x157)]&&_0x4fbb8b[_0x32d6d7(0x169)])return{'datasetCode':_0x4fbb8b[_0x32d6d7(0x16a)],'operationType':_0x4fbb8b[_0x32d6d7(0x157)],'functionNode':_0x4fbb8b[_0x32d6d7(0x169)]};}return undefined;}export function extractScriptDescription(_0x4debd1){const _0x2c2684=a191_0x230a,_0x4ca502=_0x4debd1['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x4ca502?.[0x1]?.[_0x2c2684(0x163)]()||undefined;}export function isValidBffFunctionName(_0x4820bd){const _0x541da7=a191_0x230a;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x541da7(0x162)](_0x4820bd);}function a191_0x23ea(){const _0x471ad7=['remoteId','50099NtqUHw','operationType','1044275bjXEKz','33eOuVuE','replace','20ZVHDtI','values','66160pIBLNz','2067732mEnPHH','4szQlvW','3670011AUSvxO','380131AFsIjz','test','trim','before','toUpperCase','1080PXuEAm','toLowerCase','376GyxjYh','functionNode','datasetCode','after','3534504tbixEf'];a191_0x23ea=function(){return _0x471ad7;};return a191_0x23ea();}export function normalizeHookFunctionNode(_0x5c1b6){const _0x3a7ff4=a191_0x230a;if(!_0x5c1b6)return undefined;const _0x2e2973=_0x5c1b6[_0x3a7ff4(0x163)]()[_0x3a7ff4(0x167)]();if(_0x2e2973===_0x3a7ff4(0x164)||_0x2e2973===_0x3a7ff4(0x16b))return _0x2e2973;return undefined;}
@@ -1 +1 @@
1
- (function(_0x185385,_0x188151){const _0x125c1c=a192_0x4b04,_0x2429be=_0x185385();while(!![]){try{const _0x5ce485=-parseInt(_0x125c1c(0x1c4))/0x1*(parseInt(_0x125c1c(0x1cd))/0x2)+-parseInt(_0x125c1c(0x1b1))/0x3+parseInt(_0x125c1c(0x1b5))/0x4*(parseInt(_0x125c1c(0x1c6))/0x5)+-parseInt(_0x125c1c(0x1b8))/0x6*(-parseInt(_0x125c1c(0x1b2))/0x7)+parseInt(_0x125c1c(0x1ca))/0x8*(-parseInt(_0x125c1c(0x1be))/0x9)+parseInt(_0x125c1c(0x1cb))/0xa*(-parseInt(_0x125c1c(0x1b4))/0xb)+-parseInt(_0x125c1c(0x1b9))/0xc*(-parseInt(_0x125c1c(0x1cc))/0xd);if(_0x5ce485===_0x188151)break;else _0x2429be['push'](_0x2429be['shift']());}catch(_0x5a45e3){_0x2429be['push'](_0x2429be['shift']());}}}(a192_0x2453,0x9d373));function a192_0x4b04(_0x428bc2,_0x343d43){_0x428bc2=_0x428bc2-0x1ae;const _0x24536e=a192_0x2453();let _0x4b0450=_0x24536e[_0x428bc2];return _0x4b0450;}import{listDatasets}from'../core/api-client.js';function a192_0x2453(){const _0x55d493=['\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','250747OspOXx','set','18740qtKgET','filter','map','dbtableConfig','18808rfJhPm','10LDFPOI','37630541mpQuPG','10ZDuvIQ','dbId','entries','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbName','3370803FIXNYe','7531727rcMdVY','\x22\x20matches\x20multiple\x20databases:\x20','9971929uMVfKQ','968xVESGW','.\x20Be\x20more\x20specific.','db-','6fXYFAG','12YgqfCJ','toLowerCase','find','\x22\x20under\x20app\x20\x22','length','3636MMdKHr','\x22.\x20Available:\x20','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','No\x20database\x20matching\x20\x22','join'];a192_0x2453=function(){return _0x55d493;};return a192_0x2453();}const cache=new Map();export async function listDatabases(_0x4d5cec){const _0x1b6d91=a192_0x4b04;if(cache['has'](_0x4d5cec))return cache['get'](_0x4d5cec);const _0x3b684f=await listDatasets(_0x4d5cec),_0xadb0f7=new Map();for(const _0x253376 of _0x3b684f){const _0x158c4f=_0x253376[_0x1b6d91(0x1c9)];_0x158c4f?.[_0x1b6d91(0x1ce)]!=null&&_0xadb0f7[_0x1b6d91(0x1c5)](_0x158c4f['dbId'],_0x158c4f[_0x1b6d91(0x1b0)]??_0x1b6d91(0x1b7)+_0x158c4f[_0x1b6d91(0x1ce)]);}const _0x54690f=[..._0xadb0f7[_0x1b6d91(0x1ae)]()][_0x1b6d91(0x1c8)](([_0x5777db,_0x232175])=>({'dbId':_0x5777db,'dbName':_0x232175}));return cache['set'](_0x4d5cec,_0x54690f),_0x54690f;}export async function resolveDb(_0x5f0d41,_0x271649){const _0x1efb63=a192_0x4b04,_0x4644e4=await listDatabases(_0x5f0d41);if(_0x4644e4[_0x1efb63(0x1bd)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20under\x20app\x20\x22'+_0x5f0d41+_0x1efb63(0x1c3)};if(!_0x271649)return{'resolved':_0x4644e4};const _0x582a10=Number(_0x271649);if(!Number['isNaN'](_0x582a10)){const _0x3130ce=_0x4644e4[_0x1efb63(0x1bb)](_0x2462d7=>_0x2462d7[_0x1efb63(0x1ce)]===_0x582a10);if(_0x3130ce)return{'resolved':[_0x3130ce]};}const _0xd741a4=_0x271649['toLowerCase'](),_0x2d7dad=_0x4644e4[_0x1efb63(0x1c7)](_0x81a952=>_0x81a952[_0x1efb63(0x1b0)][_0x1efb63(0x1ba)]()['includes'](_0xd741a4));if(_0x2d7dad[_0x1efb63(0x1bd)]>0x0)return{'resolved':_0x2d7dad};const _0x3e5c20=_0x4644e4[_0x1efb63(0x1c8)](_0x27c5cc=>_0x27c5cc[_0x1efb63(0x1b0)]+'\x20('+_0x27c5cc['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x1efb63(0x1c1)+_0x271649+_0x1efb63(0x1bc)+_0x5f0d41+_0x1efb63(0x1bf)+_0x3e5c20+_0x1efb63(0x1c0)};}export async function resolveOneDb(_0x1618de,_0x168989){const _0x1fba39=a192_0x4b04,{resolved:_0x164d44,error:_0x21fb41}=await resolveDb(_0x1618de,_0x168989);if(_0x21fb41)return{'db':null,'error':_0x21fb41};if(_0x164d44['length']===0x1)return{'db':_0x164d44[0x0]};if(!_0x168989){const _0x13c574=_0x164d44[_0x1fba39(0x1c8)](_0x3faf34=>_0x3faf34['dbName']+'\x20('+_0x3faf34[_0x1fba39(0x1ce)]+')')[_0x1fba39(0x1c2)](',\x20');return{'db':null,'error':_0x1fba39(0x1af)+_0x13c574};}const _0x284027=_0x164d44[_0x1fba39(0x1c8)](_0x568451=>_0x568451[_0x1fba39(0x1b0)]+'\x20('+_0x568451[_0x1fba39(0x1ce)]+')')[_0x1fba39(0x1c2)](',\x20');return{'db':null,'error':'\x22'+_0x168989+_0x1fba39(0x1b3)+_0x284027+_0x1fba39(0x1b6)};}export async function getDbName(_0x24c663,_0x5e29cb){const _0x3f4279=a192_0x4b04,_0x315e6=await listDatabases(_0x24c663);return _0x315e6['find'](_0x31e614=>_0x31e614[_0x3f4279(0x1ce)]===_0x5e29cb)?.[_0x3f4279(0x1b0)];}
1
+ function a192_0x71b6(_0x3d805a,_0x1ebf13){_0x3d805a=_0x3d805a-0x1cd;const _0x15e54d=a192_0x15e5();let _0x71b650=_0x15e54d[_0x3d805a];return _0x71b650;}(function(_0x47c5e5,_0x415483){const _0x186afc=a192_0x71b6,_0x2c70d2=_0x47c5e5();while(!![]){try{const _0x6af745=parseInt(_0x186afc(0x1e3))/0x1*(parseInt(_0x186afc(0x1de))/0x2)+parseInt(_0x186afc(0x1db))/0x3+parseInt(_0x186afc(0x1d7))/0x4*(parseInt(_0x186afc(0x1d1))/0x5)+-parseInt(_0x186afc(0x1dc))/0x6*(-parseInt(_0x186afc(0x1ea))/0x7)+parseInt(_0x186afc(0x1da))/0x8+-parseInt(_0x186afc(0x1e9))/0x9+-parseInt(_0x186afc(0x1cf))/0xa;if(_0x6af745===_0x415483)break;else _0x2c70d2['push'](_0x2c70d2['shift']());}catch(_0x42d38d){_0x2c70d2['push'](_0x2c70d2['shift']());}}}(a192_0x15e5,0x70ac9));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x5c9ff2){const _0x2fb49e=a192_0x71b6;if(cache[_0x2fb49e(0x1d2)](_0x5c9ff2))return cache[_0x2fb49e(0x1e6)](_0x5c9ff2);const _0x4dae3b=await listDatasets(_0x5c9ff2),_0x13b7c8=new Map();for(const _0x56966d of _0x4dae3b){const _0x1a54f3=_0x56966d[_0x2fb49e(0x1e8)];_0x1a54f3?.['dbId']!=null&&_0x13b7c8[_0x2fb49e(0x1e4)](_0x1a54f3[_0x2fb49e(0x1dd)],_0x1a54f3[_0x2fb49e(0x1e2)]??'db-'+_0x1a54f3[_0x2fb49e(0x1dd)]);}const _0x2a106a=[..._0x13b7c8['entries']()][_0x2fb49e(0x1ce)](([_0x5e7399,_0x19813f])=>({'dbId':_0x5e7399,'dbName':_0x19813f}));return cache[_0x2fb49e(0x1e4)](_0x5c9ff2,_0x2a106a),_0x2a106a;}export async function resolveDb(_0x17ec62,_0x55a265){const _0x53c4de=a192_0x71b6,_0x49726d=await listDatabases(_0x17ec62);if(_0x49726d[_0x53c4de(0x1d8)]===0x0)return{'resolved':[],'error':_0x53c4de(0x1cd)+_0x17ec62+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x55a265)return{'resolved':_0x49726d};const _0x4f402f=Number(_0x55a265);if(!Number['isNaN'](_0x4f402f)){const _0x3b3e42=_0x49726d['find'](_0x5a6b3a=>_0x5a6b3a['dbId']===_0x4f402f);if(_0x3b3e42)return{'resolved':[_0x3b3e42]};}const _0xc46c29=_0x55a265[_0x53c4de(0x1e5)](),_0xf4fb99=_0x49726d[_0x53c4de(0x1d3)](_0x561b75=>_0x561b75['dbName']['toLowerCase']()[_0x53c4de(0x1d4)](_0xc46c29));if(_0xf4fb99['length']>0x0)return{'resolved':_0xf4fb99};const _0x1bbb76=_0x49726d['map'](_0x13d90=>_0x13d90[_0x53c4de(0x1e2)]+'\x20('+_0x13d90[_0x53c4de(0x1dd)]+')')[_0x53c4de(0x1d5)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x55a265+_0x53c4de(0x1d9)+_0x17ec62+_0x53c4de(0x1e7)+_0x1bbb76+_0x53c4de(0x1d0)};}export async function resolveOneDb(_0x3933e2,_0x3d3cde){const _0x4c2ed6=a192_0x71b6,{resolved:_0x5d613b,error:_0x5075b4}=await resolveDb(_0x3933e2,_0x3d3cde);if(_0x5075b4)return{'db':null,'error':_0x5075b4};if(_0x5d613b['length']===0x1)return{'db':_0x5d613b[0x0]};if(!_0x3d3cde){const _0xa940ed=_0x5d613b[_0x4c2ed6(0x1ce)](_0x1c46b9=>_0x1c46b9[_0x4c2ed6(0x1e2)]+'\x20('+_0x1c46b9[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':_0x4c2ed6(0x1e1)+_0xa940ed};}const _0x7c42f7=_0x5d613b[_0x4c2ed6(0x1ce)](_0x405d89=>_0x405d89['dbName']+'\x20('+_0x405d89[_0x4c2ed6(0x1dd)]+')')[_0x4c2ed6(0x1d5)](',\x20');return{'db':null,'error':'\x22'+_0x3d3cde+_0x4c2ed6(0x1e0)+_0x7c42f7+_0x4c2ed6(0x1d6)};}export async function getDbName(_0x3db250,_0x1332ff){const _0x59bb26=a192_0x71b6,_0x222b11=await listDatabases(_0x3db250);return _0x222b11[_0x59bb26(0x1df)](_0x559052=>_0x559052[_0x59bb26(0x1dd)]===_0x1332ff)?.[_0x59bb26(0x1e2)];}function a192_0x15e5(){const _0x2878c2=['2747025TeeloL','421734OxIuTu','dbId','122914msgiAU','find','\x22\x20matches\x20multiple\x20databases:\x20','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbName','15VUrLnW','set','toLowerCase','get','\x22.\x20Available:\x20','dbtableConfig','6395760hnKPmt','21eKVQNN','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','map','17098930bjyvzp','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','145085BgcUJA','has','filter','includes','join','.\x20Be\x20more\x20specific.','20GMkbbV','length','\x22\x20under\x20app\x20\x22','5508512ffqIHP'];a192_0x15e5=function(){return _0x2878c2;};return a192_0x15e5();}
@@ -1 +1 @@
1
- const a193_0x4eb373=a193_0x25aa;(function(_0x267711,_0x19cd18){const _0x12280d=a193_0x25aa,_0x31614b=_0x267711();while(!![]){try{const _0x2f81d5=parseInt(_0x12280d(0x1cf))/0x1*(parseInt(_0x12280d(0x1cc))/0x2)+parseInt(_0x12280d(0x1c0))/0x3+-parseInt(_0x12280d(0x1ca))/0x4*(parseInt(_0x12280d(0x1c2))/0x5)+parseInt(_0x12280d(0x1c5))/0x6*(-parseInt(_0x12280d(0x1cd))/0x7)+-parseInt(_0x12280d(0x1cb))/0x8*(parseInt(_0x12280d(0x1ce))/0x9)+parseInt(_0x12280d(0x1c7))/0xa*(parseInt(_0x12280d(0x1c8))/0xb)+parseInt(_0x12280d(0x1d2))/0xc;if(_0x2f81d5===_0x19cd18)break;else _0x31614b['push'](_0x31614b['shift']());}catch(_0x2447d7){_0x31614b['push'](_0x31614b['shift']());}}}(a193_0x2166,0x97fe3));import{constants}from'node:fs';function a193_0x25aa(_0x27e572,_0x194bc5){_0x27e572=_0x27e572-0x1c0;const _0x21665b=a193_0x2166();let _0x25aa0b=_0x21665b[_0x27e572];return _0x25aa0b;}import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x35c53e,_0x4f0c05=process[a193_0x4eb373(0x1d0)]()){const _0xa38437=a193_0x4eb373,_0x15de21=resolve(_0x4f0c05),_0x144246=join(_0x15de21,_0xa38437(0x1d1),_0xa38437(0x1c1));return{'projectRoot':_0x15de21,'pagesBaseDir':_0x144246,'appPagesDir':join(_0x144246,_0x35c53e),'lockFilePath':join(_0x15de21,_0xa38437(0x1d1),_0xa38437(0x1c9))};}export function buildPageFileName(_0x3b36d4,_0x36755a){const _0x212d4a=a193_0x4eb373;return _0x3b36d4+'-'+String(_0x36755a)[_0x212d4a(0x1c3)]()+_0x212d4a(0x1c6);}export function resolvePageFilePath(_0x7d65c3,_0x337106,_0x516cf7){const _0x451ad0=a193_0x4eb373;return join(_0x7d65c3[_0x451ad0(0x1d3)],buildPageFileName(_0x337106,_0x516cf7));}export async function ensureParentDirectory(_0x592e51){await mkdir(dirname(_0x592e51),{'recursive':!![]});}export async function fileExists(_0x43b760){const _0x32895f=a193_0x4eb373;try{return await access(_0x43b760,constants[_0x32895f(0x1c4)]),!![];}catch{return![];}}function a193_0x2166(){const _0x26443c=['F_OK','3554934JxThDN','.json','120ZSLsfn','258995tjhDuN','page.lock.json','4AfouHz','149304AWZWhL','721534MFoEcq','7fKDtKN','27HJZcje','1djUGMM','cwd','.rabetbase','12857664bOAZdY','appPagesDir','2058414fKhuvK','page','5649380JErhCG','toUpperCase'];a193_0x2166=function(){return _0x26443c;};return a193_0x2166();}
1
+ const a193_0x47c4db=a193_0x2eb7;(function(_0x2bcaa2,_0x20a65e){const _0x46588b=a193_0x2eb7,_0xa62038=_0x2bcaa2();while(!![]){try{const _0x21f547=-parseInt(_0x46588b(0xc8))/0x1*(parseInt(_0x46588b(0xc9))/0x2)+-parseInt(_0x46588b(0xc1))/0x3+-parseInt(_0x46588b(0xc7))/0x4*(-parseInt(_0x46588b(0xbe))/0x5)+-parseInt(_0x46588b(0xc3))/0x6*(-parseInt(_0x46588b(0xc0))/0x7)+-parseInt(_0x46588b(0xcb))/0x8*(parseInt(_0x46588b(0xc6))/0x9)+parseInt(_0x46588b(0xca))/0xa+parseInt(_0x46588b(0xbf))/0xb*(parseInt(_0x46588b(0xc2))/0xc);if(_0x21f547===_0x20a65e)break;else _0xa62038['push'](_0xa62038['shift']());}catch(_0x23d472){_0xa62038['push'](_0xa62038['shift']());}}}(a193_0x4df1,0xb88d8));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a193_0x4df1(){const _0x18d3ad=['11UarmBy','1522801tjmInv','1618668aebAXJ','17092392lpyCwS','6uicVOF','page','.json','2492181HLMoCC','141608xsPqgA','188553siVLDt','8KtGuFX','2535650FyJvDq','16mxjKqM','appPagesDir','cwd','F_OK','100yrHZPE'];a193_0x4df1=function(){return _0x18d3ad;};return a193_0x4df1();}export function loadPageProjectConfig(_0x260ad1,_0x5b247d=process[a193_0x47c4db(0xbc)]()){const _0x2b0371=a193_0x47c4db,_0x2f2a1b=resolve(_0x5b247d),_0xaabf14=join(_0x2f2a1b,'.rabetbase',_0x2b0371(0xc4));return{'projectRoot':_0x2f2a1b,'pagesBaseDir':_0xaabf14,'appPagesDir':join(_0xaabf14,_0x260ad1),'lockFilePath':join(_0x2f2a1b,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0x306cc5,_0x67da04){const _0x163737=a193_0x47c4db;return _0x306cc5+'-'+String(_0x67da04)['toUpperCase']()+_0x163737(0xc5);}export function resolvePageFilePath(_0x5cd263,_0x3ce340,_0x498e87){const _0x4f2cd5=a193_0x47c4db;return join(_0x5cd263[_0x4f2cd5(0xcc)],buildPageFileName(_0x3ce340,_0x498e87));}export async function ensureParentDirectory(_0x412a8a){await mkdir(dirname(_0x412a8a),{'recursive':!![]});}function a193_0x2eb7(_0x5941aa,_0x576ecd){_0x5941aa=_0x5941aa-0xbc;const _0x4df189=a193_0x4df1();let _0x2eb754=_0x4df189[_0x5941aa];return _0x2eb754;}export async function fileExists(_0x1da274){const _0x48eebe=a193_0x47c4db;try{return await access(_0x1da274,constants[_0x48eebe(0xbd)]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x27fe55,_0x5bdf33){const _0x35bd3c=a194_0x416e,_0x2ff6e6=_0x27fe55();while(!![]){try{const _0x52b53c=parseInt(_0x35bd3c(0x197))/0x1+parseInt(_0x35bd3c(0x193))/0x2*(-parseInt(_0x35bd3c(0x195))/0x3)+-parseInt(_0x35bd3c(0x19c))/0x4*(parseInt(_0x35bd3c(0x192))/0x5)+parseInt(_0x35bd3c(0x19a))/0x6+-parseInt(_0x35bd3c(0x196))/0x7*(-parseInt(_0x35bd3c(0x194))/0x8)+-parseInt(_0x35bd3c(0x19d))/0x9+-parseInt(_0x35bd3c(0x18f))/0xa;if(_0x52b53c===_0x5bdf33)break;else _0x2ff6e6['push'](_0x2ff6e6['shift']());}catch(_0x31b83d){_0x2ff6e6['push'](_0x2ff6e6['shift']());}}}(a194_0x11c6,0xec0a3));import a194_0xea02e0 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x2f3691){return JSON['stringify'](JSON['parse'](_0x2f3691),null,0x2)+'\x0a';}export function computePageContentHash(_0x35c763){const _0x3bcd56=a194_0x416e;return a194_0xea02e0[_0x3bcd56(0x191)](_0x3bcd56(0x199))['update'](_0x35c763)[_0x3bcd56(0x19b)](_0x3bcd56(0x190));}function a194_0x416e(_0x469a91,_0x53b6ca){_0x469a91=_0x469a91-0x18f;const _0x11c671=a194_0x11c6();let _0x416e6b=_0x11c671[_0x469a91];return _0x416e6b;}function a194_0x11c6(){const _0x20bdd9=['md5','6776832YDgwrI','digest','1228YOqkPL','2728206ebPlCo','1177780InWEJL','hex','createHash','16435MKmhlz','451468XnEKBm','48dwgvac','9JYLMak','1551809wBunBw','614448HmXTUq','utf8'];a194_0x11c6=function(){return _0x20bdd9;};return a194_0x11c6();}export function computeSerializedSchemaHash(_0x9878ec){return computePageContentHash(serializePageSchemaForFile(_0x9878ec));}export async function computePageFileHash(_0x397262){const _0x5188e6=a194_0x416e,_0x517617=await readFile(_0x397262,_0x5188e6(0x198));return computePageContentHash(_0x517617);}
1
+ (function(_0x13b63a,_0x49cdc6){const _0x4eaa7c=a194_0x590b,_0xc410e=_0x13b63a();while(!![]){try{const _0x783483=-parseInt(_0x4eaa7c(0x9d))/0x1*(parseInt(_0x4eaa7c(0xa8))/0x2)+parseInt(_0x4eaa7c(0xa0))/0x3*(-parseInt(_0x4eaa7c(0xa4))/0x4)+-parseInt(_0x4eaa7c(0xa1))/0x5*(-parseInt(_0x4eaa7c(0xac))/0x6)+-parseInt(_0x4eaa7c(0xaa))/0x7+parseInt(_0x4eaa7c(0x9f))/0x8*(parseInt(_0x4eaa7c(0x9e))/0x9)+parseInt(_0x4eaa7c(0xa3))/0xa+parseInt(_0x4eaa7c(0xa7))/0xb*(parseInt(_0x4eaa7c(0xa9))/0xc);if(_0x783483===_0x49cdc6)break;else _0xc410e['push'](_0xc410e['shift']());}catch(_0x1b5f33){_0xc410e['push'](_0xc410e['shift']());}}}(a194_0xbc69,0x22e48));import a194_0x1bb3a0 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x38740b){return JSON['stringify'](JSON['parse'](_0x38740b),null,0x2)+'\x0a';}export function computePageContentHash(_0xc85902){const _0x1d5b33=a194_0x590b;return a194_0x1bb3a0[_0x1d5b33(0xa6)](_0x1d5b33(0xad))[_0x1d5b33(0xab)](_0xc85902)['digest'](_0x1d5b33(0xa2));}export function computeSerializedSchemaHash(_0x3681eb){return computePageContentHash(serializePageSchemaForFile(_0x3681eb));}function a194_0x590b(_0x2bd10d,_0x45cd73){_0x2bd10d=_0x2bd10d-0x9d;const _0xbc6945=a194_0xbc69();let _0x590bce=_0xbc6945[_0x2bd10d];return _0x590bce;}function a194_0xbc69(){const _0x2df9b1=['1610714aknmfB','update','822DOBiBA','md5','3pJsmnT','9NpZojs','1110344fkBjJm','32979JioyLC','4135kKSdfv','hex','170010biToRy','52GrZxla','utf8','createHash','11SFozsi','75702MuSyOc','4324692mkXKLN'];a194_0xbc69=function(){return _0x2df9b1;};return a194_0xbc69();}export async function computePageFileHash(_0x3d69c9){const _0x44327c=a194_0x590b,_0x1adde3=await readFile(_0x3d69c9,_0x44327c(0xa5));return computePageContentHash(_0x1adde3);}
@@ -1 +1 @@
1
- (function(_0x10307e,_0x249f4){const _0x2c7462=a195_0xfe63,_0x584566=_0x10307e();while(!![]){try{const _0x4bd84e=-parseInt(_0x2c7462(0x1ef))/0x1+-parseInt(_0x2c7462(0x1e8))/0x2*(parseInt(_0x2c7462(0x1ed))/0x3)+-parseInt(_0x2c7462(0x1f4))/0x4+parseInt(_0x2c7462(0x1f1))/0x5*(-parseInt(_0x2c7462(0x1f2))/0x6)+parseInt(_0x2c7462(0x1ec))/0x7*(parseInt(_0x2c7462(0x1ee))/0x8)+parseInt(_0x2c7462(0x1f5))/0x9+-parseInt(_0x2c7462(0x1f0))/0xa*(-parseInt(_0x2c7462(0x1ea))/0xb);if(_0x4bd84e===_0x249f4)break;else _0x584566['push'](_0x584566['shift']());}catch(_0x112c28){_0x584566['push'](_0x584566['shift']());}}}(a195_0x4097,0x51f18));function a195_0xfe63(_0x31b5c4,_0x4c54ff){_0x31b5c4=_0x31b5c4-0x1e4;const _0x4097a6=a195_0x4097();let _0xfe63ba=_0x4097a6[_0x31b5c4];return _0xfe63ba;}import{mkdir,readFile,writeFile}from'node:fs/promises';function a195_0x4097(){const _0x587bb4=['ENOENT','parse','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','pages','object','5892GavezF','lastSync','11UzmTSr','stringify','364ujySTO','138SqdxDA','62128sXbBiH','118211BZdcjI','3736570tJFgJw','371470iDEMso','6JECiQs','apps','2249712HqCwxT','4037400kONebm'];a195_0x4097=function(){return _0x587bb4;};return a195_0x4097();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x37a68f,_0x5612ac){const _0x43de57=a195_0xfe63,_0x28b040={'apps':_0x37a68f[_0x43de57(0x1f3)]&&typeof _0x37a68f[_0x43de57(0x1f3)]===_0x43de57(0x1e7)?_0x37a68f[_0x43de57(0x1f3)]:{}};let _0x42de35=_0x28b040['apps'][_0x5612ac];if(!_0x42de35)return _0x42de35={'lastSync':'','pages':{}},_0x28b040[_0x43de57(0x1f3)][_0x5612ac]=_0x42de35,{'lockData':_0x28b040,'appLock':_0x42de35};return!_0x42de35[_0x43de57(0x1e9)]&&(_0x42de35[_0x43de57(0x1e9)]=''),(!_0x42de35[_0x43de57(0x1e6)]||typeof _0x42de35[_0x43de57(0x1e6)]!==_0x43de57(0x1e7))&&(_0x42de35['pages']={}),{'lockData':_0x28b040,'appLock':_0x42de35};}export async function readPageLockFile(_0x2d9cfb){const _0xbac4db=a195_0xfe63;try{const _0x3c1348=await readFile(_0x2d9cfb,'utf8'),_0x2599fc=JSON[_0xbac4db(0x1e4)](_0x3c1348);return{'apps':_0x2599fc[_0xbac4db(0x1f3)]&&typeof _0x2599fc['apps']===_0xbac4db(0x1e7)?_0x2599fc[_0xbac4db(0x1f3)]:{}};}catch(_0x4ca128){if(_0x4ca128['code']===_0xbac4db(0x1f6))return null;throw new Error(_0xbac4db(0x1e5)+String(_0x4ca128));}}export async function writePageLockFile(_0x2b36b6,_0xab5611){const _0x577937=a195_0xfe63;await mkdir(dirname(_0x2b36b6),{'recursive':!![]}),await writeFile(_0x2b36b6,JSON[_0x577937(0x1eb)](_0xab5611,null,0x2),'utf8');}
1
+ (function(_0x136588,_0x335f7a){const _0x4a3b1b=a195_0x4554,_0x52f9e7=_0x136588();while(!![]){try{const _0x510efc=parseInt(_0x4a3b1b(0x176))/0x1*(parseInt(_0x4a3b1b(0x17b))/0x2)+parseInt(_0x4a3b1b(0x185))/0x3*(-parseInt(_0x4a3b1b(0x174))/0x4)+parseInt(_0x4a3b1b(0x182))/0x5+-parseInt(_0x4a3b1b(0x17e))/0x6+parseInt(_0x4a3b1b(0x178))/0x7+parseInt(_0x4a3b1b(0x184))/0x8+-parseInt(_0x4a3b1b(0x179))/0x9*(-parseInt(_0x4a3b1b(0x17d))/0xa);if(_0x510efc===_0x335f7a)break;else _0x52f9e7['push'](_0x52f9e7['shift']());}catch(_0x2fc595){_0x52f9e7['push'](_0x52f9e7['shift']());}}}(a195_0x1905,0xea01d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x793d4d,_0x438eda){const _0xc325dd=a195_0x4554,_0x321f4c={'apps':_0x793d4d[_0xc325dd(0x181)]&&typeof _0x793d4d[_0xc325dd(0x181)]==='object'?_0x793d4d['apps']:{}};let _0x467b5d=_0x321f4c['apps'][_0x438eda];if(!_0x467b5d)return _0x467b5d={'lastSync':'','pages':{}},_0x321f4c[_0xc325dd(0x181)][_0x438eda]=_0x467b5d,{'lockData':_0x321f4c,'appLock':_0x467b5d};return!_0x467b5d['lastSync']&&(_0x467b5d[_0xc325dd(0x180)]=''),(!_0x467b5d['pages']||typeof _0x467b5d[_0xc325dd(0x183)]!==_0xc325dd(0x175))&&(_0x467b5d[_0xc325dd(0x183)]={}),{'lockData':_0x321f4c,'appLock':_0x467b5d};}function a195_0x4554(_0x4233b9,_0x44fd9d){_0x4233b9=_0x4233b9-0x174;const _0x190592=a195_0x1905();let _0x4554c0=_0x190592[_0x4233b9];return _0x4554c0;}export async function readPageLockFile(_0x276b41){const _0x414346=a195_0x4554;try{const _0x446348=await readFile(_0x276b41,'utf8'),_0x109079=JSON[_0x414346(0x17f)](_0x446348);return{'apps':_0x109079[_0x414346(0x181)]&&typeof _0x109079[_0x414346(0x181)]===_0x414346(0x175)?_0x109079['apps']:{}};}catch(_0x3be0cd){if(_0x3be0cd['code']===_0x414346(0x177))return null;throw new Error(_0x414346(0x17c)+String(_0x3be0cd));}}function a195_0x1905(){const _0x18cff7=['Failed\x20to\x20read\x20page\x20lock\x20file:\x20','60090PEobBG','5339400zeXdrA','parse','lastSync','apps','943045DzDDnX','pages','5839632uffZHn','4647nwwYcw','3868atFElY','object','2485ERjDjX','ENOENT','8790523RuyOph','99BMMlvh','utf8','890JQRWXr'];a195_0x1905=function(){return _0x18cff7;};return a195_0x1905();}export async function writePageLockFile(_0x58b7da,_0x4b6307){const _0x2f0fb3=a195_0x4554;await mkdir(dirname(_0x58b7da),{'recursive':!![]}),await writeFile(_0x58b7da,JSON['stringify'](_0x4b6307,null,0x2),_0x2f0fb3(0x17a));}
@@ -1 +1 @@
1
- function a197_0x304e(_0x4c6973,_0x3b8fac){_0x4c6973=_0x4c6973-0xf1;const _0x4f08db=a197_0x4f08();let _0x304e5a=_0x4f08db[_0x4c6973];return _0x304e5a;}const a197_0x2afcb3=a197_0x304e;function a197_0x4f08(){const _0x1116fc=['51sgvWTl','5409966kJQqAb','sql','6780PVWXLd','21794SNdcaQ','8qlpmoM','sql-trash','2667071wuuqzR','4114413WwLXck','1448quyLzq','.rabetbase','1175354hNROPQ','40HmINhr','35504124tFXqhG','7YFiQVH'];a197_0x4f08=function(){return _0x1116fc;};return a197_0x4f08();}(function(_0x1e6a62,_0x11ff76){const _0x3978a1=a197_0x304e,_0x5c8c7b=_0x1e6a62();while(!![]){try{const _0x49bba7=-parseInt(_0x3978a1(0xf5))/0x1+-parseInt(_0x3978a1(0xfd))/0x2*(parseInt(_0x3978a1(0xf9))/0x3)+-parseInt(_0x3978a1(0xf3))/0x4*(parseInt(_0x3978a1(0xfc))/0x5)+-parseInt(_0x3978a1(0xfa))/0x6*(parseInt(_0x3978a1(0xf8))/0x7)+-parseInt(_0x3978a1(0xfe))/0x8*(parseInt(_0x3978a1(0xf2))/0x9)+parseInt(_0x3978a1(0xf6))/0xa*(parseInt(_0x3978a1(0xf1))/0xb)+parseInt(_0x3978a1(0xf7))/0xc;if(_0x49bba7===_0x11ff76)break;else _0x5c8c7b['push'](_0x5c8c7b['shift']());}catch(_0x2884df){_0x5c8c7b['push'](_0x5c8c7b['shift']());}}}(a197_0x4f08,0xaf594));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a197_0x2afcb3(0xf4),LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME=a197_0x2afcb3(0xff);export function loadSqlProjectConfig(_0x33cc73,_0x1622d8){const _0x31ec71=a197_0x2afcb3,_0x5326ef=resolve(_0x1622d8??findProjectRootDirectory()),_0x27156c=DOT_DIR+'/sql',_0x58493a=_0x27156c+'/'+_0x33cc73;return{'projectRoot':_0x5326ef,'appCode':_0x33cc73,'sqlWorkspaceRoot':_0x27156c,'sqlRoot':_0x58493a,'sqlRootDir':resolve(_0x5326ef,DOT_DIR,_0x31ec71(0xfb),_0x33cc73),'lockFilePath':resolve(_0x5326ef,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5326ef,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a197_0x25ef(){const _0x2ca42c=['1925RohdXC','28092jIZXTv','243336LCXZUR','1966NEZrKN','140VUIlOv','.rabetbase','44628royNZQ','675510mJpnEg','70JlDmJn','657nohPEx','29505vrdveu','sql','63GoLWtF','173518gimtUj','sql.lock.json'];a197_0x25ef=function(){return _0x2ca42c;};return a197_0x25ef();}const a197_0x147be9=a197_0x2092;(function(_0x5e629a,_0x4702bb){const _0x2e1ba3=a197_0x2092,_0x2670f3=_0x5e629a();while(!![]){try{const _0xf3a328=-parseInt(_0x2e1ba3(0x8a))/0x1+-parseInt(_0x2e1ba3(0x8f))/0x2*(parseInt(_0x2e1ba3(0x86))/0x3)+parseInt(_0x2e1ba3(0x90))/0x4*(-parseInt(_0x2e1ba3(0x87))/0x5)+parseInt(_0x2e1ba3(0x8d))/0x6*(-parseInt(_0x2e1ba3(0x85))/0x7)+-parseInt(_0x2e1ba3(0x8e))/0x8*(-parseInt(_0x2e1ba3(0x89))/0x9)+-parseInt(_0x2e1ba3(0x84))/0xa+-parseInt(_0x2e1ba3(0x8c))/0xb*(-parseInt(_0x2e1ba3(0x92))/0xc);if(_0xf3a328===_0x4702bb)break;else _0x2670f3['push'](_0x2670f3['shift']());}catch(_0x3cfff4){_0x2670f3['push'](_0x2670f3['shift']());}}}(a197_0x25ef,0x259bb));import{resolve}from'node:path';function a197_0x2092(_0x3d9641,_0x31541d){_0x3d9641=_0x3d9641-0x84;const _0x25efd1=a197_0x25ef();let _0x209289=_0x25efd1[_0x3d9641];return _0x209289;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a197_0x147be9(0x91),LOCK_FILE_NAME=a197_0x147be9(0x8b),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x349643,_0x340bff){const _0x12b277=a197_0x147be9,_0x49fbe1=resolve(_0x340bff??findProjectRootDirectory()),_0xb3126f=DOT_DIR+'/sql',_0x453dd1=_0xb3126f+'/'+_0x349643;return{'projectRoot':_0x49fbe1,'appCode':_0x349643,'sqlWorkspaceRoot':_0xb3126f,'sqlRoot':_0x453dd1,'sqlRootDir':resolve(_0x49fbe1,DOT_DIR,_0x12b277(0x88),_0x349643),'lockFilePath':resolve(_0x49fbe1,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x49fbe1,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- function a198_0x2ea4(_0x151b21,_0x1476c4){_0x151b21=_0x151b21-0x1ea;const _0xc3914d=a198_0xc391();let _0x2ea42f=_0xc3914d[_0x151b21];return _0x2ea42f;}(function(_0x4454d6,_0x1a5a3b){const _0x3b2ccf=a198_0x2ea4,_0x2a7af2=_0x4454d6();while(!![]){try{const _0x45f419=-parseInt(_0x3b2ccf(0x208))/0x1+-parseInt(_0x3b2ccf(0x1f3))/0x2+parseInt(_0x3b2ccf(0x202))/0x3+-parseInt(_0x3b2ccf(0x1fb))/0x4*(-parseInt(_0x3b2ccf(0x1ea))/0x5)+-parseInt(_0x3b2ccf(0x1f7))/0x6+parseInt(_0x3b2ccf(0x1f1))/0x7*(parseInt(_0x3b2ccf(0x1f4))/0x8)+-parseInt(_0x3b2ccf(0x1fc))/0x9*(-parseInt(_0x3b2ccf(0x200))/0xa);if(_0x45f419===_0x1a5a3b)break;else _0x2a7af2['push'](_0x2a7af2['shift']());}catch(_0x3d83eb){_0x2a7af2['push'](_0x2a7af2['shift']());}}}(a198_0xc391,0x42a09));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x194c9a){const _0x576e88=a198_0x2ea4;if(_0x194c9a===_0x576e88(0x203))return _0x576e88(0x1fa);if(_0x194c9a===_0x576e88(0x1ec))return'mybatisXml';return undefined;}async function scanSqlFilesRecursively(_0x1d7676,_0x39d03c){const _0x394bbd=a198_0x2ea4,_0x5d6af0=[];try{const _0x27f417=await readdir(_0x1d7676,{'withFileTypes':!![]});for(const _0x36f8bc of _0x27f417){const _0x3b5212=join(_0x1d7676,_0x36f8bc[_0x394bbd(0x201)]);if(_0x36f8bc[_0x394bbd(0x1ee)]()){_0x5d6af0[_0x394bbd(0x1fe)](...await scanSqlFilesRecursively(_0x3b5212,_0x39d03c));continue;}if(!_0x36f8bc[_0x394bbd(0x1f9)]())continue;const _0xcb45c7=extname(_0x36f8bc[_0x394bbd(0x201)])[_0x394bbd(0x1f8)](),_0x191071=extensionToMode(_0xcb45c7);if(!_0x191071)continue;const _0xfe0dc8=relative(_0x39d03c,_0x3b5212)[_0x394bbd(0x209)](/\\/g,'/'),_0x15f024=_0xfe0dc8[_0x394bbd(0x1f2)]('/')[_0x394bbd(0x205)](Boolean),_0x4a55d9=parseSqlPath(_0x15f024,_0x36f8bc[_0x394bbd(0x201)],_0xcb45c7);if(!_0x4a55d9)continue;_0x5d6af0[_0x394bbd(0x1fe)]({'sqlCode':_0x4a55d9[_0x394bbd(0x207)],'sqlName':_0x4a55d9['sqlName'],'dbDirectory':_0x15f024[0x0],'filePath':_0x3b5212,'relativePath':_0xfe0dc8,'lockKey':_0x4a55d9['sqlCode'],'mode':_0x191071});}}catch(_0x27217b){if(_0x27217b[_0x394bbd(0x206)]!==_0x394bbd(0x1eb))throw _0x27217b;}return _0x5d6af0;}function a198_0xc391(){const _0x1fbf7c=['indexOf','filter','code','sqlCode','313766ogFPGU','replace','test','sqlRootDir','5xbeatZ','ENOENT','.xml','slice','isDirectory','dbName','dbId','10269mQprlW','split','164674omCaID','1120fVPZnh','mode','sqlName','2782230JFskBj','toLowerCase','isFile','sql','2032820wiJEnx','2151agtZsz','path','push','length','5710ftcYib','name','847977EBQXrm','.sql'];a198_0xc391=function(){return _0x1fbf7c;};return a198_0xc391();}export async function scanLocalSqlQueries(_0xa404ee){const _0x289dea=a198_0x2ea4;return scanSqlFilesRecursively(_0xa404ee[_0x289dea(0x20b)],_0xa404ee[_0x289dea(0x20b)]);}export function resolveLocalSqlFilePath(_0x4acc10,_0x330fa4,_0x4dfa05){const _0x56f041=a198_0x2ea4,_0x418801=_0x4dfa05?.[_0x56f041(0x1fd)]||(_0x4dfa05?.[_0x56f041(0x1f6)]||_0x4dfa05?.['dbName']?buildSqlRelativePath(_0x330fa4,_0x4dfa05?.[_0x56f041(0x1f6)],_0x4dfa05?.[_0x56f041(0x1ef)],_0x4dfa05?.[_0x56f041(0x1f5)]||'sql',_0x4dfa05?.[_0x56f041(0x1f0)]):buildDefaultSqlFileName(_0x330fa4,_0x4dfa05?.[_0x56f041(0x1f5)]||_0x56f041(0x1fa)));return join(_0x4acc10['sqlRootDir'],_0x418801);}export async function directoryExists(_0x1dae57){try{const _0x2da5dc=await stat(_0x1dae57);return _0x2da5dc['isDirectory']();}catch{return![];}}function parseSqlPath(_0x854d5d,_0x4af8fb,_0x110e5c){const _0x353d1d=a198_0x2ea4,_0x4cadba=_0x4af8fb[_0x353d1d(0x1ed)](0x0,-_0x110e5c[_0x353d1d(0x1ff)]);if(_0x854d5d['length']<0x2)return null;const _0x1bffeb=_0x4cadba[_0x353d1d(0x204)]('_');if(_0x1bffeb<=0x0||_0x1bffeb>=_0x4cadba[_0x353d1d(0x1ff)]-0x1)return null;const _0x4b1475=_0x4cadba[_0x353d1d(0x1ed)](0x0,_0x1bffeb);if(!isLikelySqlCode(_0x4b1475))return null;return{'sqlCode':_0x4b1475,'sqlName':_0x4cadba['slice'](_0x1bffeb+0x1)};}function isLikelySqlCode(_0x2a2d59){const _0x43e35f=a198_0x2ea4;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x43e35f(0x20a)](_0x2a2d59);}
1
+ (function(_0x228894,_0x427c10){const _0x54b007=a198_0x31a9,_0x1f6363=_0x228894();while(!![]){try{const _0x55d8c7=-parseInt(_0x54b007(0x11e))/0x1+parseInt(_0x54b007(0x123))/0x2+-parseInt(_0x54b007(0x119))/0x3*(parseInt(_0x54b007(0x111))/0x4)+parseInt(_0x54b007(0x11d))/0x5*(-parseInt(_0x54b007(0x117))/0x6)+-parseInt(_0x54b007(0x11c))/0x7*(parseInt(_0x54b007(0x110))/0x8)+-parseInt(_0x54b007(0x10f))/0x9*(parseInt(_0x54b007(0x115))/0xa)+parseInt(_0x54b007(0x108))/0xb*(parseInt(_0x54b007(0x109))/0xc);if(_0x55d8c7===_0x427c10)break;else _0x1f6363['push'](_0x1f6363['shift']());}catch(_0x104367){_0x1f6363['push'](_0x1f6363['shift']());}}}(a198_0x49b1,0xf3665));import{readdir,stat}from'node:fs/promises';function a198_0x31a9(_0x5696e0,_0x6bb7df){_0x5696e0=_0x5696e0-0x105;const _0x49b122=a198_0x49b1();let _0x31a965=_0x49b122[_0x5696e0];return _0x31a965;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2fc128){const _0x205053=a198_0x31a9;if(_0x2fc128==='.sql')return _0x205053(0x10e);if(_0x2fc128==='.xml')return _0x205053(0x105);return undefined;}async function scanSqlFilesRecursively(_0x43c196,_0x967f8e){const _0x1f3bf3=a198_0x31a9,_0x524dd4=[];try{const _0x5356ef=await readdir(_0x43c196,{'withFileTypes':!![]});for(const _0x1f43fe of _0x5356ef){const _0x3f715d=join(_0x43c196,_0x1f43fe[_0x1f3bf3(0x10b)]);if(_0x1f43fe[_0x1f3bf3(0x122)]()){_0x524dd4['push'](...await scanSqlFilesRecursively(_0x3f715d,_0x967f8e));continue;}if(!_0x1f43fe['isFile']())continue;const _0x1fba2c=extname(_0x1f43fe[_0x1f3bf3(0x10b)])[_0x1f3bf3(0x10a)](),_0x4f6deb=extensionToMode(_0x1fba2c);if(!_0x4f6deb)continue;const _0x5e9d18=relative(_0x967f8e,_0x3f715d)[_0x1f3bf3(0x106)](/\\/g,'/'),_0x212e5=_0x5e9d18[_0x1f3bf3(0x107)]('/')[_0x1f3bf3(0x10c)](Boolean),_0x395ebf=parseSqlPath(_0x212e5,_0x1f43fe[_0x1f3bf3(0x10b)],_0x1fba2c);if(!_0x395ebf)continue;_0x524dd4[_0x1f3bf3(0x10d)]({'sqlCode':_0x395ebf['sqlCode'],'sqlName':_0x395ebf['sqlName'],'dbDirectory':_0x212e5[0x0],'filePath':_0x3f715d,'relativePath':_0x5e9d18,'lockKey':_0x395ebf['sqlCode'],'mode':_0x4f6deb});}}catch(_0x4301a8){if(_0x4301a8[_0x1f3bf3(0x113)]!==_0x1f3bf3(0x112))throw _0x4301a8;}return _0x524dd4;}export async function scanLocalSqlQueries(_0x263cf9){const _0x43c669=a198_0x31a9;return scanSqlFilesRecursively(_0x263cf9[_0x43c669(0x11a)],_0x263cf9['sqlRootDir']);}function a198_0x49b1(){const _0x498057=['8068dRMxmk','ENOENT','code','sqlName','10vwnLxY','mode','60FCjIFT','dbName','2856frcTfc','sqlRootDir','test','7zuDzLH','70765TGITwy','1752506tslESG','slice','length','indexOf','isDirectory','799778hJJenZ','mybatisXml','replace','split','110VQIRzc','7447152rdvdqB','toLowerCase','name','filter','push','sql','4276287lwyKzw','10556168JfmSnv'];a198_0x49b1=function(){return _0x498057;};return a198_0x49b1();}export function resolveLocalSqlFilePath(_0x2ccc20,_0x2e1867,_0x2b2ed8){const _0x1ceb7e=a198_0x31a9,_0x451ba8=_0x2b2ed8?.['path']||(_0x2b2ed8?.[_0x1ceb7e(0x114)]||_0x2b2ed8?.[_0x1ceb7e(0x118)]?buildSqlRelativePath(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x114)],_0x2b2ed8?.[_0x1ceb7e(0x118)],_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e),_0x2b2ed8?.['dbId']):buildDefaultSqlFileName(_0x2e1867,_0x2b2ed8?.[_0x1ceb7e(0x116)]||_0x1ceb7e(0x10e)));return join(_0x2ccc20[_0x1ceb7e(0x11a)],_0x451ba8);}export async function directoryExists(_0x1a746b){const _0x36b187=a198_0x31a9;try{const _0x29a0bc=await stat(_0x1a746b);return _0x29a0bc[_0x36b187(0x122)]();}catch{return![];}}function parseSqlPath(_0x131059,_0x133520,_0x1c70d7){const _0x471da2=a198_0x31a9,_0x41c39f=_0x133520[_0x471da2(0x11f)](0x0,-_0x1c70d7[_0x471da2(0x120)]);if(_0x131059[_0x471da2(0x120)]<0x2)return null;const _0x21b646=_0x41c39f[_0x471da2(0x121)]('_');if(_0x21b646<=0x0||_0x21b646>=_0x41c39f[_0x471da2(0x120)]-0x1)return null;const _0x32682b=_0x41c39f[_0x471da2(0x11f)](0x0,_0x21b646);if(!isLikelySqlCode(_0x32682b))return null;return{'sqlCode':_0x32682b,'sqlName':_0x41c39f[_0x471da2(0x11f)](_0x21b646+0x1)};}function isLikelySqlCode(_0x3e1e39){const _0xb19564=a198_0x31a9;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0xb19564(0x11b)](_0x3e1e39);}
@@ -1 +1 @@
1
- (function(_0x2e018d,_0x237a28){const _0x36c658=a199_0x1ef0,_0x222e56=_0x2e018d();while(!![]){try{const _0x423794=-parseInt(_0x36c658(0xc3))/0x1+parseInt(_0x36c658(0xcc))/0x2*(parseInt(_0x36c658(0xbe))/0x3)+parseInt(_0x36c658(0xc8))/0x4+parseInt(_0x36c658(0xc9))/0x5*(parseInt(_0x36c658(0xc0))/0x6)+parseInt(_0x36c658(0xc5))/0x7+parseInt(_0x36c658(0xc2))/0x8*(-parseInt(_0x36c658(0xcd))/0x9)+-parseInt(_0x36c658(0xca))/0xa*(parseInt(_0x36c658(0xcb))/0xb);if(_0x423794===_0x237a28)break;else _0x222e56['push'](_0x222e56['shift']());}catch(_0x11cab9){_0x222e56['push'](_0x222e56['shift']());}}}(a199_0x6ee8,0x51915));import{readFile}from'node:fs/promises';function a199_0x1ef0(_0x36fdb4,_0x15c0ef){_0x36fdb4=_0x36fdb4-0xbe;const _0x6ee8c5=a199_0x6ee8();let _0x1ef01c=_0x6ee8c5[_0x36fdb4];return _0x1ef01c;}function a199_0x6ee8(){const _0x2c428d=['862833VPyftU','digest','6yJhzbz','utf8','1528984UVIebR','185544dObmCV','update','3197187TdqUrw','createHash','hex','880924XEKYhQ','1037735mXwOiT','263720XBcSxv','33qWQWGP','2OZkOHz','27gppraV'];a199_0x6ee8=function(){return _0x2c428d;};return a199_0x6ee8();}import a199_0x24ebb2 from'node:crypto';export function computeSqlContentHash(_0x20b0e1){const _0x41e3ee=a199_0x1ef0;return a199_0x24ebb2[_0x41e3ee(0xc6)]('md5')[_0x41e3ee(0xc4)](_0x20b0e1)[_0x41e3ee(0xbf)](_0x41e3ee(0xc7));}export async function computeSqlFileHash(_0x3c4e22){const _0x5832f2=a199_0x1ef0,_0x2ab419=await readFile(_0x3c4e22,_0x5832f2(0xc1));return computeSqlContentHash(_0x2ab419);}
1
+ (function(_0x31d1d6,_0x5b268c){const _0x421ba5=a199_0x5a8d,_0x5a5581=_0x31d1d6();while(!![]){try{const _0x518d6c=-parseInt(_0x421ba5(0x127))/0x1+parseInt(_0x421ba5(0x128))/0x2+parseInt(_0x421ba5(0x124))/0x3*(parseInt(_0x421ba5(0x129))/0x4)+-parseInt(_0x421ba5(0x12c))/0x5*(parseInt(_0x421ba5(0x11f))/0x6)+parseInt(_0x421ba5(0x126))/0x7+parseInt(_0x421ba5(0x11d))/0x8+parseInt(_0x421ba5(0x122))/0x9*(-parseInt(_0x421ba5(0x121))/0xa);if(_0x518d6c===_0x5b268c)break;else _0x5a5581['push'](_0x5a5581['shift']());}catch(_0x544e3a){_0x5a5581['push'](_0x5a5581['shift']());}}}(a199_0x4e89,0xd008f));import{readFile}from'node:fs/promises';function a199_0x5a8d(_0x2715d7,_0x2711d8){_0x2715d7=_0x2715d7-0x11d;const _0x4e89b7=a199_0x4e89();let _0x5a8d95=_0x4e89b7[_0x2715d7];return _0x5a8d95;}import a199_0x338806 from'node:crypto';export function computeSqlContentHash(_0x1272a0){const _0x90c585=a199_0x5a8d;return a199_0x338806[_0x90c585(0x125)](_0x90c585(0x120))[_0x90c585(0x12a)](_0x1272a0)[_0x90c585(0x12b)](_0x90c585(0x11e));}function a199_0x4e89(){const _0x3de24d=['32KcZBMr','update','digest','6605kyfjJB','12555976RlHFjT','hex','3414MkxhKn','md5','10ShPBeN','7527951tjuwMt','utf8','1242zykPRS','createHash','6023822psoFmx','122656AmuUBA','259000cZiwcg'];a199_0x4e89=function(){return _0x3de24d;};return a199_0x4e89();}export async function computeSqlFileHash(_0x3dc21c){const _0x486352=a199_0x5a8d,_0x224892=await readFile(_0x3dc21c,_0x486352(0x123));return computeSqlContentHash(_0x224892);}