@superblocksteam/shared 0.9559.0 → 0.9560.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 (123) hide show
  1. package/dist/plugins/index.d.ts +8 -0
  2. package/dist/plugins/index.d.ts.map +1 -1
  3. package/dist/plugins/index.js +45 -1
  4. package/dist/plugins/index.js.map +1 -1
  5. package/dist/plugins/templates/athena.d.ts +1 -0
  6. package/dist/plugins/templates/athena.d.ts.map +1 -1
  7. package/dist/plugins/templates/athena.js +55 -1
  8. package/dist/plugins/templates/athena.js.map +1 -1
  9. package/dist/plugins/templates/bigquery.d.ts +1 -0
  10. package/dist/plugins/templates/bigquery.d.ts.map +1 -1
  11. package/dist/plugins/templates/bigquery.js +38 -1
  12. package/dist/plugins/templates/bigquery.js.map +1 -1
  13. package/dist/plugins/templates/cockroachdb.d.ts +1 -0
  14. package/dist/plugins/templates/cockroachdb.d.ts.map +1 -1
  15. package/dist/plugins/templates/cockroachdb.js +38 -1
  16. package/dist/plugins/templates/cockroachdb.js.map +1 -1
  17. package/dist/plugins/templates/databricks.d.ts +1 -0
  18. package/dist/plugins/templates/databricks.d.ts.map +1 -1
  19. package/dist/plugins/templates/databricks.js +55 -1
  20. package/dist/plugins/templates/databricks.js.map +1 -1
  21. package/dist/plugins/templates/mariadb.d.ts +1 -0
  22. package/dist/plugins/templates/mariadb.d.ts.map +1 -1
  23. package/dist/plugins/templates/mariadb.js +62 -1
  24. package/dist/plugins/templates/mariadb.js.map +1 -1
  25. package/dist/plugins/templates/mssql.d.ts +1 -0
  26. package/dist/plugins/templates/mssql.d.ts.map +1 -1
  27. package/dist/plugins/templates/mssql.js +62 -1
  28. package/dist/plugins/templates/mssql.js.map +1 -1
  29. package/dist/plugins/templates/mysql.d.ts +1 -0
  30. package/dist/plugins/templates/mysql.d.ts.map +1 -1
  31. package/dist/plugins/templates/mysql.js +62 -1
  32. package/dist/plugins/templates/mysql.js.map +1 -1
  33. package/dist/plugins/templates/oracledb.d.ts +1 -0
  34. package/dist/plugins/templates/oracledb.d.ts.map +1 -1
  35. package/dist/plugins/templates/oracledb.js +55 -1
  36. package/dist/plugins/templates/oracledb.js.map +1 -1
  37. package/dist/plugins/templates/postgres.d.ts +1 -0
  38. package/dist/plugins/templates/postgres.d.ts.map +1 -1
  39. package/dist/plugins/templates/postgres.js +47 -2
  40. package/dist/plugins/templates/postgres.js.map +1 -1
  41. package/dist/plugins/templates/redshift.d.ts +1 -0
  42. package/dist/plugins/templates/redshift.d.ts.map +1 -1
  43. package/dist/plugins/templates/redshift.js +38 -1
  44. package/dist/plugins/templates/redshift.js.map +1 -1
  45. package/dist/plugins/templates/snowflake.d.ts +1 -0
  46. package/dist/plugins/templates/snowflake.d.ts.map +1 -1
  47. package/dist/plugins/templates/snowflake.js +38 -1
  48. package/dist/plugins/templates/snowflake.js.map +1 -1
  49. package/dist/types/api/action.d.ts +1 -0
  50. package/dist/types/api/action.d.ts.map +1 -1
  51. package/dist/types/api/action.js.map +1 -1
  52. package/dist/types/plugin/form.d.ts +5 -0
  53. package/dist/types/plugin/form.d.ts.map +1 -1
  54. package/dist/types/plugin/form.js.map +1 -1
  55. package/dist-esm/plugins/index.d.ts +8 -0
  56. package/dist-esm/plugins/index.d.ts.map +1 -1
  57. package/dist-esm/plugins/index.js +45 -1
  58. package/dist-esm/plugins/index.js.map +1 -1
  59. package/dist-esm/plugins/templates/athena.d.ts +1 -0
  60. package/dist-esm/plugins/templates/athena.d.ts.map +1 -1
  61. package/dist-esm/plugins/templates/athena.js +55 -1
  62. package/dist-esm/plugins/templates/athena.js.map +1 -1
  63. package/dist-esm/plugins/templates/bigquery.d.ts +1 -0
  64. package/dist-esm/plugins/templates/bigquery.d.ts.map +1 -1
  65. package/dist-esm/plugins/templates/bigquery.js +38 -1
  66. package/dist-esm/plugins/templates/bigquery.js.map +1 -1
  67. package/dist-esm/plugins/templates/cockroachdb.d.ts +1 -0
  68. package/dist-esm/plugins/templates/cockroachdb.d.ts.map +1 -1
  69. package/dist-esm/plugins/templates/cockroachdb.js +38 -1
  70. package/dist-esm/plugins/templates/cockroachdb.js.map +1 -1
  71. package/dist-esm/plugins/templates/databricks.d.ts +1 -0
  72. package/dist-esm/plugins/templates/databricks.d.ts.map +1 -1
  73. package/dist-esm/plugins/templates/databricks.js +55 -1
  74. package/dist-esm/plugins/templates/databricks.js.map +1 -1
  75. package/dist-esm/plugins/templates/mariadb.d.ts +1 -0
  76. package/dist-esm/plugins/templates/mariadb.d.ts.map +1 -1
  77. package/dist-esm/plugins/templates/mariadb.js +62 -1
  78. package/dist-esm/plugins/templates/mariadb.js.map +1 -1
  79. package/dist-esm/plugins/templates/mssql.d.ts +1 -0
  80. package/dist-esm/plugins/templates/mssql.d.ts.map +1 -1
  81. package/dist-esm/plugins/templates/mssql.js +62 -1
  82. package/dist-esm/plugins/templates/mssql.js.map +1 -1
  83. package/dist-esm/plugins/templates/mysql.d.ts +1 -0
  84. package/dist-esm/plugins/templates/mysql.d.ts.map +1 -1
  85. package/dist-esm/plugins/templates/mysql.js +62 -1
  86. package/dist-esm/plugins/templates/mysql.js.map +1 -1
  87. package/dist-esm/plugins/templates/oracledb.d.ts +1 -0
  88. package/dist-esm/plugins/templates/oracledb.d.ts.map +1 -1
  89. package/dist-esm/plugins/templates/oracledb.js +55 -1
  90. package/dist-esm/plugins/templates/oracledb.js.map +1 -1
  91. package/dist-esm/plugins/templates/postgres.d.ts +1 -0
  92. package/dist-esm/plugins/templates/postgres.d.ts.map +1 -1
  93. package/dist-esm/plugins/templates/postgres.js +47 -2
  94. package/dist-esm/plugins/templates/postgres.js.map +1 -1
  95. package/dist-esm/plugins/templates/redshift.d.ts +1 -0
  96. package/dist-esm/plugins/templates/redshift.d.ts.map +1 -1
  97. package/dist-esm/plugins/templates/redshift.js +38 -1
  98. package/dist-esm/plugins/templates/redshift.js.map +1 -1
  99. package/dist-esm/plugins/templates/snowflake.d.ts +1 -0
  100. package/dist-esm/plugins/templates/snowflake.d.ts.map +1 -1
  101. package/dist-esm/plugins/templates/snowflake.js +38 -1
  102. package/dist-esm/plugins/templates/snowflake.js.map +1 -1
  103. package/dist-esm/types/api/action.d.ts +1 -0
  104. package/dist-esm/types/api/action.d.ts.map +1 -1
  105. package/dist-esm/types/api/action.js.map +1 -1
  106. package/dist-esm/types/plugin/form.d.ts +5 -0
  107. package/dist-esm/types/plugin/form.d.ts.map +1 -1
  108. package/dist-esm/types/plugin/form.js.map +1 -1
  109. package/package.json +2 -2
  110. package/src/plugins/index.ts +47 -0
  111. package/src/plugins/templates/athena.ts +56 -1
  112. package/src/plugins/templates/bigquery.ts +39 -1
  113. package/src/plugins/templates/cockroachdb.ts +39 -1
  114. package/src/plugins/templates/databricks.ts +56 -1
  115. package/src/plugins/templates/mariadb.ts +63 -1
  116. package/src/plugins/templates/mssql.ts +63 -1
  117. package/src/plugins/templates/mysql.ts +63 -1
  118. package/src/plugins/templates/oracledb.ts +56 -1
  119. package/src/plugins/templates/postgres.ts +48 -2
  120. package/src/plugins/templates/redshift.ts +39 -1
  121. package/src/plugins/templates/snowflake.ts +39 -1
  122. package/src/types/api/action.ts +1 -0
  123. package/src/types/plugin/form.ts +5 -0
