ingestron 0.17.8 → 1.0.0

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 (273) hide show
  1. package/NOTICE +3 -5
  2. package/README.md +26 -74
  3. package/THIRD_PARTY_NOTICES +148 -0
  4. package/dist/main.js +29188 -0
  5. package/package.json +32 -65
  6. package/project-recipes/adf/connections/adls-gen2.yaml +7 -0
  7. package/project-recipes/adf/connections/amazon-rds-oracle.yaml +9 -0
  8. package/project-recipes/adf/connections/amazon-rds-sqlserver.yaml +9 -0
  9. package/project-recipes/adf/connections/amazon-redshift.yaml +10 -0
  10. package/project-recipes/adf/connections/amazon-s3.yaml +8 -0
  11. package/project-recipes/adf/connections/azure-blob.yaml +7 -0
  12. package/project-recipes/adf/connections/azure-cosmos-db-mongodb.yaml +8 -0
  13. package/project-recipes/adf/connections/azure-cosmos-db-nosql.yaml +8 -0
  14. package/project-recipes/adf/connections/azure-cosmos-postgresql.yaml +10 -0
  15. package/project-recipes/adf/connections/azure-data-explorer.yaml +8 -0
  16. package/project-recipes/adf/connections/azure-databricks-delta.yaml +9 -0
  17. package/project-recipes/adf/connections/azure-files.yaml +8 -0
  18. package/project-recipes/adf/connections/azure-mysql.yaml +7 -0
  19. package/project-recipes/adf/connections/azure-postgresql.yaml +10 -0
  20. package/project-recipes/adf/connections/azure-sql-database.yaml +9 -0
  21. package/project-recipes/adf/connections/azure-sql-managed-instance.yaml +9 -0
  22. package/project-recipes/adf/connections/azure-synapse.yaml +9 -0
  23. package/project-recipes/adf/connections/azure-table-storage.yaml +7 -0
  24. package/project-recipes/adf/connections/cassandra.yaml +9 -0
  25. package/project-recipes/adf/connections/dataverse.yaml +9 -0
  26. package/project-recipes/adf/connections/db2.yaml +7 -0
  27. package/project-recipes/adf/connections/dynamics-365.yaml +9 -0
  28. package/project-recipes/adf/connections/dynamics-ax.yaml +11 -0
  29. package/project-recipes/adf/connections/dynamics-crm.yaml +9 -0
  30. package/project-recipes/adf/connections/fabric-lakehouse.yaml +8 -0
  31. package/project-recipes/adf/connections/fabric-warehouse.yaml +9 -0
  32. package/project-recipes/adf/connections/files.yaml +9 -0
  33. package/project-recipes/adf/connections/ftp.yaml +9 -0
  34. package/project-recipes/adf/connections/google-ads.yaml +12 -0
  35. package/project-recipes/adf/connections/google-bigquery.yaml +8 -0
  36. package/project-recipes/adf/connections/google-cloud-storage.yaml +8 -0
  37. package/project-recipes/adf/connections/greenplum.yaml +10 -0
  38. package/project-recipes/adf/connections/hdfs.yaml +9 -0
  39. package/project-recipes/adf/connections/hive.yaml +11 -0
  40. package/project-recipes/adf/connections/http.yaml +7 -0
  41. package/project-recipes/adf/connections/hubspot.yaml +10 -0
  42. package/project-recipes/adf/connections/impala.yaml +11 -0
  43. package/project-recipes/adf/connections/informix.yaml +9 -0
  44. package/project-recipes/adf/connections/jira.yaml +9 -0
  45. package/project-recipes/adf/connections/mariadb.yaml +10 -0
  46. package/project-recipes/adf/connections/microsoft-365.yaml +10 -0
  47. package/project-recipes/adf/connections/microsoft-access.yaml +9 -0
  48. package/project-recipes/adf/connections/mongodb-atlas.yaml +8 -0
  49. package/project-recipes/adf/connections/mongodb.yaml +8 -0
  50. package/project-recipes/adf/connections/mysql.yaml +10 -0
  51. package/project-recipes/adf/connections/netezza.yaml +11 -0
  52. package/project-recipes/adf/connections/odata.yaml +9 -0
  53. package/project-recipes/adf/connections/odbc.yaml +9 -0
  54. package/project-recipes/adf/connections/oracle-cloud-storage.yaml +9 -0
  55. package/project-recipes/adf/connections/oracle.yaml +9 -0
  56. package/project-recipes/adf/connections/postgresql.yaml +10 -0
  57. package/project-recipes/adf/connections/presto.yaml +11 -0
  58. package/project-recipes/adf/connections/quickbooks.yaml +10 -0
  59. package/project-recipes/adf/connections/rest.yaml +12 -0
  60. package/project-recipes/adf/connections/s3-compatible.yaml +9 -0
  61. package/project-recipes/adf/connections/salesforce-service-cloud.yaml +10 -0
  62. package/project-recipes/adf/connections/salesforce.yaml +10 -0
  63. package/project-recipes/adf/connections/sap-bw-mdx.yaml +11 -0
  64. package/project-recipes/adf/connections/sap-bw-open-hub.yaml +11 -0
  65. package/project-recipes/adf/connections/sap-c4c.yaml +9 -0
  66. package/project-recipes/adf/connections/sap-ecc.yaml +9 -0
  67. package/project-recipes/adf/connections/sap-hana.yaml +7 -0
  68. package/project-recipes/adf/connections/sap-table.yaml +11 -0
  69. package/project-recipes/adf/connections/servicenow.yaml +9 -0
  70. package/project-recipes/adf/connections/sftp.yaml +10 -0
  71. package/project-recipes/adf/connections/sharepoint-online-list.yaml +10 -0
  72. package/project-recipes/adf/connections/shopify.yaml +8 -0
  73. package/project-recipes/adf/connections/snowflake.yaml +11 -0
  74. package/project-recipes/adf/connections/spark.yaml +11 -0
  75. package/project-recipes/adf/connections/sqlserver.yaml +9 -0
  76. package/project-recipes/adf/connections/square.yaml +10 -0
  77. package/project-recipes/adf/connections/sybase.yaml +10 -0
  78. package/project-recipes/adf/connections/teradata.yaml +9 -0
  79. package/project-recipes/adf/connections/vertica.yaml +10 -0
  80. package/project-recipes/adf/connections/web-table.yaml +7 -0
  81. package/project-recipes/adf/connections/xero.yaml +10 -0
  82. package/project-recipes/adf/contracts/records.yaml +12 -0
  83. package/project-recipes/adf/contracts/salesforce-account.yaml +12 -0
  84. package/project-recipes/adf/flows/adls-gen2.yaml +14 -0
  85. package/project-recipes/adf/flows/amazon-rds-oracle.yaml +12 -0
  86. package/project-recipes/adf/flows/amazon-rds-sqlserver.yaml +12 -0
  87. package/project-recipes/adf/flows/amazon-redshift.yaml +12 -0
  88. package/project-recipes/adf/flows/amazon-s3.yaml +14 -0
  89. package/project-recipes/adf/flows/azure-blob.yaml +14 -0
  90. package/project-recipes/adf/flows/azure-cosmos-db-mongodb.yaml +12 -0
  91. package/project-recipes/adf/flows/azure-cosmos-db-nosql.yaml +12 -0
  92. package/project-recipes/adf/flows/azure-cosmos-postgresql.yaml +12 -0
  93. package/project-recipes/adf/flows/azure-data-explorer.yaml +13 -0
  94. package/project-recipes/adf/flows/azure-databricks-delta.yaml +15 -0
  95. package/project-recipes/adf/flows/azure-files.yaml +14 -0
  96. package/project-recipes/adf/flows/azure-mysql.yaml +12 -0
  97. package/project-recipes/adf/flows/azure-postgresql.yaml +12 -0
  98. package/project-recipes/adf/flows/azure-sql-database.yaml +12 -0
  99. package/project-recipes/adf/flows/azure-sql-managed-instance.yaml +12 -0
  100. package/project-recipes/adf/flows/azure-synapse.yaml +12 -0
  101. package/project-recipes/adf/flows/azure-table-storage.yaml +12 -0
  102. package/project-recipes/adf/flows/cassandra.yaml +12 -0
  103. package/project-recipes/adf/flows/dataverse.yaml +12 -0
  104. package/project-recipes/adf/flows/db2.yaml +12 -0
  105. package/project-recipes/adf/flows/dynamics-365.yaml +12 -0
  106. package/project-recipes/adf/flows/dynamics-ax.yaml +12 -0
  107. package/project-recipes/adf/flows/dynamics-crm.yaml +12 -0
  108. package/project-recipes/adf/flows/fabric-lakehouse.yaml +14 -0
  109. package/project-recipes/adf/flows/fabric-warehouse.yaml +14 -0
  110. package/project-recipes/adf/flows/files.yaml +14 -0
  111. package/project-recipes/adf/flows/ftp.yaml +14 -0
  112. package/project-recipes/adf/flows/google-ads.yaml +13 -0
  113. package/project-recipes/adf/flows/google-bigquery.yaml +12 -0
  114. package/project-recipes/adf/flows/google-cloud-storage.yaml +14 -0
  115. package/project-recipes/adf/flows/greenplum.yaml +12 -0
  116. package/project-recipes/adf/flows/hdfs.yaml +14 -0
  117. package/project-recipes/adf/flows/hive.yaml +12 -0
  118. package/project-recipes/adf/flows/http.yaml +18 -0
  119. package/project-recipes/adf/flows/hubspot.yaml +12 -0
  120. package/project-recipes/adf/flows/impala.yaml +12 -0
  121. package/project-recipes/adf/flows/informix.yaml +13 -0
  122. package/project-recipes/adf/flows/jira.yaml +12 -0
  123. package/project-recipes/adf/flows/mariadb.yaml +13 -0
  124. package/project-recipes/adf/flows/microsoft-365.yaml +19 -0
  125. package/project-recipes/adf/flows/microsoft-access.yaml +13 -0
  126. package/project-recipes/adf/flows/mongodb-atlas.yaml +12 -0
  127. package/project-recipes/adf/flows/mongodb.yaml +12 -0
  128. package/project-recipes/adf/flows/mysql.yaml +12 -0
  129. package/project-recipes/adf/flows/netezza.yaml +13 -0
  130. package/project-recipes/adf/flows/odata.yaml +12 -0
  131. package/project-recipes/adf/flows/odbc.yaml +13 -0
  132. package/project-recipes/adf/flows/oracle-cloud-storage.yaml +14 -0
  133. package/project-recipes/adf/flows/oracle.yaml +12 -0
  134. package/project-recipes/adf/flows/postgresql.yaml +18 -0
  135. package/project-recipes/adf/flows/presto.yaml +12 -0
  136. package/project-recipes/adf/flows/quickbooks.yaml +12 -0
  137. package/project-recipes/adf/flows/rest.yaml +21 -0
  138. package/project-recipes/adf/flows/s3-compatible.yaml +14 -0
  139. package/project-recipes/adf/flows/salesforce-service-cloud.yaml +12 -0
  140. package/project-recipes/adf/flows/salesforce.yaml +13 -0
  141. package/project-recipes/adf/flows/sap-bw-mdx.yaml +14 -0
  142. package/project-recipes/adf/flows/sap-bw-open-hub.yaml +13 -0
  143. package/project-recipes/adf/flows/sap-c4c.yaml +12 -0
  144. package/project-recipes/adf/flows/sap-ecc.yaml +13 -0
  145. package/project-recipes/adf/flows/sap-hana.yaml +14 -0
  146. package/project-recipes/adf/flows/sap-table.yaml +13 -0
  147. package/project-recipes/adf/flows/servicenow.yaml +12 -0
  148. package/project-recipes/adf/flows/sftp.yaml +14 -0
  149. package/project-recipes/adf/flows/sharepoint-online-list.yaml +12 -0
  150. package/project-recipes/adf/flows/shopify.yaml +12 -0
  151. package/project-recipes/adf/flows/snowflake.yaml +15 -0
  152. package/project-recipes/adf/flows/spark.yaml +12 -0
  153. package/project-recipes/adf/flows/sqlserver.yaml +12 -0
  154. package/project-recipes/adf/flows/square.yaml +13 -0
  155. package/project-recipes/adf/flows/sybase.yaml +13 -0
  156. package/project-recipes/adf/flows/teradata.yaml +12 -0
  157. package/project-recipes/adf/flows/vertica.yaml +12 -0
  158. package/project-recipes/adf/flows/web-table.yaml +14 -0
  159. package/project-recipes/adf/flows/xero.yaml +12 -0
  160. package/project-recipes/adf/platform.yaml +29 -0
  161. package/project-recipes/adf/project.yaml +10 -0
  162. package/project-recipes/adf/sample.yaml +3 -0
  163. package/project-recipes/adf/standard.yaml +15 -0
  164. package/project-templates/kafka/README.md +12 -0
  165. package/project-templates/kafka/connections/events.yaml +8 -0
  166. package/project-templates/kafka/contracts/page_views.yaml +13 -0
  167. package/project-templates/kafka/contracts/purchases.yaml +13 -0
  168. package/project-templates/kafka/flows/events.yaml +10 -0
  169. package/project-templates/kafka/project.yaml +10 -0
  170. package/project-templates/kafka/standard.yaml +4 -0
  171. package/project-templates/kafka/template.yaml +3 -0
  172. package/project-templates/minimal/README.md +10 -0
  173. package/project-templates/minimal/connections/shop.yaml +7 -0
  174. package/project-templates/minimal/contracts/orders.yaml +14 -0
  175. package/project-templates/minimal/flows/orders.yaml +6 -0
  176. package/project-templates/minimal/project.yaml +11 -0
  177. package/project-templates/minimal/standard.yaml +4 -0
  178. package/project-templates/minimal/template.yaml +7 -0
  179. package/project-templates/private-files/README.md +29 -0
  180. package/project-templates/private-files/connections/share.yaml +10 -0
  181. package/project-templates/private-files/contracts/sales.yaml +14 -0
  182. package/project-templates/private-files/contracts/stock.yaml +14 -0
  183. package/project-templates/private-files/flows/stores.yaml +9 -0
  184. package/project-templates/private-files/platform.yaml +11 -0
  185. package/project-templates/private-files/project.yaml +19 -0
  186. package/project-templates/private-files/standard.yaml +11 -0
  187. package/project-templates/private-files/template.yaml +10 -0
  188. package/project-templates/private-sql-server/README.md +25 -0
  189. package/project-templates/private-sql-server/connections/erp.yaml +10 -0
  190. package/project-templates/private-sql-server/contracts/customers.yaml +14 -0
  191. package/project-templates/private-sql-server/contracts/invoices.yaml +15 -0
  192. package/project-templates/private-sql-server/flows/erp.yaml +13 -0
  193. package/project-templates/private-sql-server/platform.yaml +11 -0
  194. package/project-templates/private-sql-server/project.yaml +19 -0
  195. package/project-templates/private-sql-server/standard.yaml +17 -0
  196. package/project-templates/private-sql-server/template.yaml +10 -0
  197. package/project-templates/pyspark/README.md +12 -0
  198. package/project-templates/pyspark/connections/billing.yaml +7 -0
  199. package/project-templates/pyspark/contracts/invoices.yaml +16 -0
  200. package/project-templates/pyspark/contracts/monthly_revenue.yaml +14 -0
  201. package/project-templates/pyspark/flows/billing.yaml +6 -0
  202. package/project-templates/pyspark/project.yaml +11 -0
  203. package/project-templates/pyspark/standard.yaml +4 -0
  204. package/project-templates/pyspark/template.yaml +3 -0
  205. package/project-templates/pyspark/transforms/monthly_revenue.py +10 -0
  206. package/project-templates/pyspark/transforms/monthly_revenue.yaml +10 -0
  207. package/project-templates/retail/README.md +22 -0
  208. package/project-templates/retail/connections/shop.yaml +8 -0
  209. package/project-templates/retail/contracts/customers.yaml +12 -0
  210. package/project-templates/retail/contracts/daily_sales.yaml +19 -0
  211. package/project-templates/retail/contracts/orders.yaml +16 -0
  212. package/project-templates/retail/flows/shop.yaml +18 -0
  213. package/project-templates/retail/platform.yaml +21 -0
  214. package/project-templates/retail/project.yaml +18 -0
  215. package/project-templates/retail/standard.yaml +15 -0
  216. package/project-templates/retail/template.yaml +10 -0
  217. package/project-templates/retail/transforms/daily_sales.sql +7 -0
  218. package/project-templates/retail/transforms/daily_sales.yaml +7 -0
  219. package/project-templates/salesforce/README.md +6 -0
  220. package/project-templates/salesforce/connections/salesforce.yaml +7 -0
  221. package/project-templates/salesforce/contracts/accounts.yaml +13 -0
  222. package/project-templates/salesforce/contracts/opportunities.yaml +14 -0
  223. package/project-templates/salesforce/flows/salesforce.yaml +7 -0
  224. package/project-templates/salesforce/project.yaml +9 -0
  225. package/project-templates/salesforce/standard.yaml +4 -0
  226. package/project-templates/salesforce/template.yaml +3 -0
  227. package/project-templates/sql-server/README.md +17 -0
  228. package/project-templates/sql-server/connections/erp.yaml +8 -0
  229. package/project-templates/sql-server/contracts/customer_balances.yaml +13 -0
  230. package/project-templates/sql-server/contracts/customers.yaml +13 -0
  231. package/project-templates/sql-server/contracts/invoices.yaml +14 -0
  232. package/project-templates/sql-server/flows/erp.yaml +13 -0
  233. package/project-templates/sql-server/platform.yaml +6 -0
  234. package/project-templates/sql-server/project.yaml +13 -0
  235. package/project-templates/sql-server/standard.yaml +9 -0
  236. package/project-templates/sql-server/template.yaml +3 -0
  237. package/project-templates/sql-server/transforms/customer_balances.sql +5 -0
  238. package/project-templates/sql-server/transforms/customer_balances.yaml +6 -0
  239. package/schemas/NOTICE.md +7 -0
  240. package/schemas/connection.schema.yaml +37 -0
  241. package/schemas/flow.schema.yaml +124 -0
  242. package/schemas/odcs-v3.1.0.schema.json +2808 -0
  243. package/schemas/platform.schema.yaml +260 -0
  244. package/schemas/standard.schema.yaml +211 -0
  245. package/schemas/transform.schema.yaml +108 -0
  246. package/templates/apply-contract.py.liquid +58 -0
  247. package/templates/change-data.sql.liquid +20 -0
  248. package/templates/materialised-view.py.liquid +28 -0
  249. package/templates/materialised-view.sql.liquid +4 -0
  250. package/templates/read-files.liquid +7 -0
  251. package/templates/streaming-table.sql.liquid +3 -0
  252. package/templates/table.liquid +17 -0
  253. package/CHANGELOG.md +0 -162
  254. package/SECURITY.md +0 -32
  255. package/THIRD_PARTY_NOTICES.md +0 -3678
  256. package/build/cli/cli/index.d.ts +0 -2
  257. package/build/cli/cli/index.js +0 -685
  258. package/build/cli/cli/operation-worker.d.ts +0 -1
  259. package/build/cli/cli/operation-worker.js +0 -5
  260. package/build/cli/cli/output.d.ts +0 -3
  261. package/build/cli/cli/output.js +0 -246
  262. package/build/cli/cli/plugin-browser.d.ts +0 -14
  263. package/build/cli/cli/plugin-browser.js +0 -74
  264. package/build/cli/cli/plugin-resolution.d.ts +0 -126
  265. package/build/cli/cli/plugin-resolution.js +0 -270
  266. package/build/cli/cli/presentation.d.ts +0 -12
  267. package/build/cli/cli/presentation.js +0 -57
  268. package/build/cli/cli/workflow-commands.d.ts +0 -15
  269. package/build/cli/cli/workflow-commands.js +0 -430
  270. package/build/cli/mcp/index.d.ts +0 -3
  271. package/build/cli/mcp/index.js +0 -67
  272. package/build/cli/version.d.ts +0 -2
  273. package/build/cli/version.js +0 -14
