|
11 | 11 | from singer_sdk.helpers._classproperty import classproperty |
12 | 12 | from singer_sdk.helpers.capabilities import TapCapabilities |
13 | 13 |
|
14 | | -from tap_csv.client import CSVStream |
| 14 | +from . import client, filesystem_config |
15 | 15 |
|
16 | 16 |
|
17 | 17 | class TapCSV(Tap): |
@@ -53,87 +53,9 @@ class TapCSV(Tap): |
53 | 53 | "dropbox", |
54 | 54 | ], |
55 | 55 | ), |
56 | | - th.Property( |
57 | | - "ftp", |
58 | | - th.ObjectType( |
59 | | - th.Property( |
60 | | - "host", |
61 | | - th.StringType, |
62 | | - required=True, |
63 | | - description="FTP server host", |
64 | | - ), |
65 | | - th.Property( |
66 | | - "port", |
67 | | - th.IntegerType, |
68 | | - default=21, |
69 | | - description="FTP server port", |
70 | | - ), |
71 | | - th.Property( |
72 | | - "username", |
73 | | - th.StringType, |
74 | | - description="FTP username", |
75 | | - ), |
76 | | - th.Property( |
77 | | - "password", |
78 | | - th.StringType, |
79 | | - secret=True, |
80 | | - description="FTP password", |
81 | | - ), |
82 | | - th.Property( |
83 | | - "encoding", |
84 | | - th.StringType, |
85 | | - default="utf-8", |
86 | | - description="FTP server encoding", |
87 | | - ), |
88 | | - ), |
89 | | - description="FTP connection settings", |
90 | | - ), |
91 | | - th.Property( |
92 | | - "github", |
93 | | - th.ObjectType( |
94 | | - th.Property( |
95 | | - "org", |
96 | | - th.StringType, |
97 | | - required=True, |
98 | | - description=( |
99 | | - "GitHub organization or user where the repository is located" |
100 | | - ), |
101 | | - ), |
102 | | - th.Property( |
103 | | - "repo", |
104 | | - th.StringType, |
105 | | - required=True, |
106 | | - description="GitHub repository", |
107 | | - ), |
108 | | - th.Property( |
109 | | - "username", |
110 | | - th.StringType, |
111 | | - required=False, |
112 | | - description="GitHub username", |
113 | | - ), |
114 | | - th.Property( |
115 | | - "token", |
116 | | - th.StringType, |
117 | | - required=False, |
118 | | - secret=True, |
119 | | - description="GitHub token", |
120 | | - ), |
121 | | - ), |
122 | | - description="GitHub connection settings", |
123 | | - ), |
124 | | - th.Property( |
125 | | - "dropbox", |
126 | | - th.ObjectType( |
127 | | - th.Property( |
128 | | - "token", |
129 | | - th.StringType, |
130 | | - secret=True, |
131 | | - required=True, |
132 | | - description="Dropbox token", |
133 | | - ), |
134 | | - ), |
135 | | - description="Dropbox connection settings", |
136 | | - ), |
| 56 | + filesystem_config.FTP, |
| 57 | + filesystem_config.GITHUB, |
| 58 | + filesystem_config.DROPBOX, |
137 | 59 | th.Property( |
138 | 60 | "csv_files_definition", |
139 | 61 | th.StringType, |
@@ -189,7 +111,7 @@ def discover_streams(self) -> list[Stream]: |
189 | 111 | raise ConfigValidationError(msg, errors=errors) |
190 | 112 |
|
191 | 113 | return [ |
192 | | - CSVStream( |
| 114 | + client.CSVStream( |
193 | 115 | tap=self, |
194 | 116 | name=file_config.get("entity"), |
195 | 117 | file_config=file_config, |
|
0 commit comments