xmes-dingtalk-connectflow-sdk 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

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.
@@ -1,3 +1,3 @@
1
- __version__ = '1.0.1'
2
-
3
- from .complex_table import * # noqa: F403
1
+ __version__ = '1.0.2'
2
+
3
+ from .complex_table import ComplexTable # noqa: F401
@@ -0,0 +1,103 @@
1
+ import json
2
+ from copy import deepcopy
3
+ from dataclasses import dataclass
4
+ from typing import Literal
5
+
6
+ from .._types import FilteredDataclass
7
+
8
+
9
+ @dataclass
10
+ class GetterFilter:
11
+ """记录筛选器"""
12
+
13
+ field: str
14
+ operator: Literal[
15
+ 'equal', 'notEqual', 'incontain', 'notContain', 'empty', 'notEmpty'
16
+ ]
17
+ value: list[str] = None
18
+
19
+
20
+ @dataclass
21
+ class Updater:
22
+ """记录更新器"""
23
+
24
+ record_id: str
25
+ fields: dict[str, any]
26
+
27
+ def to_dict(self):
28
+ return self.__dict__
29
+
30
+
31
+ @dataclass
32
+ class GetterResult(metaclass=FilteredDataclass):
33
+ """获取器结果"""
34
+
35
+ nextCursor: str = None
36
+ records: list[dict] = None
37
+ hasMore: bool = False
38
+
39
+ def __post_init__(self):
40
+ if self.records and isinstance(self.records, list):
41
+ self.records = self.__records_handle()
42
+
43
+ def __records_handle(self):
44
+ records: list[dict] = []
45
+ for record in self.records:
46
+ record_temp = {'id': record.get('id'), 'fields': {}}
47
+ fields: dict = record.get('fields')
48
+
49
+ for field_name, field_value in fields.items():
50
+ _value = deepcopy(field_value)
51
+ if isinstance(field_value, dict):
52
+ if 'link' in field_value:
53
+ _value = field_value.get('link')
54
+ elif 'name' in field_value:
55
+ _value = field_value.get('name')
56
+
57
+ record_temp['fields'][field_name] = _value
58
+
59
+ records.append(record_temp)
60
+
61
+ return records
62
+
63
+ def to_file(self, file_path: str):
64
+ """
65
+ 将数据写出到本地
66
+
67
+ Args:
68
+ file_path: 用于存储数据的文件路径
69
+ Returns:
70
+ 格式化后的 json 字符串
71
+ """
72
+
73
+ if not self.records:
74
+ raise ValueError('数据记录为空, 无法写出')
75
+
76
+ json_str = json.dumps(self.records, ensure_ascii=False, indent=2)
77
+ with open(file_path, 'w', encoding='utf-8') as f:
78
+ f.write(json_str)
79
+
80
+ return json_str
81
+
82
+
83
+ @dataclass
84
+ class AdderResult(metaclass=FilteredDataclass):
85
+ """新增器结果"""
86
+
87
+ result: list[str] = None
88
+ """新增的记录id列表"""
89
+ success: bool = None
90
+
91
+
92
+ @dataclass
93
+ class UpdaterResult(metaclass=FilteredDataclass):
94
+ """更新器结果"""
95
+
96
+ success: bool = None
97
+
98
+
99
+ @dataclass
100
+ class DeletorResult(metaclass=FilteredDataclass):
101
+ """删除器结果"""
102
+
103
+ success: bool = None
@@ -0,0 +1,187 @@
1
+ from typing import Any, Literal
2
+
3
+ from requests import post
4
+
5
+ from ._types import (
6
+ AdderResult,
7
+ DeletorResult,
8
+ GetterFilter,
9
+ GetterResult,
10
+ Updater,
11
+ UpdaterResult,
12
+ )
13
+
14
+
15
+ class Table:
16
+ __HEADERS = {
17
+ 'Content-Type': 'application/json',
18
+ }
19
+
20
+ def __init__(self, flow_url: str, did: str, tid: str):
21
+ self.flow_url = flow_url
22
+ self.did = did
23
+ self.tid = tid
24
+ self.global_reqdata = {
25
+ 'did': did,
26
+ 'tid': tid,
27
+ }
28
+
29
+ def __verify_records(self, records: list[Any], record_type: object):
30
+ """
31
+ records 参数校验
32
+ - 校验失败, 抛出 ValueError 异常
33
+ - 校验成功, 返回清洗后的 records 列表
34
+
35
+ Args:
36
+ records: 记录列表
37
+ record_type: 记录类型
38
+ """
39
+
40
+ if not records or not isinstance(records, list):
41
+ raise ValueError('records 参数需要是列表类型且不能为空')
42
+
43
+ records_clean = [
44
+ record for record in records if record and isinstance(record, record_type)
45
+ ]
46
+ if not records_clean:
47
+ record_type_name = record_type.__qualname__
48
+ raise ValueError(
49
+ f'records 列表经过判断清洗后, 未在其中找到有效的 {record_type_name}'
50
+ )
51
+
52
+ return records_clean
53
+
54
+ def get(
55
+ self,
56
+ size=20,
57
+ cursor: str = '',
58
+ combination: Literal['and', 'or'] = 'and',
59
+ filters: list[GetterFilter] | None = None,
60
+ ):
61
+ """
62
+ 获取表格数据
63
+ Args:
64
+ size: 每页数据条数, 默认为 20
65
+ cursor: 分页游标, 首次请求可不传, 后续需传入上一次返回的 nextCursor 值
66
+ combination: 组合方式
67
+ filters: 过滤条件
68
+ Returns:
69
+ GetterResult 对象
70
+ """
71
+
72
+ reqdata = {
73
+ **self.global_reqdata,
74
+ 'handle': 'GET',
75
+ 'handle_get': {
76
+ 'size': size,
77
+ 'cursor': cursor,
78
+ },
79
+ }
80
+
81
+ if combination and combination in ['and', 'or']:
82
+ filter_field = {}
83
+ filter_field['combination'] = combination
84
+ if filters and isinstance(filters, list):
85
+ conditions = [
86
+ item.__dict__ for item in filters if isinstance(item, GetterFilter)
87
+ ]
88
+ filter_field['conditions'] = conditions
89
+ reqdata['handle_get']['filter'] = filter_field
90
+
91
+ resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
92
+ resp_json: dict = resp.json()
93
+ result: dict = resp_json.get('GET_RESULT')
94
+ if not result or not isinstance(result, dict):
95
+ raise ValueError('返回的数据中未找到 GET_RESULT 字段或该字段非字典类型')
96
+
97
+ getter_result = GetterResult(**result)
98
+
99
+ return getter_result
100
+
101
+ def add(self, records: list[dict]):
102
+ """
103
+ 新增记录
104
+ Args:
105
+ records: 用于新增的记录列表
106
+ Returns:
107
+ AdderResult 对象
108
+ """
109
+
110
+ records_clean = self.__verify_records(records, dict)
111
+
112
+ reqdata = {
113
+ **self.global_reqdata,
114
+ 'handle': 'ADD',
115
+ 'handle_add': {
116
+ 'records': records_clean,
117
+ },
118
+ }
119
+
120
+ resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
121
+ resp_json: dict = resp.json()
122
+ result: dict = resp_json.get('ADD_RESULT')
123
+ if not result or not isinstance(result, dict):
124
+ raise ValueError('返回的数据中未找到 ADD_RESULT 字段或该字段非字典类型')
125
+
126
+ adder_result = AdderResult(**result)
127
+
128
+ return adder_result
129
+
130
+ def update(self, records: list[Updater]):
131
+ """
132
+ 更新记录
133
+ Args:
134
+ records: 更新记录列表
135
+ Returns:
136
+ UpdaterResult 对象
137
+ """
138
+
139
+ records_clean: list[Updater] = self.__verify_records(records, Updater)
140
+ records_clean = [record.to_dict() for record in records_clean]
141
+
142
+ reqdata = {
143
+ **self.global_reqdata,
144
+ 'handle': 'UPDATE',
145
+ 'handle_update': {
146
+ 'records': records_clean,
147
+ },
148
+ }
149
+
150
+ resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
151
+ resp_json: dict = resp.json()
152
+ result: dict = resp_json.get('UPDATE_RESULT')
153
+ if not result or not isinstance(result, dict):
154
+ raise ValueError('返回的数据中未找到 UPDATE_RESULT 字段或该字段非字典类型')
155
+
156
+ updater_result = UpdaterResult(**result)
157
+
158
+ return updater_result
159
+
160
+ def delete(self, record_ids: list[str]):
161
+ """
162
+ 删除记录
163
+ Args:
164
+ record_ids: 记录 id 列表
165
+ Returns:
166
+ DeletorResult 对象
167
+ """
168
+
169
+ record_ids_clean = self.__verify_records(record_ids, str)
170
+
171
+ reqdata = {
172
+ **self.global_reqdata,
173
+ 'handle': 'DELETE',
174
+ 'handle_delete': {
175
+ 'record_ids': record_ids_clean,
176
+ },
177
+ }
178
+
179
+ resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
180
+ resp_json: dict = resp.json()
181
+ result: dict = resp_json.get('DELETE_RESULT')
182
+ if not result or not isinstance(result, dict):
183
+ raise ValueError('返回的数据中未找到 DELETE_RESULT 字段或该字段非字典类型')
184
+
185
+ deletor_result = DeletorResult(**result)
186
+
187
+ return deletor_result
@@ -1,256 +1,82 @@
1
- """
2
- Copyright (c) 2024-now LeslieLiang All rights reserved.
3
- Build Date: 2024-12-18
4
- Author: LeslieLiang
5
- Description: 多维表连接流SDK
6
- """
7
-
8
- import json
9
- from copy import deepcopy
10
- from dataclasses import dataclass
11
- from typing import Literal
12
-
13
- from requests import post
14
-
15
- from ._types import FilteredDataclass
16
-
17
-
18
- @dataclass
19
- class GetterFilter:
20
- """记录筛选器"""
21
-
22
- field: str
23
- operator: Literal[
24
- 'equal', 'notEqual', 'incontain', 'notContain', 'empty', 'notEmpty'
25
- ]
26
- value: list[str] = None
27
-
28
-
29
- @dataclass
30
- class Updater:
31
- """记录更新器"""
32
-
33
- record_id: str
34
- fields: dict[str, any]
35
-
36
-
37
- @dataclass
38
- class GetterResult(metaclass=FilteredDataclass):
39
- """获取器结果"""
40
-
41
- nextCursor: str = None
42
- records: list[dict] = None
43
- hasMore: bool = False
44
-
45
- def __post_init__(self):
46
- if self.records and isinstance(self.records, list):
47
- self.records = self.__records_handle()
48
-
49
- def __records_handle(self):
50
- records: list[dict] = []
51
- for record in self.records:
52
- record_temp = {'id': record.get('id'), 'fields': {}}
53
- fields: dict = record.get('fields')
54
-
55
- for field_name, field_value in fields.items():
56
- _value = deepcopy(field_value)
57
- if isinstance(field_value, dict):
58
- if 'link' in field_value:
59
- _value = field_value.get('link')
60
- elif 'name' in field_value:
61
- _value = field_value.get('name')
62
-
63
- record_temp['fields'][field_name] = _value
64
-
65
- records.append(record_temp)
66
-
67
- return records
68
-
69
- def to_file(self, file_path: str):
70
- """
71
- 将数据写出到本地
72
-
73
- Args:
74
- file_path: 用于存储数据的文件路径, 不需要文件后缀
75
- Returns:
76
- 数据文件路径
77
- """
78
-
79
- if not self.records:
80
- raise ValueError('数据记录为空, 无法写出')
81
-
82
- with open(f'{file_path}.json', 'w', encoding='utf-8') as f:
83
- f.write(json.dumps(self.records, ensure_ascii=False, indent=2))
84
-
85
- return file_path
86
-
87
-
88
- class Table:
89
- __HEADERS = {
90
- 'Content-Type': 'application/json',
91
- }
92
-
93
- def __init__(self, flow_url: str, did: str, tid: str):
94
- self.flow_url = flow_url
95
- self.did = did
96
- self.tid = tid
97
- self.global_reqdata = {
98
- 'did': did,
99
- 'tid': tid,
100
- }
101
-
102
- def get(
103
- self,
104
- size=20,
105
- cursor: str = '',
106
- combination: Literal['and', 'or'] = 'and',
107
- filters: list[GetterFilter] | None = None,
108
- ):
109
- """
110
- 获取表格数据
111
- Args:
112
- size: 每页数据条数, 默认为 20
113
- cursor: 分页游标, 首次请求可不传, 后续需传入上一次返回的 nextCursor 值
114
- combination: 组合方式
115
- filters: 过滤条件
116
- Returns:
117
- 表格数据
118
- """
119
-
120
- reqdata = {
121
- **self.global_reqdata,
122
- 'handle': 'GET',
123
- 'handle_get': {
124
- 'size': size,
125
- 'cursor': cursor,
126
- },
127
- }
128
-
129
- if combination and combination in ['and', 'or']:
130
- filter_field = {}
131
- filter_field['combination'] = combination
132
- if filters and isinstance(filters, list):
133
- conditions = [
134
- item.__dict__ for item in filters if isinstance(item, GetterFilter)
135
- ]
136
- filter_field['conditions'] = conditions
137
- reqdata['handle_get']['filter'] = filter_field
138
-
139
- resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
140
- result: dict = resp.json().get('GET_RESULT')
141
-
142
- getter_result = GetterResult(**result)
143
-
144
- return getter_result
145
-
146
- def add(self, records: list[dict]):
147
- """
148
- 新增记录
149
- Args:
150
- records: 新增记录列表
151
- Returns:
152
- 新增记录结果
153
- """
154
-
155
- if not records or not isinstance(records, list):
156
- raise ValueError('records must be a list')
157
-
158
- records_clean = [
159
- record for record in records if record and isinstance(record, dict)
160
- ]
161
- if not records_clean:
162
- raise ValueError('records must not be empty')
163
-
164
- reqdata = {
165
- **self.global_reqdata,
166
- 'handle': 'ADD',
167
- 'handle_add': {
168
- 'records': records_clean,
169
- },
170
- }
171
-
172
- resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
173
- return resp.json().get('ADD_RESULT')
174
-
175
- def update(self, records: list[Updater]):
176
- """
177
- 更新记录
178
- Args:
179
- records: 更新记录列表
180
- Returns:
181
- 更新记录结果
182
- """
183
-
184
- if not records or not isinstance(records, list):
185
- raise ValueError('records must be a list')
186
-
187
- records_clean = [
188
- record.__dict__
189
- for record in records
190
- if record and isinstance(record, Updater)
191
- ]
192
- if not records_clean:
193
- raise ValueError('records must not be empty')
194
-
195
- reqdata = {
196
- **self.global_reqdata,
197
- 'handle': 'UPDATE',
198
- 'handle_update': {
199
- 'records': records_clean,
200
- },
201
- }
202
-
203
- resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
204
- return resp.json().get('UPDATE_RESULT')
205
-
206
- def delete(self, record_ids: list[str]):
207
- """
208
- 删除记录
209
- Args:
210
- record_ids: 记录 id 列表
211
- Returns:
212
- 删除记录结果
213
- """
214
-
215
- if not record_ids or not isinstance(record_ids, list):
216
- raise ValueError('record_ids must be a list')
217
-
218
- record_ids_clean = [
219
- record_id
220
- for record_id in record_ids
221
- if record_id and isinstance(record_id, str)
222
- ]
223
-
224
- reqdata = {
225
- **self.global_reqdata,
226
- 'handle': 'DELETE',
227
- 'handle_delete': {
228
- 'record_ids': record_ids_clean,
229
- },
230
- }
231
-
232
- resp = post(self.flow_url, json=reqdata, headers=self.__HEADERS)
233
- return resp.json().get('DELETE_RESULT')
234
-
235
-
236
- class ComplexTable:
237
- def __init__(self, flow_url: str):
238
- """
239
- 初始化 ComplexTable 类
240
- Args:
241
- flow_url: 连接流 url
242
- """
243
-
244
- self.flow_url = flow_url
245
-
246
- def get_table(self, did: str, tid: str) -> Table:
247
- """
248
- 获取表格对象
249
- Args:
250
- did: 文档 id
251
- tid: 数据表 id
252
- Returns:
253
- Table 对象
254
- """
255
-
256
- return Table(self.flow_url, did, tid)
1
+ """
2
+ Copyright (c) 2024-now LeslieLiang All rights reserved.
3
+ Build Date: 2024-12-18
4
+ Author: LeslieLiang
5
+ Description: 多维表连接流SDK
6
+ """
7
+
8
+ from dataclasses import dataclass
9
+ from urllib.parse import parse_qs, urlparse
10
+
11
+ from ._table.table import Table
12
+
13
+
14
+ @dataclass
15
+ class ViewUrl:
16
+ """视图链接对象"""
17
+
18
+ url: str = None
19
+ did: str = None
20
+ """文档id"""
21
+ tid: str = None
22
+ """数据表id"""
23
+
24
+
25
+ class ComplexTable:
26
+ def __init__(self, flow_url: str):
27
+ """
28
+ 初始化 ComplexTable 类
29
+ Args:
30
+ flow_url: 连接流 url
31
+ """
32
+
33
+ self.flow_url = flow_url
34
+
35
+ def _parse_view_url(self, view_url: str):
36
+ """
37
+ 解析视图链接
38
+
39
+ Args:
40
+ view_url: 视图链接
41
+ Returns:
42
+ ViewUrl 对象
43
+ """
44
+
45
+ if not view_url or not isinstance(view_url, str):
46
+ raise ValueError('view_url 参数不能为空或非字符串类型')
47
+
48
+ parsed_url = urlparse(view_url)
49
+ url_path_splited = parsed_url.path.split('/')
50
+ did = url_path_splited[-1]
51
+
52
+ query_dict = {k: v[0] for k, v in parse_qs(parsed_url.query).items()}
53
+ iframeQuery = query_dict.get('iframeQuery')
54
+ tid = parse_qs(iframeQuery).get('sheetId')[0]
55
+
56
+ return ViewUrl(url=view_url, did=did, tid=tid)
57
+
58
+ def get_table(self, did: str, tid: str) -> Table:
59
+ """
60
+ 获取表格对象
61
+ Args:
62
+ did: 文档 id
63
+ tid: 数据表 id
64
+ Returns:
65
+ Table 对象
66
+ """
67
+
68
+ return Table(self.flow_url, did, tid)
69
+
70
+ def get_table_by_view_url(self, url: str):
71
+ """
72
+ 通过视图链接获取表格对象
73
+ - 解析视图链接获取其中的文档id和视图id
74
+
75
+ Args:
76
+ url: 视图链接
77
+ Returns:
78
+ Table 对象
79
+ """
80
+
81
+ view_url = self._parse_view_url(view_url=url)
82
+ return self.get_table(did=view_url.did, tid=view_url.tid)
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Martian Bugs
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Martian Bugs
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xmes-dingtalk-connectflow-sdk
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: DingTalk Connection Platform Connection Flow SDK
5
5
  License: MIT