@@ -1,270 +0,0 @@
1
- /** Official-name convenience at the adapter boundary; core only receives exact references. */
2
- import { executeAsync, operationSchemas, } from "@ingestron/core";
3
- import { check, packageLock, Problem } from "@ingestron/core/adapter";
4
- import { coreVersion } from "../version.js";
5
- export const officialPlugins = {
6
- adf: {
7
- kind: "provider",
8
- repository: "ingestron/provider-adf",
9
- path: "plugin/provider.yaml",
10
- tagPrefix: "",
11
- },
12
- "azure-blob": {
13
- kind: "connector",
14
- repository: "ingestron/connectors",
15
- path: "connectors/azure-blob/connector.yaml",
16
- tagPrefix: "azure-blob-",
17
- },
18
- databricks: {
19
- kind: "provider",
20
- repository: "ingestron/provider-databricks",
21
- path: "plugin/provider.yaml",
22
- tagPrefix: "",
23
- },
24
- files: {
25
- kind: "connector",
26
- repository: "ingestron/connectors",
27
- path: "connectors/files/connector.yaml",
28
- tagPrefix: "files-",
29
- },
30
- gcs: {
31
- kind: "connector",
32
- repository: "ingestron/connectors",
33
- path: "connectors/gcs/connector.yaml",
34
- tagPrefix: "gcs-",
35
- },
36
- github: {
37
- kind: "connector",
38
- repository: "ingestron/connectors",
39
- path: "connectors/github/connector.yaml",
40
- tagPrefix: "github-",
41
- },
42
- hubspot: {
43
- kind: "connector",
44
- repository: "ingestron/connectors",
45
- path: "connectors/hubspot/connector.yaml",
46
- tagPrefix: "hubspot-",
47
- },
48
- jira: {
49
- kind: "connector",
50
- repository: "ingestron/connectors",
51
- path: "connectors/jira/connector.yaml",
52
- tagPrefix: "jira-",
53
- },
54
- local: {
55
- kind: "provider",
56
- repository: "ingestron/provider-local",
57
- path: "plugin/provider.yaml",
58
- tagPrefix: "",
59
- },
60
- mysql: {
61
- kind: "connector",
62
- repository: "ingestron/connectors",
63
- path: "connectors/mysql/connector.yaml",
64
- tagPrefix: "mysql-",
65
- },
66
- onedrive: {
67
- kind: "connector",
68
- repository: "ingestron/connectors",
69
- path: "connectors/onedrive/connector.yaml",
70
- tagPrefix: "onedrive-",
71
- },
72
- oracle: {
73
- kind: "connector",
74
- repository: "ingestron/connectors",
75
- path: "connectors/oracle/connector.yaml",
76
- tagPrefix: "oracle-",
77
- },
78
- postgresql: {
79
- kind: "connector",
80
- repository: "ingestron/connectors",
81
- path: "connectors/postgresql/connector.yaml",
82
- tagPrefix: "postgresql-",
83
- },
84
- s3: {
85
- kind: "connector",
86
- repository: "ingestron/connectors",
87
- path: "connectors/s3/connector.yaml",
88
- tagPrefix: "s3-",
89
- },
90
- salesforce: {
91
- kind: "connector",
92
- repository: "ingestron/connectors",
93
- path: "connectors/salesforce/connector.yaml",
94
- tagPrefix: "salesforce-",
95
- },
96
- sftp: {
97
- kind: "connector",
98
- repository: "ingestron/connectors",
99
- path: "connectors/sftp/connector.yaml",
100
- tagPrefix: "sftp-",
101
- },
102
- sharepoint: {
103
- kind: "connector",
104
- repository: "ingestron/connectors",
105
- path: "connectors/sharepoint/connector.yaml",
106
- tagPrefix: "sharepoint-",
107
- },
108
- "sql-server": {
109
- kind: "connector",
110
- repository: "ingestron/connectors",
111
- path: "connectors/sql-server/connector.yaml",
112
- tagPrefix: "sql-server-",
113
- },
114
- stripe: {
115
- kind: "connector",
116
- repository: "ingestron/connectors",
117
- path: "connectors/stripe/connector.yaml",
118
- tagPrefix: "stripe-",
119
- },
120
- };
121
- const catalogueUrl = "https://raw.githubusercontent.com/ingestron/connectors/main/catalogue.json";
122
- const stable = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
123
- const compare = (a, b) => {
124
- const x = a.split(".").map(Number), y = b.split(".").map(Number);
125
- return y[0] - x[0] || y[1] - x[1] || y[2] - x[2];
126
- };
127
- export function officialName(reference) {
128
- if (reference.includes("/"))
129
- return undefined;
130
- const [name, version, extra] = reference.split("@");
131
- check(Object.hasOwn(officialPlugins, name), "PACKAGE", `Unknown official plugin '${name}'. Use ${Object.keys(officialPlugins).join(", ")}, or an explicit owner/repository reference. Check ingestron --version and update the CLI if a documented name is missing.`);
132
- check(extra === undefined &&
133
- (version === undefined || version === "latest" || stable.test(version)), "PACKAGE", "Use a stable version, @latest, or omit the version for an official plugin");
134
- return { name: name, version };
135
- }
136
- export function catalogueReleases(value, name, host = coreVersion) {
137
- const identity = officialPlugins[name];
138
- check(value?.apiVersion === "ingestron.catalogue/v1", "CATALOGUE", "Unsupported official catalogue format");
139
- const entry = value.plugins?.[name];
140
- check(entry &&
141
- entry.repository === identity.repository &&
142
- entry.path === identity.path &&
143
- entry.tagPrefix === identity.tagPrefix &&
144
- Array.isArray(entry.releases) &&
145
- entry.releases.length <= 1000, "CATALOGUE", `Invalid official catalogue identity for ${name}`);
146
- const seen = new Set();
147
- for (const release of entry.releases) {
148
- check(stable.test(release.version) &&
149
- !seen.has(release.version) &&
150
- Array.isArray(release.coreVersions) &&
151
- release.coreVersions.length > 0 &&
152
- release.coreVersions.every((v) => typeof v === "string" && stable.test(v)), "CATALOGUE", `Invalid qualified release for ${name}`);
153
- seen.add(release.version);
154
- }
155
- return entry.releases
156
- .filter((r) => r.coreVersions.includes(host))
157
- .map((r) => r.version)
158
- .sort(compare);
159
- }
160
- export async function fetchCatalogue() {
161
- try {
162
- const response = await fetch(catalogueUrl, {
163
- signal: AbortSignal.timeout(10000),
164
- redirect: "error",
165
- });
166
- check(response.ok && response.body, "CATALOGUE", "Official catalogue is unavailable; retry or install an explicit version");
167
- const reader = response.body.getReader();
168
- const chunks = [];
169
- let size = 0;
170
- try {
171
- for (;;) {
172
- const { value, done } = await reader.read();
173
- if (done)
174
- break;
175
- size += value.length;
176
- check(size <= 262144, "CATALOGUE", "Official catalogue exceeds the size limit");
177
- chunks.push(value);
178
- }
179
- }
180
- finally {
181
- await reader.cancel();
182
- }
183
- return JSON.parse(Buffer.concat(chunks).toString("utf8"));
184
- }
185
- catch (error) {
186
- if (error instanceof Problem)
187
- throw error;
188
- throw new Problem("CATALOGUE", "Cannot read the official catalogue; retry or install an explicit version");
189
- }
190
- }
191
- export async function resolvePluginArgs(context, operation, args, catalogue = fetchCatalogue) {
192
- if (operation !== "packages_install" && operation !== "plugin_versions")
193
- return args;
194
- const field = operation === "packages_install" ? "reference" : "provider";
195
- const alias = officialName(args[field]);
196
- if (!alias)
197
- return args;
198
- const identity = officialPlugins[alias.name];
199
- if (operation === "packages_install" && args.kind)
200
- check(args.kind === identity.kind, "PACKAGE", `${alias.name} is a ${identity.kind}; use ingestron ${identity.kind} install ${alias.name}`);
201
- check(args.tagPrefix === undefined || args.tagPrefix === identity.tagPrefix, "OPTION", "Official plugin tag prefixes cannot be overridden; use an explicit reference for custom tags");
202
- if (operation === "plugin_versions")
203
- return {
204
- ...args,
205
- provider: identity.repository,
206
- tagPrefix: identity.tagPrefix,
207
- };
208
- // Check permissions before catalogue network access, just as core does before install.
209
- check(context.allowWrite, "PERMISSION", "Package installation requires write access");
210
- check(!(args.update && args.frozen), "PACKAGE", "Frozen installation cannot update packages");
211
- const base = `${identity.repository}/${identity.path}@`;
212
- let version = alias.version;
213
- if (version === undefined || version === "latest") {
214
- const installed = Object.keys(packageLock(context.root).packages)
215
- .filter((r) => r.startsWith(base) && stable.test(r.slice(base.length)))
216
- .map((r) => r.slice(base.length))
217
- .sort(compare);
218
- if (!args.update && installed.length)
219
- version = installed[0];
220
- else {
221
- check(!args.frozen, "PACKAGE", "Frozen installation requires an existing exact lock; install an exact version first");
222
- check(context.allowNetwork, "PERMISSION", "Latest plugin resolution requires explicit package-network access");
223
- check(!args.fromGit, "OPTION", "Use an exact version with --from-git; latest selects official qualified releases");
224
- const versions = catalogueReleases(await catalogue(), alias.name);
225
- check(versions.length, "COMPATIBILITY", `No qualified ${alias.name} release supports core ${coreVersion}; update the CLI or select an explicitly compatible version`);
226
- version = [...versions, ...installed].sort(compare)[0];
227
- }
228
- }
229
- // Even 'update' must never retarget an existing immutable version lock.
230
- return {
231
- ...args,
232
- reference: `${base}${version}`,
233
- tagPrefix: identity.tagPrefix,
234
- update: false,
235
- };
236
- }
237
- export async function executePluginOperation(context, operation, args = {}) {
238
- try {
239
- if (operation === "packages_install" || operation === "plugin_versions") {
240
- const parsed = operationSchemas[operation].safeParse(args);
241
- check(parsed.success, "SCHEMA", "Invalid plugin operation arguments");
242
- if (operation === "packages_install")
243
- check(context.allowWrite, "PERMISSION", "Package installation requires write access");
244
- check(context.allowNetwork || parsed.data?.fromGit, "PERMISSION", "Package access requires explicit package-network access");
245
- args = await resolvePluginArgs(context, operation, parsed.data);
246
- }
247
- const result = await executeAsync(context, operation, args);
248
- // Keep custom manifest paths in every returned installable reference.
249
- if (operation === "plugin_versions" && result.ok) {
250
- const identity = Object.values(officialPlugins).find((p) => p.repository === args.provider && p.tagPrefix === args.tagPrefix);
251
- if (identity)
252
- result.result.versions = result.result.versions.map((v) => ({
253
- ...v,
254
- reference: `${identity.repository}/${identity.path}@${v.version}`,
255
- }));
256
- }
257
- return result;
258
- }
259
- catch (error) {
260
- const e = error instanceof Problem
261
- ? error
262
- : new Problem("PACKAGE", "Plugin resolution failed; check the reference and catalogue");
263
- return {
264
- apiVersion: "ingestron.operation/v1",
265
- operation,
266
- ok: false,
267
- diagnostics: [{ code: e.code, message: e.message }],
268
- };
269
- }
270
- }
@@ -1,12 +0,0 @@
1
- import type { Context, OperationName, Result } from "@ingestron/core";
2
- export interface Presentation {
3
- tty: boolean;
4
- plain?: boolean;
5
- colour?: boolean;
6
- progress?: boolean;
7
- json?: boolean;
8
- }
9
- export declare function richTerminal(options: Presentation, env?: NodeJS.ProcessEnv): boolean;
10
- export declare function decorate(text: string, ok: boolean, options: Presentation): string;
11
- export declare function banner(text: string, options: Presentation): string;
12
- export declare function backgroundOperation(context: Context, operation: OperationName, args: unknown, label: string, options: Presentation): Promise<Result>;
@@ -1,57 +0,0 @@
1
- import { Worker } from "node:worker_threads";
2
- export function richTerminal(options, env = process.env) {
3
- return (options.tty &&
4
- !options.json &&
5
- !options.plain &&
6
- options.colour !== false &&
7
- env.NO_COLOR === undefined &&
8
- env.TERM !== "dumb" &&
9
- !env.CI);
10
- }
11
- export function decorate(text, ok, options) {
12
- if (!richTerminal(options))
13
- return text;
14
- const [title, ...body] = text.split("\n");
15
- return `\x1b[${ok ? "32" : "31"}m${ok ? "[ok]" : "[!]"}\x1b[0m \x1b[1m${title}\x1b[0m${body.length ? "\n" + body.join("\n") : ""}`;
16
- }
17
- export function banner(text, options) {
18
- return richTerminal(options)
19
- ? `\x1b[36m+-- INGESTRON ----------------------------------+\x1b[0m\n\n${text}`
20
- : text;
21
- }
22
- export async function backgroundOperation(context, operation, args, label, options) {
23
- const animate = richTerminal(options) &&
24
- options.progress !== false &&
25
- process.env.INGESTRON_NO_ANIMATION !== "1" &&
26
- !!process.stderr.isTTY;
27
- const frames = ["|", "/", "-", "\\"];
28
- let index = 0;
29
- const safe = label
30
- .replace(/[\u0000-\u001f\u007f-\u009f]/g, " ")
31
- .slice(0, Math.max(20, (process.stderr.columns ?? 80) - 8));
32
- const draw = () => process.stderr.write(`\r\x1b[2K ${frames[index++ % frames.length]} ${safe}`);
33
- if (animate)
34
- draw();
35
- const timer = animate ? setInterval(draw, 100) : undefined;
36
- try {
37
- return await new Promise((resolve, reject) => {
38
- const worker = new Worker(new URL("./operation-worker.js", import.meta.url), { workerData: { context, operation, args } });
39
- let received = false;
40
- worker.once("message", (result) => {
41
- received = true;
42
- resolve(result);
43
- });
44
- worker.once("error", reject);
45
- worker.once("exit", (code) => {
46
- if (!received)
47
- reject(new Error(`Operation worker stopped (${code})`));
48
- });
49
- });
50
- }
51
- finally {
52
- if (timer)
53
- clearInterval(timer);
54
- if (animate)
55
- process.stderr.write("\r\x1b[2K");
56
- }
57
- }
@@ -1,15 +0,0 @@
1
- import { Command } from "commander";
2
- import { type Context, type OperationName, type Result } from "@ingestron/core";
3
- interface Host {
4
- context: () => Context;
5
- run: (name: OperationName, args?: any) => void;
6
- author: (name: OperationName, args: any) => void;
7
- print: (result: Result, args?: any) => void;
8
- readData: (file: string) => any;
9
- canPrompt: () => boolean;
10
- answer: (value: unknown) => Promise<any>;
11
- perform: (operation: OperationName, args: any, label: string) => Promise<Result>;
12
- }
13
- /** Implemented CLI workflows over the versioned core operation API. */
14
- export declare function workflowCommands(app: Command, host: Host): void;
15
- export {};