@nocobase/plugin-collection-fdw 2.0.3

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.
Files changed (155) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/07d37b2045cf49ac.js +10 -0
  6. package/dist/client/19796e1ee00c3777.js +10 -0
  7. package/dist/client/545679e3c044a8fb.js +10 -0
  8. package/dist/client/components/CreateDatabaseServerAction.d.ts +10 -0
  9. package/dist/client/components/DatabaseServerSelect.d.ts +20 -0
  10. package/dist/client/components/EditDatabaseServerAction.d.ts +10 -0
  11. package/dist/client/components/PreviewFields.d.ts +10 -0
  12. package/dist/client/components/PreviewTable.d.ts +10 -0
  13. package/dist/client/components/RemoteTableSelect.d.ts +10 -0
  14. package/dist/client/components/SyncFieldsAction.d.ts +11 -0
  15. package/dist/client/components/UnSupportFields.d.ts +12 -0
  16. package/dist/client/components/schema.d.ts +19 -0
  17. package/dist/client/dccc3127ba4bb534.js +10 -0
  18. package/dist/client/ff008086e5ac8e5e.js +10 -0
  19. package/dist/client/hooks.d.ts +20 -0
  20. package/dist/client/index.d.ts +13 -0
  21. package/dist/client/index.js +10 -0
  22. package/dist/externalVersion.js +24 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +42 -0
  25. package/dist/locale/de-DE.json +17 -0
  26. package/dist/locale/en-US.json +17 -0
  27. package/dist/locale/es-ES.json +17 -0
  28. package/dist/locale/fr-FR.json +17 -0
  29. package/dist/locale/hu-HU.json +17 -0
  30. package/dist/locale/id-ID.json +17 -0
  31. package/dist/locale/index.d.ts +10 -0
  32. package/dist/locale/index.js +42 -0
  33. package/dist/locale/it-IT.json +17 -0
  34. package/dist/locale/ja-JP.json +17 -0
  35. package/dist/locale/ko-KR.json +17 -0
  36. package/dist/locale/nl-NL.json +17 -0
  37. package/dist/locale/pt-BR.json +17 -0
  38. package/dist/locale/ru-RU.json +18 -0
  39. package/dist/locale/tr-TR.json +17 -0
  40. package/dist/locale/uk-UA.json +17 -0
  41. package/dist/locale/vi-VN.json +17 -0
  42. package/dist/locale/zh-CN.json +17 -0
  43. package/dist/locale/zh-TW.json +17 -0
  44. package/dist/node_modules/node-sql-parser/LICENSE +201 -0
  45. package/dist/node_modules/node-sql-parser/ast/postgresql.ts +1834 -0
  46. package/dist/node_modules/node-sql-parser/build/bigquery.d.ts +1 -0
  47. package/dist/node_modules/node-sql-parser/build/bigquery.js +2 -0
  48. package/dist/node_modules/node-sql-parser/build/db2.d.ts +1 -0
  49. package/dist/node_modules/node-sql-parser/build/db2.js +2 -0
  50. package/dist/node_modules/node-sql-parser/build/flinksql.d.ts +1 -0
  51. package/dist/node_modules/node-sql-parser/build/flinksql.js +2 -0
  52. package/dist/node_modules/node-sql-parser/build/hive.d.ts +1 -0
  53. package/dist/node_modules/node-sql-parser/build/hive.js +2 -0
  54. package/dist/node_modules/node-sql-parser/build/mariadb.d.ts +1 -0
  55. package/dist/node_modules/node-sql-parser/build/mariadb.js +2 -0
  56. package/dist/node_modules/node-sql-parser/build/mysql.d.ts +1 -0
  57. package/dist/node_modules/node-sql-parser/build/mysql.js +2 -0
  58. package/dist/node_modules/node-sql-parser/build/noql.d.ts +1 -0
  59. package/dist/node_modules/node-sql-parser/build/noql.js +2 -0
  60. package/dist/node_modules/node-sql-parser/build/postgresql.d.ts +1 -0
  61. package/dist/node_modules/node-sql-parser/build/postgresql.js +2 -0
  62. package/dist/node_modules/node-sql-parser/build/snowflake.d.ts +1 -0
  63. package/dist/node_modules/node-sql-parser/build/snowflake.js +2 -0
  64. package/dist/node_modules/node-sql-parser/build/sqlite.d.ts +1 -0
  65. package/dist/node_modules/node-sql-parser/build/sqlite.js +2 -0
  66. package/dist/node_modules/node-sql-parser/build/transactsql.d.ts +1 -0
  67. package/dist/node_modules/node-sql-parser/build/transactsql.js +2 -0
  68. package/dist/node_modules/node-sql-parser/index.d.ts +1 -0
  69. package/dist/node_modules/node-sql-parser/index.js +1 -0
  70. package/dist/node_modules/node-sql-parser/lib/aggregation.js +39 -0
  71. package/dist/node_modules/node-sql-parser/lib/alter.js +174 -0
  72. package/dist/node_modules/node-sql-parser/lib/analyze.js +40 -0
  73. package/dist/node_modules/node-sql-parser/lib/array-struct.js +60 -0
  74. package/dist/node_modules/node-sql-parser/lib/assign.js +33 -0
  75. package/dist/node_modules/node-sql-parser/lib/binary.js +46 -0
  76. package/dist/node_modules/node-sql-parser/lib/case.js +39 -0
  77. package/dist/node_modules/node-sql-parser/lib/column.js +221 -0
  78. package/dist/node_modules/node-sql-parser/lib/command.js +299 -0
  79. package/dist/node_modules/node-sql-parser/lib/constrain.js +45 -0
  80. package/dist/node_modules/node-sql-parser/lib/create.js +439 -0
  81. package/dist/node_modules/node-sql-parser/lib/delete.js +42 -0
  82. package/dist/node_modules/node-sql-parser/lib/exec.js +37 -0
  83. package/dist/node_modules/node-sql-parser/lib/expr.js +123 -0
  84. package/dist/node_modules/node-sql-parser/lib/func.js +152 -0
  85. package/dist/node_modules/node-sql-parser/lib/index-definition.js +106 -0
  86. package/dist/node_modules/node-sql-parser/lib/insert.js +111 -0
  87. package/dist/node_modules/node-sql-parser/lib/interval.js +28 -0
  88. package/dist/node_modules/node-sql-parser/lib/json.js +28 -0
  89. package/dist/node_modules/node-sql-parser/lib/limit.js +45 -0
  90. package/dist/node_modules/node-sql-parser/lib/over.js +39 -0
  91. package/dist/node_modules/node-sql-parser/lib/parser.all.js +33 -0
  92. package/dist/node_modules/node-sql-parser/lib/parser.js +82 -0
  93. package/dist/node_modules/node-sql-parser/lib/parser.single.js +23 -0
  94. package/dist/node_modules/node-sql-parser/lib/proc.js +39 -0
  95. package/dist/node_modules/node-sql-parser/lib/select.js +132 -0
  96. package/dist/node_modules/node-sql-parser/lib/show.js +88 -0
  97. package/dist/node_modules/node-sql-parser/lib/sql.js +43 -0
  98. package/dist/node_modules/node-sql-parser/lib/tables.js +211 -0
  99. package/dist/node_modules/node-sql-parser/lib/transaction.js +26 -0
  100. package/dist/node_modules/node-sql-parser/lib/union.js +81 -0
  101. package/dist/node_modules/node-sql-parser/lib/update.js +59 -0
  102. package/dist/node_modules/node-sql-parser/lib/util.js +444 -0
  103. package/dist/node_modules/node-sql-parser/lib/window.js +85 -0
  104. package/dist/node_modules/node-sql-parser/lib/with.js +37 -0
  105. package/dist/node_modules/node-sql-parser/package.json +1 -0
  106. package/dist/node_modules/node-sql-parser/types.d.ts +227 -0
  107. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.d.ts +1 -0
  108. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.js +2 -0
  109. package/dist/node_modules/node-sql-parser/umd/db2.umd.d.ts +1 -0
  110. package/dist/node_modules/node-sql-parser/umd/db2.umd.js +2 -0
  111. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.d.ts +1 -0
  112. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.js +2 -0
  113. package/dist/node_modules/node-sql-parser/umd/hive.umd.d.ts +1 -0
  114. package/dist/node_modules/node-sql-parser/umd/hive.umd.js +2 -0
  115. package/dist/node_modules/node-sql-parser/umd/index.umd.d.ts +1 -0
  116. package/dist/node_modules/node-sql-parser/umd/index.umd.js +2 -0
  117. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.d.ts +1 -0
  118. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.js +2 -0
  119. package/dist/node_modules/node-sql-parser/umd/mysql.umd.d.ts +1 -0
  120. package/dist/node_modules/node-sql-parser/umd/mysql.umd.js +2 -0
  121. package/dist/node_modules/node-sql-parser/umd/noql.umd.d.ts +1 -0
  122. package/dist/node_modules/node-sql-parser/umd/noql.umd.js +2 -0
  123. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.d.ts +1 -0
  124. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.js +2 -0
  125. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.d.ts +1 -0
  126. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.js +2 -0
  127. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.d.ts +1 -0
  128. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.js +2 -0
  129. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.d.ts +1 -0
  130. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.js +2 -0
  131. package/dist/server/bridges/mariadb-to-mariadb.d.ts +3 -0
  132. package/dist/server/bridges/mariadb-to-mariadb.js +38 -0
  133. package/dist/server/bridges/mysql-to-mysql.d.ts +13 -0
  134. package/dist/server/bridges/mysql-to-mysql.js +117 -0
  135. package/dist/server/bridges/mysql-to-pg.d.ts +8 -0
  136. package/dist/server/bridges/mysql-to-pg.js +9 -0
  137. package/dist/server/bridges/pg-to-pg.d.ts +21 -0
  138. package/dist/server/bridges/pg-to-pg.js +137 -0
  139. package/dist/server/bridges/remote-local-bridge.d.ts +57 -0
  140. package/dist/server/bridges/remote-local-bridge.js +73 -0
  141. package/dist/server/collections/database-server-collection.d.ts +10 -0
  142. package/dist/server/collections/database-server-collection.js +54 -0
  143. package/dist/server/foreign-data-collection.d.ts +22 -0
  144. package/dist/server/foreign-data-collection.js +118 -0
  145. package/dist/server/index.d.ts +9 -0
  146. package/dist/server/index.js +42 -0
  147. package/dist/server/models/database-server.d.ts +29 -0
  148. package/dist/server/models/database-server.js +226 -0
  149. package/dist/server/plugin.d.ts +14 -0
  150. package/dist/server/plugin.js +111 -0
  151. package/dist/server/resourcers/tables.d.ts +17 -0
  152. package/dist/server/resourcers/tables.js +181 -0
  153. package/package.json +43 -0
  154. package/server.d.ts +2 -0
  155. package/server.js +1 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # NocoBase
