@tapd/tapd-node-sdk 1.43.0 → 1.44.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Tencent
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1566,6 +1566,24 @@ module.exports = class API extends SDK {
1566
1566
  );
1567
1567
  }
1568
1568
 
1569
+ /**
1570
+ * @description 获取单个图片下载链接
1571
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/attachment/get_image.html
1572
+ * @scope attachment#r
1573
+
1574
+ * @params - {integer} workspace_id 项目ID
1575
+ * @params - {string} image_path 图片路径, 支持完整url地址, 图片所属项目必须和传入的项目id一致
1576
+ */
1577
+ getImage(...args) {
1578
+ return this.oAuthRequest.apply(
1579
+ this, [
1580
+ '/files/get_image',
1581
+ 'GET',
1582
+ ...args
1583
+ ]
1584
+ );
1585
+ }
1586
+
1569
1587
  /**
1570
1588
  * @description 复制缺陷
1571
1589
  * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/bug/copy_bug.html
@@ -7467,6 +7485,358 @@ module.exports = class API extends SDK {
7467
7485
  );
7468
7486
  }
7469
7487
 
7488
+ /**
7489
+ * @description 添加工作项
7490
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/add_mini_item.html
7491
+ * @scope mini_item#w
7492
+
7493
+ */
7494
+ addMiniItem(...args) {
7495
+ return this.oAuthRequest.apply(
7496
+ this, [
7497
+ '/mini_items',
7498
+ 'POST',
7499
+ ...args
7500
+ ]
7501
+ );
7502
+ }
7503
+
7504
+ /**
7505
+ * @description 更新工作项
7506
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/update_mini_item.html
7507
+ * @scope mini_item#w
7508
+
7509
+ */
7510
+ updateMiniItem(...args) {
7511
+ return this.oAuthRequest.apply(
7512
+ this, [
7513
+ '/mini_items',
7514
+ 'POST',
7515
+ ...args
7516
+ ]
7517
+ );
7518
+ }
7519
+
7520
+ /**
7521
+ * @description 获取工作项
7522
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_items.html
7523
+ * @scope mini_item#r
7524
+
7525
+ */
7526
+ getMiniItems(...args) {
7527
+ return this.oAuthRequest.apply(
7528
+ this, [
7529
+ '/mini_items',
7530
+ 'GET',
7531
+ ...args
7532
+ ]
7533
+ );
7534
+ }
7535
+
7536
+ /**
7537
+ * @description 获取工作项数量
7538
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_items_count.html
7539
+ * @scope mini_item#r
7540
+
7541
+ */
7542
+ getMiniItemsCount(...args) {
7543
+ return this.oAuthRequest.apply(
7544
+ this, [
7545
+ '/mini_items/count',
7546
+ 'GET',
7547
+ ...args
7548
+ ]
7549
+ );
7550
+ }
7551
+
7552
+ /**
7553
+ * @description 创建分组
7554
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/add_mini_item_category.html
7555
+ * @scope mini_item#w
7556
+
7557
+ */
7558
+ addMiniItemCategory(...args) {
7559
+ return this.oAuthRequest.apply(
7560
+ this, [
7561
+ '/mini_item_categories',
7562
+ 'POST',
7563
+ ...args
7564
+ ]
7565
+ );
7566
+ }
7567
+
7568
+ /**
7569
+ * @description 更新分组
7570
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/update_mini_item_category.html
7571
+ * @scope mini_item#w
7572
+
7573
+ */
7574
+ updateMiniItemCategory(...args) {
7575
+ return this.oAuthRequest.apply(
7576
+ this, [
7577
+ '/mini_item_categories',
7578
+ 'POST',
7579
+ ...args
7580
+ ]
7581
+ );
7582
+ }
7583
+
7584
+ /**
7585
+ * @description 获取分组
7586
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_categories.html
7587
+ * @scope mini_item#r
7588
+
7589
+ */
7590
+ getMiniItemCategories(...args) {
7591
+ return this.oAuthRequest.apply(
7592
+ this, [
7593
+ '/mini_item_categories',
7594
+ 'GET',
7595
+ ...args
7596
+ ]
7597
+ );
7598
+ }
7599
+
7600
+ /**
7601
+ * @description 获取分组数量
7602
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_categories_count.html
7603
+ * @scope mini_item#r
7604
+
7605
+ */
7606
+ getMiniItemCategoriesCount(...args) {
7607
+ return this.oAuthRequest.apply(
7608
+ this, [
7609
+ '/mini_item_categories/count',
7610
+ 'GET',
7611
+ ...args
7612
+ ]
7613
+ );
7614
+ }
7615
+
7616
+ /**
7617
+ * @description 获取工作项动态
7618
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_changes.html
7619
+ * @scope mini_item#r
7620
+
7621
+ */
7622
+ getMiniItemChanges(...args) {
7623
+ return this.oAuthRequest.apply(
7624
+ this, [
7625
+ '/mini_item_changes',
7626
+ 'GET',
7627
+ ...args
7628
+ ]
7629
+ );
7630
+ }
7631
+
7632
+ /**
7633
+ * @description 获取工作项动态数量
7634
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_changes_count.html
7635
+ * @scope mini_item#r
7636
+
7637
+ */
7638
+ getMiniItemChangesCount(...args) {
7639
+ return this.oAuthRequest.apply(
7640
+ this, [
7641
+ '/mini_item_changes/count',
7642
+ 'GET',
7643
+ ...args
7644
+ ]
7645
+ );
7646
+ }
7647
+
7648
+ /**
7649
+ * @description 获取工作项自定义字段配置
7650
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_custom_fields_settings.html
7651
+ * @scope mini_item#r
7652
+
7653
+ */
7654
+ getMiniItemCustomFieldsSettings(...args) {
7655
+ return this.oAuthRequest.apply(
7656
+ this, [
7657
+ '/mini_items/custom_fields_settings',
7658
+ 'GET',
7659
+ ...args
7660
+ ]
7661
+ );
7662
+ }
7663
+
7664
+ /**
7665
+ * @description 获取工作项所有字段的标签
7666
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_fields_label.html
7667
+ * @scope mini_item#r
7668
+
7669
+ */
7670
+ getMiniItemFieldsLabel(...args) {
7671
+ return this.oAuthRequest.apply(
7672
+ this, [
7673
+ '/mini_items/get_fields_label',
7674
+ 'GET',
7675
+ ...args
7676
+ ]
7677
+ );
7678
+ }
7679
+
7680
+ /**
7681
+ * @description 创建工作项与其他业务对象的关联关系
7682
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/create_mini_item_relation.html
7683
+ * @scope mini_item#w
7684
+
7685
+ */
7686
+ createMiniItemRelation(...args) {
7687
+ return this.oAuthRequest.apply(
7688
+ this, [
7689
+ '/mini_items/create_mini_item_relation',
7690
+ 'POST',
7691
+ ...args
7692
+ ]
7693
+ );
7694
+ }
7695
+
7696
+ /**
7697
+ * @description 获取工作项与需求的所有关联关系
7698
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_link_stories.html
7699
+ * @scope mini_item#r
7700
+
7701
+ */
7702
+ getMiniItemLinkStories(...args) {
7703
+ return this.oAuthRequest.apply(
7704
+ this, [
7705
+ '/mini_items/get_link_stories',
7706
+ 'GET',
7707
+ ...args
7708
+ ]
7709
+ );
7710
+ }
7711
+
7712
+ /**
7713
+ * @description 获取工作项与缺陷的所有关联关系
7714
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_mini_item_related_bugs.html
7715
+ * @scope mini_item#r
7716
+
7717
+ */
7718
+ getMiniItemRelatedBugs(...args) {
7719
+ return this.oAuthRequest.apply(
7720
+ this, [
7721
+ '/mini_items/get_related_bugs',
7722
+ 'GET',
7723
+ ...args
7724
+ ]
7725
+ );
7726
+ }
7727
+
7728
+ /**
7729
+ * @description 解除工作项与缺陷关联关系
7730
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/remove_mini_item_bug_relation.html
7731
+ * @scope mini_item#w
7732
+
7733
+ */
7734
+ removeMiniItemBugRelation(...args) {
7735
+ return this.oAuthRequest.apply(
7736
+ this, [
7737
+ '/mini_items/remove_mini_item_bug_relation',
7738
+ 'POST',
7739
+ ...args
7740
+ ]
7741
+ );
7742
+ }
7743
+
7744
+ /**
7745
+ * @description 获取回收站的工作项
7746
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_item/get_removed_mini_items.html
7747
+ * @scope mini_item#r
7748
+
7749
+ */
7750
+ getRemovedMiniItems(...args) {
7751
+ return this.oAuthRequest.apply(
7752
+ this, [
7753
+ '/mini_items/get_removed_mini_items',
7754
+ 'GET',
7755
+ ...args
7756
+ ]
7757
+ );
7758
+ }
7759
+
7760
+ /**
7761
+ * @description 获取空间信息
7762
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_project/get_mini_project_info.html
7763
+ * @scope mini_project#r
7764
+
7765
+ */
7766
+ getMiniProjectInfo(...args) {
7767
+ return this.oAuthRequest.apply(
7768
+ this, [
7769
+ '/workspaces/get_workspace_info',
7770
+ 'GET',
7771
+ ...args
7772
+ ]
7773
+ );
7774
+ }
7775
+
7776
+ /**
7777
+ * @description 添加空间成员
7778
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_project/add_mini_project_member.html
7779
+ * @scope mini_project#w
7780
+
7781
+ */
7782
+ addMiniProjectMember(...args) {
7783
+ return this.oAuthRequest.apply(
7784
+ this, [
7785
+ '/workspaces/add_workspace_member',
7786
+ 'POST',
7787
+ ...args
7788
+ ]
7789
+ );
7790
+ }
7791
+
7792
+ /**
7793
+ * @description 获取空间成员列表
7794
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_project/get_mini_project_users.html
7795
+ * @scope mini_project#r
7796
+
7797
+ */
7798
+ getMiniProjectUsers(...args) {
7799
+ return this.oAuthRequest.apply(
7800
+ this, [
7801
+ '/workspaces/users',
7802
+ 'GET',
7803
+ ...args
7804
+ ]
7805
+ );
7806
+ }
7807
+
7808
+ /**
7809
+ * @description 新建空间
7810
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_project/create_mini_project_oa.html
7811
+ * @scope mini_project#w
7812
+
7813
+ */
7814
+ createMiniProjectOa(...args) {
7815
+ return this.oAuthRequest.apply(
7816
+ this, [
7817
+ '/workspaces/create_mini_project_oa',
7818
+ 'POST',
7819
+ ...args
7820
+ ]
7821
+ );
7822
+ }
7823
+
7824
+ /**
7825
+ * @description 获取用户所有参与的空间
7826
+ * @link o.tapd.tencent.com/document/api-doc/API%E6%96%87%E6%A1%A3/api_reference/mini_project/get_mini_project_list_with_permission.html
7827
+ * @scope mini_project#r
7828
+
7829
+ */
7830
+ getMiniProjectListWithPermission(...args) {
7831
+ return this.oAuthRequest.apply(
7832
+ this, [
7833
+ '/workspaces/get_mini_project_list_with_permission',
7834
+ 'POST',
7835
+ ...args
7836
+ ]
7837
+ );
7838
+ }
7839
+
7470
7840
 
