@thinkingai/ae-cli 1.0.30 → 6.0.16-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 (355) hide show
  1. package/dist/{auth-U25QJU5D.js → auth-DYC2BGLM.js} +2 -3
  2. package/dist/{auth-H3GJD55A.js → auth-GHBMJ5ZR.js} +33 -17
  3. package/dist/{chunk-CLJF7MQA.js → chunk-2DUEAXV3.js} +1 -1
  4. package/dist/{chunk-SF3KTPIC.js → chunk-5OC7CYCG.js} +2 -2
  5. package/dist/{chunk-SRJIAOBN.js → chunk-6W4QOZAL.js} +10 -0
  6. package/dist/{chunk-I42JGQ2J.js → chunk-BJX3GXWC.js} +3 -5
  7. package/dist/{chunk-GLNZSDKO.js → chunk-DMMEPCST.js} +4 -6
  8. package/dist/{chunk-VJFUB3H3.js → chunk-I5CRVM2S.js} +3 -3
  9. package/dist/{chunk-GSJGPNKK.js → chunk-PN3OS34E.js} +1 -1
  10. package/dist/{chunk-JM34JPCO.js → chunk-RSHMZ3LG.js} +178 -4
  11. package/dist/{client-IN42F223.js → client-2UJ63MVQ.js} +3 -4
  12. package/dist/{config-64G36TJL.js → config-NCUGK6NS.js} +3 -3
  13. package/dist/index.js +2530 -28
  14. package/dist/{model-VZCYNIOG.js → model-SJSOZTRS.js} +2 -2
  15. package/dist/{raw-WJIWC6YP.js → raw-7NVWSVJP.js} +5 -7
  16. package/dist/{sync-NVASAISS.js → sync-GRVO4K3U.js} +3 -3
  17. package/dist/{te-agent-YV4DXEXK.js → te-agent-KZRIEN4N.js} +468 -46
  18. package/dist/{te-analysis-CB3DA5I5.js → te-analysis-VAR4KUOK.js} +144 -29
  19. package/dist/{te-audience-W7SCQFC7.js → te-audience-KMKYI2YJ.js} +22 -15
  20. package/dist/{te-common-FBXVWBSI.js → te-common-WNCZB7R7.js} +4 -5
  21. package/dist/{te-community-LNVDZSGW.js → te-community-JEEFXPB3.js} +10 -11
  22. package/dist/{te-dataops-IPCSSWYH.js → te-dataops-GD3XBYCS.js} +11 -12
  23. package/dist/{te-engage-KARARMIR.js → te-engage-4XHCTS6I.js} +4 -5
  24. package/dist/{te-kb-2Z2CARN3.js → te-kb-B62KFP2A.js} +96 -8
  25. package/dist/{te-meta-PDKLMWXN.js → te-meta-EPZGQN56.js} +9 -10
  26. package/dist/{te-team-SW5B7DHO.js → te-team-YY24VORI.js} +6 -7
  27. package/dist/tracking/i18n/resources/cli/en.json +153 -0
  28. package/dist/tracking/i18n/resources/cli/ja.json +153 -0
  29. package/dist/tracking/i18n/resources/cli/ko.json +153 -0
  30. package/dist/tracking/i18n/resources/cli/zh.json +153 -0
  31. package/package.json +9 -3
  32. package/skills/ae-agent/SKILL.md +65 -25
  33. package/skills/ae-analysis/SKILL.md +108 -8
  34. package/skills/ae-analysis/references/cancel_query.md +39 -0
  35. package/skills/ae-analysis/references/drilldown_user_events.md +4 -2
  36. package/skills/ae-analysis/references/drilldown_users.md +4 -2
  37. package/skills/ae-analysis/references/get_bi_panel_detail.md +35 -0
  38. package/skills/ae-analysis/references/list_alerts.md +1 -1
  39. package/skills/ae-analysis/references/list_bi_panels.md +35 -0
  40. package/skills/ae-analysis/references/list_cluster_members.md +4 -1
  41. package/skills/ae-analysis/references/list_dashboards.md +1 -1
  42. package/skills/ae-analysis/references/list_entities.md +1 -1
  43. package/skills/ae-analysis/references/list_events.md +1 -1
  44. package/skills/ae-analysis/references/list_metrics.md +1 -1
  45. package/skills/ae-analysis/references/list_project_mark_times.md +1 -1
  46. package/skills/ae-analysis/references/list_properties.md +1 -1
  47. package/skills/ae-analysis/references/list_public_access_links.md +1 -1
  48. package/skills/ae-analysis/references/list_reports.md +1 -1
  49. package/skills/ae-analysis/references/list_tag_members.md +4 -1
  50. package/skills/ae-analysis/references/query_adhoc.md +6 -5
  51. package/skills/ae-analysis/references/query_bi_panel_data.md +58 -0
  52. package/skills/ae-analysis/references/query_dashboard_report_data.md +4 -1
  53. package/skills/ae-analysis/references/query_entity_details.md +5 -2
  54. package/skills/ae-analysis/references/query_event_details.md +4 -1
  55. package/skills/ae-analysis/references/query_report_data.md +2 -2
  56. package/skills/ae-analysis-global/SKILL.md +3 -1
  57. package/skills/ae-analysis-intent/SKILL.md +132 -0
  58. package/skills/ae-data-integration-helper/SKILL.md +242 -0
  59. package/skills/ae-data-integration-helper/references/android_sdk_faq.md +179 -0
  60. package/skills/ae-data-integration-helper/references/c_sdk_compilation.md +83 -0
  61. package/skills/ae-data-integration-helper/references/c_sdk_faq.md +416 -0
  62. package/skills/ae-data-integration-helper/references/cocoscreator_sdk_faq.md +123 -0
  63. package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +365 -0
  64. package/skills/ae-data-integration-helper/references/index.md +56 -0
  65. package/skills/ae-data-integration-helper/references/ios_sdk_faq.md +118 -0
  66. package/skills/ae-data-integration-helper/references/java_sdk_faq.md +406 -0
  67. package/skills/ae-data-integration-helper/references/javascript_sdk_faq.md +129 -0
  68. package/skills/ae-data-integration-helper/references/logbus2_guide.md +309 -0
  69. package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +348 -0
  70. package/skills/ae-data-integration-helper/references/minigame_sdk_faq.md +115 -0
  71. package/skills/ae-data-integration-helper/references/miniprogram_sdk_faq.md +118 -0
  72. package/skills/ae-data-integration-helper/references/python_sdk_faq.md +232 -0
  73. package/skills/ae-data-integration-helper/references/restful_api_notes.md +74 -0
  74. package/skills/ae-data-integration-helper/references/sdk_log_guide.md +316 -0
  75. package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +107 -0
  76. package/skills/ae-data-integration-helper/references/unity_sdk_faq.md +115 -0
  77. package/skills/ae-generate-tracking-code/SKILL.md +629 -0
  78. package/skills/ae-generate-tracking-code/references/autotrack-enum.md +183 -0
  79. package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +202 -0
  80. package/skills/ae-generate-tracking-code/references/datax-config.md +43 -0
  81. package/skills/ae-generate-tracking-code/references/debug-script.md +102 -0
  82. package/skills/ae-generate-tracking-code/references/logbus-config.md +200 -0
  83. package/skills/ae-generate-tracking-code/references/modes.md +83 -0
  84. package/skills/ae-generate-tracking-code/references/restful-call.md +36 -0
  85. package/skills/ae-generate-tracking-code/references/sdk-index.md +128 -0
  86. package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +206 -0
  87. package/skills/ae-generate-tracking-code/references/snippet-delivery.md +394 -0
  88. package/skills/ae-generate-tracking-code/references/te-api.md +181 -0
  89. package/skills/ae-generate-tracking-plan/SKILL.md +1083 -0
  90. package/skills/ae-generate-tracking-plan/references/autotrack-events.md +273 -0
  91. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +425 -0
  92. package/skills/ae-generate-tracking-plan/references/te-api.md +100 -0
  93. package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +152 -0
  94. package/skills/ae-kb/SKILL.md +38 -5
  95. package/tracking-plan-template/MMO/346/211/213/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +104 -0
  96. package/tracking-plan-template/MMO/346/211/213/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  97. package/tracking-plan-template/MMO/351/241/265/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +117 -0
  98. package/tracking-plan-template/MMO/351/241/265/346/270/270/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
  99. package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +72 -0
  100. package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  101. package/tracking-plan-template/SLG/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +86 -0
  102. package/tracking-plan-template/SLG/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  103. package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +80 -0
  104. package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  105. package/tracking-plan-template/TE /345/237/213/347/202/271/347/244/272/344/276/213/346/250/241/346/235/277.md" +40 -0
  106. package/tracking-plan-template/TE /345/237/213/347/202/271/347/244/272/344/276/213/346/250/241/346/235/277.xlsx +0 -0
  107. package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.md +40 -0
  108. package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.xlsx +0 -0
  109. package/tracking-plan-template//344/274/221/351/227/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +92 -0
  110. package/tracking-plan-template//344/274/221/351/227/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
  111. package/tracking-plan-template//345/215/241/347/211/214/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +119 -0
  112. package/tracking-plan-template//345/215/241/347/211/214/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  113. package/tracking-plan-template//345/241/224/351/230/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_V1.md +130 -0
  114. package/tracking-plan-template//345/241/224/351/230/262/345/205/273/346/210/220/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_V1.xlsx +0 -0
  115. package/tracking-plan-template//345/276/256/344/277/241/345/260/217/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +52 -0
  116. package/tracking-plan-template//345/276/256/344/277/241/345/260/217/346/270/270/346/210/217/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  117. package/tracking-plan-template//346/215/225/351/261/274/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +68 -0
  118. package/tracking-plan-template//346/215/225/351/261/274/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  119. package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/215/241/347/211/214/346/270/270/346/210/217_/345/237/213/347/202/271/346/250/241/347/211/210v1.md +108 -0
  120. package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/215/241/347/211/214/346/270/270/346/210/217_/345/237/213/347/202/271/346/250/241/347/211/210v1.xlsx +0 -0
  121. package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +119 -0
  122. package/tracking-plan-template//346/224/276/347/275/256/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  123. package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/346/226/227/345/234/260/344/270/273/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +63 -0
  124. package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/346/226/227/345/234/260/344/270/273/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  125. package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/351/272/273/345/260/206/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v2.md +101 -0
  126. package/tracking-plan-template//346/243/213/347/211/214/347/261/273/357/274/210/351/272/273/345/260/206/357/274/211/345/237/213/347/202/271/346/250/241/346/235/277_v2.xlsx +0 -0
  127. package/tracking-plan-template//347/224/265/345/225/206/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.md +84 -0
  128. package/tracking-plan-template//347/224/265/345/225/206/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.xlsx +0 -0
  129. package/tracking-plan-template//347/237/255/345/211/247/344/272/247/345/223/201/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.md +79 -0
  130. package/tracking-plan-template//347/237/255/345/211/247/344/272/247/345/223/201/345/237/213/347/202/271/346/226/271/346/241/210/346/250/241/346/235/277_v1.xlsx +0 -0
  131. package/tracking-plan-template//347/244/276/344/272/244/350/201/212/345/244/251/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +105 -0
  132. package/tracking-plan-template//347/244/276/344/272/244/350/201/212/345/244/251/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  133. package/tracking-plan-template//351/230/205/350/257/273/347/261/273APP/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +83 -0
  134. package/tracking-plan-template//351/230/205/350/257/273/347/261/273APP/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
  135. package/wiki/te-docs/index.md +225 -0
  136. package/wiki/te-docs/raw/advanced-data-type/first-event-check.md +66 -0
  137. package/wiki/te-docs/raw/advanced-data-type/updated-event.md +87 -0
  138. package/wiki/te-docs/raw/advanced-data-type.md +16 -0
  139. package/wiki/te-docs/raw/data-ingestion-guide/about-gdpr.md +55 -0
  140. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/automatic-event-tracking.md +431 -0
  141. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/debugging-and-logging.md +49 -0
  142. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/multi-instance.md +66 -0
  143. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/preset-properties.md +466 -0
  144. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/third-party-integration.md +127 -0
  145. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced.md +513 -0
  146. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/compliance.md +24 -0
  147. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/release-notes.md +177 -0
  148. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android.md +228 -0
  149. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/c-advanced.md +419 -0
  150. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/release-notes.md +45 -0
  151. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c.md +110 -0
  152. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/client-side-sdk-faq.md +52 -0
  153. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/cpp-advanced.md +366 -0
  154. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/release-notes.md +103 -0
  155. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp.md +201 -0
  156. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/compliance.md +26 -0
  157. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/automatically-track-events.md +117 -0
  158. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/debugging-and-logging.md +47 -0
  159. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/preset-properties.md +52 -0
  160. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced.md +267 -0
  161. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/release-notes.md +82 -0
  162. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter.md +139 -0
  163. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/compliance.md +26 -0
  164. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/automatically-track-events.md +121 -0
  165. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/debugging-and-logging.md +54 -0
  166. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/preset-properties.md +18 -0
  167. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced.md +305 -0
  168. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/release-notes.md +79 -0
  169. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native.md +137 -0
  170. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/release-notes.md +24 -0
  171. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/automatically-track-events.md +54 -0
  172. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/debugging-and-logging.md +53 -0
  173. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/multi-instance.md +42 -0
  174. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/preset-properties.md +119 -0
  175. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/support-native.md +81 -0
  176. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced.md +331 -0
  177. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app.md +156 -0
  178. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform.md +12 -0
  179. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/automatic-event-tracking.md +29 -0
  180. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/debugging-and-logging.md +47 -0
  181. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/multi-instance.md +21 -0
  182. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/preset-properties.md +249 -0
  183. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced.md +301 -0
  184. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/compliance.md +24 -0
  185. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/release-notes.md +51 -0
  186. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x.md +281 -0
  187. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/automatic-event-tracking.md +70 -0
  188. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/debugging-and-logging.md +57 -0
  189. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/native-support.md +104 -0
  190. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/preset-properties.md +91 -0
  191. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance.md +374 -0
  192. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/compliance.md +35 -0
  193. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/release-notes.md +109 -0
  194. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator.md +170 -0
  195. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/compliance.md +28 -0
  196. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/automatic-event-tracking.md +29 -0
  197. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/debugging-and-logging.md +58 -0
  198. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/preset-properties.md +43 -0
  199. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced.md +204 -0
  200. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/release-notes.md +29 -0
  201. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona.md +269 -0
  202. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/compliance.md +24 -0
  203. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/release-notes.md +177 -0
  204. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/automatic-event-tracking.md +119 -0
  205. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/debugging-and-logging.md +47 -0
  206. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/multi-instance.md +50 -0
  207. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/native-pluggable.md +43 -0
  208. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/preset-properties.md +212 -0
  209. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/third-party-integration.md +77 -0
  210. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced.md +396 -0
  211. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity.md +176 -0
  212. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/compliance.md +24 -0
  213. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/release-notes.md +81 -0
  214. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/automatic-event-tracking.md +79 -0
  215. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/debugging-and-logging.md +31 -0
  216. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/preset-properties.md +25 -0
  217. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/third-party-integrations.md +141 -0
  218. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced.md +278 -0
  219. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal.md +190 -0
  220. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine.md +14 -0
  221. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/h5-and-app-sdk-connection.md +147 -0
  222. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/instant-app-and-game.md +24 -0
  223. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/compliance.md +24 -0
  224. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/automatic-event-tracking.md +272 -0
  225. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/debugging-and-logging.md +77 -0
  226. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/multi-instance.md +142 -0
  227. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/preset-properties.md +484 -0
  228. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/third-party-integrations.md +132 -0
  229. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced.md +682 -0
  230. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/release-notes.md +163 -0
  231. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios.md +304 -0
  232. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/compliance.md +29 -0
  233. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/automatic-event-tracking.md +136 -0
  234. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/debugging-and-logging.md +48 -0
  235. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/multi-instance.md +50 -0
  236. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/preset-properties.md +132 -0
  237. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced.md +462 -0
  238. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/release-notes.md +107 -0
  239. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript.md +208 -0
  240. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/debugging-and-logging.md +62 -0
  241. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/preset-properties.md +118 -0
  242. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced.md +556 -0
  243. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos.md +231 -0
  244. package/wiki/te-docs/raw/data-ingestion-guide/client-sdk.md +25 -0
  245. package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/filebeat-logstash-user-guide.md +610 -0
  246. package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/logbus2-user-guide.md +1215 -0
  247. package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/ta-datax-writer-plugin-user-guide.md +278 -0
  248. package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools.md +15 -0
  249. package/wiki/te-docs/raw/data-ingestion-guide/privacy-policy.md +38 -0
  250. package/wiki/te-docs/raw/data-ingestion-guide/restful-api-user-guide.md +155 -0
  251. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-FM9Cwz.md +37 -0
  252. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-RSyfw7.md +41 -0
  253. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging.md +89 -0
  254. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-OxzWw.md +126 -0
  255. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-VuE3wr.md +126 -0
  256. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties.md +126 -0
  257. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-IauKwI.md +175 -0
  258. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-YAilwk.md +210 -0
  259. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced.md +211 -0
  260. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-PVazwa.md +62 -0
  261. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-TADbwY.md +50 -0
  262. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes.md +69 -0
  263. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-V2W3wv.md +131 -0
  264. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-Zf9Jwl.md +179 -0
  265. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c.md +189 -0
  266. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/debugging-and-logging.md +38 -0
  267. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/preset-properties.md +126 -0
  268. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced.md +113 -0
  269. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/release-notes.md +34 -0
  270. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang.md +155 -0
  271. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/debugging-and-logging.md +42 -0
  272. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/preset-properties.md +126 -0
  273. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced.md +157 -0
  274. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/release-notes.md +72 -0
  275. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang.md +148 -0
  276. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/debugging-and-logging.md +49 -0
  277. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/preset-properties.md +126 -0
  278. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced.md +223 -0
  279. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/release-notes.md +88 -0
  280. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java.md +174 -0
  281. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/debugging-and-logging.md +46 -0
  282. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/preset-properties.md +126 -0
  283. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced.md +182 -0
  284. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/release-notes.md +61 -0
  285. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua.md +121 -0
  286. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/debugging-and-logging.md +55 -0
  287. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/preset-properties.md +126 -0
  288. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced.md +225 -0
  289. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/release-notes.md +45 -0
  290. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs.md +141 -0
  291. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/debugging-and-logging.md +41 -0
  292. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/preset-properties.md +126 -0
  293. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced.md +216 -0
  294. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/release-notes.md +45 -0
  295. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php.md +173 -0
  296. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/debugging-and-logging.md +40 -0
  297. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/preset-properties.md +126 -0
  298. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced.md +206 -0
  299. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/release-notes.md +51 -0
  300. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python.md +116 -0
  301. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/release-notes.md +44 -0
  302. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/debugging-and-logging.md +47 -0
  303. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/preset-properties.md +126 -0
  304. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced.md +189 -0
  305. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby.md +142 -0
  306. package/wiki/te-docs/raw/data-ingestion-guide/server-sdk.md +22 -0
  307. package/wiki/te-docs/raw/data-ingestion-guide/thinkingdata-privacy-policy.md +37 -0
  308. package/wiki/te-docs/raw/data-ingestion-guide.md +48 -0
  309. package/wiki/te-docs/raw/preparations-before-data-ingestion/data-rules.md +396 -0
  310. package/wiki/te-docs/raw/preparations-before-data-ingestion/preset-properties-and-system-fields.md +957 -0
  311. package/wiki/te-docs/raw/preparations-before-data-ingestion/user-identification-rules.md +723 -0
  312. package/wiki/te-docs/raw/preparations-before-data-ingestion.md +203 -0
  313. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//345/220/210/350/247/204/346/214/207/345/215/227.md +96 -0
  314. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//346/233/264/346/226/260/346/227/245/345/277/227.md +97 -0
  315. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//345/244/232/345/256/236/344/276/213.md +52 -0
  316. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +48 -0
  317. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +447 -0
  318. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony//350/277/233/351/230/266/346/214/207/345/215/227.md +370 -0
  319. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony.md +172 -0
  320. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//345/220/210/350/247/204/346/214/207/345/215/227.md +37 -0
  321. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//346/233/264/346/226/260/346/227/245/345/277/227.md +209 -0
  322. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//345/244/232/345/256/236/344/276/213.md +71 -0
  323. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +49 -0
  324. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +125 -0
  325. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +498 -0
  326. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217//350/277/233/351/230/266/346/214/207/345/215/227.md +612 -0
  327. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//345/260/217/347/250/213/345/272/217/345/260/217/346/270/270/346/210/217.md +373 -0
  328. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//345/220/210/350/247/204/346/214/207/345/215/227.md +26 -0
  329. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//346/233/264/346/226/260/346/227/245/345/277/227.md +32 -0
  330. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +48 -0
  331. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +30 -0
  332. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +61 -0
  333. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua//350/277/233/351/230/266/346/214/207/345/215/227.md +236 -0
  334. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/cocos2d-lua.md +200 -0
  335. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//346/233/264/346/226/260/346/227/245/345/277/227.md +83 -0
  336. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227/native/346/224/257/346/214/201.md +66 -0
  337. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +54 -0
  338. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +62 -0
  339. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +358 -0
  340. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret//350/277/233/351/230/266/346/214/207/345/215/227.md +615 -0
  341. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/egret.md +166 -0
  342. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//346/233/264/346/226/260/346/227/245/345/277/227.md +87 -0
  343. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227/native/346/224/257/346/214/201.md +71 -0
  344. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//345/256/236/346/227/266/350/260/203/350/257/225.md +54 -0
  345. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//350/207/252/345/212/250/351/207/207/351/233/206.md +61 -0
  346. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227//351/242/204/347/275/256/345/261/236/346/200/247.md +406 -0
  347. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair//350/277/233/351/230/266/346/214/207/345/215/227.md +597 -0
  348. package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk//346/270/270/346/210/217/345/274/225/346/223/216/layaair.md +179 -0
  349. package/wiki/te-docs/schema.md +16 -0
  350. package/wiki/te-docs/synthesis/batch-ingest-comparison.md +324 -0
  351. package/wiki/te-docs/synthesis/js-sdk-cheatsheet.md +538 -0
  352. package/wiki/te-docs/synthesis/restful-api-reference.md +363 -0
  353. package/wiki/te-docs/synthesis/sdk-selection.md +372 -0
  354. package/wiki/te-docs/synthesis/server-sdk-overview.md +449 -0
  355. package/dist/chunk-U6TKB3IV.js +0 -171
