@tapd/tapd-node-sdk 1.32.0-beta.7 → 1.32.0-beta.9
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/package.json +1 -1
- package/src/index.js +352 -0
- package/src/sdk.js +10 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -7485,6 +7485,358 @@ module.exports = class API extends SDK {
|
|
|
7485
7485
|
);
|
|
7486
7486
|
}
|
|
7487
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
|
+
|
|
7488
7840
|
|
|
7489
7841
|
}
|
|
7490
7842
|
module.exports.FILE = FILE;
|
package/src/sdk.js
CHANGED
|
@@ -12,11 +12,15 @@ class SDK {
|
|
|
12
12
|
address = '',
|
|
13
13
|
accessToken = '',
|
|
14
14
|
authType = '',
|
|
15
|
+
corpid = '',
|
|
16
|
+
corpsecret = '',
|
|
15
17
|
} = {}) {
|
|
16
18
|
this.client = client;
|
|
17
19
|
this.secret = secret;
|
|
18
20
|
this.address = address;
|
|
19
21
|
this.axios = Axios(this.address);
|
|
22
|
+
this.corpid = corpid;
|
|
23
|
+
this.corpsecret = corpsecret;
|
|
20
24
|
|
|
21
25
|
if (authType !== '') {
|
|
22
26
|
this.authType = authType;
|
|
@@ -129,6 +133,12 @@ class SDK {
|
|
|
129
133
|
const authHeader = this.isOauth() ? `Bearer ${accessToken}` : `Basic ${Base64.encode(`${this.client}:${this.secret}`)}`;
|
|
130
134
|
const upperMethod = method.toUpperCase();
|
|
131
135
|
|
|
136
|
+
// 添加企微数据
|
|
137
|
+
if (this.corpid && this.corpsecret) {
|
|
138
|
+
params.corpid = this.corpid
|
|
139
|
+
params.corpsecret = this.corpsecret
|
|
140
|
+
}
|
|
141
|
+
|
|
132
142
|
const config = {
|
|
133
143
|
...args,
|
|
134
144
|
method,
|