7471
7841
  }
7472
7842
  module.exports.FILE = FILE;
@@ -1,5 +1,5 @@
1
1
  const semver = require('semver');
2
- const { engines } = require('../package.json');
2
+ const { engines } = require('../../package.json');
3
3
 
4
4
  const requiredNodeVersion = engines.node;
5
5
 
@@ -14,12 +14,16 @@ class SDK {
14
14
  accessToken = '',
15
15
  authType = '',
16
16
  rioToken = '',
17
+ corpid = '',
18
+ corpsecret = '',
17
19
  } = {}) {
18
20
  this.client = client;
19
21
  this.secret = secret;
20
22
  this.address = address;
21
23
  this.axios = Axios(this.address);
22
24
  this.rioToken = rioToken;
25
+ this.corpid = corpid;
26
+ this.corpsecret = corpsecret;
23
27
 
24
28
  if (authType !== '') {
25
29
  this.authType = authType;
@@ -141,6 +145,12 @@ class SDK {
141
145
  headers['signature'] = signature
142
146
  }
143
147
 
148
+ // 添加企微数据
149
+ if (this.corpid && this.corpsecret) {
150
+ params.corpid = this.corpid
151
+ params.corpsecret = this.corpsecret
152
+ }
153
+
144
154
  const config = {
145
155
  ...args,
146
156
  method,
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@tapd/tapd-node-sdk",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "node sdk for open tapd ",
5
- "main": "src/index.js",
5
+ "main": "node-sdk/src/index.js",
6
6
  "scripts": {
7
7
  "test": "npm run test",
8
- "generate": "npm install && node scripts/sdk.generator",
9
- "build": "node scripts/sdk.generator",
10
- "lint": "npx eslint --fix --ext .js ./src ./scripts ./test",
11
- "ex_replace_package_json": "node ../../../scripts/replace-tencent-in-package-json/main.js @tapd",
12
- "replace_package_json": "node ../../../scripts/replace-tencent-in-package-json/main.js @opentapd"
8
+ "generate": "npm install && node ./node-sdk/scripts/sdk.generator",
9
+ "build": "node ./node-sdk/scripts/sdk.generator",
10
+ "lint": "npx eslint --fix --ext .js ./node-sdk/src ./node-sdk/scripts ./node-sdk/test",
11
+ "ex_replace_package_json": "node ../../scripts/replace-tencent-in-package-json/main.js @tapd",
12
+ "replace_package_json": "node ../../scripts/replace-tencent-in-package-json/main.js @opentapd"
13
13
  },
14
14
  "keywords": [
15
15
  "node",
@@ -39,10 +39,10 @@
39
39
  "node": ">=10.0.0"
40
40
  },
41
41
  "files": [
42
- "src"
42
+ "node-sdk/src"
43
43
  ],
44
44
  "directories": {
45
45
  "test": "test"
46
46
  },
47
- "gitHead": "f97bca016ede45e729630db9004390d1fb21abcd"
47
+ "gitHead": "0e96f3cbfdd683fb6d7a2d5302c0f3d9bacea179"
48
48
  }
File without changes
File without changes
File without changes