@superblocksteam/sdk-api 2.0.99 → 2.0.100-next.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 (73) hide show
  1. package/dist/files.d.ts +68 -0
  2. package/dist/files.d.ts.map +1 -0
  3. package/dist/files.js +42 -0
  4. package/dist/files.js.map +1 -0
  5. package/dist/index.d.ts +7 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
  10. package/dist/integrations/base/rest-api-integration-client.js +6 -35
  11. package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
  12. package/dist/integrations/cosmosdb/client.d.ts.map +1 -1
  13. package/dist/integrations/cosmosdb/client.js +30 -63
  14. package/dist/integrations/cosmosdb/client.js.map +1 -1
  15. package/dist/integrations/cosmosdb/client.test.d.ts +8 -0
  16. package/dist/integrations/cosmosdb/client.test.d.ts.map +1 -0
  17. package/dist/integrations/cosmosdb/client.test.js +141 -0
  18. package/dist/integrations/cosmosdb/client.test.js.map +1 -0
  19. package/dist/integrations/declarations.d.ts +106 -66
  20. package/dist/integrations/declarations.d.ts.map +1 -1
  21. package/dist/integrations/declarations.js +33 -0
  22. package/dist/integrations/declarations.js.map +1 -1
  23. package/dist/integrations/declarations.test.d.ts +2 -0
  24. package/dist/integrations/declarations.test.d.ts.map +1 -0
  25. package/dist/integrations/declarations.test.js +40 -0
  26. package/dist/integrations/declarations.test.js.map +1 -0
  27. package/dist/integrations/gcs/client.d.ts.map +1 -1
  28. package/dist/integrations/gcs/client.js +1 -1
  29. package/dist/integrations/gcs/client.js.map +1 -1
  30. package/dist/integrations/index.d.ts +3 -1
  31. package/dist/integrations/index.d.ts.map +1 -1
  32. package/dist/integrations/index.js +2 -1
  33. package/dist/integrations/index.js.map +1 -1
  34. package/dist/integrations/python/client.test.js +1 -3
  35. package/dist/integrations/python/client.test.js.map +1 -1
  36. package/dist/integrations/redis/client.d.ts.map +1 -1
  37. package/dist/integrations/redis/client.js +8 -1
  38. package/dist/integrations/redis/client.js.map +1 -1
  39. package/dist/integrations/registry.d.ts +1 -0
  40. package/dist/integrations/registry.d.ts.map +1 -1
  41. package/dist/integrations/registry.js +6 -0
  42. package/dist/integrations/registry.js.map +1 -1
  43. package/dist/integrations/restapiintegration/client.d.ts +19 -0
  44. package/dist/integrations/restapiintegration/client.d.ts.map +1 -0
  45. package/dist/integrations/restapiintegration/client.js +18 -0
  46. package/dist/integrations/restapiintegration/client.js.map +1 -0
  47. package/dist/integrations/restapiintegration/index.d.ts +6 -0
  48. package/dist/integrations/restapiintegration/index.d.ts.map +1 -0
  49. package/dist/integrations/restapiintegration/index.js +5 -0
  50. package/dist/integrations/restapiintegration/index.js.map +1 -0
  51. package/dist/integrations/restapiintegration/types.d.ts +33 -0
  52. package/dist/integrations/restapiintegration/types.d.ts.map +1 -0
  53. package/dist/integrations/restapiintegration/types.js +5 -0
  54. package/dist/integrations/restapiintegration/types.js.map +1 -0
  55. package/dist/integrations/snowflake/types.d.ts +4 -4
  56. package/package.json +3 -2
  57. package/src/files.ts +54 -0
  58. package/src/index.ts +21 -0
  59. package/src/integrations/base/rest-api-integration-client.ts +6 -43
  60. package/src/integrations/cosmosdb/client.test.ts +209 -0
  61. package/src/integrations/cosmosdb/client.ts +66 -75
  62. package/src/integrations/declarations.test.ts +64 -0
  63. package/src/integrations/declarations.ts +231 -134
  64. package/src/integrations/gcs/client.ts +1 -5
  65. package/src/integrations/index.ts +6 -0
  66. package/src/integrations/python/client.test.ts +5 -3
  67. package/src/integrations/redis/client.ts +10 -1
  68. package/src/integrations/registry.ts +11 -0
  69. package/src/integrations/restapiintegration/client.ts +21 -0
  70. package/src/integrations/restapiintegration/index.ts +6 -0
  71. package/src/integrations/restapiintegration/types.ts +40 -0
  72. package/src/integrations/snowflake/README.md +7 -7
  73. package/src/integrations/snowflake/types.ts +4 -4
@@ -94,6 +94,7 @@ import type { SuperblocksOCRClient } from "./superblocks-ocr/index.js";
94
94
  import type { LakebaseClient } from "./lakebase/index.js";
95
95
  import type { SnowflakePostgresClient } from "./snowflakepostgres/index.js";
96
96
  import type { SmtpClient } from "./smtp/index.js";
97
+ import type { RestApiIntegrationPluginClient } from "./restapiintegration/index.js";
97
98
  import type { PythonClient } from "./python/index.js";
98
99
 
99
100
  // -----------------------------------------------------------------------------
@@ -125,14 +126,20 @@ export interface IntegrationRef<TPluginId extends string, TClient> {
125
126
  readonly __clientType?: TClient;
126
127
  }
127
128
 
129
+ /**
130
+ * Rejects the broad `string` type while still accepting string literal types.
131
+ * This keeps integration IDs statically analyzable by the build pipeline.
132
+ */
133
+ type LiteralString<T extends string> = string extends T ? never : T;
134
+
128
135
  /**
129
136
  * Helper function to create an integration reference.
130
137
  *
131
138
  * @internal
132
139
  */