2
+
3
+ <video width="100%" controls>
4
+ <source src="https://github.com/user-attachments/assets/4d11a87b-00e2-48f3-9bf7-389d21072d13" type="video/mp4">
5
+ </video>
6
+
7
+ <p align="center">
8
+ <a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
9
+ <a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability&#0045;first&#0044;&#0032;open&#0045;source&#0032;no&#0045;code&#0032;platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
10
+ </p>
11
+
12
+ ## What is NocoBase
13
+
14
+ NocoBase is the most extensible AI-powered no-code platform.
15
+ Total control. Infinite extensibility. AI collaboration.
16
+ Enable your team to adapt quickly and cut costs dramatically.
17
+ No years of development. No millions wasted.
18
+ Deploy NocoBase in minutes — and take control of everything.
19
+
20
+ Homepage:
21
+ https://www.nocobase.com/
22
+
23
+ Online Demo:
24
+ https://demo.nocobase.com/new
25
+
26
+ Documents:
27
+ https://docs.nocobase.com/
28
+
29
+ Forum:
30
+ https://forum.nocobase.com/
31
+
32
+ Use Cases:
33
+ https://www.nocobase.com/en/blog/tags/customer-stories
34
+
35
+ ## Release Notes
36
+
37
+ Our [blog](https://www.nocobase.com/en/blog/timeline) is regularly updated with release notes and provides a weekly summary.
38
+
39
+ ## Distinctive features
40
+
41
+ ### 1. Data model-driven, not form/table–driven
42
+
43
+ Instead of being constrained by forms or tables, NocoBase adopts a data model–driven approach, separating data structure from user interface to unlock unlimited possibilities.
44
+
45
+ - UI and data structure are fully decoupled
46
+ - Multiple blocks and actions can be created for the same table or record in any quantity or form
47
+ - Supports the main database, external databases, and third-party APIs as data sources
48
+
49
+ ![model](https://static-docs.nocobase.com/model.png)
50
+
51
+ ### 2. AI employees, integrated into your business systems
52
+ Unlike standalone AI demos, NocoBase allows you to embed AI capabilities seamlessly into your interfaces, workflows, and data context, making AI truly useful in real business scenarios.
53
+
54
+ - Define AI employees for roles such as translator, analyst, researcher, or assistant
55
+ - Seamless AI–human collaboration in interfaces and workflows
56
+ - Ensure AI usage is secure, transparent, and customizable for your business needs
57
+
58
+ ![AI-employee](https://static-docs.nocobase.com/ai-employee-home.png)
59
+
60
+ ### 3. What you see is what you get, incredibly easy to use
61
+
62
+ While enabling the development of complex business systems, NocoBase keeps the experience simple and intuitive.
63
+
64
+ - One-click switch between usage mode and configuration mode
65
+ - Pages serve as a canvas to arrange blocks and actions, similar to Notion
66
+ - Configuration mode is designed for ordinary users, not just programmers
67
+
68
+ ![wysiwyg](https://static-docs.nocobase.com/wysiwyg.gif)
69
+
70
+ ### 4. Everything is a plugin, designed for extension
71
+ Adding more no-code features will never cover every business case. NocoBase is built for extension through its plugin-based microkernel architecture.
72
+
73
+ - All functionalities are plugins, similar to WordPress
74
+ - Plugins are ready to use upon installation
75
+ - Pages, blocks, actions, APIs, and data sources can all be extended through custom plugins
76
+
77
+ ![plugins](https://static-docs.nocobase.com/plugins.png)
78
+
79
+ ## Installation
80
+
81
+ NocoBase supports three installation methods:
82
+
83
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
84
+
85
+ Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
86
+
87
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
88
+
89
+ The business code of the project is completely independent and supports low-code development.
90
+
91
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
92
+
93
+ If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
94
+
95
+ ## How NocoBase works
96
+
97
+ <video width="100%" controls>
98
+ <source src="https://github.com/user-attachments/assets/8d183b44-9bb5-4792-b08f-bc08fe8dfaaf" type="video/mp4">
99
+ </video>
package/client.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client';
2
+ export { default } from './dist/client';
package/client.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client/index.js');
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_collection_fdw=self.webpackChunk_nocobase_plugin_collection_fdw||[]).push([["406"],{967:function(e,t,n){n.r(t),n.d(t,{PreviewTable:function(){return y}});var r=n(505),o=n(721),a=n(156),l=n.n(a),i=n(238),c=n(563),u=n(772);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p=["lineString","point","circle","polygon"],y=function(e){var t=e.remoteServerName,n=e.remoteTableName,s=e.fields,y=m((0,a.useState)([]),2),d=y[0],b=y[1],v=m((0,a.useState)([]),2),g=v[0],O=v[1],h=(0,a.useContext)(r.SchemaOptionsContext),S=(0,u.useCompile)(),w=m((0,a.useState)(!1),2),j=w[0],E=w[1],P=(0,u.useCollectionManager_deprecated)().getInterface,k=(0,u.useAPIClient)(),T=(0,i.useTranslation)().t,_=(0,r.useForm)();(0,a.useEffect)(function(){t&&n?C():b([])},[n]),(0,a.useEffect)(function(){b([]);var e=x(s);setTimeout(function(){b(e)})},[_.values.fields]);var C=function(){var e={};_.values.fields.map(function(t){p.includes(t.type)&&(e[t.name]=t.type)}),E(!0),k.resource("databaseServers.tables",t).query({filterByTk:n,fieldTypes:e}).then(function(e){var t=e.data;t&&(E(!1),O((null==t?void 0:t.data)||[]))}).catch},x=function(e){var t;return null==(t=e.filter(function(e){return e.interface}))?void 0:t.map(function(e){var t,n,o,a=(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,i=(null==(o=P(e.interface))||null==(n=o.default)?void 0:n.uiSchema)||{};return{title:S(a),dataIndex:e.name,key:e.name,width:200,render:function(t,n,o){var a,c,s=n[e.name],m={type:"object",properties:f({},"".concat(e.name,"_").concat(o),(a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){f(e,t,n[t])})}return e}({},i),c=c={"x-read-pretty":!0,default:"json"===e.interface?JSON.stringify(s):s},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(c)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(c,e))}),a))};return l().createElement(u.EllipsisWithTooltip,{ellipsis:!0},l().createElement(u.SchemaComponentOptions,{components:h.components},l().createElement(r.RecursionField,{schema:m,name:o,onlyRenderProperties:!0})))}}})},A=(0,a.useMemo)(function(){return(0,c.createForm)({readPretty:!0,readOnly:!0})},[d]);return l().createElement(o.Spin,{spinning:j,key:"preview"},l().createElement("div",{style:{marginBottom:22}},l().createElement("div",{className:"ant-formily-item-label",style:{marginTop:24,display:"flex",padding:"0 0 8px"},key:t},l().createElement("div",{className:"ant-formily-item-label-content"},l().createElement("span",null,l().createElement("label",null,T("Preview")))),l().createElement("span",{className:"ant-formily-item-colon"},":")),(null==d?void 0:d.length)>0&&l().createElement(r.FormProvider,{form:A},l().createElement(o.Table,{size:"middle",pagination:!1,bordered:!0,columns:d,dataSource:g,scroll:{x:1e3,y:300},key:"".concat(t,"-preview")}))))}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_collection_fdw=self.webpackChunk_nocobase_plugin_collection_fdw||[]).push([["865"],{95:function(e,t,n){n.r(t),n.d(t,{PreviewFields:function(){return g}});var r=n(505),a=n(467),o=n(632),l=n(721),i=n(156),u=n.n(i),c=n(238),s=n(563),f=n(772),m=n(784),p=function(e){var t=e.dataSource,n=(0,c.useTranslation)().t,r=[{title:n("Field name"),dataIndex:"name",key:"name"},{title:n("Field database type",{ns:m.A}),dataIndex:"rawType",key:"rawType"}];return(null==t?void 0:t.length)>0&&u().createElement(u().Fragment,null,u().createElement(l.Divider,{plain:!0,orientation:"left",orientationMargin:"0"},u().createElement("h3",null,n("Unknown field type",{ns:m.A}))),u().createElement("div",{style:{marginBottom:"15px"}},n("The following field types are not compatible and do not support output and display",{ns:m.A})),u().createElement(l.Table,{columns:r,dataSource:t,pagination:!1}))};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(e,t){var n=[];return e.forEach(function(e){var r=e.children.filter(function(e){var n;return null==e||null==(n=e.availableTypes)?void 0:n.includes(t)});n.push({label:e.label,key:e.key,children:r})}),n.filter(function(e){var t;return(null==(t=e.children)?void 0:t.length)>0})},g=u().memo(function(e){var t=e.remoteServerName,n=e.remoteTableName,m=(0,i.useContext)(f.ResourceActionContext).data,d=(0,f.useAPIClient)(),g=(0,c.useTranslation)().t,S=b((0,i.useState)(!1),2),O=S[0],w=S[1],j=b((0,i.useState)([]),2),E=j[0],P=j[1],x=b((0,i.useState)([]),2),A=x[0],k=x[1],C=(0,r.useForm)(),F=(0,i.useMemo)(function(){return(0,s.createForm)({effects:function(){(0,s.onFieldValidateFailed)("*",function(){C.query("fields").take(function(e){e.setFeedback({type:"error",messages:["display name is required"]})})}),(0,s.onFieldValidateSuccess)("*",function(){F.valid&&C.query("fields").take(function(e){e.setFeedback({type:"error",messages:[]})})})}})},[]),T=(0,r.useField)(),I=(0,f.useCollectionManager_deprecated)().getInterface,N=(0,f.useCompile)(),D=(0,f.useFieldInterfaceOptions)().filter(function(e){return!["relation"].includes(e.key)});(0,i.useEffect)(function(){t&&n?(w(!0),d.resource("databaseServers/".concat(t,"/tables")).get({filterByTk:n}).then(function(e){var t=e.data;if(t){w(!1),P([]);var n,r,o=null==(n=Object.values(null==t||null==(r=t.data)?void 0:r.fields))?void 0:n.map(function(e){var t=(null==m?void 0:m.data.find(function(t){return t.name===e.name&&t.type===e.type}))||e;return v(y({},t),{uiSchema:(0,a.omit)(null==t?void 0:t.uiSchema,"rawTitle"),allowNull:e.allowNull,primaryKey:e.primaryKey,unique:e.unique})}).map(function(e){var t;return v(y({},e),{uiSchema:{title:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,required:!e.allowNull}})});T.value=o,setTimeout(function(){var e;P(o),k(null==t||null==(e=t.data)?void 0:e.unsupportedFields)})}}).catch):(P([]),T.value=[])},[n,t]);var _=function(e,t){var n=y({},E[t],e);E.splice(t,1,n),P(E),T.value=E},M=function(e){var t,n,r,a=e.item,o=e.index,c=h(D,a.type),s=null==c||null==(r=c[0])||null==(n=r.children)||null==(t=n[0])?void 0:t.name;return(0,i.useEffect)(function(){if(!a.interface){var e,t,n=I(s);_({interface:s,uiSchema:v(y({title:null==a||null==(e=a.uiSchema)?void 0:e.title},null==n||null==(t=n.default)?void 0:t.uiSchema),{required:!a.allowNull})},o)}},[]),u().createElement(l.Select,{defaultValue:a.interface||s,style:{width:"100%"},popupMatchSelectWidth:!1,onChange:function(e){var t,n=I(e);_({interface:e,uiSchema:v(y({},null==n||null==(t=n.default)?void 0:t.uiSchema),{required:!a.allowNull})},o)}},c.map(function(e){return u().createElement(l.Select.OptGroup,{key:e.key,label:N(e.label)},e.children.map(function(e){return u().createElement(l.Select.Option,{key:e.value,value:e.name},N(e.label))}))}))},V=[{title:g("Name"),dataIndex:"name",key:"name",width:130},{title:g("Type"),dataIndex:"type",width:140,key:"type",render:function(e,t,n){var r=E[n];return(null==r?void 0:r.possibleTypes)?u().createElement(l.Select,{defaultValue:e,popupMatchSelectWidth:!1,style:{width:"100%"},options:(null==r?void 0:r.possibleTypes.map(function(e){return{label:e,value:e}}))||[],onChange:function(e){return _({type:e},n)}}):e&&u().createElement(l.Tag,null,e)}},{title:g("Interface"),dataIndex:"interface",key:"interface",width:150,render:function(e,t,n){var r=E[n];return r.source?e:u().createElement(M,{item:r,index:n})}},{title:g("Display name"),dataIndex:"title",key:"title",width:180,render:function(e,t,n){var i,c=E[n];return u().createElement(r.Field,{name:"".concat(t.name),required:!0,decorator:[o.FormItem,{feedbackLayout:"terse",style:{marginBottom:"0px"}}],component:[l.Input,{defaultValue:(null==c||null==(i=c.uiSchema)?void 0:i.title)||e,onChange:function(e){return _({uiSchema:v(y({},(0,a.omit)(null==c?void 0:c.uiSchema,"rawTitle")),{title:e.target.value})},n)}}]})}}];return u().createElement(l.Spin,{spinning:O},E.length>0&&u().createElement(u().Fragment,null,u().createElement("div",{className:"ant-formily-item-label",style:{display:"flex",padding:"0 0 8px"}},u().createElement("div",{className:"ant-formily-item-label-content"},u().createElement("span",null,u().createElement("label",null,g("Fields")))),u().createElement("span",{className:"ant-formily-item-colon"},":")),u().createElement(r.FormProvider,{form:F},u().createElement(l.Table,{bordered:!0,size:"middle",columns:V,dataSource:E,scroll:{y:300},pagination:!1,rowClassName:"editable-row",key:t}))),u().createElement(p,{dataSource:A}))},function(e,t){return t.remoteServerName===e.remoteServerName&&t.remoteTableName===e.remoteTableName});g.displayName="PreviewFields"},967:function(e,t,n){n.r(t),n.d(t,{PreviewTable:function(){return d}});var r=n(505),a=n(721),o=n(156),l=n.n(o),i=n(238),u=n(563),c=n(772);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p=["lineString","point","circle","polygon"],d=function(e){var t=e.remoteServerName,n=e.remoteTableName,s=e.fields,d=m((0,o.useState)([]),2),y=d[0],v=d[1],b=m((0,o.useState)([]),2),h=b[0],g=b[1],S=(0,o.useContext)(r.SchemaOptionsContext),O=(0,c.useCompile)(),w=m((0,o.useState)(!1),2),j=w[0],E=w[1],P=(0,c.useCollectionManager_deprecated)().getInterface,x=(0,c.useAPIClient)(),A=(0,i.useTranslation)().t,k=(0,r.useForm)();(0,o.useEffect)(function(){t&&n?C():v([])},[n]),(0,o.useEffect)(function(){v([]);var e=F(s);setTimeout(function(){v(e)})},[k.values.fields]);var C=function(){var e={};k.values.fields.map(function(t){p.includes(t.type)&&(e[t.name]=t.type)}),E(!0),x.resource("databaseServers.tables",t).query({filterByTk:n,fieldTypes:e}).then(function(e){var t=e.data;t&&(E(!1),g((null==t?void 0:t.data)||[]))}).catch},F=function(e){var t;return null==(t=e.filter(function(e){return e.interface}))?void 0:t.map(function(e){var t,n,a,o=(null==e||null==(t=e.uiSchema)?void 0:t.title)||e.name,i=(null==(a=P(e.interface))||null==(n=a.default)?void 0:n.uiSchema)||{};return{title:O(o),dataIndex:e.name,key:e.name,width:200,render:function(t,n,a){var o,u,s=n[e.name],m={type:"object",properties:f({},"".concat(e.name,"_").concat(a),(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){f(e,t,n[t])})}return e}({},i),u=u={"x-read-pretty":!0,default:"json"===e.interface?JSON.stringify(s):s},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(u)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(u,e))}),o))};return l().createElement(c.EllipsisWithTooltip,{ellipsis:!0},l().createElement(c.SchemaComponentOptions,{components:S.components},l().createElement(r.RecursionField,{schema:m,name:a,onlyRenderProperties:!0})))}}})},T=(0,o.useMemo)(function(){return(0,u.createForm)({readPretty:!0,readOnly:!0})},[y]);return l().createElement(a.Spin,{spinning:j,key:"preview"},l().createElement("div",{style:{marginBottom:22}},l().createElement("div",{className:"ant-formily-item-label",style:{marginTop:24,display:"flex",padding:"0 0 8px"},key:t},l().createElement("div",{className:"ant-formily-item-label-content"},l().createElement("span",null,l().createElement("label",null,A("Preview")))),l().createElement("span",{className:"ant-formily-item-colon"},":")),(null==y?void 0:y.length)>0&&l().createElement(r.FormProvider,{form:T},l().createElement(a.Table,{size:"middle",pagination:!1,bordered:!0,columns:y,dataSource:h,scroll:{x:1e3,y:300},key:"".concat(t,"-preview")}))))}},20:function(e,t,n){n.r(t),n.d(t,{SyncFieldsAction:function(){return j},SyncFieldsActionCom:function(){return E}});var r=n(632),a=n(505),o=n(875),l=n(721),i=n(467),u=n(156),c=n.n(u),s=n(238),f=n(772),m=n(95),p=n(967),d=n(397),y=n(784);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t,n,r,a,o,l){try{var i=e[o](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,a)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(e,t,n,r){if(e){var a,l,u,c=(0,i.cloneDeep)(e.properties);!0===e.hasDefaultValue&&(c.defaultValue=(0,i.cloneDeep)(null==e||null==(u=e.default)?void 0:u.uiSchema),c.defaultValue.title=n('{{ t("Default value") }}'),c.defaultValue["x-decorator"]="FormItem");var s=(a=g({name:"f_".concat((0,o.uid)())},(0,i.cloneDeep)(e.default)),l=l={interface:e.name},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(l)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(l)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(l,e))}),a);return s.reverseField&&(s.reverseField.name="f_".concat((0,o.uid)())),{type:"object",properties:h({},(0,o.uid)(),{type:"void","x-component":"Action.Drawer","x-component-props":{getContainer:"{{ getContainer }}"},"x-decorator":"Form","x-decorator-props":{useValues:function(e){return(0,f.useRequest)(function(){return Promise.resolve({data:s})},e)}},title:r("Sync from remote table",{ns:y.A}),properties:{schema:{type:"string","x-hidden":!0,default:null==t?void 0:t.schema},viewName:{type:"string","x-hidden":!0,default:null==t?void 0:t.viewName},fields:{type:"array","x-component":m.PreviewFields,"x-component-props":g({},t),default:t.fields},preview:{type:"object","x-component":p.PreviewTable,"x-component-props":g({},t),"x-reactions":{dependencies:["fields"],fulfill:{schema:{"x-component-props":"{{{...record,...$form.values}}}"}}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{action1:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},action2:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useSyncFromDatabase }}"}}}}}})}}},w=function(){var e=(0,a.useForm)(),t=(0,f.useCollectionManager_deprecated)().refreshCM,n=(0,f.useActionContext)(),r=(0,f.useResourceActionContext)().refresh,o=(0,f.useResourceContext)().targetKey,l=(0,f.useRecord)()[o],i=(0,f.useAPIClient)(),u=(0,a.useField)();return{run:function(){var a;return(a=function(){return function(e,t){var n,r,a,o,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(o){return function(i){var u=[o,i];if(n)throw TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,r=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){l.label=u[1];break}if(6===u[0]&&l.label<a[1]){l.label=a[1],a=u;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(u);break}a[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}catch(e){u=[6,e],r=0}finally{n=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,e.submit()];case 1:a.sent(),u.data=u.data||{},u.data.loading=!0,a.label=2;case 2:return a.trys.push([2,6,,7]),[4,i.resource("collections").setFields({filterByTk:l,values:e.values})];case 3:return a.sent(),n.setVisible(!1),[4,e.reset()];case 4:return a.sent(),u.data.loading=!1,r(),[4,t()];case 5:return a.sent(),[3,7];case 6:return a.sent(),u.data.loading=!1,[3,7];case 7:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var o=a.apply(e,t);function l(e){b(o,n,r,l,i,"next",e)}function i(e){b(o,n,r,l,i,"throw",e)}l(void 0)})})()}}},j=function(e){var t=(0,f.useRecord)();return c().createElement(E,g({item:t},e))},E=function(e){var t=e.scope,n=e.getContainer,a=e.item,o=e.children,i=S((0,u.useState)(!1),2),m=i[0],p=i[1],v=S((0,u.useState)({}),2),b=v[0],h=v[1],j=(0,f.useCompile)(),E=(0,s.useTranslation)().t;return c().createElement(f.RecordProvider,{record:a},c().createElement(f.ActionContextProvider,{value:{visible:m,setVisible:p,drawerProps:{width:900}}},o||c().createElement(l.Button,{onClick:function(e){var t=O({},a,j,E);t&&(h(t),p(!0))}},E("Sync from remote table",{ns:y.A})),c().createElement(f.SchemaComponent,{schema:b,components:{ArrayTable:r.ArrayTable},scope:g({getContainer:n,useCancelAction:d.OP,createOnly:!0,isOverride:!1,useSyncFromDatabase:w,record:a},t)})))}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_collection_fdw=self.webpackChunk_nocobase_plugin_collection_fdw||[]).push([["331"],{753:function(e,t,n){n.r(t),n.d(t,{DatabaseServerContext:function(){return C},ServerContext:function(){return P},DatabaseServerSelectProvider:function(){return D},DatabaseServerSelect:function(){return j}});var r=n(156),o=n.n(r),a=n(721),i=n(238),c=n(772),s=n(505),u=n(482),l=n(784);function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var m={description:{type:"string",title:'{{t("Display name",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Server name",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid","x-disabled":"{{ createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},host:{type:"string",title:'{{t("Host",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},port:{type:"string",title:'{{t("Port",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},database:{type:"string",title:'{{t("Database",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},username:{type:"string",title:'{{t("Username",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},password:{type:"string",title:'{{t("Password",{ ns: "'.concat(l.A,'" })}}'),required:!0,"x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0}}},d={type:"object",properties:{form:{type:"void","x-decorator":"Form","x-component":"Action.Modal",title:'{{ t("Create database server",{ ns: "'.concat(l.A,'" }) }}'),"x-component-props":{width:520,getContainer:"{{ getContainer }}"},properties:f(p({},m),{footer:{type:"void","x-component":"Action.Modal.Footer",properties:{testConnectiion:{title:'{{ t("Test Connection",{ ns: "'.concat(l.A,'" }) }}'),"x-component":"Action","x-component-props":{useAction:"{{ useTestConnectionAction }}"}},action1:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},action2:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateDatabaseServer }}"}}}}})}}},b={type:"object",properties:{form:{type:"void","x-decorator":"Form","x-decorator-props":{useValues:"{{useEditServerProps}}"},"x-component":"Action.Modal",title:'{{ t("Edit database server",{ ns: "'.concat(l.A,'" }) }}'),"x-component-props":{width:520,getContainer:"{{ getContainer }}"},properties:f(p({},m),{footer:{type:"void","x-component":"Action.Modal.Footer",properties:{testConnectiion:{title:'{{ t("Test Connection",{ ns: "'.concat(l.A,'" }) }}'),"x-component":"Action","x-component-props":{useAction:"{{ useTestConnectionAction }}"}},action1:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},action2:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useEditDatabaseServer }}"}}}}})}}},y=n(397);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=(0,s.observer)(function(e){var t,n=e.scope,a=e.getContainer,s=e.setOpen,l=e.handleDataServerChange,p=(t=(0,r.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),a.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(c)throw r}}return a}}(t,2)||function(e,t){if(e){if("string"==typeof e)return v(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=p[0],m=p[1],b=(0,i.useTranslation)().t;return o().createElement(c.ActionContextProvider,{value:{visible:f,setVisible:m}},o().createElement("span",{style:{cursor:"pointer"},onClick:function(){s(!1),m(!0)}},o().createElement(u.PlusOutlined,{style:{marginRight:"5px"}})," ",b("Create database server",{ns:"collection-fdw"})),o().createElement(c.SchemaComponent,{schema:d,scope:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({getContainer:a,useCreateDatabaseServer:function(){return(0,y.jZ)(l)},useCancelAction:y.OP,useTestConnectionAction:y.nK,createOnly:!1},n)}))},{displayName:"CreateDatabaseServerAction"}),g=n(467);function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var x=(0,s.observer)(function(e){var t,n=e.getContainer,a=e.setOpen,s=(t=(0,r.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),a.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(c)throw r}}return a}}(t,2)||function(e,t){if(e){if("string"==typeof e)return O(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],l=s[1],p=(0,i.useTranslation)().t;return o().createElement(c.ActionContextProvider,{value:{visible:u,setVisible:l}},o().createElement("span",{style:{width:"50px"},onClick:function(e){e.stopPropagation(),a(!1),l(!0)},title:p("Edit database server")},p("Edit")),o().createElement(c.SchemaComponent,{schema:b,scope:{getContainer:n,useEditDatabaseServer:y.hu,useCancelAction:y.OP,useEditServerProps:function(e){var t,n,o=(0,r.useContext)(P).item,a=(0,c.useRequest)(function(){return Promise.resolve({data:(0,g.cloneDeep)(o)})},(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={manual:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)),i=(0,c.useActionContext)();return(0,r.useEffect)(function(){i.visible&&a.run()},[i.visible]),a},useTestConnectionAction:y.nK,createOnly:!0}}))},{displayName:"EditDatabaseServerAction"});function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(e){n(e);return}c.done?t(s):Promise.resolve(s).then(r,o)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=(0,r.createContext)({options:[],initialOptions:[]}),P=(0,r.createContext)({item:{}}),E=function(e){var t=e.item,n=e.children;return o().createElement(P.Provider,{value:{item:t}},n)},j=(0,s.observer)(function(e){var t=(0,r.useContext)(C),n=t.options,u=t.setOptions,l=t.initialOptions,p=t.refresh,f=w((0,r.useState)(null),2),m=f[0],d=f[1],b=w((0,r.useState)(!1),2),y=b[0],v=b[1],g=(0,i.useTranslation)().t,O=(0,s.useForm)(),S=(0,c.useAPIClient)();(0,r.useEffect)(function(){d(e.value)},[e.value]);var P=function(e){d(e.name),O.setValuesIn("remoteServerName",e.name),O.setValuesIn("remoteTableName",null),v(!1)},j=function(e){var t;a.Modal.confirm({title:g("Are you sure you want to delete it?"),onOk:(t=function(){return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return[4,S.resource("databaseServers").destroy({filterByTk:e.name})];case 1:return t.sent(),a.message.success(g("Saved successfully")),p(),[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(e){A(a,r,o,i,c,"next",e)}function c(e){A(a,r,o,i,c,"throw",e)}i(void 0)})})})};return o().createElement(a.Select,{disabled:e.disabled,allowClear:!0,showSearch:!0,onClear:function(){d(null),O.setValuesIn("remoteServerName",null),O.setValuesIn("remoteTableName",null),v(!1)},value:m,open:y,style:{width:"100%"},onSearch:function(e){u(function(){return l.filter(function(t){return t.description.toLowerCase().indexOf(e.toLowerCase())>=0})})},onDropdownVisibleChange:function(e){return v(e)},dropdownRender:function(){return o().createElement("div",null,n.length>0?o().createElement(a.Menu,null,null==n?void 0:n.map(function(e){return o().createElement(a.Menu.Item,{key:e.name,onClick:function(){return P(e)},style:{margin:"0px",height:"30px",lineHeight:"30px"}},e.description,o().createElement(a.Space,{style:{float:"right",display:"inline-flex",color:"#1677FF"}},o().createElement(E,{item:e},o().createElement(s.RecursionField,{name:"edit-server",schema:{name:"edit-server","x-component":x,type:"void",title:'{{ t("Edit database server") }}',"x-component-props":{setOpen:v}}})),o().createElement(a.Divider,{type:"vertical"}),o().createElement("span",{style:{cursor:"pointer"},onClick:function(t){t.stopPropagation(),j(e)}},g("Delete"))))})):o().createElement(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE}),o().createElement(a.Divider,{style:{margin:"8px 0"}}),o().createElement(a.Space,{style:{padding:"0 8px 4px"}},o().createElement(s.RecursionField,{name:"create-server",schema:{name:"create-server","x-component":h,type:"void",title:'{{ t("Create database server") }}',"x-component-props":{setOpen:v,handleDataServerChange:P}}})))},fieldNames:{value:"name",label:"description"},options:n})},{displayName:"DatabaseServerSelect"}),D=function(e){var t=w((0,r.useState)([]),2),n=t[0],a=t[1],i=(0,c.useAPIClient)(),s=(0,r.useRef)(),u=function(){i.resource("databaseServers").list().then(function(e){var t=e.data;s.current=null==t?void 0:t.data,a(null==t?void 0:t.data)})};return(0,r.useEffect)(function(){try{u()}catch(e){console.log(e)}},[]),o().createElement(C.Provider,{value:{options:n,setOptions:a,refresh:u,initialOptions:s.current}},o().createElement(c.FormItem,null,e.children))}},397:function(e,t,n){n.d(t,{OP:function(){return y},hu:function(){return v},jZ:function(){return d},nK:function(){return b}});var r=n(505),o=n(721),a=n(156),i=n(238),c=n(772),s=n(753),u=n(784);function l(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(e){n(e);return}c.done?t(s):Promise.resolve(s).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){l(a,r,o,i,c,"next",e)}function c(e){l(a,r,o,i,c,"throw",e)}i(void 0)})}}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function m(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var d=function(e){var t=(0,r.useForm)(),n=(0,c.useActionContext)(),u=(0,a.useContext)(s.DatabaseServerContext),l=u.options,d=u.setOptions,b=(0,c.useAPIClient)(),y=(0,i.useTranslation)().t,v=(0,r.useField)();return v.data=v.data||{},{run:function(){return p(function(){var r,a,i;return m(this,function(c){switch(c.label){case 0:return[4,t.submit()];case 1:c.sent(),c.label=2;case 2:return c.trys.push([2,5,,6]),v.data.loading=!0,[4,b.resource("databaseServers").create({values:f({},t.values)})];case 3:return r=c.sent().data,v.data.loading=!1,n.setVisible(!1),[4,t.reset()];case 4:return c.sent(),(a=l.concat()).push(null==r?void 0:r.data),null==e||e(null==r?void 0:r.data),d(a),o.message.success(y("Saved successfully")),[3,6];case 5:return i=c.sent(),v.data.loading=!1,console.log(i),[3,6];case 6:return[2]}})})()}}},b=function(){var e=(0,r.useForm)(),t=(0,c.useAPIClient)(),n=(0,i.useTranslation)().t,a=(0,r.useField)();return a.data=a.data||{},{run:function(){return p(function(){var r;return m(this,function(i){switch(i.label){case 0:return[4,e.submit()];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),a.data.loading=!0,[4,t.resource("databaseServers").testConnection({values:f({},e.values)})];case 3:return i.sent(),a.data.loading=!1,o.message.success(n("Connection successful",{ns:u.A})),[3,5];case 4:return r=i.sent(),a.data.loading=!1,console.log(r),[3,5];case 5:return[2]}})})()}}},y=function(){var e=(0,r.useForm)(),t=(0,c.useActionContext)();return{run:function(){return p(function(){return m(this,function(n){return t.setVisible(!1),e.reset(),[2]})})()}}},v=function(){var e=(0,r.useForm)(),t=(0,c.useActionContext)(),n=(0,a.useContext)(s.DatabaseServerContext).refresh,o=(0,c.useAPIClient)();return{run:function(){return p(function(){return m(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,5,,6]),[4,o.resource("databaseServers").update({filterByTk:e.values.name,values:f({},e.values)})];case 3:return r.sent(),t.setVisible(!1),[4,e.reset()];case 4:return r.sent(),n(),[3,6];case 5:return console.log(r.sent()),[3,6];case 6:return[2]}})})()}}}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const CreateDatabaseServerAction: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React, { Dispatch, SetStateAction } from 'react';
10
+ export declare const DatabaseServerContext: React.Context<{
11
+ options: any[];
12
+ setOptions?: Dispatch<SetStateAction<any>>;
13
+ refresh?: Function;
14
+ initialOptions: any[];
15
+ }>;
16
+ export declare const ServerContext: React.Context<{
17
+ item: object;
18
+ }>;
19
+ export declare const DatabaseServerSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
20
+ export declare const DatabaseServerSelectProvider: (props: any) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const EditDatabaseServerAction: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const PreviewFields: React.MemoExoticComponent<(props: any) => React.JSX.Element>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const PreviewTable: (props: any) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const RemoteTableSelect: React.MemoExoticComponent<(props: any) => React.JSX.Element>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const SyncFieldsAction: (props: any) => React.JSX.Element;
11
+ export declare const SyncFieldsActionCom: (props: any) => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This program is offered under a commercial license.
7
+ * For more information, see <https://www.nocobase.com/agreement>
8
+ */
9
+ import React from 'react';
10
+ export declare const UnSupportFields: ({ dataSource }: {
11
+ dataSource: any;
12
+ }) => React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /**
10
+ * This file is part of the NocoBase (R) project.
11
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
12
+ * Authors: NocoBase Team.
13
+ *
14
+ * This program is offered under a commercial license.
15
+ * For more information, see <https://www.nocobase.com/agreement>
16
+ */
17
+ import { ISchema } from '@formily/react';
18
+ export declare const createDatabaseServerSchema: ISchema;
19
+ export declare const editDatabaseServerSchema: ISchema;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_collection_fdw=self.webpackChunk_nocobase_plugin_collection_fdw||[]).push([["321"],{12:function(e,t,n){n.r(t),n.d(t,{RemoteTableSelect:function(){return s}});var r=n(156),o=n.n(r),a=n(721),l=n(505),u=n(772);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,u=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(u)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s=(0,r.memo)(function(e){var t=e.remoteServerName,n=e.onChange,c=e.disabled,s=i((0,r.useState)([]),2),f=s[0],b=s[1],m=i((0,r.useState)(e.value),2),p=m[0],y=m[1],d=i((0,r.useState)(!1),2),v=d[0],h=d[1],O=(0,u.useAPIClient)(),g=(0,l.useForm)();return(0,r.useEffect)(function(){try{t?(h(!0),O.resource("databaseServers/".concat(t,"/tables")).list().then(function(t){var n=t.data;b(null==n?void 0:n.data.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},f),n={customLabel:e.schema?"".concat(e.schema,".").concat(e.name):e.name},n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})),y(e.value),h(!1)})):(b([]),g.setValuesIn("remoteTableName",null),null==n||n(null),y(null))}catch(e){console.log(e)}},[t]),o().createElement(a.Select,{virtual:!0,disabled:c,showSearch:!0,optionFilterProp:"customLabel",filterOption:function(e,t){return t.customLabel.toLowerCase().indexOf(e.toLowerCase())>=0},notFoundContent:v?o().createElement(a.Spin,null):o().createElement(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE}),options:f,value:p,onChange:function(e){if(e){var t=e.includes(".")?e.split("."):[null,e];g.setValuesIn("remoteTableName",e),g.setValuesIn("remoteTableInfo",{tableName:t[1],schema:t[0]}),null==n||n(e),y(e)}else g.setValuesIn("remoteTableName",null),g.setValuesIn("remoteTableInfo",{})},fieldNames:{label:"customLabel",value:"customLabel"},style:{width:"100%"}})})}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_collection_fdw=self.webpackChunk_nocobase_plugin_collection_fdw||[]).push([["573"],{95:function(e,t,n){n.r(t),n.d(t,{PreviewFields:function(){return g}});var r=n(505),l=n(467),a=n(632),i=n(721),u=n(156),o=n.n(u),c=n(238),d=n(563),m=n(772),s=n(784),f=function(e){var t=e.dataSource,n=(0,c.useTranslation)().t,r=[{title:n("Field name"),dataIndex:"name",key:"name"},{title:n("Field database type",{ns:s.A}),dataIndex:"rawType",key:"rawType"}];return(null==t?void 0:t.length)>0&&o().createElement(o().Fragment,null,o().createElement(i.Divider,{plain:!0,orientation:"left",orientationMargin:"0"},o().createElement("h3",null,n("Unknown field type",{ns:s.A}))),o().createElement("div",{style:{marginBottom:"15px"}},n("The following field types are not compatible and do not support output and display",{ns:s.A})),o().createElement(i.Table,{columns:r,dataSource:t,pagination:!1}))};function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],i=!0,u=!1;try{for(l=l.call(e);!(i=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(u)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(e,t){var n=[];return e.forEach(function(e){var r=e.children.filter(function(e){var n;return null==e||null==(n=e.availableTypes)?void 0:n.includes(t)});n.push({label:e.label,key:e.key,children:r})}),n.filter(function(e){var t;return(null==(t=e.children)?void 0:t.length)>0})},g=o().memo(function(e){var t=e.remoteServerName,n=e.remoteTableName,s=(0,u.useContext)(m.ResourceActionContext).data,p=(0,m.useAPIClient)(),g=(0,c.useTranslation)().t,S=b((0,u.useState)(!1),2),w=S[0],E=S[1],O=b((0,u.useState)([]),2),k=O[0],F=O[1],T=b((0,u.useState)([]),2),j=T[0],N=T[1],x=(0,r.useForm)(),I=(0,u.useMemo)(function(){return(0,d.createForm)({effects:function(){(0,d.onFieldValidateFailed)("*",function(){x.query("fields").take(function(e){e.setFeedback({type:"error",messages:["display name is required"]})})}),(0,d.onFieldValidateSuccess)("*",function(){I.valid&&x.query("fields").take(function(e){e.setFeedback({type:"error",messages:[]})})})}})},[]),P=(0,r.useField)(),C=(0,m.useCollectionManager_deprecated)().getInterface,A=(0,m.useCompile)(),q=(0,m.useFieldInterfaceOptions)().filter(function(e){return!["relation"].includes(e.key)});(0,u.useEffect)(function(){t&&n?(E(!0),p.resource("databaseServers/".concat(t,"/tables")).get({filterByTk:n}).then(function(e){var t=e.data;if(t){E(!1),F([]);var n,r,a=null==(n=Object.values(null==t||null==(r=t.data)?void 0:r.fields))?void 0:n.map(function(e){var t=(null==s?void 0:s.data.find(function(t){return t.name===e.name&&t.type===e.type}))||e;return v(y({},t),{uiSchema:(0,l.omit)(null==t?void 0:t.uiSchema,"rawTitle"),allowNull:e.allowNull,primaryKey:e.primaryKey,unique:e.unique})}).map(function(e){var t;return v(y({},e),{uiSchema:{title:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,required:!e.allowNull}})});P.value=a,setTimeout(function(){var e;F(a),N(null==t||null==(e=t.data)?void 0:e.unsupportedFields)})}}).catch):(F([]),P.value=[])},[n,t]);var _=function(e,t){var n=y({},k[t],e);k.splice(t,1,n),F(k),P.value=k},D=function(e){var t,n,r,l=e.item,a=e.index,c=h(q,l.type),d=null==c||null==(r=c[0])||null==(n=r.children)||null==(t=n[0])?void 0:t.name;return(0,u.useEffect)(function(){if(!l.interface){var e,t,n=C(d);_({interface:d,uiSchema:v(y({title:null==l||null==(e=l.uiSchema)?void 0:e.title},null==n||null==(t=n.default)?void 0:t.uiSchema),{required:!l.allowNull})},a)}},[]),o().createElement(i.Select,{defaultValue:l.interface||d,style:{width:"100%"},popupMatchSelectWidth:!1,onChange:function(e){var t,n=C(e);_({interface:e,uiSchema:v(y({},null==n||null==(t=n.default)?void 0:t.uiSchema),{required:!l.allowNull})},a)}},c.map(function(e){return o().createElement(i.Select.OptGroup,{key:e.key,label:A(e.label)},e.children.map(function(e){return o().createElement(i.Select.Option,{key:e.value,value:e.name},A(e.label))}))}))},M=[{title:g("Name"),dataIndex:"name",key:"name",width:130},{title:g("Type"),dataIndex:"type",width:140,key:"type",render:function(e,t,n){var r=k[n];return(null==r?void 0:r.possibleTypes)?o().createElement(i.Select,{defaultValue:e,popupMatchSelectWidth:!1,style:{width:"100%"},options:(null==r?void 0:r.possibleTypes.map(function(e){return{label:e,value:e}}))||[],onChange:function(e){return _({type:e},n)}}):e&&o().createElement(i.Tag,null,e)}},{title:g("Interface"),dataIndex:"interface",key:"interface",width:150,render:function(e,t,n){var r=k[n];return r.source?e:o().createElement(D,{item:r,index:n})}},{title:g("Display name"),dataIndex:"title",key:"title",width:180,render:function(e,t,n){var u,c=k[n];return o().createElement(r.Field,{name:"".concat(t.name),required:!0,decorator:[a.FormItem,{feedbackLayout:"terse",style:{marginBottom:"0px"}}],component:[i.Input,{defaultValue:(null==c||null==(u=c.uiSchema)?void 0:u.title)||e,onChange:function(e){return _({uiSchema:v(y({},(0,l.omit)(null==c?void 0:c.uiSchema,"rawTitle")),{title:e.target.value})},n)}}]})}}];return o().createElement(i.Spin,{spinning:w},k.length>0&&o().createElement(o().Fragment,null,o().createElement("div",{className:"ant-formily-item-label",style:{display:"flex",padding:"0 0 8px"}},o().createElement("div",{className:"ant-formily-item-label-content"},o().createElement("span",null,o().createElement("label",null,g("Fields")))),o().createElement("span",{className:"ant-formily-item-colon"},":")),o().createElement(r.FormProvider,{form:I},o().createElement(i.Table,{bordered:!0,size:"middle",columns:M,dataSource:k,scroll:{y:300},pagination:!1,rowClassName:"editable-row",key:t}))),o().createElement(f,{dataSource:j}))},function(e,t){return t.remoteServerName===e.remoteServerName&&t.remoteTableName===e.remoteTableName});g.displayName="PreviewFields"}}]);