6
6
  Author: leslieliang
@@ -16,7 +16,7 @@ Requires-Dist: requests (>=2.32.3,<3.0.0)
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  ## 概述
19
- ![Version](https://img.shields.io/badge/Version-v1.0.1-green)
19
+ ![Version](https://img.shields.io/badge/Version-v1.0.2-green)
20
20
  ![Python Version](https://img.shields.io/badge/Python-%E2%89%A53.9-blue)
21
21
 
22
22
  `xmes-dingtalk-connectflow-sdk` 是钉钉连接平台自建连接流SDK(向美而生),通过该工具可以方便快捷的调用钉钉的连接流。
@@ -33,35 +33,38 @@ pip install xmes-dingtalk-connectflow-sdk
33
33
  ### ComplexTable
34
34
  该工具提供了连接流 `多维表CURD_241217` 的操作调用工具。
35
35
  ```python
36
- from DingtalkConnectflowSDK import ComplexTable, GetterFilter, Updater
36
+ from DingtalkConnectflowSDK import ComplexTable
37
+ from DingtalkConnectflowSDk._table._types import GetterFilter, Updater
37
38
 
38
39
  # 初始化ComplexTable对象
39
40
  complextable = ComplexTable(flow_url='<连接流的同步协调URL>')
40
41
 
41
42
  # 获取 Table 对象
42
43
  table = complextable.get_table(did='<文档ID>', tid='<数据表ID>')
44
+ # 或者直接传入视图链接
45
+ # table = complextable.get_table_by_view_url(url='<视图链接>')
43
46
 
44
47
  # 查询数据
45
48
  filters = [
46
49
  GetterFilter(field='来源', operator='equal', value=['SDK', 'API'])
47
50
  ]
48
- resp = table.get(size=10, fillters=filters)
51
+ result = table.get(size=10, fillters=filters)
49
52
 
50
53
  # 新增数据
51
54
  records = [
52
55
  {'标题': 'Test Record 1', '来源': 'SDK},
53
56
  {'标题': 'Test Record 2', '来源': 'SDK},
54
57
  ]
55
- resp = table.add(records)
58
+ result = table.add(records)
56
59
 
57
60
  # 更新数据
58
61
  records = [
59
62
  Updater(record_id='<记录ID>', fields={'来源': 'API'}),
60
63
  Updater(record_id='<记录ID>', fields={'来源': 'API'}),
61
64
  ]
62
- resp = table.update(records)
65
+ result = table.update(records)
63
66
 
64
67
  # 删除数据
65
68
  record_ids = ['<记录ID>', '<记录ID>']
66
- resp = table.delete(record_ids)
69
+ result = table.delete(record_ids)
67
70
  ```
@@ -0,0 +1,9 @@
1
+ DingtalkConnectflowSDk/__init__.py,sha256=jnOiabDzIV6eXluD6SWo1DpaesB7a-lbg_CGpKAJJDs,77
2
+ DingtalkConnectflowSDk/_table/_types.py,sha256=HGqKMhOk996fEYyFCq9R4l4pYHods-T_R8uV2hfd4ac,2438
3
+ DingtalkConnectflowSDk/_table/table.py,sha256=prr7dAzKox8I4CrzWDMjB5Pr3HF4eafzmQXPaZ_wkNM,5568
4
+ DingtalkConnectflowSDk/_types.py,sha256=TnJI3HHXVObasHWWdqBkX9n-N5E1IENmx7a4k0ehbdk,317
5
+ DingtalkConnectflowSDk/complex_table.py,sha256=96yQ-bq2FXBt_zxKdHT9y5qn_XXVa9Wg8aH1nxNOeFY,1974
6
+ xmes_dingtalk_connectflow_sdk-1.0.2.dist-info/LICENSE,sha256=ofcWXcFPprzNE-4OVMRppECrnnvDFvuUHOTtlXR3XhA,1069
7
+ xmes_dingtalk_connectflow_sdk-1.0.2.dist-info/METADATA,sha256=nfeZ_1tfcfQqoT4TSm_v0GMRcZ4HQ_JTZuth0qxUpBM,2156
8
+ xmes_dingtalk_connectflow_sdk-1.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
+ xmes_dingtalk_connectflow_sdk-1.0.2.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- DingtalkConnectflowSDk/__init__.py,sha256=-hU6zkU0j1fC1i5ctzX9dvrooD_4Z9mJqjvz13yiqPc,69
2
- DingtalkConnectflowSDk/_types.py,sha256=TnJI3HHXVObasHWWdqBkX9n-N5E1IENmx7a4k0ehbdk,317
3
- DingtalkConnectflowSDk/complex_table.py,sha256=V4Az32gtsMlbjshrumuO_7dsx67I3EwK6-mceeZAurk,7000
4
- xmes_dingtalk_connectflow_sdk-1.0.1.dist-info/LICENSE,sha256=pLVhl_GNSUPILCWP8DLtqZXytsqXr1lfPp4RwXXypZc,1090
5
- xmes_dingtalk_connectflow_sdk-1.0.1.dist-info/METADATA,sha256=dMVvQ_UqRGy_1WRpFxOiJcvIZpxUcezwig0dRH4YLGc,2000
6
- xmes_dingtalk_connectflow_sdk-1.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
7
- xmes_dingtalk_connectflow_sdk-1.0.1.dist-info/RECORD,,