@tencent-map/lbs-skills 0.0.2 → 0.0.4

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 CHANGED
@@ -17,7 +17,7 @@ npm install -g @tencent-map/lbs-skills
17
17
  tmap-lbs config set-key YOUR_KEY
18
18
 
19
19
  # 方式二:环境变量(当前会话有效)
20
- export TMAP_LBS_KEY=YOUR_KEY
20
+ export TMAP_WEBSERVICE_KEY=YOUR_KEY
21
21
  ```
22
22
 
23
23
  获取 Key:https://lbs.qq.com/dev/console/application/mine
package/bin/cli.js CHANGED
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const lib = require('../lib/index.js');
5
+ const { version } = require('../package.json');
5
6
 
6
7
  // ─── 工具函数 ────────────────────────────────────────────────────────
7
8
 
@@ -45,7 +46,7 @@ function parseArgs(argv) {
45
46
  // ─── 帮助信息 ────────────────────────────────────────────────────────
46
47
 
47
48
  const HELP = `
48
- tmap-lbs — 腾讯地图位置服务 CLI
49
+ tmap-lbs v${version} — 腾讯地图位置服务 CLI
49
50
 
50
51
  Usage:
51
52
  tmap-lbs <command> [options]
@@ -68,7 +69,7 @@ Run \`tmap-lbs <command> --help\` for command-specific usage.
68
69
 
69
70
  配置 Key:
70
71
  tmap-lbs config set-key <your-key>
71
- 或 export TMAP_LBS_KEY=<your-key>
72
+ 或 export TMAP_WEBSERVICE_KEY=<your-key>
72
73
 
73
74
  获取 Key: https://lbs.qq.com/dev/console/application/mine
74
75
  `;
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ function saveConfigFile(config) {
40
40
  * @returns {string|null}
41
41
  */
42
42
  function getKey() {
43
- return process.env.TMAP_LBS_KEY || process.env.TMAP_LBS_CONFIG || loadConfigFile().key || null;
43
+ return process.env.TMAP_WEBSERVICE_KEY || loadConfigFile().key || null;
44
44
  }
45
45
 
46
46
  /**
@@ -75,7 +75,7 @@ function ensureKey() {
75
75
  '',
76
76
  '请通过以下方式之一设置:',
77
77
  ' tmap-lbs config set-key <your-key>',
78
- ' export TMAP_LBS_KEY=<your-key>',
78
+ ' export TMAP_WEBSERVICE_KEY=<your-key>',
79
79
  '',
80
80
  '获取 Key: https://lbs.qq.com/dev/console/application/mine',
81
81
  '',
@@ -234,12 +234,14 @@ async function walkRoute(params) {
234
234
  return {
235
235
  status: '1',
236
236
  route: {
237
- paths: [{
238
- distance: route.distance,
239
- duration: route.duration,
240
- direction: route.direction || '',
241
- steps: route.steps || [],
242
- }],
237
+ paths: [
238
+ {
239
+ distance: route.distance,
240
+ duration: route.duration,
241
+ direction: route.direction || '',
242
+ steps: route.steps || [],
243
+ },
244
+ ],
243
245
  },
244
246
  _raw: data,
245
247
  };
@@ -274,15 +276,17 @@ async function driveRoute(params) {
274
276
  return {
275
277
  status: '1',
276
278
  route: {
277
- paths: [{
278
- distance: route.distance,
279
- duration: route.duration,
280
- toll: route.toll || 0,
281
- traffic_light_count: route.traffic_light_count || 0,
282
- restriction: route.restriction || null,
283
- tags: route.tags || [],
284
- steps: route.steps || [],
285
- }],
279
+ paths: [
280
+ {
281
+ distance: route.distance,
282
+ duration: route.duration,
283
+ toll: route.toll || 0,
284
+ traffic_light_count: route.traffic_light_count || 0,
285
+ restriction: route.restriction || null,
286
+ tags: route.tags || [],
287
+ steps: route.steps || [],
288
+ },
289
+ ],
286
290
  },
287
291
  _raw: data,
288
292
  };
@@ -307,12 +311,14 @@ async function cycleRoute(params) {
307
311
  return {
308
312
  status: '1',
309
313
  route: {
310
- paths: [{
311
- distance: route.distance,
312
- duration: route.duration,
313
- direction: route.direction || '',
314
- steps: route.steps || [],
315
- }],
314
+ paths: [
315
+ {
316
+ distance: route.distance,
317
+ duration: route.duration,
318
+ direction: route.direction || '',
319
+ steps: route.steps || [],
320
+ },
321
+ ],
316
322
  },
317
323
  _raw: data,
318
324
  };
@@ -337,12 +343,14 @@ async function ecycleRoute(params) {
337
343
  return {
338
344
  status: '1',
339
345
  route: {
340
- paths: [{
341
- distance: route.distance,
342
- duration: route.duration,
343
- direction: route.direction || '',
344
- steps: route.steps || [],
345
- }],
346
+ paths: [
347
+ {
348
+ distance: route.distance,
349
+ duration: route.duration,
350
+ direction: route.direction || '',
351
+ steps: route.steps || [],
352
+ },
353
+ ],
346
354
  },
347
355
  _raw: data,
348
356
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencent-map/lbs-skills",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "腾讯地图位置服务命令行工具,支持 POI 搜索、地理编码、周边搜索、路径规划、旅游规划、轨迹可视化等功能",
5
5
  "bin": {
6
6
  "tmap-lbs": "./bin/cli.js"
@@ -11,9 +11,8 @@
11
11
  "lib",
12
12
  "README.md"
13
13
  ],
14
- "scripts": {
15
- "test": "echo \"no test\" && exit 0"
16
- },
14
+ "scripts": {},
15
+ "homepage": "https://lbs.qq.com",
17
16
  "keywords": [
18
17
  "tmap",
19
18
  "tencent-map",
@@ -23,7 +22,7 @@
23
22
  "route-planning",
24
23
  "cli"
25
24
  ],
26
- "author": "",
25
+ "author": "Tencent Map Teams",
27
26
  "license": "MIT",
28
27
  "dependencies": {}
29
28
  }