133
- function createRef<TPluginId extends string, TClient>(
140
+ function createRef<TPluginId extends string, TClient, TId extends string>(
134
141
  pluginId: TPluginId,
135
- id: string,
142
+ id: LiteralString<TId>,
136
143
  ): IntegrationRef<TPluginId, TClient> {
137
144
  return { pluginId, id };
138
145
  }
@@ -357,6 +364,12 @@ export type SnowflakePostgresRef = IntegrationRef<
357
364
  /** Reference to an SMTP integration */
358
365
  export type SmtpRef = IntegrationRef<"smtp", SmtpClient>;
359
366
 
367
+ /** Reference to a REST API Integration */
368
+ export type RestApiIntegrationRef = IntegrationRef<
369
+ "restapiintegration",
370
+ RestApiIntegrationPluginClient
371
+ >;
372
+
360
373
  // -----------------------------------------------------------------------------
361
374
  // Declaration Functions
362
375
  // -----------------------------------------------------------------------------
@@ -390,8 +403,8 @@ export type SmtpRef = IntegrationRef<"smtp", SmtpClient>;
390
403
  * });
391
404
  * ```
392
405
  */
393
- export function postgres(id: string): PostgresRef {
394
- return createRef<"postgres", PostgresClient>("postgres", id);
406
+ export function postgres<T extends string>(id: LiteralString<T>): PostgresRef {
407
+ return createRef<"postgres", PostgresClient, T>("postgres", id);
395
408
  }
396
409
 
397
410
  /**
@@ -422,8 +435,8 @@ export function postgres(id: string): PostgresRef {
422
435
  * });
423
436
  * ```
424
437
  */