@@ -0,0 +1,449 @@
1
+ ---
2
+ topic: Server SDK Overview
3
+ sources:
4
+ - raw/data-ingestion-guide/server-sdk.md
5
+ - raw/data-ingestion-guide/server-sdk/java.md
6
+ - raw/data-ingestion-guide/server-sdk/python.md
7
+ - raw/data-ingestion-guide/server-sdk/golang.md
8
+ - raw/data-ingestion-guide/server-sdk/nodejs.md
9
+ - raw/data-ingestion-guide/server-sdk/php.md
10
+ generated: 2026-06-16
11
+ ---
12
+
13
+ # Server SDK Overview
14
+
15
+ The ThinkingData server SDK family provides language-specific libraries for ingesting event data and user properties from server-side applications into the ThinkingData analytics platform. All server SDKs share a common architecture: they accumulate data locally (typically writing JSON log files to disk) and rely on LogBus to pick up files and upload them to the TA backend. This document covers six languages -- Java, Python, Golang, Node.js, PHP -- with cross-language comparisons for initialization, event tracking, user properties, buffering, teardown, and major differences.
16
+
17
+ ## Architecture Summary
18
+
19
+ Every server SDK follows the same three-layer model:
20
+
21
+ 1. **Consumer** -- accumulates events in memory, serializes them to JSON, and writes batch files to a local directory.
22
+ 2. **SDK client (TDAnalytics or equivalent)** -- exposes the track/user-set/flush/close API and delegates to the consumer.
23
+ 3. **LogBus** -- a separate daemon that watches the consumer's output directory, tails the log files, and uploads data to ThinkingData. LogBus is the recommended production transport.
24
+
25
+ The architecture is deliberately decoupled so the SDK never blocks on network I/O; data is always persisted to disk first.
26
+
27
+ ```
28
+ Application code
29
+ |
30
+ v
31
+ TDAnalytics client --track/userSet/flush/close--> Consumer --writes--> Local log files
32
+ |
33
+ v
34
+ LogBus --uploads--> ThinkingData servers
35
+ ```
36
+
37
+ ## Supported Languages at a Glance
38
+
39
+ | Language | Package/Module | Version (latest documented) | Minimum Runtime |
40
+ |---|---|---|---|
41
+ | Java | `cn.thinkingdata:thinkingdatasdk` (Maven) | v3.0.4-beta.1 (2026-01) | JDK 8 |
42
+ | Python | `ThinkingDataSdk` (pip) | v3.0.0 (2023-10) | (not specified) |
43
+ | Golang | `github.com/ThinkingDataAnalytics/go-sdk/v2` | v2.3.0 (2026-03) | (not specified) |
44
+ | Node.js | `thinkingdata-node` (npm) | v1.5.0 (2024-03) | (not specified) |
45
+ | PHP | `thinkinggame/ta-php-sdk` (Composer) | v3.1.1 (2024-07) | PHP 5.5+ |
46
+
47
+ Other languages with server SDKs (not covered in detail here): C, Ruby, C#, Lua, C++, ErLang.
48
+
49
+ ---
50
+
51
+ ## Consumer Type and Naming
52
+
53
+ Each language has its own consumer class name, though the role is identical across languages:
54
+
55
+ | Language | Consumer Class | Buffer Trigger |
56
+ |---|---|---|
57
+ | Java | `TDLoggerConsumer` | Byte threshold (default 8192 bytes) |
58
+ | Python | `TDLogConsumer` | Count threshold (default 5 events; configurable `buffer_size`) |
59
+ | Golang | `TDLogConsumer` (via `NewLogConsumerWithConfig`) | Real-time write; `Flush()` syncs memory cache |
60
+ | Node.js | `TDLoggingConsumer` (internal, created by `initWithLoggingMode`) | Real-time write to disk |
61
+ | PHP | `TDFileConsumer` | Count threshold (default 100 events; configurable in constructor) |
62
+
63
+ The critical difference: **Java** flushes when the accumulated JSON string length exceeds a byte threshold (8192 by default), while **Python** and **PHP** flush when the in-memory event count hits a threshold. **Golang** and **Node.js** write to disk in real time per event and use `flush` only to sync the filesystem cache or the OS buffer.
64
+
65
+ ---
66
+
67
+ ## Initialization
68
+
69
+ All SDKs require a log directory path where the consumer will write files. Some offer additional configuration via a config object.
70
+
71
+ ### Java
72
+
73
+ ```java
74
+ // Simple initialization
75
+ TDAnalytics te = new TDAnalytics(new TDLoggerConsumer("LOG_DIRECTORY"), false);
76
+
77
+ // Full initialization with configurable prefix
78
+ TDLoggerConsumer.Config config = new TDLoggerConsumer.Config("LOG_DIRECTORY");
79
+ config.setFilenamePrefix("unique_name");
80
+ TDAnalytics te = new TDAnalytics(new TDLoggerConsumer(config), false);
81
+ ```
82
+
83
+ The second argument (`false`) controls debug mode. The SDK is thread-safe and uses synchronous calls; the documentation recommends invoking API calls in a child thread to avoid blocking business threads.
84
+
85
+ ### Python
86
+
87
+ ```python
88
+ from tgasdk.sdk import *
89
+
90
+ # Simple
91
+ te = TDAnalytics(TDLogConsumer("LOG_DIRECTORY"))
92
+
93
+ # With buffer size control
94
+ te = TDAnalytics(TDLogConsumer("LOG_DIRECTORY", buffer_size=20))
95
+ ```
96
+
97
+ The `LOG_DIRECTORY` must match the LogBus listening folder.
98
+
99
+ ### Golang
100
+
101
+ ```go
102
+ import "github.com/ThinkingDataAnalytics/go-sdk/v2/src/thinkingdata"
103
+
104
+ config := thinkingdata.TDLogConsumerConfig{
105
+ Directory: "LOG_DIRECTORY",
106
+ }
107
+ consumer, _ := thinkingdata.NewLogConsumerWithConfig(config)
108
+ te := thinkingdata.New(consumer)
109
+ ```
110
+
111
+ ### Node.js
112
+
113
+ ```javascript
114
+ const ThinkingData = require('thinkingdata-node');
115
+
116
+ // Simple
117
+ let teSDK = ThinkingData.initWithLoggingMode('LOG_DIRECTORY');
118
+
119
+ // With options
120
+ let teSDK = ThinkingData.initWithLoggingMode('LOG_DIRECTORY', {
121
+ filePrefix: 'test',
122
+ rotateHourly: true
123
+ });
124
+ ```
125
+
126
+ Note that Node.js uses a factory function (`initWithLoggingMode`) rather than a constructor. Options include `filePrefix` and `rotateHourly`.
127
+
128
+ ### PHP
129
+
130
+ ```php
131
+ require_once "vendor/autoload.php";
132
+ use ThinkingData\TDLog;
133
+ use ThinkingData\TDAnalytics;
134
+ use ThinkingData\TDFileConsumer;
135
+
136
+ TDLog::$enable = true;
137
+
138
+ $consumer = new TDFileConsumer("LOG_DIRECTORY", 200, true, "LOG_FILE_PREFIX");
139
+ $teSDK = new TDAnalytics($consumer, true);
140
+ ```
141
+
142
+ The `TDFileConsumer` constructor accepts `(directory, bufferSize, autoFlush, filePrefix)`. Setting `TDLog::$enable = true` enables debug logging.
143
+
144
+ ### Initialization Comparison
145
+
146
+ | Aspect | Java | Python | Golang | Node.js | PHP |
147
+ |---|---|---|---|---|---|
148
+ | Create style | Constructor | Constructor | Config + Constructor | Factory function | Constructor |
149
+ | Consumer injection | First arg | First arg | First arg (via New) | Implicit in factory | First arg |
150
+ | Debug/verbose flag | Second arg (boolean) | Not in init | Not in init | Not in init | Second arg (boolean) |
151
+ | File prefix config | `setFilenamePrefix` | Not documented separately | In `TDLogConsumerConfig` | `filePrefix` option | Fourth constructor arg |
152
+ | Log rotation | Not in init | Not in init | Not in init | `rotateHourly` option | Not in init |
153
+
154
+ ---
155
+
156
+ ## Sending Events -- `track`
157
+
158
+ All languages provide a `track` (or `Track`) method. The event name and properties must follow the same rules across languages: property keys are strings (max 50 chars, must start with a letter, containing alphanumerics and underscores; case-insensitive with uppercase converted to lowercase). Values support string, number, boolean, Date/time, object (map/dict), array of objects, and array of primitives.
159
+
160
+ ### Parameter Order Differences (Critical)
161
+
162
+ This is the single most important cross-language difference. The order of `account_id` and `distinct_id` varies:
163
+
164
+ | Language | API Signature | Order |
165
+ |---|---|---|
166
+ | Java | `te.track(account_id, distinct_id, event, properties)` | account_id first |
167
+ | Python | `te.track(distinct_id, account_id, event, properties)` | distinct_id first |
168
+ | Golang | `te.Track(accountId, distinctId, event, properties)` | accountId first |
169
+ | Node.js | `teSDK.track({accountId, distinctId, event, properties})` | Object (named keys) |
170
+ | PHP | `$teSDK->track(distinct_id, account_id, event, properties)` | distinct_id first |
171
+
172
+ Java and Golang place `account_id` first. Python and PHP place `distinct_id` first. Node.js avoids the ambiguity entirely by using an object literal with named properties.
173
+
174
+ ### Code Examples
175
+
176
+ **Java** -- HashMap-based properties, supports nested objects and arrays:
177
+
178
+ ```java
179
+ HashMap<String,Object> properties = new HashMap<>();
180
+ properties.put("#ip", "192.168.1.1");
181
+ properties.put("channel", "te");
182
+ properties.put("age", 1);
183
+ properties.put("isSuccess", true);
184
+ properties.put("birthday", new Date());
185
+
186
+ te.track("account_id", "distinct_id", "payment", properties);
187
+ ```
188
+
189
+ **Python** -- dict-based properties; preset properties like `#time` and `#ip` are passed in the properties dict:
190
+
191
+ ```python
192
+ properties = {
193
+ "#time": datetime.datetime.now(),
194
+ "#ip": "192.168.1.1",
195
+ "Product_Name": "商品名",
196
+ "Price": 30,
197
+ "OrderId": "订单号abc_123"
198
+ }
199
+ te.track(distinct_id, account_id, "Payment", properties)
200
+ ```
201
+
202
+ **Golang** -- `map[string]interface{}` with PascalCase method names. Errors are returned rather than thrown:
203
+
204
+ ```go
205
+ properties := map[string]interface{}{
206
+ "channel": "te",
207
+ "age": 1,
208
+ "is_success": true,
209
+ "birthday": time.Now(),
210
+ "object": map[string]interface{}{"key": "value"},
211
+ "objectArr": []interface{}{map[string]interface{}{"key": "value"}},
212
+ "arr": []string{"value"},
213
+ }
214
+ err := te.Track(accountId, distinctId, "payment", properties)
215
+ ```
216
+
217
+ **Node.js** -- event object with callback for async error handling:
218
+
219
+ ```javascript
220
+ let trackEvent = {
221
+ accountId: '2222',
222
+ distinctId: '1111',
223
+ event: 'test_event',
224
+ time: new Date(),
225
+ ip: '202.38.64.1',
226
+ properties: { prop_double: 134.1 },
227
+ callback(e) {
228
+ if (e) { console.log(e); }
229
+ }
230
+ };
231
+ teSDK.track(trackEvent);
232
+ ```
233
+
234
+ **PHP** -- associative arrays; `distinct_id` first:
235
+
236
+ ```php
237
+ $properties = array();
238
+ $properties['age'] = 20;
239
+ $properties['Product_Name'] = 'c';
240
+ $properties['update_time'] = date('Y-m-d H:i:s', time());
241
+
242
+ $teSDK->track($distinct_id, $account_id, "viewPage", $properties);
243
+ ```
244
+
245
+ ---
246
+
247
+ ## User Properties -- `user_set` / `userSet` / `UserSet`
248
+
249
+ The user-set API replaces (or creates, if not yet present) user property values on the specified user. The naming convention follows each language's idiomatic style:
250
+
251
+ | Language | Method Name | Notes |
252
+ |---|---|---|
253
+ | Java | `te.userSet(account_id, distinct_id, properties)` | Same parameter order as `track` |
254
+ | Python | `te.user_set(account_id="...", distinct_id="...", properties=...)` | Keyword arguments; flexible order |
255
+ | Golang | `te.UserSet(accountId, distinctId, properties)` | PascalCase |
256
+ | Node.js | `teSDK.userSet({accountId, properties, callback})` | Object pattern |
257
+ | PHP | `$teSDK->user_set(distinct_id, account_id, properties)` | Same parameter order as `track` |
258
+
259
+ Code examples:
260
+
261
+ ```java
262
+ // Java
263
+ Map<String,Object> userProperties = new HashMap<>();
264
+ userProperties.put("user_name", "TA");
265
+ te.userSet("account_id", "distinct_id", userProperties);
266
+ ```
267
+
268
+ ```python
269
+ # Python -- note keyword arguments
270
+ te.user_set(account_id="account_id", distinct_id="distinct_id",
271
+ properties={"user_name": "ABC"})
272
+ ```
273
+
274
+ ```go
275
+ // Golang
276
+ err := te.UserSet("accountId", "distinctId", map[string]interface{}{
277
+ "user_name": "TA",
278
+ })
279
+ ```
280
+
281
+ ```javascript
282
+ // Node.js
283
+ teSDK.userSet({
284
+ accountId: 'node_test',
285
+ properties: {
286
+ prop_string: 'hello',
287
+ prop_int: 666,
288
+ },
289
+ callback(e) { if (e) console.log(e); }
290
+ });
291
+ ```
292
+
293
+ ```php
294
+ // PHP
295
+ $teSDK->user_set('distinct_id', 'account_id', $properties);
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Buffer and Flush Behavior
301
+
302
+ All SDKs buffer events in memory before writing to disk, but the trigger mechanism and default thresholds differ:
303
+
304
+ | Language | Buffer Trigger | Default Threshold | `flush()` Behavior |
305
+ |---|---|---|---|
306
+ | Java | Byte length of accumulated JSON | 8192 bytes | Force immediate disk write |
307
+ | Python | Event count in array | 5 events | Force immediate disk write |
308
+ | Golang | Per-event write (real time) | N/A | Sync filesystem cache to disk |
309
+ | Node.js | Per-event write (real time) | N/A | Not explicitly featured; data written in real time |
310
+ | PHP | Event count in array | 100 events | Force immediate disk write |
311
+
312
+ ### Best Practice for `flush()`
313
+
314
+ In all languages, `flush()` forces data to disk immediately:
315
+
316
+ ```java
317
+ te.flush(); // Java
318
+ te.flush() # Python
319
+ te.Flush() // Go
320
+ $te->flush(); // PHP
321
+ ```
322
+
323
+ The documentation uniformly warns: frequent `flush()` calls degrade performance. Use sparingly -- typically only before process shutdown. For **Golang**, the SDK writes to disk in real time, and `Flush()` merely syncs the OS-level filesystem cache; manually calling it is generally unnecessary.
324
+
325
+ For **Node.js**, the SDK writes in real time and the API documentation does not include a dedicated `flush()` method.
326
+
327
+ ---
328
+
329
+ ## SDK Shutdown -- `close` / `close()` / `Close`
330
+
331
+ All SDKs must be explicitly closed before process exit to avoid losing buffered data:
332
+
333
+ | Language | Method | Notes |
334
+ |---|---|---|
335
+ | Java | `te.close()` | Call before server shutdown |
336
+ | Python | `te.close()` | Call before server shutdown |
337
+ | Golang | `te.Close()` | PascalCase |
338
+ | Node.js | `teSDK.Close()` | PascalCase |
339
+ | PHP | `$te->close()` | Surrounded by try/catch |
340
+
341
+ ---
342
+
343
+ ## Error Handling Patterns
344
+
345
+ | Language | Pattern |
346
+ |---|---|
347
+ | Java | Try/catch around each API call |
348
+ | Python | Try/except around each API call |
349
+ | Golang | Returned `error` value (check after each call) |
350
+ | Node.js | Callback receives error as first argument |
351
+ | PHP | Try/catch around each API call |
352
+
353
+ ---
354
+
355
+ ## Naming Convention Summary
356
+
357
+ Each SDK follows the host language's naming conventions:
358
+
359
+ | Convention | Java | Python | Golang | Node.js | PHP |
360
+ |---|---|---|---|---|---|
361
+ | Method names | camelCase | snake_case | PascalCase | camelCase | snake_case |
362
+ | Property dict type | `HashMap<String,Object>` | `dict` | `map[string]interface{}` | Plain object `{}` | `array()` / `[]` |
363
+ | Error handling | Exceptions | Exceptions | Return value | Callback (err, result) | Exceptions |
364
+ | Thread safety | Thread-safe (sync) | N/A | N/A | Async (event loop) | N/A |
365
+
366
+ ---
367
+
368
+ ## Complete Best-Practice Workflow (Cross-Language)
369
+
370
+ Regardless of language, the recommended sequence is:
371
+
372
+ 1. **Initialize** the SDK consumer with a dedicated log directory.
373
+ 2. **Send events** via `track`, always including both `distinct_id` and `account_id` to ensure correct user identity binding.
374
+ 3. **Set user properties** via `user_set` / `UserSet` when user attributes change.
375
+ 4. **Call `flush()`** before process shutdown to drain any remaining buffer.
376
+ 5. **Call `close()`** to gracefully tear down the SDK.
377
+
378
+ ### End-to-End Examples
379
+
380
+ **Java:**
381
+ ```java
382
+ TDAnalytics te = new TDAnalytics(new TDLoggerConsumer("LOG_DIRECTORY"), false);
383
+ // ... send events and user properties ...
384
+ te.flush();
385
+ te.close();
386
+ ```
387
+
388
+ **Python:**
389
+ ```python
390
+ from tgasdk.sdk import *
391
+ te = TDAnalytics(TDLogConsumer("LOG_DIRECTORY"))
392
+ # ... send events and user properties ...
393
+ te.flush()
394
+ te.close()
395
+ ```
396
+
397
+ **Golang:**
398
+ ```go
399
+ consumer, _ := thinkingdata.NewLogConsumerWithConfig(thinkingdata.TDLogConsumerConfig{
400
+ Directory: "./log_directory",
401
+ })
402
+ te := thinkingdata.New(consumer)
403
+ // ... send events and user properties ...
404
+ te.Flush() // generally optional in Go
405
+ te.Close()
406
+ ```
407
+
408
+ **Node.js:**
409
+ ```javascript
410
+ var teSDK = ThinkingData.initWithLoggingMode('LOG_DIRECTORY');
411
+ // ... send events and user properties ...
412
+ // No explicit flush; Close() drains the buffer
413
+ teSDK.Close();
414
+ ```
415
+
416
+ **PHP:**
417
+ ```php
418
+ $consumer = new TDFileConsumer("LOG_DIRECTORY", 200, true, "te");
419
+ $teSDK = new TDAnalytics($consumer, true);
420
+ // ... send events and user properties ...
421
+ $te->flush();
422
+ $te->close();
423
+ ```
424
+
425
+ ---
426
+
427
+ ## Language Selection Guide
428
+
429
+ | Criterion | Recommendation |
430
+ |---|---|
431
+ | JVM ecosystem (Spring, Kafka, Hadoop) | **Java** -- mature, thread-safe, Maven-native |
432
+ | Data science / ML pipelines | **Python** -- pip integration, idiomatic dict properties |
433
+ | Microservices / cloud-native (Kubernetes, high concurrency) | **Golang** -- real-time writes, no explicit flush needed, low overhead |
434
+ | Node.js backends / BFF layers | **Node.js** -- npm-native, callback-based async model, object-pattern API |
435
+ | LAMP stack / CMS / legacy PHP applications | **PHP** -- Composer-native, PHP 5.5+ compatibility |
436
+ | When parameter-order ambiguity is a concern | **Node.js** (named-object pattern) or **Python** (keyword arguments for `user_set`) |
437
+ | When you want the safest buffer guarantees | **Golang** or **Node.js** (real-time disk write per event) |
438
+ | When minimizing disk I/O is critical | **Java** (byte-threshold batch writes) or **PHP** (configurable count batch writes) |
439
+
440
+ ---
441
+
442
+ ## Key Takeaways
443
+
444
+ 1. **All server SDKs share the same core APIs** -- init, track, user_set, flush, close -- differing only in naming convention and parameter order to match host language idioms.
445
+ 2. **Parameter order for `track` is inconsistent across languages**: Java/Go put `account_id` first; Python/PHP put `distinct_id` first; Node.js uses named keys. Always consult the SDK-specific documentation.
446
+ 3. **Buffer strategy varies**: Java batches by byte size, Python and PHP batch by event count, Go and Node.js write per-event in real time. This affects when you need to call `flush()`.
447
+ 4. **LogBus is the universal transport**: all SDKs write to local files; LogBus handles the upload to ThinkingData servers.
448
+ 5. **Always send both `account_id` and `distinct_id`** with every event to ensure correct user identity matching.
449
+ 6. **Always call `close()`** before process termination to prevent data loss.
@@ -1,171 +0,0 @@
1
- import {
2
- SecureStoreAuthError,
3
- getValidAccessToken
4
- } from "./chunk-JM34JPCO.js";
5
- import {
6
- getActiveHost,
7
- getConfigDir,
8
- logger,
9
- safeJsonParse,
10
- safeReadJsonFile
11
- } from "./chunk-SRJIAOBN.js";
12
-
13
- // src/core/auth.ts
14
- import fs from "fs";
15
- import path from "path";
16
- var TOKENS_FILE = path.join(getConfigDir(), "tokens.json");
17
- var LEGACY_MCP_TOKENS_FILE = path.join(getConfigDir(), "mcp-tokens.json");
18
- var LEGACY_DIR = path.join(process.env.HOME || "", ".te-mcp");
19
- (function removeLegacyMcpTokens() {
20
- try {
21
- if (fs.existsSync(LEGACY_MCP_TOKENS_FILE)) {
22
- fs.rmSync(LEGACY_MCP_TOKENS_FILE);
23
- logger.info("auth: removed legacy mcp-tokens.json (plaintext MCP token file)");
24
- }
25
- } catch {
26
- }
27
- })();
28
- function ensureDir() {
29
- const dir = getConfigDir();
30
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
31
- }
32
- function resolveHost(hostOverride) {
33
- if (hostOverride) return hostOverride;
34
- return getActiveHost();
35
- }
36
- async function validateToken(token, hostUrl) {
37
- const url = `${hostUrl}/v1/oauth/checkToken`;
38
- try {
39
- const resp = await fetch(url, {
40
- method: "POST",
41
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
42
- body: new URLSearchParams({ accessToken: token }).toString()
43
- });
44
- const respJson = safeJsonParse(await resp.text());
45
- return respJson?.return_code === 0;
46
- } catch {
47
- return false;
48
- }
49
- }
50
- function loadAllTokens() {
51
- try {
52
- const legacyTokens = path.join(LEGACY_DIR, "tokens.json");
53
- if (fs.existsSync(legacyTokens) && !fs.existsSync(TOKENS_FILE)) {
54
- const data = safeReadJsonFile(legacyTokens);
55
- const migrated = {};
56
- for (const [key, val] of Object.entries(data)) {
57
- const url = key.startsWith("http") ? key : `https://${key}`;
58
- migrated[url] = val;
59
- }
60
- ensureDir();
61
- fs.writeFileSync(TOKENS_FILE, JSON.stringify(migrated, null, 2));
62
- return migrated;
63
- }
64
- if (fs.existsSync(TOKENS_FILE)) {
65
- const data = safeReadJsonFile(TOKENS_FILE);
66
- let needsMigration = false;
67
- const migrated = {};
68
- for (const [key, val] of Object.entries(data)) {
69
- if (!key.startsWith("http")) {
70
- migrated[`https://${key}`] = val;
71
- needsMigration = true;
72
- } else {
73
- migrated[key] = val;
74
- }
75
- }
76
- if (needsMigration) {
77
- fs.writeFileSync(TOKENS_FILE, JSON.stringify(migrated, null, 2));
78
- return migrated;
79
- }
80
- return data;
81
- }
82
- } catch {
83
- }
84
- return {};
85
- }
86
- function saveAllTokens(tokens) {
87
- ensureDir();
88
- fs.writeFileSync(TOKENS_FILE, JSON.stringify(tokens, null, 2));
89
- try {
90
- fs.chmodSync(TOKENS_FILE, 384);
91
- } catch {
92
- }
93
- }
94
- function loadToken(hostUrl) {
95
- const tokens = loadAllTokens();
96
- const entry = tokens[hostUrl];
97
- if (!entry || !entry.token) return null;
98
- return { host: hostUrl, token: entry.token, updatedAt: entry.updatedAt };
99
- }
100
- function saveToken(token, hostUrl) {
101
- const tokens = loadAllTokens();
102
- tokens[hostUrl] = { token, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
103
- saveAllTokens(tokens);
104
- logger.info(`Token saved for ${hostUrl}`);
105
- }
106
- function clearToken(hostUrl) {
107
- const tokens = loadAllTokens();
108
- delete tokens[hostUrl];
109
- saveAllTokens(tokens);
110
- }
111
- function setTokenManual(token, hostUrl) {
112
- saveToken(token, hostUrl);
113
- }
114
- function getAuthStatus(hostUrl) {
115
- if (process.env.TE_TOKEN) {
116
- return { authenticated: true, host: hostUrl, source: "env:TE_TOKEN" };
117
- }
118
- const cached = loadToken(hostUrl);
119
- if (cached) {
120
- const ageMs = Date.now() - new Date(cached.updatedAt).getTime();
121
- const hours = Math.round(ageMs / 36e5);
122
- return { authenticated: true, host: hostUrl, tokenAge: `${hours}h ago`, source: "cache" };
123
- }
124
- return { authenticated: false, host: hostUrl };
125
- }
126
- async function getToken(hostUrl) {
127
- if (!hostUrl) {
128
- throw new Error(
129
- `No AE host configured.
130
- Run: ae-cli config set-host <url>`
131
- );
132
- }
133
- if (process.env.TE_TOKEN) {
134
- logger.info("Using token from env:TE_TOKEN");
135
- return process.env.TE_TOKEN;
136
- }
137
- const cached = loadToken(hostUrl);
138
- if (cached && cached.token) {
139
- logger.info(`Using cached token for ${hostUrl}`);
140
- return cached.token;
141
- }
142
- try {
143
- const secureToken = await getValidAccessToken(hostUrl);
144
- logger.info(`Using secure-store token for ${hostUrl}`);
145
- return secureToken;
146
- } catch (e) {
147
- if (e instanceof SecureStoreAuthError) {
148
- logger.info(`secure-store: ${e.message}`);
149
- } else {
150
- logger.warn(`secure-store unexpected error: ${e.message}`);
151
- }
152
- }
153
- throw new Error(
154
- `Cannot obtain token for ${hostUrl}.
155
- Options:
156
- 1. ae-cli auth login (device code flow, cross-platform)
157
- 2. ae-cli auth set-token <token>
158
- 3. export TE_TOKEN=<token> (CI/headless)`
159
- );
160
- }
161
-
162
- export {
163
- resolveHost,
164
- validateToken,
165
- loadToken,
166
- saveToken,
167
- clearToken,
168
- setTokenManual,
169
- getAuthStatus,
170
- getToken
171
- };