@aws/nx-plugin 0.94.0 → 0.94.2
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.
- package/LICENSE-THIRD-PARTY +19 -577
- package/package.json +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +228 -106
- package/src/py/mcp-server/generator.js +1 -1
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/strands-agent/generator.js +1 -1
- package/src/py/strands-agent/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +228 -106
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +114 -53
- package/src/utils/bundle/bundle.d.ts +2 -2
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
|
@@ -1586,20 +1586,6 @@ export interface HttpApiIntegration {
|
|
|
1586
1586
|
options?: Omit<AddRoutesOptions, 'path' | 'methods' | 'integration'>;
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
1589
|
-
/**
|
|
1590
|
-
* Common options shared by all IntegrationBuilder configurations
|
|
1591
|
-
*/
|
|
1592
|
-
interface IntegrationBuilderPropsBase<
|
|
1593
|
-
TOperation extends string,
|
|
1594
|
-
TDefaultIntegrationProps extends object,
|
|
1595
|
-
> {
|
|
1596
|
-
/** Map of operation names to their API path and HTTP method details */
|
|
1597
|
-
operations: Record<TOperation, OperationDetails>;
|
|
1598
|
-
|
|
1599
|
-
/** Default configuration options for integrations */
|
|
1600
|
-
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
1589
|
/**
|
|
1604
1590
|
* Options for constructing an IntegrationBuilder with a shared integration pattern.
|
|
1605
1591
|
* A single default integration is built once (for '$router') and reused for all operations.
|
|
@@ -1608,8 +1594,12 @@ interface SharedIntegrationBuilderProps<
|
|
|
1608
1594
|
TOperation extends string,
|
|
1609
1595
|
TDefaultIntegrationProps extends object,
|
|
1610
1596
|
TDefaultIntegration,
|
|
1611
|
-
>
|
|
1597
|
+
> {
|
|
1612
1598
|
pattern: 'shared';
|
|
1599
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
1600
|
+
operations: Record<TOperation, OperationDetails>;
|
|
1601
|
+
/** Default configuration options for integrations */
|
|
1602
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
1613
1603
|
/** Function to create a default integration for the shared router */
|
|
1614
1604
|
buildDefaultIntegration: (
|
|
1615
1605
|
op: '$router',
|
|
@@ -1625,8 +1615,12 @@ interface IsolatedIntegrationBuilderProps<
|
|
|
1625
1615
|
TOperation extends string,
|
|
1626
1616
|
TDefaultIntegrationProps extends object,
|
|
1627
1617
|
TDefaultIntegration,
|
|
1628
|
-
>
|
|
1618
|
+
> {
|
|
1629
1619
|
pattern: 'isolated';
|
|
1620
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
1621
|
+
operations: Record<TOperation, OperationDetails>;
|
|
1622
|
+
/** Default configuration options for integrations */
|
|
1623
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
1630
1624
|
/** Function to create a default integration for an operation */
|
|
1631
1625
|
buildDefaultIntegration: (
|
|
1632
1626
|
op: TOperation,
|
|
@@ -1654,25 +1648,6 @@ export type IntegrationBuilderProps<
|
|
|
1654
1648
|
TDefaultIntegration
|
|
1655
1649
|
>;
|
|
1656
1650
|
|
|
1657
|
-
/**
|
|
1658
|
-
* Extracts the IntegrationBuilderProps variant matching the given pattern.
|
|
1659
|
-
*/
|
|
1660
|
-
type IntegrationBuilderPropsForPattern<
|
|
1661
|
-
TOperation extends string,
|
|
1662
|
-
TBaseIntegration,
|
|
1663
|
-
TDefaultIntegrationProps extends object,
|
|
1664
|
-
TDefaultIntegration extends TBaseIntegration,
|
|
1665
|
-
TPattern extends 'shared' | 'isolated',
|
|
1666
|
-
> = Extract<
|
|
1667
|
-
IntegrationBuilderProps<
|
|
1668
|
-
TOperation,
|
|
1669
|
-
TBaseIntegration,
|
|
1670
|
-
TDefaultIntegrationProps,
|
|
1671
|
-
TDefaultIntegration
|
|
1672
|
-
>,
|
|
1673
|
-
{ pattern: TPattern }
|
|
1674
|
-
>;
|
|
1675
|
-
|
|
1676
1651
|
/**
|
|
1677
1652
|
* Resolves the default integration keys based on the pattern.
|
|
1678
1653
|
* - 'shared': only '$router' is a default key
|
|
@@ -1732,22 +1707,65 @@ export class IntegrationBuilder<
|
|
|
1732
1707
|
private integrations: Partial<TIntegrations> = {};
|
|
1733
1708
|
|
|
1734
1709
|
/**
|
|
1735
|
-
* Create an Integration Builder for an HTTP API
|
|
1710
|
+
* Create an Integration Builder for an HTTP API with a shared pattern
|
|
1736
1711
|
*/
|
|
1737
|
-
public static http
|
|
1712
|
+
public static http<
|
|
1738
1713
|
TOperation extends string,
|
|
1739
1714
|
TDefaultIntegrationProps extends object,
|
|
1740
1715
|
TDefaultIntegration extends HttpApiIntegration,
|
|
1741
|
-
TPattern extends 'shared' | 'isolated',
|
|
1742
1716
|
>(
|
|
1743
|
-
options:
|
|
1717
|
+
options: SharedIntegrationBuilderProps<
|
|
1744
1718
|
TOperation,
|
|
1745
|
-
HttpApiIntegration,
|
|
1746
1719
|
TDefaultIntegrationProps,
|
|
1747
|
-
TDefaultIntegration
|
|
1748
|
-
TPattern
|
|
1720
|
+
TDefaultIntegration
|
|
1749
1721
|
>,
|
|
1750
|
-
)
|
|
1722
|
+
): IntegrationBuilder<
|
|
1723
|
+
TOperation,
|
|
1724
|
+
HttpApiIntegration,
|
|
1725
|
+
Record<'$router', TDefaultIntegration>,
|
|
1726
|
+
TDefaultIntegrationProps,
|
|
1727
|
+
TDefaultIntegration,
|
|
1728
|
+
'shared'
|
|
1729
|
+
>;
|
|
1730
|
+
/**
|
|
1731
|
+
* Create an Integration Builder for an HTTP API with an isolated pattern
|
|
1732
|
+
*/
|
|
1733
|
+
public static http<
|
|
1734
|
+
TOperation extends string,
|
|
1735
|
+
TDefaultIntegrationProps extends object,
|
|
1736
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
1737
|
+
>(
|
|
1738
|
+
options: IsolatedIntegrationBuilderProps<
|
|
1739
|
+
TOperation,
|
|
1740
|
+
TDefaultIntegrationProps,
|
|
1741
|
+
TDefaultIntegration
|
|
1742
|
+
>,
|
|
1743
|
+
): IntegrationBuilder<
|
|
1744
|
+
TOperation,
|
|
1745
|
+
HttpApiIntegration,
|
|
1746
|
+
Record<TOperation, TDefaultIntegration>,
|
|
1747
|
+
TDefaultIntegrationProps,
|
|
1748
|
+
TDefaultIntegration,
|
|
1749
|
+
'isolated'
|
|
1750
|
+
>;
|
|
1751
|
+
public static http<
|
|
1752
|
+
TOperation extends string,
|
|
1753
|
+
TDefaultIntegrationProps extends object,
|
|
1754
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
1755
|
+
TPattern extends 'shared' | 'isolated',
|
|
1756
|
+
>(
|
|
1757
|
+
options:
|
|
1758
|
+
| SharedIntegrationBuilderProps<
|
|
1759
|
+
TOperation,
|
|
1760
|
+
TDefaultIntegrationProps,
|
|
1761
|
+
TDefaultIntegration
|
|
1762
|
+
>
|
|
1763
|
+
| IsolatedIntegrationBuilderProps<
|
|
1764
|
+
TOperation,
|
|
1765
|
+
TDefaultIntegrationProps,
|
|
1766
|
+
TDefaultIntegration
|
|
1767
|
+
>,
|
|
1768
|
+
) {
|
|
1751
1769
|
return new IntegrationBuilder<
|
|
1752
1770
|
TOperation,
|
|
1753
1771
|
HttpApiIntegration,
|
|
@@ -1756,25 +1774,68 @@ export class IntegrationBuilder<
|
|
|
1756
1774
|
TDefaultIntegration,
|
|
1757
1775
|
TPattern
|
|
1758
1776
|
>(options);
|
|
1759
|
-
}
|
|
1777
|
+
}
|
|
1760
1778
|
|
|
1761
1779
|
/**
|
|
1762
|
-
* Create an Integration Builder for a REST API
|
|
1780
|
+
* Create an Integration Builder for a REST API with a shared pattern
|
|
1763
1781
|
*/
|
|
1764
|
-
public static rest
|
|
1782
|
+
public static rest<
|
|
1765
1783
|
TOperation extends string,
|
|
1766
1784
|
TDefaultIntegrationProps extends object,
|
|
1767
1785
|
TDefaultIntegration extends RestApiIntegration,
|
|
1768
|
-
TPattern extends 'shared' | 'isolated',
|
|
1769
1786
|
>(
|
|
1770
|
-
options:
|
|
1787
|
+
options: SharedIntegrationBuilderProps<
|
|
1771
1788
|
TOperation,
|
|
1772
|
-
RestApiIntegration,
|
|
1773
1789
|
TDefaultIntegrationProps,
|
|
1774
|
-
TDefaultIntegration
|
|
1775
|
-
|
|
1790
|
+
TDefaultIntegration
|
|
1791
|
+
>,
|
|
1792
|
+
): IntegrationBuilder<
|
|
1793
|
+
TOperation,
|
|
1794
|
+
RestApiIntegration,
|
|
1795
|
+
Record<'$router', TDefaultIntegration>,
|
|
1796
|
+
TDefaultIntegrationProps,
|
|
1797
|
+
TDefaultIntegration,
|
|
1798
|
+
'shared'
|
|
1799
|
+
>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Create an Integration Builder for a REST API with an isolated pattern
|
|
1802
|
+
*/
|
|
1803
|
+
public static rest<
|
|
1804
|
+
TOperation extends string,
|
|
1805
|
+
TDefaultIntegrationProps extends object,
|
|
1806
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
1807
|
+
>(
|
|
1808
|
+
options: IsolatedIntegrationBuilderProps<
|
|
1809
|
+
TOperation,
|
|
1810
|
+
TDefaultIntegrationProps,
|
|
1811
|
+
TDefaultIntegration
|
|
1776
1812
|
>,
|
|
1777
|
-
)
|
|
1813
|
+
): IntegrationBuilder<
|
|
1814
|
+
TOperation,
|
|
1815
|
+
RestApiIntegration,
|
|
1816
|
+
Record<TOperation, TDefaultIntegration>,
|
|
1817
|
+
TDefaultIntegrationProps,
|
|
1818
|
+
TDefaultIntegration,
|
|
1819
|
+
'isolated'
|
|
1820
|
+
>;
|
|
1821
|
+
public static rest<
|
|
1822
|
+
TOperation extends string,
|
|
1823
|
+
TDefaultIntegrationProps extends object,
|
|
1824
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
1825
|
+
TPattern extends 'shared' | 'isolated',
|
|
1826
|
+
>(
|
|
1827
|
+
options:
|
|
1828
|
+
| SharedIntegrationBuilderProps<
|
|
1829
|
+
TOperation,
|
|
1830
|
+
TDefaultIntegrationProps,
|
|
1831
|
+
TDefaultIntegration
|
|
1832
|
+
>
|
|
1833
|
+
| IsolatedIntegrationBuilderProps<
|
|
1834
|
+
TOperation,
|
|
1835
|
+
TDefaultIntegrationProps,
|
|
1836
|
+
TDefaultIntegration
|
|
1837
|
+
>,
|
|
1838
|
+
) {
|
|
1778
1839
|
return new IntegrationBuilder<
|
|
1779
1840
|
TOperation,
|
|
1780
1841
|
RestApiIntegration,
|
|
@@ -1783,7 +1844,7 @@ export class IntegrationBuilder<
|
|
|
1783
1844
|
TDefaultIntegration,
|
|
1784
1845
|
TPattern
|
|
1785
1846
|
>(options);
|
|
1786
|
-
}
|
|
1847
|
+
}
|
|
1787
1848
|
|
|
1788
1849
|
private constructor(
|
|
1789
1850
|
options: IntegrationBuilderProps<
|
|
@@ -2377,20 +2438,6 @@ export interface HttpApiIntegration {
|
|
|
2377
2438
|
options?: Omit<AddRoutesOptions, 'path' | 'methods' | 'integration'>;
|
|
2378
2439
|
}
|
|
2379
2440
|
|
|
2380
|
-
/**
|
|
2381
|
-
* Common options shared by all IntegrationBuilder configurations
|
|
2382
|
-
*/
|
|
2383
|
-
interface IntegrationBuilderPropsBase<
|
|
2384
|
-
TOperation extends string,
|
|
2385
|
-
TDefaultIntegrationProps extends object,
|
|
2386
|
-
> {
|
|
2387
|
-
/** Map of operation names to their API path and HTTP method details */
|
|
2388
|
-
operations: Record<TOperation, OperationDetails>;
|
|
2389
|
-
|
|
2390
|
-
/** Default configuration options for integrations */
|
|
2391
|
-
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
2441
|
/**
|
|
2395
2442
|
* Options for constructing an IntegrationBuilder with a shared integration pattern.
|
|
2396
2443
|
* A single default integration is built once (for '$router') and reused for all operations.
|
|
@@ -2399,8 +2446,12 @@ interface SharedIntegrationBuilderProps<
|
|
|
2399
2446
|
TOperation extends string,
|
|
2400
2447
|
TDefaultIntegrationProps extends object,
|
|
2401
2448
|
TDefaultIntegration,
|
|
2402
|
-
>
|
|
2449
|
+
> {
|
|
2403
2450
|
pattern: 'shared';
|
|
2451
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
2452
|
+
operations: Record<TOperation, OperationDetails>;
|
|
2453
|
+
/** Default configuration options for integrations */
|
|
2454
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
2404
2455
|
/** Function to create a default integration for the shared router */
|
|
2405
2456
|
buildDefaultIntegration: (
|
|
2406
2457
|
op: '$router',
|
|
@@ -2416,8 +2467,12 @@ interface IsolatedIntegrationBuilderProps<
|
|
|
2416
2467
|
TOperation extends string,
|
|
2417
2468
|
TDefaultIntegrationProps extends object,
|
|
2418
2469
|
TDefaultIntegration,
|
|
2419
|
-
>
|
|
2470
|
+
> {
|
|
2420
2471
|
pattern: 'isolated';
|
|
2472
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
2473
|
+
operations: Record<TOperation, OperationDetails>;
|
|
2474
|
+
/** Default configuration options for integrations */
|
|
2475
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
2421
2476
|
/** Function to create a default integration for an operation */
|
|
2422
2477
|
buildDefaultIntegration: (
|
|
2423
2478
|
op: TOperation,
|
|
@@ -2445,25 +2500,6 @@ export type IntegrationBuilderProps<
|
|
|
2445
2500
|
TDefaultIntegration
|
|
2446
2501
|
>;
|
|
2447
2502
|
|
|
2448
|
-
/**
|
|
2449
|
-
* Extracts the IntegrationBuilderProps variant matching the given pattern.
|
|
2450
|
-
*/
|
|
2451
|
-
type IntegrationBuilderPropsForPattern<
|
|
2452
|
-
TOperation extends string,
|
|
2453
|
-
TBaseIntegration,
|
|
2454
|
-
TDefaultIntegrationProps extends object,
|
|
2455
|
-
TDefaultIntegration extends TBaseIntegration,
|
|
2456
|
-
TPattern extends 'shared' | 'isolated',
|
|
2457
|
-
> = Extract<
|
|
2458
|
-
IntegrationBuilderProps<
|
|
2459
|
-
TOperation,
|
|
2460
|
-
TBaseIntegration,
|
|
2461
|
-
TDefaultIntegrationProps,
|
|
2462
|
-
TDefaultIntegration
|
|
2463
|
-
>,
|
|
2464
|
-
{ pattern: TPattern }
|
|
2465
|
-
>;
|
|
2466
|
-
|
|
2467
2503
|
/**
|
|
2468
2504
|
* Resolves the default integration keys based on the pattern.
|
|
2469
2505
|
* - 'shared': only '$router' is a default key
|
|
@@ -2523,22 +2559,65 @@ export class IntegrationBuilder<
|
|
|
2523
2559
|
private integrations: Partial<TIntegrations> = {};
|
|
2524
2560
|
|
|
2525
2561
|
/**
|
|
2526
|
-
* Create an Integration Builder for an HTTP API
|
|
2562
|
+
* Create an Integration Builder for an HTTP API with a shared pattern
|
|
2527
2563
|
*/
|
|
2528
|
-
public static http
|
|
2564
|
+
public static http<
|
|
2529
2565
|
TOperation extends string,
|
|
2530
2566
|
TDefaultIntegrationProps extends object,
|
|
2531
2567
|
TDefaultIntegration extends HttpApiIntegration,
|
|
2532
|
-
TPattern extends 'shared' | 'isolated',
|
|
2533
2568
|
>(
|
|
2534
|
-
options:
|
|
2569
|
+
options: SharedIntegrationBuilderProps<
|
|
2535
2570
|
TOperation,
|
|
2536
|
-
HttpApiIntegration,
|
|
2537
2571
|
TDefaultIntegrationProps,
|
|
2538
|
-
TDefaultIntegration
|
|
2539
|
-
TPattern
|
|
2572
|
+
TDefaultIntegration
|
|
2540
2573
|
>,
|
|
2541
|
-
)
|
|
2574
|
+
): IntegrationBuilder<
|
|
2575
|
+
TOperation,
|
|
2576
|
+
HttpApiIntegration,
|
|
2577
|
+
Record<'$router', TDefaultIntegration>,
|
|
2578
|
+
TDefaultIntegrationProps,
|
|
2579
|
+
TDefaultIntegration,
|
|
2580
|
+
'shared'
|
|
2581
|
+
>;
|
|
2582
|
+
/**
|
|
2583
|
+
* Create an Integration Builder for an HTTP API with an isolated pattern
|
|
2584
|
+
*/
|
|
2585
|
+
public static http<
|
|
2586
|
+
TOperation extends string,
|
|
2587
|
+
TDefaultIntegrationProps extends object,
|
|
2588
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
2589
|
+
>(
|
|
2590
|
+
options: IsolatedIntegrationBuilderProps<
|
|
2591
|
+
TOperation,
|
|
2592
|
+
TDefaultIntegrationProps,
|
|
2593
|
+
TDefaultIntegration
|
|
2594
|
+
>,
|
|
2595
|
+
): IntegrationBuilder<
|
|
2596
|
+
TOperation,
|
|
2597
|
+
HttpApiIntegration,
|
|
2598
|
+
Record<TOperation, TDefaultIntegration>,
|
|
2599
|
+
TDefaultIntegrationProps,
|
|
2600
|
+
TDefaultIntegration,
|
|
2601
|
+
'isolated'
|
|
2602
|
+
>;
|
|
2603
|
+
public static http<
|
|
2604
|
+
TOperation extends string,
|
|
2605
|
+
TDefaultIntegrationProps extends object,
|
|
2606
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
2607
|
+
TPattern extends 'shared' | 'isolated',
|
|
2608
|
+
>(
|
|
2609
|
+
options:
|
|
2610
|
+
| SharedIntegrationBuilderProps<
|
|
2611
|
+
TOperation,
|
|
2612
|
+
TDefaultIntegrationProps,
|
|
2613
|
+
TDefaultIntegration
|
|
2614
|
+
>
|
|
2615
|
+
| IsolatedIntegrationBuilderProps<
|
|
2616
|
+
TOperation,
|
|
2617
|
+
TDefaultIntegrationProps,
|
|
2618
|
+
TDefaultIntegration
|
|
2619
|
+
>,
|
|
2620
|
+
) {
|
|
2542
2621
|
return new IntegrationBuilder<
|
|
2543
2622
|
TOperation,
|
|
2544
2623
|
HttpApiIntegration,
|
|
@@ -2547,25 +2626,68 @@ export class IntegrationBuilder<
|
|
|
2547
2626
|
TDefaultIntegration,
|
|
2548
2627
|
TPattern
|
|
2549
2628
|
>(options);
|
|
2550
|
-
}
|
|
2629
|
+
}
|
|
2551
2630
|
|
|
2552
2631
|
/**
|
|
2553
|
-
* Create an Integration Builder for a REST API
|
|
2632
|
+
* Create an Integration Builder for a REST API with a shared pattern
|
|
2554
2633
|
*/
|
|
2555
|
-
public static rest
|
|
2634
|
+
public static rest<
|
|
2556
2635
|
TOperation extends string,
|
|
2557
2636
|
TDefaultIntegrationProps extends object,
|
|
2558
2637
|
TDefaultIntegration extends RestApiIntegration,
|
|
2559
|
-
TPattern extends 'shared' | 'isolated',
|
|
2560
2638
|
>(
|
|
2561
|
-
options:
|
|
2639
|
+
options: SharedIntegrationBuilderProps<
|
|
2562
2640
|
TOperation,
|
|
2563
|
-
RestApiIntegration,
|
|
2564
2641
|
TDefaultIntegrationProps,
|
|
2565
|
-
TDefaultIntegration
|
|
2566
|
-
|
|
2642
|
+
TDefaultIntegration
|
|
2643
|
+
>,
|
|
2644
|
+
): IntegrationBuilder<
|
|
2645
|
+
TOperation,
|
|
2646
|
+
RestApiIntegration,
|
|
2647
|
+
Record<'$router', TDefaultIntegration>,
|
|
2648
|
+
TDefaultIntegrationProps,
|
|
2649
|
+
TDefaultIntegration,
|
|
2650
|
+
'shared'
|
|
2651
|
+
>;
|
|
2652
|
+
/**
|
|
2653
|
+
* Create an Integration Builder for a REST API with an isolated pattern
|
|
2654
|
+
*/
|
|
2655
|
+
public static rest<
|
|
2656
|
+
TOperation extends string,
|
|
2657
|
+
TDefaultIntegrationProps extends object,
|
|
2658
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
2659
|
+
>(
|
|
2660
|
+
options: IsolatedIntegrationBuilderProps<
|
|
2661
|
+
TOperation,
|
|
2662
|
+
TDefaultIntegrationProps,
|
|
2663
|
+
TDefaultIntegration
|
|
2567
2664
|
>,
|
|
2568
|
-
)
|
|
2665
|
+
): IntegrationBuilder<
|
|
2666
|
+
TOperation,
|
|
2667
|
+
RestApiIntegration,
|
|
2668
|
+
Record<TOperation, TDefaultIntegration>,
|
|
2669
|
+
TDefaultIntegrationProps,
|
|
2670
|
+
TDefaultIntegration,
|
|
2671
|
+
'isolated'
|
|
2672
|
+
>;
|
|
2673
|
+
public static rest<
|
|
2674
|
+
TOperation extends string,
|
|
2675
|
+
TDefaultIntegrationProps extends object,
|
|
2676
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
2677
|
+
TPattern extends 'shared' | 'isolated',
|
|
2678
|
+
>(
|
|
2679
|
+
options:
|
|
2680
|
+
| SharedIntegrationBuilderProps<
|
|
2681
|
+
TOperation,
|
|
2682
|
+
TDefaultIntegrationProps,
|
|
2683
|
+
TDefaultIntegration
|
|
2684
|
+
>
|
|
2685
|
+
| IsolatedIntegrationBuilderProps<
|
|
2686
|
+
TOperation,
|
|
2687
|
+
TDefaultIntegrationProps,
|
|
2688
|
+
TDefaultIntegration
|
|
2689
|
+
>,
|
|
2690
|
+
) {
|
|
2569
2691
|
return new IntegrationBuilder<
|
|
2570
2692
|
TOperation,
|
|
2571
2693
|
RestApiIntegration,
|
|
@@ -2574,7 +2696,7 @@ export class IntegrationBuilder<
|
|
|
2574
2696
|
TDefaultIntegration,
|
|
2575
2697
|
TPattern
|
|
2576
2698
|
>(options);
|
|
2577
|
-
}
|
|
2699
|
+
}
|
|
2578
2700
|
|
|
2579
2701
|
private constructor(
|
|
2580
2702
|
options: IntegrationBuilderProps<
|
|
@@ -48,20 +48,6 @@ export interface HttpApiIntegration {
|
|
|
48
48
|
options?: Omit<AddRoutesOptions, 'path' | 'methods' | 'integration'>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* Common options shared by all IntegrationBuilder configurations
|
|
53
|
-
*/
|
|
54
|
-
interface IntegrationBuilderPropsBase<
|
|
55
|
-
TOperation extends string,
|
|
56
|
-
TDefaultIntegrationProps extends object,
|
|
57
|
-
> {
|
|
58
|
-
/** Map of operation names to their API path and HTTP method details */
|
|
59
|
-
operations: Record<TOperation, OperationDetails>;
|
|
60
|
-
|
|
61
|
-
/** Default configuration options for integrations */
|
|
62
|
-
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
51
|
/**
|
|
66
52
|
* Options for constructing an IntegrationBuilder with a shared integration pattern.
|
|
67
53
|
* A single default integration is built once (for '$router') and reused for all operations.
|
|
@@ -70,8 +56,12 @@ interface SharedIntegrationBuilderProps<
|
|
|
70
56
|
TOperation extends string,
|
|
71
57
|
TDefaultIntegrationProps extends object,
|
|
72
58
|
TDefaultIntegration,
|
|
73
|
-
>
|
|
59
|
+
> {
|
|
74
60
|
pattern: 'shared';
|
|
61
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
62
|
+
operations: Record<TOperation, OperationDetails>;
|
|
63
|
+
/** Default configuration options for integrations */
|
|
64
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
75
65
|
/** Function to create a default integration for the shared router */
|
|
76
66
|
buildDefaultIntegration: (
|
|
77
67
|
op: '$router',
|
|
@@ -87,8 +77,12 @@ interface IsolatedIntegrationBuilderProps<
|
|
|
87
77
|
TOperation extends string,
|
|
88
78
|
TDefaultIntegrationProps extends object,
|
|
89
79
|
TDefaultIntegration,
|
|
90
|
-
>
|
|
80
|
+
> {
|
|
91
81
|
pattern: 'isolated';
|
|
82
|
+
/** Map of operation names to their API path and HTTP method details */
|
|
83
|
+
operations: Record<TOperation, OperationDetails>;
|
|
84
|
+
/** Default configuration options for integrations */
|
|
85
|
+
defaultIntegrationOptions: TDefaultIntegrationProps;
|
|
92
86
|
/** Function to create a default integration for an operation */
|
|
93
87
|
buildDefaultIntegration: (
|
|
94
88
|
op: TOperation,
|
|
@@ -116,25 +110,6 @@ export type IntegrationBuilderProps<
|
|
|
116
110
|
TDefaultIntegration
|
|
117
111
|
>;
|
|
118
112
|
|
|
119
|
-
/**
|
|
120
|
-
* Extracts the IntegrationBuilderProps variant matching the given pattern.
|
|
121
|
-
*/
|
|
122
|
-
type IntegrationBuilderPropsForPattern<
|
|
123
|
-
TOperation extends string,
|
|
124
|
-
TBaseIntegration,
|
|
125
|
-
TDefaultIntegrationProps extends object,
|
|
126
|
-
TDefaultIntegration extends TBaseIntegration,
|
|
127
|
-
TPattern extends 'shared' | 'isolated',
|
|
128
|
-
> = Extract<
|
|
129
|
-
IntegrationBuilderProps<
|
|
130
|
-
TOperation,
|
|
131
|
-
TBaseIntegration,
|
|
132
|
-
TDefaultIntegrationProps,
|
|
133
|
-
TDefaultIntegration
|
|
134
|
-
>,
|
|
135
|
-
{ pattern: TPattern }
|
|
136
|
-
>;
|
|
137
|
-
|
|
138
113
|
/**
|
|
139
114
|
* Resolves the default integration keys based on the pattern.
|
|
140
115
|
* - 'shared': only '$router' is a default key
|
|
@@ -194,22 +169,65 @@ export class IntegrationBuilder<
|
|
|
194
169
|
private integrations: Partial<TIntegrations> = {};
|
|
195
170
|
|
|
196
171
|
/**
|
|
197
|
-
* Create an Integration Builder for an HTTP API
|
|
172
|
+
* Create an Integration Builder for an HTTP API with a shared pattern
|
|
198
173
|
*/
|
|
199
|
-
public static http
|
|
174
|
+
public static http<
|
|
200
175
|
TOperation extends string,
|
|
201
176
|
TDefaultIntegrationProps extends object,
|
|
202
177
|
TDefaultIntegration extends HttpApiIntegration,
|
|
203
|
-
TPattern extends 'shared' | 'isolated',
|
|
204
178
|
>(
|
|
205
|
-
options:
|
|
179
|
+
options: SharedIntegrationBuilderProps<
|
|
206
180
|
TOperation,
|
|
207
|
-
HttpApiIntegration,
|
|
208
181
|
TDefaultIntegrationProps,
|
|
209
|
-
TDefaultIntegration
|
|
210
|
-
|
|
182
|
+
TDefaultIntegration
|
|
183
|
+
>,
|
|
184
|
+
): IntegrationBuilder<
|
|
185
|
+
TOperation,
|
|
186
|
+
HttpApiIntegration,
|
|
187
|
+
Record<'$router', TDefaultIntegration>,
|
|
188
|
+
TDefaultIntegrationProps,
|
|
189
|
+
TDefaultIntegration,
|
|
190
|
+
'shared'
|
|
191
|
+
>;
|
|
192
|
+
/**
|
|
193
|
+
* Create an Integration Builder for an HTTP API with an isolated pattern
|
|
194
|
+
*/
|
|
195
|
+
public static http<
|
|
196
|
+
TOperation extends string,
|
|
197
|
+
TDefaultIntegrationProps extends object,
|
|
198
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
199
|
+
>(
|
|
200
|
+
options: IsolatedIntegrationBuilderProps<
|
|
201
|
+
TOperation,
|
|
202
|
+
TDefaultIntegrationProps,
|
|
203
|
+
TDefaultIntegration
|
|
211
204
|
>,
|
|
212
|
-
)
|
|
205
|
+
): IntegrationBuilder<
|
|
206
|
+
TOperation,
|
|
207
|
+
HttpApiIntegration,
|
|
208
|
+
Record<TOperation, TDefaultIntegration>,
|
|
209
|
+
TDefaultIntegrationProps,
|
|
210
|
+
TDefaultIntegration,
|
|
211
|
+
'isolated'
|
|
212
|
+
>;
|
|
213
|
+
public static http<
|
|
214
|
+
TOperation extends string,
|
|
215
|
+
TDefaultIntegrationProps extends object,
|
|
216
|
+
TDefaultIntegration extends HttpApiIntegration,
|
|
217
|
+
TPattern extends 'shared' | 'isolated',
|
|
218
|
+
>(
|
|
219
|
+
options:
|
|
220
|
+
| SharedIntegrationBuilderProps<
|
|
221
|
+
TOperation,
|
|
222
|
+
TDefaultIntegrationProps,
|
|
223
|
+
TDefaultIntegration
|
|
224
|
+
>
|
|
225
|
+
| IsolatedIntegrationBuilderProps<
|
|
226
|
+
TOperation,
|
|
227
|
+
TDefaultIntegrationProps,
|
|
228
|
+
TDefaultIntegration
|
|
229
|
+
>,
|
|
230
|
+
) {
|
|
213
231
|
return new IntegrationBuilder<
|
|
214
232
|
TOperation,
|
|
215
233
|
HttpApiIntegration,
|
|
@@ -218,25 +236,68 @@ export class IntegrationBuilder<
|
|
|
218
236
|
TDefaultIntegration,
|
|
219
237
|
TPattern
|
|
220
238
|
>(options);
|
|
221
|
-
}
|
|
239
|
+
}
|
|
222
240
|
|
|
223
241
|
/**
|
|
224
|
-
* Create an Integration Builder for a REST API
|
|
242
|
+
* Create an Integration Builder for a REST API with a shared pattern
|
|
225
243
|
*/
|
|
226
|
-
public static rest
|
|
244
|
+
public static rest<
|
|
227
245
|
TOperation extends string,
|
|
228
246
|
TDefaultIntegrationProps extends object,
|
|
229
247
|
TDefaultIntegration extends RestApiIntegration,
|
|
230
|
-
TPattern extends 'shared' | 'isolated',
|
|
231
248
|
>(
|
|
232
|
-
options:
|
|
249
|
+
options: SharedIntegrationBuilderProps<
|
|
233
250
|
TOperation,
|
|
234
|
-
RestApiIntegration,
|
|
235
251
|
TDefaultIntegrationProps,
|
|
236
|
-
TDefaultIntegration
|
|
237
|
-
TPattern
|
|
252
|
+
TDefaultIntegration
|
|
238
253
|
>,
|
|
239
|
-
)
|
|
254
|
+
): IntegrationBuilder<
|
|
255
|
+
TOperation,
|
|
256
|
+
RestApiIntegration,
|
|
257
|
+
Record<'$router', TDefaultIntegration>,
|
|
258
|
+
TDefaultIntegrationProps,
|
|
259
|
+
TDefaultIntegration,
|
|
260
|
+
'shared'
|
|
261
|
+
>;
|
|
262
|
+
/**
|
|
263
|
+
* Create an Integration Builder for a REST API with an isolated pattern
|
|
264
|
+
*/
|
|
265
|
+
public static rest<
|
|
266
|
+
TOperation extends string,
|
|
267
|
+
TDefaultIntegrationProps extends object,
|
|
268
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
269
|
+
>(
|
|
270
|
+
options: IsolatedIntegrationBuilderProps<
|
|
271
|
+
TOperation,
|
|
272
|
+
TDefaultIntegrationProps,
|
|
273
|
+
TDefaultIntegration
|
|
274
|
+
>,
|
|
275
|
+
): IntegrationBuilder<
|
|
276
|
+
TOperation,
|
|
277
|
+
RestApiIntegration,
|
|
278
|
+
Record<TOperation, TDefaultIntegration>,
|
|
279
|
+
TDefaultIntegrationProps,
|
|
280
|
+
TDefaultIntegration,
|
|
281
|
+
'isolated'
|
|
282
|
+
>;
|
|
283
|
+
public static rest<
|
|
284
|
+
TOperation extends string,
|
|
285
|
+
TDefaultIntegrationProps extends object,
|
|
286
|
+
TDefaultIntegration extends RestApiIntegration,
|
|
287
|
+
TPattern extends 'shared' | 'isolated',
|
|
288
|
+
>(
|
|
289
|
+
options:
|
|
290
|
+
| SharedIntegrationBuilderProps<
|
|
291
|
+
TOperation,
|
|
292
|
+
TDefaultIntegrationProps,
|
|
293
|
+
TDefaultIntegration
|
|
294
|
+
>
|
|
295
|
+
| IsolatedIntegrationBuilderProps<
|
|
296
|
+
TOperation,
|
|
297
|
+
TDefaultIntegrationProps,
|
|
298
|
+
TDefaultIntegration
|
|
299
|
+
>,
|
|
300
|
+
) {
|
|
240
301
|
return new IntegrationBuilder<
|
|
241
302
|
TOperation,
|
|
242
303
|
RestApiIntegration,
|
|
@@ -245,7 +306,7 @@ export class IntegrationBuilder<
|
|
|
245
306
|
TDefaultIntegration,
|
|
246
307
|
TPattern
|
|
247
308
|
>(options);
|
|
248
|
-
}
|
|
309
|
+
}
|
|
249
310
|
|
|
250
311
|
private constructor(
|
|
251
312
|
options: IntegrationBuilderProps<
|