@@ -13,7 +13,8 @@ import { CONNECTION_METHODS_AND_DISPLAY_NAMES, makeDropdownItem } from './shared
13
13
 
14
14
  export const OracleDbPluginVersions = {
15
15
  V1: '0.0.1',
16
- V2: '0.0.2'
16
+ V2: '0.0.2',
17
+ V3: '0.0.3'
17
18
  };
18
19
 
19
20
  const BASE_HOST = {
@@ -186,10 +187,31 @@ export const OracleDbPlugin: Plugin = {
186
187
  {
187
188
  name: 'main',
188
189
  items: [
190
+ {
191
+ label: 'Parameters (:1, :2, ...)',
192
+ name: 'runSql.parameters',
193
+ startVersion: OracleDbPluginVersions.V3,
194
+ ldFlag: 'clark.parameterized-apis.v2.enabled',
195
+ componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
196
+ placeholder: '[param1, param2, ...]',
197
+ tooltip: {
198
+ markdownText:
199
+ 'JavaScript expression that evaluates to an array of parameter values. Use `:1`, `:2`, etc. in your SQL query to reference these parameters.'
200
+ }
201
+ },
189
202
  {
190
203
  label: '', // Query
191
204
  name: 'runSql.sqlBody',
192
205
  startVersion: OracleDbPluginVersions.V1,
206
+ endVersion: OracleDbPluginVersions.V2,
207
+ componentType: FormComponentType.CODE_EDITOR,
208
+ language: EditorLanguage.SQL,
209
+ initialValue: DB_SQL_INITIAL_TEXT
210
+ },
211
+ {
212
+ label: '', // Query
213
+ name: 'runSql.sqlBody',
214
+ startVersion: OracleDbPluginVersions.V3,
193
215
  componentType: FormComponentType.CODE_EDITOR,
194
216
  language: EditorLanguage.SQL,
195
217
  initialValue: DB_SQL_INITIAL_TEXT
@@ -203,10 +225,43 @@ export const OracleDbPlugin: Plugin = {
203
225
  label: 'Use parameterized SQL',
204
226
  name: 'runSql.useParameterized',
205
227
  startVersion: OracleDbPluginVersions.V1,
228
+ endVersion: OracleDbPluginVersions.V2,
229
+ componentType: FormComponentType.SWITCH,
230
+ initialValue: true,
231
+ tooltip: {
232
+ markdownText: PARAMETERIZED_SQL_DESCRIPTION
233
+ }
234
+ },
235
+ {
236
+ label: 'Use parameterized SQL',
237
+ name: 'runSql.useParameterized',
238
+ startVersion: OracleDbPluginVersions.V3,
239
+ ldFlag: '!clark.parameterized-apis.v2.enabled',
206
240
  componentType: FormComponentType.SWITCH,
207
241
  initialValue: true,
208
242
  tooltip: {
209
243
  markdownText: PARAMETERIZED_SQL_DESCRIPTION
244
+ },
245
+ display: {
246
+ show: {
247
+ 'runSql.parameters': ['undefined']
248
+ }
249
+ }
250
+ },
251
+ {
252
+ label: 'Use parameterized SQL',
253
+ name: 'runSql.useParameterized',
254
+ startVersion: OracleDbPluginVersions.V3,
255
+ ldFlag: 'clark.parameterized-apis.v2.enabled',
256
+ componentType: FormComponentType.SWITCH,
257
+ initialValue: undefined,
258
+ tooltip: {
259
+ markdownText: PARAMETERIZED_SQL_DESCRIPTION
260
+ },
261
+ display: {
262
+ show: {
263
+ 'runSql.parameters': ['undefined']
264
+ }
210
265
  }
211
266
  }
212
267
  ]
@@ -19,7 +19,8 @@ export const PostgresPluginVersions = {
19
19
  V8: '0.0.8',
20
20
  V9: '0.0.9',
21
21
  V10: '0.0.10',
22
- V11: '0.0.11'
22
+ V11: '0.0.11',
23
+ V12: '0.0.12'
23
24
  };
24
25
 
25
26
  const BASE_HOST = {
@@ -344,6 +345,7 @@ export const PostgresPlugin: Plugin = {
344
345
  label: 'Operation',
345
346
  name: 'operation',
346
347
  startVersion: PostgresPluginVersions.V10,
348
+ endVersion: PostgresPluginVersions.V11,
347
349
  componentType: FormComponentType.DROPDOWN,
348
350
  options: [
349
351
  {
@@ -359,6 +361,49 @@ export const PostgresPlugin: Plugin = {
359
361
  ],
360
362
  initialValue: SqlOperations.RUN_SQL
361
363
  },
364
+ {
365
+ // Only show operation dropdown if UPDATE_ROWS was previously selected
366
+ // This effectively deprecates UPDATE_ROWS for new actions
367
+ label: 'Operation',
368
+ name: 'operation',
369
+ startVersion: PostgresPluginVersions.V12,
370
+ componentType: FormComponentType.DROPDOWN,
371
+ options: [
372
+ {
373
+ displayName: 'Run SQL',
374
+ key: SqlOperations.RUN_SQL,
375
+ value: SqlOperations.RUN_SQL
376
+ },
377
+ {
378
+ displayName: 'Insert, update, or delete rows with form',
379
+ key: SqlOperations.UPDATE_ROWS,
380
+ value: SqlOperations.UPDATE_ROWS
381
+ }
382
+ ],
383
+ initialValue: SqlOperations.RUN_SQL,
384
+ display: {
385
+ show: {
386
+ operation: [SqlOperations.UPDATE_ROWS]
387
+ }
388
+ }
389
+ },
390
+ {
391
+ label: 'Parameters ($1, $2, ...)',
392
+ name: 'parameters',
393
+ startVersion: PostgresPluginVersions.V12,
394
+ ldFlag: 'clark.parameterized-apis.v2.enabled',
395
+ componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
396
+ placeholder: '[param1, param2, ...]',
397
+ tooltip: {
398
+ markdownText:
399
+ 'JavaScript expression that evaluates to an array of parameter values. Use `$1`, `$2`, etc. in your SQL query to reference these parameters.'
400
+ },
401
+ display: {
402
+ show: {
403
+ operation: ['undefined', SqlOperations.RUN_SQL]
404
+ }
405
+ }
406
+ },
362
407
  {
363
408
  label: '', // Query
364
409
  name: 'body',
@@ -632,7 +677,8 @@ export const PostgresPlugin: Plugin = {
632
677
  },
633
678
  display: {
634
679
  show: {
635
- operation: ['undefined', SqlOperations.RUN_SQL]
680
+ operation: ['undefined', SqlOperations.RUN_SQL],
681
+ parameters: ['undefined']
636
682
  }
637
683
  }
638
684
  }
@@ -6,7 +6,8 @@ export const RedshiftPluginVersions = {
6
6
  V1: '0.0.1',
7
7
  V2: '0.0.2',
8
8
  V6: '0.0.6',
9
- V7: '0.0.7'
9
+ V7: '0.0.7',
10
+ V8: '0.0.8'
10
11
  };
11
12
 
12
13
  const BASE_HOST = {
@@ -221,10 +222,31 @@ export const RedshiftPlugin: Plugin = {
221
222
  {
222
223
  name: 'main',
223
224
  items: [
225
+ {
226
+ label: 'Parameters ($1, $2, ...)',
227
+ name: 'parameters',
228
+ startVersion: RedshiftPluginVersions.V8,
229
+ ldFlag: 'clark.parameterized-apis.v2.enabled',
230
+ componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
231
+ placeholder: '[param1, param2, ...]',
232
+ tooltip: {
233
+ markdownText:
234
+ 'JavaScript expression that evaluates to an array of parameter values. Use `$1`, `$2`, etc. in your SQL query to reference these parameters.'
235
+ }
236
+ },
224
237
  {
225
238
  label: '', // Query
226
239
  name: 'body',
227
240
  startVersion: RedshiftPluginVersions.V1,
241
+ endVersion: RedshiftPluginVersions.V7,
242
+ componentType: FormComponentType.CODE_EDITOR,
243
+ language: EditorLanguage.SQL,
244
+ initialValue: SQL_INITIAL_TEXT
245
+ },
246
+ {
247
+ label: '', // Query
248
+ name: 'body',
249
+ startVersion: RedshiftPluginVersions.V8,
228
250
  componentType: FormComponentType.CODE_EDITOR,
229
251
  language: EditorLanguage.SQL,
230
252
  initialValue: SQL_INITIAL_TEXT
@@ -238,11 +260,27 @@ export const RedshiftPlugin: Plugin = {
238
260
  label: 'Use parameterized SQL',
239
261
  name: 'usePreparedSql',
240
262
  startVersion: RedshiftPluginVersions.V6,
263
+ endVersion: RedshiftPluginVersions.V7,
241
264
  componentType: FormComponentType.SWITCH,
242
265
  initialValue: true,
243
266
  tooltip: {
244
267
  markdownText: PARAMETERIZED_SQL_DESCRIPTION
245
268
  }
269
+ },
270
+ {
271
+ label: 'Use parameterized SQL',
272
+ name: 'usePreparedSql',
273
+ startVersion: RedshiftPluginVersions.V8,
274
+ componentType: FormComponentType.SWITCH,
275
+ initialValue: true,
276
+ tooltip: {
277
+ markdownText: PARAMETERIZED_SQL_DESCRIPTION
278
+ },
279
+ display: {
280
+ show: {
281
+ parameters: ['undefined']
282
+ }
283
+ }
246
284
  }
247
285
  ]
248
286
  }
@@ -27,7 +27,8 @@ export const SnowflakePluginVersions = {
27
27
  V7: '0.0.7',
28
28
  V8: '0.0.8',
29
29
  V9: '0.0.9',
30
- V10: '0.0.10'
30
+ V10: '0.0.10',
31
+ V11: '0.0.11'
31
32
  };
32
33
 
33
34
  const CONNECTION_TYPE_FIELD = 'connectionType';
@@ -461,10 +462,31 @@ export const SnowflakePlugin: Plugin = {
461
462
  {
462
463
  name: 'main',
463
464
  items: [
465
+ {
466
+ label: 'Parameters (?, ?, ...)',
467
+ name: 'parameters',
468
+ startVersion: SnowflakePluginVersions.V11,
469
+ ldFlag: 'clark.parameterized-apis.v2.enabled',
470
+ componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
471
+ placeholder: '[param1, param2, ...]',
472
+ tooltip: {
473
+ markdownText:
474
+ 'JavaScript expression that evaluates to an array of parameter values. Use `?` placeholders in your SQL query to reference these parameters.'
475
+ }
476
+ },
464
477
  {
465
478
  label: '', // Query
466
479
  name: 'body',
467
480
  startVersion: SnowflakePluginVersions.V1,
481
+ endVersion: SnowflakePluginVersions.V10,
482
+ componentType: FormComponentType.CODE_EDITOR,
483
+ language: EditorLanguage.SQL,
484
+ initialValue: SQL_INITIAL_TEXT
485
+ },
486
+ {
487
+ label: '', // Query
488
+ name: 'body',
489
+ startVersion: SnowflakePluginVersions.V11,
468
490
  componentType: FormComponentType.CODE_EDITOR,
469
491
  language: EditorLanguage.SQL,
470
492
  initialValue: SQL_INITIAL_TEXT
@@ -478,10 +500,26 @@ export const SnowflakePlugin: Plugin = {
478
500
  label: 'Use parameterized SQL',
479
501
  name: 'usePreparedSql',
480
502
  startVersion: SnowflakePluginVersions.V6,
503
+ endVersion: SnowflakePluginVersions.V10,
504
+ componentType: FormComponentType.SWITCH,
505
+ initialValue: true,
506
+ tooltip: {
507
+ markdownText: PARAMETERIZED_SQL_DESCRIPTION
508
+ }
509
+ },
510
+ {
511
+ label: 'Use parameterized SQL',
512
+ name: 'usePreparedSql',
513
+ startVersion: SnowflakePluginVersions.V11,
481
514
  componentType: FormComponentType.SWITCH,
482
515
  initialValue: true,
483
516
  tooltip: {
484
517
  markdownText: PARAMETERIZED_SQL_DESCRIPTION
518
+ },
519
+ display: {
520
+ show: {
521
+ parameters: ['undefined']
522
+ }
485
523
  }
486
524
  }
487
525
  ]
@@ -96,6 +96,7 @@ export type GoogleSheetsActionConfiguration = {
96
96
  export type DBActionConfiguration = {
97
97
  body?: string;
98
98
  usePreparedSql?: boolean;
99
+ parameters?: string;
99
100
  // When operation is undefined we assume it's RUN_SQL, otherwise it's part of the SqlOperations enum
100
101
  operation?: string;
101
102
  // When using operation UPDATE_ROWS the default behavior is to match by primary key- but
@@ -150,6 +150,11 @@ export interface BaseFormItem {
150
150
  agentType?: AgentType;
151
151
  actionOptions?: { label?: string; value: string; children: { label: string; value: string; description?: string }[] }[];
152
152
  transformation?: FormItemTransformation;
153
+ /**
154
+ * LaunchDarkly feature flag that controls whether this form item is shown.
155
+ * If the flag evaluates to false, the item is removed from the form.
156
+ * Supports negation with "!" prefix (e.g., "!feature.disabled" shows when flag is false).
157
+ */
153
158
  ldFlag?: string;
154
159
  }
155
160