dagster-dingtalk 0.1.42__py3-none-any.whl → 0.1.44__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.
@@ -776,7 +776,7 @@ class 文档文件__存储管理__文件传输:
776
776
 
777
777
  def 提交文件(
778
778
  self, parentDentryUuid:str, upload_key:str, url:str, headers:dict, file_content: bytes,
779
- file_path:Path|str, union_id:str, convert_to_online_doc:bool = False,
779
+ file_name:str, union_id:str, convert_to_online_doc:bool = False,
780
780
  conflictStrategy:Literal['AUTO_RENAME', 'OVERWRITE', 'RETURN_DENTRY_IF_EXISTS', 'RETURN_ERROR_IF_EXISTS'] = 'AUTO_RENAME'
781
781
  ) -> dict:
782
782
  """
@@ -784,13 +784,14 @@ class 文档文件__存储管理__文件传输:
784
784
 
785
785
  调用本接口,上传图片、语音媒体资源文件以及普通文件,接口返回媒体资源标识 media_id。
786
786
 
787
- https://open.dingtalk.com/document/orgapp/upload-media-files
787
+ https://open.dingtalk.com/document/orgapp/submittal-file
788
+
788
789
  :param parentDentryUuid: 父节点 dentryUuid。如果是空间根目录,填空间根目录的dentryUuid。
789
790
  :param upload_key: 添加文件唯一标识。
790
791
  :param url: 获取文件上传信息得到的 resourceUrl。
791
792
  :param headers: 获取文件上传信息得到的 headers。
792
- :param file_content: 文件字节内容,如果提供了 file_content,则忽略 file_path。
793
- :param file_path: 文件路径,如果提供了 file_content,则忽略 file_path。
793
+ :param file_content: 文件字节内容。
794
+ :param file_name: 文件的名称,带后缀。
794
795
  :param union_id: 操作者unionId。
795
796
  :param convert_to_online_doc: 是否转换成在线文档。默认值 False
796
797
  :param conflictStrategy: 文件名称冲突策略。AUTO_RENAME:自动重命名,默认值 OVERWRITE:覆盖 RETURN_DENTRY_IF_EXISTS:返回已存在文件 RETURN_ERROR_IF_EXISTS:文件已存在时报错
@@ -804,27 +805,17 @@ class 文档文件__存储管理__文件传输:
804
805
  }
805
806
  """
806
807
 
807
- if file_content:
808
- file_content = file_path.read_bytes()
809
- httpx.put(url=url, content=file_content, headers=headers)
810
- elif file_path:
811
- file_path = Path(file_path)
812
- if not file_path.exists():
813
- raise FileNotFoundError(f"文件路径不存在: {file_path}")
814
- else:
815
- with open(file_path, 'rb') as f:
816
- httpx.put(url=url, files={"file": f}, headers=headers)
817
- else:
818
- raise FileNotFoundError(f"未提供任何文件路径或文件内容")
819
-
808
+ httpx.put(url=url, content=file_content, headers=headers)
820
809
  response = self.__client.api(
821
810
  method="POST",
822
811
  path=f"/v2.0/storage/spaces/files/{parentDentryUuid}/commit?unionId={union_id}",
823
812
  json={
824
813
  "uploadKey": upload_key,
825
- "name": file_path.split("/")[-1],
814
+ "name": file_name,
826
815
  "convertToOnlineDoc": convert_to_online_doc,
827
- "option": {"conflictStrategy": conflictStrategy}
816
+ "option": {
817
+ "conflictStrategy": conflictStrategy
818
+ }
828
819
  }
829
820
  )
830
821
  return response.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dagster-dingtalk
3
- Version: 0.1.42
3
+ Version: 0.1.44
4
4
  Summary: A dagster plugin for the DingTalk
5
5
  Author-email: YiZixuan <sqkkyzx@qq.com>
6
6
  Requires-Python: >=3.11
@@ -1,9 +1,9 @@
1
1
  dagster_dingtalk/__init__.py,sha256=wg8o3Ys3BeHV-sMWr9A_xtUhOOgu3JUKsbkgwMgLttU,419
2
- dagster_dingtalk/app_client.py,sha256=-wGUXkET1Ne9jPZU-I025KvlYp1UIif3F15CbiC09ew,45293
2
+ dagster_dingtalk/app_client.py,sha256=SodIEp4LSDrvlUoSMqIBoSNTxq8EEx85Y0BPv5PDu4c,44707
3
3
  dagster_dingtalk/operations.py,sha256=yH_rXJpWc8rwzkiJqjqHKy5iIED0Xi3qbSOv6SVr-eA,3923
4
4
  dagster_dingtalk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dagster_dingtalk/resources.py,sha256=VRQPehJX59SN7tCO5i6O7De9-HPwD8UIcRkQsqL6v9k,17868
6
6
  dagster_dingtalk/version.py,sha256=YUih-qXiPUqv2gSiXl1m22xIJL02nxLsc9JTVuaY_9E,25
7
- dagster_dingtalk-0.1.42.dist-info/METADATA,sha256=OVSnNWd38BhPjPYv-vlOdrM5681DdP6O1epkV9PlFeY,7757
8
- dagster_dingtalk-0.1.42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- dagster_dingtalk-0.1.42.dist-info/RECORD,,
7
+ dagster_dingtalk-0.1.44.dist-info/METADATA,sha256=bRo4t_qR91dHXymKZZ57IWn3waUL_ji1yQgvamw4LjM,7757
8
+ dagster_dingtalk-0.1.44.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ dagster_dingtalk-0.1.44.dist-info/RECORD,,