@thinkingai/ae-cli 1.0.28 → 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.
- package/README.md +1 -16
- package/README.zh.md +1 -16
- package/dist/{auth-H2376DEF.js → auth-DYC2BGLM.js} +2 -2
- package/dist/{auth-5NSDQFQB.js → auth-GHBMJ5ZR.js} +31 -12
- package/dist/{chunk-CLJF7MQA.js → chunk-2DUEAXV3.js} +1 -1
- package/dist/chunk-5OC7CYCG.js +98 -0
- package/dist/{chunk-SRJIAOBN.js → chunk-6W4QOZAL.js} +10 -0
- package/dist/{chunk-LU7SXK4Q.js → chunk-BJX3GXWC.js} +2 -2
- package/dist/{chunk-WCHI7725.js → chunk-DMMEPCST.js} +47 -6
- package/dist/{chunk-IMBKVXKY.js → chunk-EGEIXA2Z.js} +82 -10
- package/dist/{chunk-AD5V3ZPJ.js → chunk-I5CRVM2S.js} +98 -10
- package/dist/chunk-NOO24N7W.js +11 -0
- package/dist/{chunk-GSJGPNKK.js → chunk-PN3OS34E.js} +1 -1
- package/dist/{chunk-CAQYQA4R.js → chunk-RSHMZ3LG.js} +15 -1
- package/dist/{client-FCMK3XEK.js → client-2UJ63MVQ.js} +3 -3
- package/dist/{config-64G36TJL.js → config-NCUGK6NS.js} +3 -3
- package/dist/index.js +2553 -29
- package/dist/{model-EZ6K7FXI.js → model-SJSOZTRS.js} +5 -7
- package/dist/{raw-VEF3D6UD.js → raw-7NVWSVJP.js} +4 -4
- package/dist/{sync-NRODEVNH.js → sync-GRVO4K3U.js} +120 -23
- package/dist/{te-agent-7U7JLJKU.js → te-agent-KZRIEN4N.js} +468 -47
- package/dist/{te-analysis-A2OSGHQ4.js → te-analysis-VAR4KUOK.js} +145 -28
- package/dist/{te-audience-LI67PPGO.js → te-audience-KMKYI2YJ.js} +23 -14
- package/dist/{te-common-35WVU3C5.js → te-common-WNCZB7R7.js} +5 -4
- package/dist/{te-community-LEAP6PWT.js → te-community-JEEFXPB3.js} +11 -10
- package/dist/{te-dataops-N2LGZBOX.js → te-dataops-GD3XBYCS.js} +33 -32
- package/dist/{te-engage-H7C72Z46.js → te-engage-4XHCTS6I.js} +5 -4
- package/dist/{te-kb-I2OKTBAI.js → te-kb-B62KFP2A.js} +97 -7
- package/dist/{te-meta-HBTIEDRO.js → te-meta-EPZGQN56.js} +10 -9
- package/dist/{te-team-EM5OWRQL.js → te-team-YY24VORI.js} +16 -12
- package/dist/tracking/i18n/resources/cli/en.json +153 -0
- package/dist/tracking/i18n/resources/cli/ja.json +153 -0
- package/dist/tracking/i18n/resources/cli/ko.json +153 -0
- package/dist/tracking/i18n/resources/cli/zh.json +153 -0
- package/package.json +9 -3
- package/skills/ae-agent/SKILL.md +66 -26
- package/skills/ae-analysis/SKILL.md +108 -8
- package/skills/ae-analysis/references/cancel_query.md +39 -0
- package/skills/ae-analysis/references/drilldown_user_events.md +4 -2
- package/skills/ae-analysis/references/drilldown_users.md +4 -2
- package/skills/ae-analysis/references/get_bi_panel_detail.md +35 -0
- package/skills/ae-analysis/references/list_alerts.md +1 -1
- package/skills/ae-analysis/references/list_bi_panels.md +35 -0
- package/skills/ae-analysis/references/list_cluster_members.md +4 -1
- package/skills/ae-analysis/references/list_dashboards.md +1 -1
- package/skills/ae-analysis/references/list_entities.md +1 -1
- package/skills/ae-analysis/references/list_events.md +1 -1
- package/skills/ae-analysis/references/list_metrics.md +1 -1
- package/skills/ae-analysis/references/list_project_mark_times.md +1 -1
- package/skills/ae-analysis/references/list_properties.md +1 -1
- package/skills/ae-analysis/references/list_public_access_links.md +1 -1
- package/skills/ae-analysis/references/list_reports.md +1 -1
- package/skills/ae-analysis/references/list_tag_members.md +4 -1
- package/skills/ae-analysis/references/query_adhoc.md +6 -5
- package/skills/ae-analysis/references/query_bi_panel_data.md +58 -0
- package/skills/ae-analysis/references/query_dashboard_report_data.md +4 -1
- package/skills/ae-analysis/references/query_entity_details.md +5 -2
- package/skills/ae-analysis/references/query_event_details.md +4 -1
- package/skills/ae-analysis/references/query_report_data.md +2 -2
- package/skills/ae-analysis-global/SKILL.md +3 -1
- package/skills/ae-analysis-intent/SKILL.md +132 -0
- package/skills/ae-data-integration-helper/SKILL.md +242 -0
- package/skills/ae-data-integration-helper/references/android_sdk_faq.md +179 -0
- package/skills/ae-data-integration-helper/references/c_sdk_compilation.md +83 -0
- package/skills/ae-data-integration-helper/references/c_sdk_faq.md +416 -0
- package/skills/ae-data-integration-helper/references/cocoscreator_sdk_faq.md +123 -0
- package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +365 -0
- package/skills/ae-data-integration-helper/references/index.md +56 -0
- package/skills/ae-data-integration-helper/references/ios_sdk_faq.md +118 -0
- package/skills/ae-data-integration-helper/references/java_sdk_faq.md +406 -0
- package/skills/ae-data-integration-helper/references/javascript_sdk_faq.md +129 -0
- package/skills/ae-data-integration-helper/references/logbus2_guide.md +309 -0
- package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +348 -0
- package/skills/ae-data-integration-helper/references/minigame_sdk_faq.md +115 -0
- package/skills/ae-data-integration-helper/references/miniprogram_sdk_faq.md +118 -0
- package/skills/ae-data-integration-helper/references/python_sdk_faq.md +232 -0
- package/skills/ae-data-integration-helper/references/restful_api_notes.md +74 -0
- package/skills/ae-data-integration-helper/references/sdk_log_guide.md +316 -0
- package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +107 -0
- package/skills/ae-data-integration-helper/references/unity_sdk_faq.md +115 -0
- package/skills/ae-generate-tracking-code/SKILL.md +629 -0
- package/skills/ae-generate-tracking-code/references/autotrack-enum.md +183 -0
- package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +202 -0
- package/skills/ae-generate-tracking-code/references/datax-config.md +43 -0
- package/skills/ae-generate-tracking-code/references/debug-script.md +102 -0
- package/skills/ae-generate-tracking-code/references/logbus-config.md +200 -0
- package/skills/ae-generate-tracking-code/references/modes.md +83 -0
- package/skills/ae-generate-tracking-code/references/restful-call.md +36 -0
- package/skills/ae-generate-tracking-code/references/sdk-index.md +128 -0
- package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +206 -0
- package/skills/ae-generate-tracking-code/references/snippet-delivery.md +394 -0
- package/skills/ae-generate-tracking-code/references/te-api.md +181 -0
- package/skills/ae-generate-tracking-plan/SKILL.md +1083 -0
- package/skills/ae-generate-tracking-plan/references/autotrack-events.md +273 -0
- package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +425 -0
- package/skills/ae-generate-tracking-plan/references/te-api.md +100 -0
- package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +152 -0
- package/skills/ae-kb/SKILL.md +38 -5
- 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
- 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
- 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
- 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
- package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +72 -0
- package/tracking-plan-template/RPG/347/261/273/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- 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
- 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
- package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.md +80 -0
- package/tracking-plan-template/Slots/345/237/213/347/202/271/346/250/241/346/235/277_v1.xlsx +0 -0
- 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
- 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
- package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.md +40 -0
- package/tracking-plan-template/TE/345/256/230/346/226/271/346/250/241/346/235/277_dataTrackSample.xlsx +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/wiki/te-docs/index.md +225 -0
- package/wiki/te-docs/raw/advanced-data-type/first-event-check.md +66 -0
- package/wiki/te-docs/raw/advanced-data-type/updated-event.md +87 -0
- package/wiki/te-docs/raw/advanced-data-type.md +16 -0
- package/wiki/te-docs/raw/data-ingestion-guide/about-gdpr.md +55 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/automatic-event-tracking.md +431 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/debugging-and-logging.md +49 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/multi-instance.md +66 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/preset-properties.md +466 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced/third-party-integration.md +127 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/android-advanced.md +513 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android/release-notes.md +177 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/android.md +228 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/c-advanced.md +419 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/c.md +110 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/client-side-sdk-faq.md +52 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/cpp-advanced.md +366 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp/release-notes.md +103 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cpp.md +201 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/compliance.md +26 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/automatically-track-events.md +117 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced/preset-properties.md +52 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/flutter-advanced.md +267 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter/release-notes.md +82 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/flutter.md +139 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/compliance.md +26 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/automatically-track-events.md +121 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/debugging-and-logging.md +54 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced/preset-properties.md +18 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/reactnative-advanced.md +305 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native/release-notes.md +79 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/react-native.md +137 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/release-notes.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/automatically-track-events.md +54 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/debugging-and-logging.md +53 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/multi-instance.md +42 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/preset-properties.md +119 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced/support-native.md +81 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app/uniapp-advanced.md +331 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform/uni-app.md +156 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/cross-platform.md +12 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/automatic-event-tracking.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/multi-instance.md +21 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/preset-properties.md +249 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced.md +301 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/release-notes.md +51 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x.md +281 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/automatic-event-tracking.md +70 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/debugging-and-logging.md +57 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/native-support.md +104 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/preset-properties.md +91 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance.md +374 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/compliance.md +35 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/release-notes.md +109 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator.md +170 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/compliance.md +28 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/automatic-event-tracking.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/debugging-and-logging.md +58 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced/preset-properties.md +43 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/corona-advanced.md +204 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona/release-notes.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/corona.md +269 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/release-notes.md +177 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/automatic-event-tracking.md +119 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/multi-instance.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/native-pluggable.md +43 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/preset-properties.md +212 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced/third-party-integration.md +77 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity/unity-advanced.md +396 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unity.md +176 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/release-notes.md +81 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/automatic-event-tracking.md +79 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/debugging-and-logging.md +31 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/preset-properties.md +25 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/third-party-integrations.md +141 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced.md +278 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal.md +190 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine.md +14 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/h5-and-app-sdk-connection.md +147 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/instant-app-and-game.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/compliance.md +24 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/automatic-event-tracking.md +272 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/debugging-and-logging.md +77 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/multi-instance.md +142 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/preset-properties.md +484 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced/third-party-integrations.md +132 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/ios-advanced.md +682 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios/release-notes.md +163 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/ios.md +304 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/compliance.md +29 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/automatic-event-tracking.md +136 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/debugging-and-logging.md +48 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/multi-instance.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced/preset-properties.md +132 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/javascript-advanced.md +462 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript/release-notes.md +107 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/javascript.md +208 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/debugging-and-logging.md +62 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced/preset-properties.md +118 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos/macos-advanced.md +556 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk/macos.md +231 -0
- package/wiki/te-docs/raw/data-ingestion-guide/client-sdk.md +25 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/filebeat-logstash-user-guide.md +610 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/logbus2-user-guide.md +1215 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools/ta-datax-writer-plugin-user-guide.md +278 -0
- package/wiki/te-docs/raw/data-ingestion-guide/data-import-tools.md +15 -0
- package/wiki/te-docs/raw/data-ingestion-guide/privacy-policy.md +38 -0
- package/wiki/te-docs/raw/data-ingestion-guide/restful-api-user-guide.md +155 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-FM9Cwz.md +37 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging-RSyfw7.md +41 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/debugging-and-logging.md +89 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-OxzWw.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties-VuE3wr.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-IauKwI.md +175 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced-YAilwk.md +210 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/c-advanced.md +211 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-PVazwa.md +62 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes-TADbwY.md +50 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c/release-notes.md +69 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-V2W3wv.md +131 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c-Zf9Jwl.md +179 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/c.md +189 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/debugging-and-logging.md +38 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/erlang-advanced.md +113 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang/release-notes.md +34 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/erlang.md +155 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/debugging-and-logging.md +42 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/golang-advanced.md +157 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang/release-notes.md +72 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/golang.md +148 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/debugging-and-logging.md +49 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/java-advanced.md +223 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java/release-notes.md +88 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/java.md +174 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/debugging-and-logging.md +46 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/lua-advanced.md +182 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua/release-notes.md +61 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/lua.md +121 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/debugging-and-logging.md +55 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/nodejs-advanced.md +225 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/nodejs.md +141 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/debugging-and-logging.md +41 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/php-advanced.md +216 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php/release-notes.md +45 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/php.md +173 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/debugging-and-logging.md +40 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/python-advanced.md +206 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python/release-notes.md +51 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/python.md +116 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/release-notes.md +44 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/debugging-and-logging.md +47 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced/preset-properties.md +126 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby/ruby-advanced.md +189 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk/ruby.md +142 -0
- package/wiki/te-docs/raw/data-ingestion-guide/server-sdk.md +22 -0
- package/wiki/te-docs/raw/data-ingestion-guide/thinkingdata-privacy-policy.md +37 -0
- package/wiki/te-docs/raw/data-ingestion-guide.md +48 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/data-rules.md +396 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/preset-properties-and-system-fields.md +957 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion/user-identification-rules.md +723 -0
- package/wiki/te-docs/raw/preparations-before-data-ingestion.md +203 -0
- 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
- 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
- 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
- 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
- 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
- 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
- package/wiki/te-docs/raw//345/256/242/346/210/267/347/253/257-sdk/openharmony.md +172 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/wiki/te-docs/schema.md +16 -0
- package/wiki/te-docs/synthesis/batch-ingest-comparison.md +324 -0
- package/wiki/te-docs/synthesis/js-sdk-cheatsheet.md +538 -0
- package/wiki/te-docs/synthesis/restful-api-reference.md +363 -0
- package/wiki/te-docs/synthesis/sdk-selection.md +372 -0
- package/wiki/te-docs/synthesis/server-sdk-overview.md +449 -0
- package/dist/chunk-KAEZTSXN.js +0 -99
- package/dist/chunk-OJDNO5QY.js +0 -63
|
@@ -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.
|
package/dist/chunk-KAEZTSXN.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getSandboxRuntimeRoot
|
|
3
|
-
} from "./chunk-SRJIAOBN.js";
|
|
4
|
-
|
|
5
|
-
// src/core/te-agent-credentials.ts
|
|
6
|
-
import { readFileSync } from "fs";
|
|
7
|
-
import { homedir } from "os";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
function getCredentialsPath() {
|
|
10
|
-
return join(process.env.HOME || homedir(), ".te-agent", "credentials.json");
|
|
11
|
-
}
|
|
12
|
-
function getPersistentEnvPath() {
|
|
13
|
-
return join(getSandboxRuntimeRoot(), ".env");
|
|
14
|
-
}
|
|
15
|
-
function parseDotEnv(raw) {
|
|
16
|
-
const result = {};
|
|
17
|
-
for (const line of raw.split("\n")) {
|
|
18
|
-
if (/^\s*#/.test(line) || line.trim() === "") continue;
|
|
19
|
-
const match = /^\s*([^=]+)=(.*)$/.exec(line);
|
|
20
|
-
if (!match) continue;
|
|
21
|
-
const key = match[1].trim();
|
|
22
|
-
let value = match[2].trim();
|
|
23
|
-
if (value.startsWith('"') && value.endsWith('"')) {
|
|
24
|
-
value = value.slice(1, -1).replace(/\\"/g, '"');
|
|
25
|
-
}
|
|
26
|
-
if (value !== "") result[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
function readPersistentEnv() {
|
|
31
|
-
const envPath = getPersistentEnvPath();
|
|
32
|
-
try {
|
|
33
|
-
const raw = readFileSync(envPath, "utf8");
|
|
34
|
-
return parseDotEnv(raw);
|
|
35
|
-
} catch (err) {
|
|
36
|
-
if (err?.code === "ENOENT") return null;
|
|
37
|
-
throw new TeAgentCredentialsError(
|
|
38
|
-
`Failed to read ${envPath}: ${err?.message ?? err}`,
|
|
39
|
-
"Check file permissions, or inject runtime credentials via TE_CLAUDE_BASE_URL / SANDBOX_ID / SECRET_KEY"
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
var TeAgentCredentialsError = class extends Error {
|
|
44
|
-
constructor(message, hint) {
|
|
45
|
-
super(message);
|
|
46
|
-
this.hint = hint;
|
|
47
|
-
this.name = "TeAgentCredentialsError";
|
|
48
|
-
}
|
|
49
|
-
hint;
|
|
50
|
-
};
|
|
51
|
-
function readLegacyCredentials() {
|
|
52
|
-
const credPath = getCredentialsPath();
|
|
53
|
-
try {
|
|
54
|
-
const raw = readFileSync(credPath, "utf8");
|
|
55
|
-
const parsed = JSON.parse(raw);
|
|
56
|
-
const main = parsed?.mainApp;
|
|
57
|
-
return main && typeof main === "object" ? main : null;
|
|
58
|
-
} catch (err) {
|
|
59
|
-
if (err?.code === "ENOENT") return null;
|
|
60
|
-
if (err instanceof SyntaxError) {
|
|
61
|
-
throw new TeAgentCredentialsError(
|
|
62
|
-
`Failed to parse ${credPath}: ${err.message}`,
|
|
63
|
-
"The credentials file may be corrupted; alternatively inject runtime credentials via TE_CLAUDE_BASE_URL / SANDBOX_ID / SECRET_KEY"
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
throw new TeAgentCredentialsError(
|
|
67
|
-
`Failed to read ${credPath}: ${err?.message ?? err}`,
|
|
68
|
-
"Check file permissions, or inject runtime credentials via TE_CLAUDE_BASE_URL / SANDBOX_ID / SECRET_KEY"
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function tryLoadTeAgentSandboxCredentials() {
|
|
73
|
-
const legacy = readLegacyCredentials();
|
|
74
|
-
const persistent = readPersistentEnv();
|
|
75
|
-
const url = process.env.TE_CLAUDE_BASE_URL || persistent?.TE_CLAUDE_BASE_URL || legacy?.url;
|
|
76
|
-
if (typeof url !== "string" || !url) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
const sandboxId = process.env.SANDBOX_ID || persistent?.SANDBOX_ID || legacy?.sandboxId || null;
|
|
80
|
-
const sandboxSecretKey = process.env.SECRET_KEY || process.env.SANDBOX_SECRET_KEY || persistent?.SECRET_KEY || persistent?.SANDBOX_SECRET_KEY || legacy?.sandboxSecretKey || legacy?.secretKey || null;
|
|
81
|
-
return {
|
|
82
|
-
url,
|
|
83
|
-
sandboxId: typeof sandboxId === "string" ? sandboxId : null,
|
|
84
|
-
sandboxSecretKey: typeof sandboxSecretKey === "string" ? sandboxSecretKey : null
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function getClaudeConfigDir() {
|
|
88
|
-
const fromEnv = process.env.CLAUDE_CONFIG_DIR;
|
|
89
|
-
if (typeof fromEnv === "string" && fromEnv.length > 0) {
|
|
90
|
-
return fromEnv;
|
|
91
|
-
}
|
|
92
|
-
return join(homedir(), ".claude");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export {
|
|
96
|
-
TeAgentCredentialsError,
|
|
97
|
-
tryLoadTeAgentSandboxCredentials,
|
|
98
|
-
getClaudeConfigDir
|
|
99
|
-
};
|
package/dist/chunk-OJDNO5QY.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getMcpToken
|
|
3
|
-
} from "./chunk-WCHI7725.js";
|
|
4
|
-
import {
|
|
5
|
-
safeJsonParse
|
|
6
|
-
} from "./chunk-SRJIAOBN.js";
|
|
7
|
-
|
|
8
|
-
// src/core/mcp-access.ts
|
|
9
|
-
function buildUrl(host, path, params = {}) {
|
|
10
|
-
const base = host.replace(/\/$/, "");
|
|
11
|
-
const p = path.startsWith("/") ? path : `/${path}`;
|
|
12
|
-
const url = new URL(`${base}${p}`);
|
|
13
|
-
for (const [key, value] of Object.entries(params)) {
|
|
14
|
-
if (value !== void 0 && value !== null) {
|
|
15
|
-
url.searchParams.set(key, String(value));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return url.toString();
|
|
19
|
-
}
|
|
20
|
-
function parseKbResponse(resp, text) {
|
|
21
|
-
if (resp.status === 401 || resp.status === 403) {
|
|
22
|
-
throw new Error(`KB MCP token auth failed: HTTP ${resp.status} ${resp.statusText}`);
|
|
23
|
-
}
|
|
24
|
-
const data = safeJsonParse(text);
|
|
25
|
-
if (data.return_code === -1001) {
|
|
26
|
-
throw new Error(`KB MCP token auth failed: ${data.return_message || "unauthorized"} (code: ${data.return_code})`);
|
|
27
|
-
}
|
|
28
|
-
if (data.return_code !== 0 && data.return_code !== void 0) {
|
|
29
|
-
throw new Error(`AE API error: ${data.return_message || "unknown"} (code: ${data.return_code})`);
|
|
30
|
-
}
|
|
31
|
-
return data.data !== void 0 ? data.data : data;
|
|
32
|
-
}
|
|
33
|
-
async function fetchWithMcpToken(input, init, mcpToken) {
|
|
34
|
-
const headers = new Headers(init.headers);
|
|
35
|
-
headers.set("mcp-token", mcpToken);
|
|
36
|
-
const resp = await fetch(input, { ...init, headers });
|
|
37
|
-
return parseKbResponse(resp, await resp.text());
|
|
38
|
-
}
|
|
39
|
-
async function kbApi(ctx, method, path, params = {}, body) {
|
|
40
|
-
const host = ctx.host();
|
|
41
|
-
const mcpToken = await getMcpToken(host);
|
|
42
|
-
const upperMethod = method.toUpperCase();
|
|
43
|
-
return fetchWithMcpToken(buildUrl(host, path, params), {
|
|
44
|
-
method: upperMethod,
|
|
45
|
-
headers: {
|
|
46
|
-
"Content-Type": "application/json"
|
|
47
|
-
},
|
|
48
|
-
body: upperMethod === "GET" ? void 0 : JSON.stringify(body ?? {})
|
|
49
|
-
}, mcpToken);
|
|
50
|
-
}
|
|
51
|
-
async function kbUpload(ctx, path, form, params = {}) {
|
|
52
|
-
const host = ctx.host();
|
|
53
|
-
const mcpToken = await getMcpToken(host);
|
|
54
|
-
return fetchWithMcpToken(buildUrl(host, path, params), {
|
|
55
|
-
method: "POST",
|
|
56
|
-
body: form
|
|
57
|
-
}, mcpToken);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
kbApi,
|
|
62
|
-
kbUpload
|
|
63
|
-
};
|