425
- export function slack(id: string): SlackRef {
426
- return createRef<"slack", SlackClient>("slack", id);
438
+ export function slack<T extends string>(id: LiteralString<T>): SlackRef {
439
+ return createRef<"slack", SlackClient, T>("slack", id);
427
440
  }
428
441
 
429
442
  /**
@@ -432,8 +445,8 @@ export function slack(id: string): SlackRef {
432
445
  * @param id - The integration ID (UUID)
433
446
  * @returns An integration reference for use in the API config
434
447
  */
435
- export function openai(id: string): OpenAIRef {
436
- return createRef<"openai_v2", OpenAIClient>("openai_v2", id);
448
+ export function openai<T extends string>(id: LiteralString<T>): OpenAIRef {
449
+ return createRef<"openai_v2", OpenAIClient, T>("openai_v2", id);
437
450
  }
438
451
 
439
452
  /**
@@ -442,8 +455,10 @@ export function openai(id: string): OpenAIRef {
442
455
  * @param id - The integration ID (UUID)
443
456
  * @returns An integration reference for use in the API config
444
457
  */
445
- export function anthropic(id: string): AnthropicRef {
446
- return createRef<"anthropic", AnthropicClient>("anthropic", id);
458
+ export function anthropic<T extends string>(
459
+ id: LiteralString<T>,
460
+ ): AnthropicRef {
461
+ return createRef<"anthropic", AnthropicClient, T>("anthropic", id);
447
462
  }
448
463
 
449
464
  /**
@@ -452,8 +467,8 @@ export function anthropic(id: string): AnthropicRef {
452
467
  * @param id - The integration ID (UUID)
453
468
  * @returns An integration reference for use in the API config
454
469
  */
455
- export function stripe(id: string): StripeRef {
456
- return createRef<"stripe", StripeClient>("stripe", id);
470
+ export function stripe<T extends string>(id: LiteralString<T>): StripeRef {
471
+ return createRef<"stripe", StripeClient, T>("stripe", id);
457
472
  }
458
473
 
459
474
  /**
@@ -462,8 +477,8 @@ export function stripe(id: string): StripeRef {
462
477
  * @param id - The integration ID (UUID)
463
478
  * @returns An integration reference for use in the API config
464
479
  */
465
- export function github(id: string): GitHubRef {
466
- return createRef<"github", GitHubClient>("github", id);
480
+ export function github<T extends string>(id: LiteralString<T>): GitHubRef {
481
+ return createRef<"github", GitHubClient, T>("github", id);
467
482
  }
468
483
 
469
484
  /**
@@ -472,8 +487,8 @@ export function github(id: string): GitHubRef {
472
487
  * @param id - The integration ID (UUID)
473
488
  * @returns An integration reference for use in the API config
474
489
  */
475
- export function notion(id: string): NotionRef {
476
- return createRef<"notion", NotionClient>("notion", id);
490
+ export function notion<T extends string>(id: LiteralString<T>): NotionRef {
491
+ return createRef<"notion", NotionClient, T>("notion", id);
477
492
  }
478
493
 
479
494
  /**
@@ -482,8 +497,10 @@ export function notion(id: string): NotionRef {
482
497
  * @param id - The integration ID (UUID)
483
498
  * @returns An integration reference for use in the API config
484
499
  */
485
- export function snowflake(id: string): SnowflakeRef {
486
- return createRef<"snowflake", SnowflakeClient>("snowflake", id);
500
+ export function snowflake<T extends string>(
501
+ id: LiteralString<T>,
502
+ ): SnowflakeRef {
503
+ return createRef<"snowflake", SnowflakeClient, T>("snowflake", id);
487
504
  }
488
505
 
489
506
  /**
@@ -492,8 +509,10 @@ export function snowflake(id: string): SnowflakeRef {
492
509
  * @param id - The integration ID (UUID)
493
510
  * @returns An integration reference for use in the API config
494
511
  */
495
- export function snowflakeCortex(id: string): SnowflakeCortexRef {
496
- return createRef<"snowflakecortex", SnowflakeCortexClient>(
512
+ export function snowflakeCortex<T extends string>(
513
+ id: LiteralString<T>,
514
+ ): SnowflakeCortexRef {
515
+ return createRef<"snowflakecortex", SnowflakeCortexClient, T>(
497
516
  "snowflakecortex",
498
517
  id,
499
518
  );
@@ -505,8 +524,8 @@ export function snowflakeCortex(id: string): SnowflakeCortexRef {
505
524
  * @param id - The integration ID (UUID)
506
525
  * @returns An integration reference for use in the API config
507
526
  */
508
- export function airtable(id: string): AirtableRef {
509
- return createRef<"airtable", AirtableClient>("airtable", id);
527
+ export function airtable<T extends string>(id: LiteralString<T>): AirtableRef {
528
+ return createRef<"airtable", AirtableClient, T>("airtable", id);
510
529
  }
511
530
 
512
531
  /**
@@ -515,8 +534,8 @@ export function airtable(id: string): AirtableRef {
515
534
  * @param id - The integration ID (UUID)
516
535
  * @returns An integration reference for use in the API config
517
536
  */
518
- export function asana(id: string): AsanaRef {
519
- return createRef<"asana", AsanaClient>("asana", id);
537
+ export function asana<T extends string>(id: LiteralString<T>): AsanaRef {
538
+ return createRef<"asana", AsanaClient, T>("asana", id);
520
539
  }
521
540
 
522
541
  /**
@@ -525,8 +544,10 @@ export function asana(id: string): AsanaRef {
525
544
  * @param id - The integration ID (UUID)
526
545
  * @returns An integration reference for use in the API config
527
546
  */
528
- export function bitbucket(id: string): BitbucketRef {
529
- return createRef<"bitbucket", BitbucketClient>("bitbucket", id);
547
+ export function bitbucket<T extends string>(
548
+ id: LiteralString<T>,
549
+ ): BitbucketRef {
550
+ return createRef<"bitbucket", BitbucketClient, T>("bitbucket", id);
530
551
  }
531
552
 
532
553
  /**
@@ -535,8 +556,8 @@ export function bitbucket(id: string): BitbucketRef {
535
556
  * @param id - The integration ID (UUID)
536
557
  * @returns An integration reference for use in the API config
537
558
  */
538
- export function box(id: string): BoxRef {
539
- return createRef<"box", BoxClient>("box", id);
559
+ export function box<T extends string>(id: LiteralString<T>): BoxRef {
560
+ return createRef<"box", BoxClient, T>("box", id);
540
561
  }
541
562
 
542
563
  /**
@@ -545,8 +566,8 @@ export function box(id: string): BoxRef {
545
566
  * @param id - The integration ID (UUID)
546
567
  * @returns An integration reference for use in the API config
547
568
  */
548
- export function circleci(id: string): CircleCIRef {
549
- return createRef<"circleci", CircleCIClient>("circleci", id);
569
+ export function circleci<T extends string>(id: LiteralString<T>): CircleCIRef {
570
+ return createRef<"circleci", CircleCIClient, T>("circleci", id);
550
571
  }
551
572
 
552
573
  /**
@@ -555,8 +576,8 @@ export function circleci(id: string): CircleCIRef {
555
576
  * @param id - The integration ID (UUID)
556
577
  * @returns An integration reference for use in the API config
557
578
  */
558
- export function cohere(id: string): CohereRef {
559
- return createRef<"cohere", CohereClient>("cohere", id);
579
+ export function cohere<T extends string>(id: LiteralString<T>): CohereRef {
580
+ return createRef<"cohere", CohereClient, T>("cohere", id);
560
581
  }
561
582
 
562
583
  /**
@@ -565,8 +586,10 @@ export function cohere(id: string): CohereRef {
565
586
  * @param id - The integration ID (UUID)
566
587
  * @returns An integration reference for use in the API config
567
588
  */
568
- export function confluence(id: string): ConfluenceRef {
569
- return createRef<"confluence", ConfluenceClient>("confluence", id);
589
+ export function confluence<T extends string>(
590
+ id: LiteralString<T>,
591
+ ): ConfluenceRef {
592
+ return createRef<"confluence", ConfluenceClient, T>("confluence", id);
570
593
  }
571
594
 
572
595
  /**
@@ -575,8 +598,8 @@ export function confluence(id: string): ConfluenceRef {
575
598
  * @param id - The integration ID (UUID)
576
599
  * @returns An integration reference for use in the API config
577
600
  */
578
- export function datadog(id: string): DatadogRef {
579
- return createRef<"datadog", DatadogClient>("datadog", id);
601
+ export function datadog<T extends string>(id: LiteralString<T>): DatadogRef {
602
+ return createRef<"datadog", DatadogClient, T>("datadog", id);
580
603
  }
581
604
 
582
605
  /**
@@ -585,8 +608,8 @@ export function datadog(id: string): DatadogRef {
585
608
  * @param id - The integration ID (UUID)
586
609
  * @returns An integration reference for use in the API config
587
610
  */
588
- export function dropbox(id: string): DropboxRef {
589
- return createRef<"dropbox", DropboxClient>("dropbox", id);
611
+ export function dropbox<T extends string>(id: LiteralString<T>): DropboxRef {
612
+ return createRef<"dropbox", DropboxClient, T>("dropbox", id);
590
613
  }
591
614
 
592
615
  /**
@@ -595,8 +618,13 @@ export function dropbox(id: string): DropboxRef {
595
618
  * @param id - The integration ID (UUID)
596
619
  * @returns An integration reference for use in the API config
597
620
  */
598
- export function elasticsearch(id: string): ElasticSearchRef {
599
- return createRef<"elasticsearch", ElasticSearchClient>("elasticsearch", id);
621
+ export function elasticsearch<T extends string>(
622
+ id: LiteralString<T>,
623
+ ): ElasticSearchRef {
624
+ return createRef<"elasticsearch", ElasticSearchClient, T>(
625
+ "elasticsearch",
626
+ id,
627
+ );
600
628
  }
601
629
 
602
630
  /**
@@ -605,8 +633,10 @@ export function elasticsearch(id: string): ElasticSearchRef {
605
633
  * @param id - The integration ID (UUID)
606
634
  * @returns An integration reference for use in the API config
607
635
  */
608
- export function fireworks(id: string): FireworksRef {
609
- return createRef<"fireworks", FireworksClient>("fireworks", id);
636
+ export function fireworks<T extends string>(
637
+ id: LiteralString<T>,
638
+ ): FireworksRef {
639
+ return createRef<"fireworks", FireworksClient, T>("fireworks", id);
610
640
  }
611
641
 
612
642
  /**
@@ -615,8 +645,8 @@ export function fireworks(id: string): FireworksRef {
615
645
  * @param id - The integration ID (UUID)
616
646
  * @returns An integration reference for use in the API config
617
647
  */
618
- export function front(id: string): FrontRef {
619
- return createRef<"front", FrontClient>("front", id);
648
+ export function front<T extends string>(id: LiteralString<T>): FrontRef {
649
+ return createRef<"front", FrontClient, T>("front", id);
620
650
  }
621
651
 
622
652
  /**
@@ -625,8 +655,8 @@ export function front(id: string): FrontRef {
625
655
  * @param id - The integration ID (UUID)
626
656
  * @returns An integration reference for use in the API config
627
657
  */
628
- export function gemini(id: string): GeminiRef {
629
- return createRef<"gemini", GeminiClient>("gemini", id);
658
+ export function gemini<T extends string>(id: LiteralString<T>): GeminiRef {
659
+ return createRef<"gemini", GeminiClient, T>("gemini", id);
630
660
  }
631
661
 
632
662
  /**
@@ -635,8 +665,10 @@ export function gemini(id: string): GeminiRef {
635
665
  * @param id - The integration ID (UUID)
636
666
  * @returns An integration reference for use in the API config
637
667
  */
638
- export function googleAnalytics(id: string): GoogleAnalyticsRef {
639
- return createRef<"googleanalytics", GoogleAnalyticsClient>(
668
+ export function googleAnalytics<T extends string>(
669
+ id: LiteralString<T>,
670
+ ): GoogleAnalyticsRef {
671
+ return createRef<"googleanalytics", GoogleAnalyticsClient, T>(
640
672
  "googleanalytics",
641
673
  id,
642
674
  );
@@ -648,8 +680,10 @@ export function googleAnalytics(id: string): GoogleAnalyticsRef {
648
680
  * @param id - The integration ID (UUID)
649
681
  * @returns An integration reference for use in the API config
650
682
  */
651
- export function googleDrive(id: string): GoogleDriveRef {
652
- return createRef<"googledrive", GoogleDriveClient>("googledrive", id);
683
+ export function googleDrive<T extends string>(
684
+ id: LiteralString<T>,
685
+ ): GoogleDriveRef {
686
+ return createRef<"googledrive", GoogleDriveClient, T>("googledrive", id);
653
687
  }
654
688
 
655
689
  /**
@@ -658,8 +692,8 @@ export function googleDrive(id: string): GoogleDriveRef {
658
692
  * @param id - The integration ID (UUID)
659
693
  * @returns An integration reference for use in the API config
660
694
  */
661
- export function groq(id: string): GroqRef {
662
- return createRef<"groq", GroqClient>("groq", id);
695
+ export function groq<T extends string>(id: LiteralString<T>): GroqRef {
696
+ return createRef<"groq", GroqClient, T>("groq", id);
663
697
  }
664
698
 
665
699
  /**
@@ -668,8 +702,8 @@ export function groq(id: string): GroqRef {
668
702
  * @param id - The integration ID (UUID)
669
703
  * @returns An integration reference for use in the API config
670
704
  */
671
- export function hubspot(id: string): HubSpotRef {
672
- return createRef<"hubspot", HubSpotClient>("hubspot", id);
705
+ export function hubspot<T extends string>(id: LiteralString<T>): HubSpotRef {
706
+ return createRef<"hubspot", HubSpotClient, T>("hubspot", id);
673
707
  }
674
708
 
675
709
  /**
@@ -678,8 +712,8 @@ export function hubspot(id: string): HubSpotRef {
678
712
  * @param id - The integration ID (UUID)
679
713
  * @returns An integration reference for use in the API config
680
714
  */
681
- export function intercom(id: string): IntercomRef {
682
- return createRef<"intercom", IntercomClient>("intercom", id);
715
+ export function intercom<T extends string>(id: LiteralString<T>): IntercomRef {
716
+ return createRef<"intercom", IntercomClient, T>("intercom", id);
683
717
  }
684
718
 
685
719
  /**
@@ -688,8 +722,8 @@ export function intercom(id: string): IntercomRef {
688
722
  * @param id - The integration ID (UUID)
689
723
  * @returns An integration reference for use in the API config
690
724
  */
691
- export function jira(id: string): JiraRef {
692
- return createRef<"jira", JiraClient>("jira", id);
725
+ export function jira<T extends string>(id: LiteralString<T>): JiraRef {
726
+ return createRef<"jira", JiraClient, T>("jira", id);
693
727
  }
694
728
 
695
729
  /**
@@ -698,8 +732,10 @@ export function jira(id: string): JiraRef {
698
732
  * @param id - The integration ID (UUID)
699
733
  * @returns An integration reference for use in the API config
700
734
  */
701
- export function launchDarkly(id: string): LaunchDarklyRef {
702
- return createRef<"launchdarkly", LaunchDarklyClient>("launchdarkly", id);
735
+ export function launchDarkly<T extends string>(
736
+ id: LiteralString<T>,
737
+ ): LaunchDarklyRef {
738
+ return createRef<"launchdarkly", LaunchDarklyClient, T>("launchdarkly", id);
703
739
  }
704
740
 
705
741
  /**
@@ -708,8 +744,8 @@ export function launchDarkly(id: string): LaunchDarklyRef {
708
744
  * @param id - The integration ID (UUID)
709
745
  * @returns An integration reference for use in the API config
710
746
  */
711
- export function mistral(id: string): MistralRef {
712
- return createRef<"mistral", MistralClient>("mistral", id);
747
+ export function mistral<T extends string>(id: LiteralString<T>): MistralRef {
748
+ return createRef<"mistral", MistralClient, T>("mistral", id);
713
749
  }
714
750
 
715
751
  /**
@@ -718,8 +754,10 @@ export function mistral(id: string): MistralRef {
718
754
  * @param id - The integration ID (UUID)
719
755
  * @returns An integration reference for use in the API config
720
756
  */
721
- export function pagerDuty(id: string): PagerDutyRef {
722
- return createRef<"pagerduty", PagerDutyClient>("pagerduty", id);
757
+ export function pagerDuty<T extends string>(
758
+ id: LiteralString<T>,
759
+ ): PagerDutyRef {
760
+ return createRef<"pagerduty", PagerDutyClient, T>("pagerduty", id);
723
761
  }
724
762
 
725
763
  /**
@@ -728,8 +766,10 @@ export function pagerDuty(id: string): PagerDutyRef {
728
766
  * @param id - The integration ID (UUID)
729
767
  * @returns An integration reference for use in the API config
730
768
  */
731
- export function perplexity(id: string): PerplexityRef {
732
- return createRef<"perplexity", PerplexityClient>("perplexity", id);
769
+ export function perplexity<T extends string>(
770
+ id: LiteralString<T>,
771
+ ): PerplexityRef {
772
+ return createRef<"perplexity", PerplexityClient, T>("perplexity", id);
733
773
  }
734
774
 
735
775
  /**
@@ -738,8 +778,8 @@ export function perplexity(id: string): PerplexityRef {
738
778
  * @param id - The integration ID (UUID)
739
779
  * @returns An integration reference for use in the API config
740
780
  */
741
- export function segment(id: string): SegmentRef {
742
- return createRef<"segment", SegmentClient>("segment", id);
781
+ export function segment<T extends string>(id: LiteralString<T>): SegmentRef {
782
+ return createRef<"segment", SegmentClient, T>("segment", id);
743
783
  }
744
784
 
745
785
  /**
@@ -748,8 +788,8 @@ export function segment(id: string): SegmentRef {
748
788
  * @param id - The integration ID (UUID)
749
789
  * @returns An integration reference for use in the API config
750
790
  */
751
- export function sendGrid(id: string): SendGridRef {
752
- return createRef<"sendgrid", SendGridClient>("sendgrid", id);
791
+ export function sendGrid<T extends string>(id: LiteralString<T>): SendGridRef {
792
+ return createRef<"sendgrid", SendGridClient, T>("sendgrid", id);
753
793
  }
754
794
 
755
795
  /**
@@ -758,8 +798,10 @@ export function sendGrid(id: string): SendGridRef {
758
798
  * @param id - The integration ID (UUID)
759
799
  * @returns An integration reference for use in the API config
760
800
  */
761
- export function stabilityAI(id: string): StabilityAIRef {
762
- return createRef<"stabilityai", StabilityAIClient>("stabilityai", id);
801
+ export function stabilityAI<T extends string>(
802
+ id: LiteralString<T>,
803
+ ): StabilityAIRef {
804
+ return createRef<"stabilityai", StabilityAIClient, T>("stabilityai", id);
763
805
  }
764
806
 
765
807
  /**
@@ -768,8 +810,8 @@ export function stabilityAI(id: string): StabilityAIRef {
768
810
  * @param id - The integration ID (UUID)
769
811
  * @returns An integration reference for use in the API config
770
812
  */
771
- export function twilio(id: string): TwilioRef {
772
- return createRef<"twilio", TwilioClient>("twilio", id);
813
+ export function twilio<T extends string>(id: LiteralString<T>): TwilioRef {
814
+ return createRef<"twilio", TwilioClient, T>("twilio", id);
773
815
  }
774
816
 
775
817
  /**
@@ -778,8 +820,8 @@ export function twilio(id: string): TwilioRef {
778
820
  * @param id - The integration ID (UUID)
779
821
  * @returns An integration reference for use in the API config
780
822
  */
781
- export function zendesk(id: string): ZendeskRef {
782
- return createRef<"zendesk", ZendeskClient>("zendesk", id);
823
+ export function zendesk<T extends string>(id: LiteralString<T>): ZendeskRef {
824
+ return createRef<"zendesk", ZendeskClient, T>("zendesk", id);
783
825
  }
784
826
 
785
827
  /**
@@ -788,8 +830,8 @@ export function zendesk(id: string): ZendeskRef {
788
830
  * @param id - The integration ID (UUID)
789
831
  * @returns An integration reference for use in the API config
790
832
  */
791
- export function zoom(id: string): ZoomRef {
792
- return createRef<"zoom", ZoomClient>("zoom", id);
833
+ export function zoom<T extends string>(id: LiteralString<T>): ZoomRef {
834
+ return createRef<"zoom", ZoomClient, T>("zoom", id);
793
835
  }
794
836
 
795
837
  /**
@@ -798,8 +840,8 @@ export function zoom(id: string): ZoomRef {
798
840
  * @param id - The integration ID (UUID)
799
841
  * @returns An integration reference for use in the API config
800
842
  */
801
- export function graphql(id: string): GraphQLRef {
802
- return createRef<"graphqlintegration", GraphQLClient>(
843
+ export function graphql<T extends string>(id: LiteralString<T>): GraphQLRef {
844
+ return createRef<"graphqlintegration", GraphQLClient, T>(
803
845
  "graphqlintegration",
804
846
  id,
805
847
  );
@@ -811,8 +853,8 @@ export function graphql(id: string): GraphQLRef {
811
853
  * @param id - The integration ID (UUID)
812
854
  * @returns An integration reference for use in the API config
813
855
  */
814
- export function mysql(id: string): MySQLRef {
815
- return createRef<"mysql", MySQLClient>("mysql", id);
856
+ export function mysql<T extends string>(id: LiteralString<T>): MySQLRef {
857
+ return createRef<"mysql", MySQLClient, T>("mysql", id);
816
858
  }
817
859
 
818
860
  /**
@@ -821,8 +863,8 @@ export function mysql(id: string): MySQLRef {
821
863
  * @param id - The integration ID (UUID)
822
864
  * @returns An integration reference for use in the API config
823
865
  */
824
- export function mariadb(id: string): MariaDBRef {
825
- return createRef<"mariadb", MariaDBClient>("mariadb", id);
866
+ export function mariadb<T extends string>(id: LiteralString<T>): MariaDBRef {
867
+ return createRef<"mariadb", MariaDBClient, T>("mariadb", id);
826
868
  }
827
869
 
828
870
  /**
@@ -831,8 +873,8 @@ export function mariadb(id: string): MariaDBRef {
831
873
  * @param id - The integration ID (UUID)
832
874
  * @returns An integration reference for use in the API config
833
875
  */
834
- export function mssql(id: string): MSSQLRef {
835
- return createRef<"mssql", MSSQLClient>("mssql", id);
876
+ export function mssql<T extends string>(id: LiteralString<T>): MSSQLRef {
877
+ return createRef<"mssql", MSSQLClient, T>("mssql", id);
836
878
  }
837
879
 
838
880
  /**
@@ -841,8 +883,10 @@ export function mssql(id: string): MSSQLRef {
841
883
  * @param id - The integration ID (UUID)
842
884
  * @returns An integration reference for use in the API config
843
885
  */
844
- export function cockroachdb(id: string): CockroachDBRef {
845
- return createRef<"cockroachdb", CockroachDBClient>("cockroachdb", id);
886
+ export function cockroachdb<T extends string>(
887
+ id: LiteralString<T>,
888
+ ): CockroachDBRef {
889
+ return createRef<"cockroachdb", CockroachDBClient, T>("cockroachdb", id);
846
890
  }
847
891
 
848
892
  /**
@@ -851,8 +895,8 @@ export function cockroachdb(id: string): CockroachDBRef {
851
895
  * @param id - The integration ID (UUID)
852
896
  * @returns An integration reference for use in the API config
853
897
  */
854
- export function oracledb(id: string): OracleDBRef {
855
- return createRef<"oracledb", OracleDBClient>("oracledb", id);
898
+ export function oracledb<T extends string>(id: LiteralString<T>): OracleDBRef {
899
+ return createRef<"oracledb", OracleDBClient, T>("oracledb", id);
856
900
  }
857
901
 
858
902
  /**
@@ -861,8 +905,8 @@ export function oracledb(id: string): OracleDBRef {
861
905
  * @param id - The integration ID (UUID)
862
906
  * @returns An integration reference for use in the API config
863
907
  */
864
- export function redshift(id: string): RedshiftRef {
865
- return createRef<"redshift", RedshiftClient>("redshift", id);
908
+ export function redshift<T extends string>(id: LiteralString<T>): RedshiftRef {
909
+ return createRef<"redshift", RedshiftClient, T>("redshift", id);
866
910
  }
867
911
 
868
912
  /**
@@ -871,8 +915,8 @@ export function redshift(id: string): RedshiftRef {
871
915
  * @param id - The integration ID (UUID)
872
916
  * @returns An integration reference for use in the API config
873
917
  */
874
- export function athena(id: string): AthenaRef {
875
- return createRef<"athena", AthenaClient>("athena", id);
918
+ export function athena<T extends string>(id: LiteralString<T>): AthenaRef {
919
+ return createRef<"athena", AthenaClient, T>("athena", id);
876
920
  }
877
921
 
878
922
  /**
@@ -881,8 +925,10 @@ export function athena(id: string): AthenaRef {
881
925
  * @param id - The integration ID (UUID)
882
926
  * @returns An integration reference for use in the API config
883
927
  */
884
- export function databricks(id: string): DatabricksRef {
885
- return createRef<"databricks", DatabricksClient>("databricks", id);
928
+ export function databricks<T extends string>(
929
+ id: LiteralString<T>,
930
+ ): DatabricksRef {
931
+ return createRef<"databricks", DatabricksClient, T>("databricks", id);
886
932
  }
887
933
 
888
934
  /**
@@ -891,8 +937,8 @@ export function databricks(id: string): DatabricksRef {
891
937
  * @param id - The integration ID (UUID)
892
938
  * @returns An integration reference for use in the API config
893
939
  */
894
- export function bigquery(id: string): BigQueryRef {
895
- return createRef<"bigquery", BigQueryClient>("bigquery", id);
940
+ export function bigquery<T extends string>(id: LiteralString<T>): BigQueryRef {
941
+ return createRef<"bigquery", BigQueryClient, T>("bigquery", id);
896
942
  }
897
943
 
898
944
  /**
@@ -901,8 +947,8 @@ export function bigquery(id: string): BigQueryRef {
901
947
  * @param id - The integration ID (UUID)
902
948
  * @returns An integration reference for use in the API config
903
949
  */
904
- export function mongodb(id: string): MongoDBRef {
905
- return createRef<"mongodb", MongoDBClient>("mongodb", id);
950
+ export function mongodb<T extends string>(id: LiteralString<T>): MongoDBRef {
951
+ return createRef<"mongodb", MongoDBClient, T>("mongodb", id);
906
952
  }
907
953
 
908
954
  /**
@@ -911,8 +957,8 @@ export function mongodb(id: string): MongoDBRef {
911
957
  * @param id - The integration ID (UUID)
912
958
  * @returns An integration reference for use in the API config
913
959
  */
914
- export function dynamodb(id: string): DynamoDBRef {
915
- return createRef<"dynamodb", DynamoDBClient>("dynamodb", id);
960
+ export function dynamodb<T extends string>(id: LiteralString<T>): DynamoDBRef {
961
+ return createRef<"dynamodb", DynamoDBClient, T>("dynamodb", id);
916
962
  }
917
963
 
918
964
  /**
@@ -921,8 +967,8 @@ export function dynamodb(id: string): DynamoDBRef {
921
967
  * @param id - The integration ID (UUID)
922
968
  * @returns An integration reference for use in the API config
923
969
  */
924
- export function cosmosdb(id: string): CosmosDBRef {
925
- return createRef<"cosmosdb", CosmosDBClient>("cosmosdb", id);
970
+ export function cosmosdb<T extends string>(id: LiteralString<T>): CosmosDBRef {
971
+ return createRef<"cosmosdb", CosmosDBClient, T>("cosmosdb", id);
926
972
  }
927
973
 
928
974
  /**
@@ -931,8 +977,10 @@ export function cosmosdb(id: string): CosmosDBRef {
931
977
  * @param id - The integration ID (UUID)
932
978
  * @returns An integration reference for use in the API config
933
979
  */
934
- export function couchbase(id: string): CouchbaseRef {
935
- return createRef<"couchbase", CouchbaseClient>("couchbase", id);
980
+ export function couchbase<T extends string>(
981
+ id: LiteralString<T>,
982
+ ): CouchbaseRef {
983
+ return createRef<"couchbase", CouchbaseClient, T>("couchbase", id);
936
984
  }
937
985
 
938
986
  /**
@@ -941,8 +989,8 @@ export function couchbase(id: string): CouchbaseRef {
941
989
  * @param id - The integration ID (UUID)
942
990
  * @returns An integration reference for use in the API config
943
991
  */
944
- export function s3(id: string): S3Ref {
945
- return createRef<"s3", S3Client>("s3", id);
992
+ export function s3<T extends string>(id: LiteralString<T>): S3Ref {
993
+ return createRef<"s3", S3Client, T>("s3", id);
946
994
  }
947
995
 
948
996
  /**
@@ -951,8 +999,8 @@ export function s3(id: string): S3Ref {
951
999
  * @param id - The integration ID (UUID)
952
1000
  * @returns An integration reference for use in the API config
953
1001
  */
954
- export function gcs(id: string): GCSRef {
955
- return createRef<"gcs", GCSClient>("gcs", id);
1002
+ export function gcs<T extends string>(id: LiteralString<T>): GCSRef {
1003
+ return createRef<"gcs", GCSClient, T>("gcs", id);
956
1004
  }
957
1005
 
958
1006
  /**
@@ -961,8 +1009,10 @@ export function gcs(id: string): GCSRef {
961
1009
  * @param id - The integration ID (UUID)
962
1010
  * @returns An integration reference for use in the API config
963
1011
  */
964
- export function googleSheets(id: string): GoogleSheetsRef {
965
- return createRef<"gsheets", GoogleSheetsClient>("gsheets", id);
1012
+ export function googleSheets<T extends string>(
1013
+ id: LiteralString<T>,
1014
+ ): GoogleSheetsRef {
1015
+ return createRef<"gsheets", GoogleSheetsClient, T>("gsheets", id);
966
1016
  }
967
1017
 
968
1018
  /**
@@ -971,8 +1021,8 @@ export function googleSheets(id: string): GoogleSheetsRef {
971
1021
  * @param id - The integration ID (UUID)
972
1022
  * @returns An integration reference for use in the API config
973
1023
  */
974
- export function kafka(id: string): KafkaRef {
975
- return createRef<"kafka", KafkaClient>("kafka", id);
1024
+ export function kafka<T extends string>(id: LiteralString<T>): KafkaRef {
1025
+ return createRef<"kafka", KafkaClient, T>("kafka", id);
976
1026
  }
977
1027
 
978
1028
  /**
@@ -981,8 +1031,8 @@ export function kafka(id: string): KafkaRef {
981
1031
  * @param id - The integration ID (UUID)
982
1032
  * @returns An integration reference for use in the API config
983
1033
  */
984
- export function kinesis(id: string): KinesisRef {
985
- return createRef<"kinesis", KinesisClient>("kinesis", id);
1034
+ export function kinesis<T extends string>(id: LiteralString<T>): KinesisRef {
1035
+ return createRef<"kinesis", KinesisClient, T>("kinesis", id);
986
1036
  }
987
1037
 
988
1038
  /**
@@ -991,8 +1041,10 @@ export function kinesis(id: string): KinesisRef {
991
1041
  * @param id - The integration ID (UUID)
992
1042
  * @returns An integration reference for use in the API config
993
1043
  */
994
- export function salesforce(id: string): SalesforceRef {
995
- return createRef<"salesforce", SalesforceClient>("salesforce", id);
1044
+ export function salesforce<T extends string>(
1045
+ id: LiteralString<T>,
1046
+ ): SalesforceRef {
1047
+ return createRef<"salesforce", SalesforceClient, T>("salesforce", id);
996
1048
  }
997
1049
 
998
1050
  /**
@@ -1001,8 +1053,8 @@ export function salesforce(id: string): SalesforceRef {
1001
1053
  * @param id - The integration ID (UUID)
1002
1054
  * @returns An integration reference for use in the API config
1003
1055
  */
1004
- export function redis(id: string): RedisRef {
1005
- return createRef<"redis", RedisClient>("redis", id);
1056
+ export function redis<T extends string>(id: LiteralString<T>): RedisRef {
1057
+ return createRef<"redis", RedisClient, T>("redis", id);
1006
1058
  }
1007
1059
 
1008
1060
  /**
@@ -1011,8 +1063,10 @@ export function redis(id: string): RedisRef {
1011
1063
  * @param id - The integration ID (UUID)
1012
1064
  * @returns An integration reference for use in the API config
1013
1065
  */
1014
- export function superblocksOcr(id: string): SuperblocksOCRRef {
1015
- return createRef<"superblocks-ocr", SuperblocksOCRClient>(
1066
+ export function superblocksOcr<T extends string>(
1067
+ id: LiteralString<T>,
1068
+ ): SuperblocksOCRRef {
1069
+ return createRef<"superblocks-ocr", SuperblocksOCRClient, T>(
1016
1070
  "superblocks-ocr",
1017
1071
  id,
1018
1072
  );
@@ -1024,8 +1078,8 @@ export function superblocksOcr(id: string): SuperblocksOCRRef {
1024
1078
  * @param id - The integration ID (UUID)
1025
1079
  * @returns An integration reference for use in the API config
1026
1080
  */
1027
- export function python(id: string): PythonRef {
1028
- return createRef<"python", PythonClient>("python", id);
1081
+ export function python<T extends string>(id: LiteralString<T>): PythonRef {
1082
+ return createRef<"python", PythonClient, T>("python", id);
1029
1083
  }
1030
1084
 
1031
1085
  /**
@@ -1034,8 +1088,10 @@ export function python(id: string): PythonRef {
1034
1088
  * @param id - The integration ID (UUID)
1035
1089
  * @returns An integration reference for use in the API config
1036
1090
  */
1037
- export function confluent(id: string): ConfluentRef {
1038
- return createRef<"confluent", KafkaClient>("confluent", id);
1091
+ export function confluent<T extends string>(
1092
+ id: LiteralString<T>,
1093
+ ): ConfluentRef {
1094
+ return createRef<"confluent", KafkaClient, T>("confluent", id);
1039
1095
  }
1040
1096
 
1041
1097
  /**
@@ -1044,8 +1100,8 @@ export function confluent(id: string): ConfluentRef {
1044
1100
  * @param id - The integration ID (UUID)
1045
1101
  * @returns An integration reference for use in the API config
1046
1102
  */
1047
- export function redpanda(id: string): RedpandaRef {
1048
- return createRef<"redpanda", KafkaClient>("redpanda", id);
1103
+ export function redpanda<T extends string>(id: LiteralString<T>): RedpandaRef {
1104
+ return createRef<"redpanda", KafkaClient, T>("redpanda", id);
1049
1105
  }
1050
1106
 
1051
1107
  /**
@@ -1054,8 +1110,8 @@ export function redpanda(id: string): RedpandaRef {
1054
1110
  * @param id - The integration ID (UUID)
1055
1111
  * @returns An integration reference for use in the API config
1056
1112
  */
1057
- export function lakebase(id: string): LakebaseRef {
1058
- return createRef<"lakebase", LakebaseClient>("lakebase", id);
1113
+ export function lakebase<T extends string>(id: LiteralString<T>): LakebaseRef {
1114
+ return createRef<"lakebase", LakebaseClient, T>("lakebase", id);
1059
1115
  }
1060
1116
 
1061
1117
  /**
@@ -1064,8 +1120,10 @@ export function lakebase(id: string): LakebaseRef {
1064
1120
  * @param id - The integration ID (UUID)
1065
1121
  * @returns An integration reference for use in the API config
1066
1122
  */
1067
- export function snowflakePostgres(id: string): SnowflakePostgresRef {
1068
- return createRef<"snowflakepostgres", SnowflakePostgresClient>(
1123
+ export function snowflakePostgres<T extends string>(
1124
+ id: LiteralString<T>,
1125
+ ): SnowflakePostgresRef {
1126
+ return createRef<"snowflakepostgres", SnowflakePostgresClient, T>(
1069
1127
  "snowflakepostgres",
1070
1128
  id,
1071
1129
  );
@@ -1077,8 +1135,47 @@ export function snowflakePostgres(id: string): SnowflakePostgresRef {
1077
1135
  * @param id - The integration ID (UUID)
1078
1136
  * @returns An integration reference for use in the API config
1079
1137
  */
1080
- export function smtp(id: string): SmtpRef {
1081
- return createRef<"smtp", SmtpClient>("smtp", id);
1138
+ export function smtp<T extends string>(id: LiteralString<T>): SmtpRef {
1139
+ return createRef<"smtp", SmtpClient, T>("smtp", id);
1140
+ }
1141
+
1142
+ /**
1143
+ * Declare a REST API Integration.
1144
+ *
1145
+ * Use this for REST API Integrations configured with a base URL and
1146
+ * authentication in the integrations page.
1147
+ *
1148
+ * @param id - The integration ID (UUID)
1149
+ * @returns An integration reference for use in the API config
1150
+ *
1151
+ * @example
1152
+ * ```typescript
1153
+ * import { api, z, restApiIntegration } from '@superblocksteam/sdk-api';
1154
+ *
1155
+ * const MY_API = 'a1b2c3d4-uuid';
1156
+ *
1157
+ * export default api({
1158
+ * integrations: {
1159
+ * myApi: restApiIntegration(MY_API),
1160
+ * },
1161
+ * output: z.object({ users: z.array(z.unknown()) }),
1162
+ * async run(ctx) {
1163
+ * const users = await ctx.integrations.myApi.apiRequest(
1164
+ * { method: 'GET', path: '/users' },
1165
+ * { response: z.object({ users: z.array(z.unknown()) }) },
1166
+ * );
1167
+ * return users;
1168
+ * },
1169
+ * });
1170
+ * ```
1171
+ */
1172
+ export function restApiIntegration<T extends string>(
1173
+ id: LiteralString<T>,
1174
+ ): RestApiIntegrationRef {
1175
+ return createRef<"restapiintegration", RestApiIntegrationPluginClient, T>(
1176
+ "restapiintegration",
1177
+ id,
1178
+ );
1082
1179
  }
1083
1180
 
1084
1181
  // -----------------------------------------------------------------------------