@zapier/zapier-sdk 0.15.4 → 0.15.9

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 (64) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/api/auth.d.ts.map +1 -1
  3. package/dist/api/auth.js +14 -4
  4. package/dist/api/auth.test.d.ts +2 -0
  5. package/dist/api/auth.test.d.ts.map +1 -0
  6. package/dist/api/auth.test.js +220 -0
  7. package/dist/api/client.d.ts.map +1 -1
  8. package/dist/api/client.js +18 -32
  9. package/dist/api/client.methods.test.d.ts +2 -0
  10. package/dist/api/client.methods.test.d.ts.map +1 -0
  11. package/dist/api/client.methods.test.js +158 -0
  12. package/dist/api/client.test.js +27 -11
  13. package/dist/api/router.d.ts +16 -0
  14. package/dist/api/router.d.ts.map +1 -0
  15. package/dist/api/router.js +37 -0
  16. package/dist/api/router.test.d.ts +2 -0
  17. package/dist/api/router.test.d.ts.map +1 -0
  18. package/dist/api/router.test.js +109 -0
  19. package/dist/auth.d.ts +15 -0
  20. package/dist/auth.d.ts.map +1 -1
  21. package/dist/auth.js +25 -0
  22. package/dist/index.cjs +247 -74
  23. package/dist/index.d.mts +402 -241
  24. package/dist/index.mjs +247 -75
  25. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  26. package/dist/plugins/eventEmission/index.js +9 -5
  27. package/dist/plugins/eventEmission/index.test.js +161 -0
  28. package/dist/plugins/getAction/index.d.ts.map +1 -1
  29. package/dist/plugins/getAction/index.js +2 -4
  30. package/dist/plugins/getAction/index.test.js +26 -3
  31. package/dist/plugins/getAuthentication/index.d.ts +2 -5
  32. package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
  33. package/dist/plugins/getAuthentication/index.js +3 -24
  34. package/dist/plugins/getAuthentication/index.test.js +32 -144
  35. package/dist/plugins/getAuthentication/schemas.d.ts +4 -13
  36. package/dist/plugins/getAuthentication/schemas.d.ts.map +1 -1
  37. package/dist/plugins/getAuthentication/schemas.js +1 -11
  38. package/dist/sdk.d.ts +1 -1
  39. package/dist/temporary-internal-core/handlers/getAuthentication.d.ts +94 -0
  40. package/dist/temporary-internal-core/handlers/getAuthentication.d.ts.map +1 -0
  41. package/dist/temporary-internal-core/handlers/getAuthentication.js +68 -0
  42. package/dist/temporary-internal-core/handlers/getAuthentication.test.d.ts +2 -0
  43. package/dist/temporary-internal-core/handlers/getAuthentication.test.d.ts.map +1 -0
  44. package/dist/temporary-internal-core/handlers/getAuthentication.test.js +248 -0
  45. package/dist/temporary-internal-core/handlers/listApps.js +1 -1
  46. package/dist/temporary-internal-core/index.d.ts +2 -0
  47. package/dist/temporary-internal-core/index.d.ts.map +1 -1
  48. package/dist/temporary-internal-core/index.js +2 -0
  49. package/dist/temporary-internal-core/schemas/authentications/index.d.ts +454 -0
  50. package/dist/temporary-internal-core/schemas/authentications/index.d.ts.map +1 -0
  51. package/dist/temporary-internal-core/schemas/authentications/index.js +96 -0
  52. package/dist/temporary-internal-core/schemas/errors/index.d.ts +139 -0
  53. package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +1 -0
  54. package/dist/temporary-internal-core/schemas/errors/index.js +129 -0
  55. package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -20
  56. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +1 -1
  57. package/dist/temporary-internal-core/utils/app-locators.js +1 -45
  58. package/dist/temporary-internal-core/utils/string-utils.d.ts +28 -0
  59. package/dist/temporary-internal-core/utils/string-utils.d.ts.map +1 -0
  60. package/dist/temporary-internal-core/utils/string-utils.js +52 -0
  61. package/dist/temporary-internal-core/utils/transformations.d.ts +14 -0
  62. package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -1
  63. package/dist/temporary-internal-core/utils/transformations.js +37 -1
  64. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1651,14 +1651,395 @@ declare const ListInputFieldsSchema: z.ZodObject<{
1651
1651
  }>;
1652
1652
  type ListInputFieldsOptions = z.infer<typeof ListInputFieldsSchema>;
1653
1653
 
1654
- declare const GetAuthenticationSchema: z.ZodObject<{
1654
+ /**
1655
+ * App and Service schemas
1656
+ *
1657
+ * Covers:
1658
+ * - App metadata
1659
+ * - Service definitions
1660
+ * - App listings and searches
1661
+ */
1662
+
1663
+ /**
1664
+ * Public API schema for listApps operation
1665
+ *
1666
+ * This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
1667
+ * The plugin resolves these to implementation IDs before calling the handler.
1668
+ */
1669
+ declare const ListAppsOptionsSchema: z.ZodObject<{
1670
+ appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1671
+ search: z.ZodOptional<z.ZodString>;
1672
+ pageSize: z.ZodOptional<z.ZodNumber>;
1673
+ maxItems: z.ZodOptional<z.ZodNumber>;
1674
+ cursor: z.ZodOptional<z.ZodString>;
1675
+ }, "strip", z.ZodTypeAny, {
1676
+ search?: string | undefined;
1677
+ appKeys?: string[] | undefined;
1678
+ pageSize?: number | undefined;
1679
+ maxItems?: number | undefined;
1680
+ cursor?: string | undefined;
1681
+ }, {
1682
+ search?: string | undefined;
1683
+ appKeys?: string[] | undefined;
1684
+ pageSize?: number | undefined;
1685
+ maxItems?: number | undefined;
1686
+ cursor?: string | undefined;
1687
+ }>;
1688
+ type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
1689
+ /**
1690
+ * Normalized app item returned by listApps
1691
+ * This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
1692
+ */
1693
+ declare const AppItemSchema$1: z.ZodObject<{
1694
+ categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
1695
+ id: z.ZodNumber;
1696
+ name: z.ZodString;
1697
+ slug: z.ZodString;
1698
+ }, "strip", z.ZodTypeAny, {
1699
+ id: number;
1700
+ name: string;
1701
+ slug: string;
1702
+ }, {
1703
+ id: number;
1704
+ name: string;
1705
+ slug: string;
1706
+ }>, "many">>;
1707
+ actions: z.ZodOptional<z.ZodObject<{
1708
+ read: z.ZodOptional<z.ZodNumber>;
1709
+ read_bulk: z.ZodOptional<z.ZodNumber>;
1710
+ write: z.ZodOptional<z.ZodNumber>;
1711
+ search: z.ZodOptional<z.ZodNumber>;
1712
+ search_or_write: z.ZodOptional<z.ZodNumber>;
1713
+ search_and_write: z.ZodOptional<z.ZodNumber>;
1714
+ filter: z.ZodOptional<z.ZodNumber>;
1715
+ }, "strip", z.ZodTypeAny, {
1716
+ search?: number | undefined;
1717
+ filter?: number | undefined;
1718
+ read?: number | undefined;
1719
+ read_bulk?: number | undefined;
1720
+ search_and_write?: number | undefined;
1721
+ search_or_write?: number | undefined;
1722
+ write?: number | undefined;
1723
+ }, {
1724
+ search?: number | undefined;
1725
+ filter?: number | undefined;
1726
+ read?: number | undefined;
1727
+ read_bulk?: number | undefined;
1728
+ search_and_write?: number | undefined;
1729
+ search_or_write?: number | undefined;
1730
+ write?: number | undefined;
1731
+ }>>;
1732
+ description: z.ZodOptional<z.ZodString>;
1733
+ is_hidden: z.ZodOptional<z.ZodBoolean>;
1734
+ age_in_days: z.ZodOptional<z.ZodNumber>;
1735
+ api_docs_url: z.ZodOptional<z.ZodString>;
1736
+ banner: z.ZodOptional<z.ZodString>;
1737
+ image: z.ZodOptional<z.ZodString>;
1738
+ images: z.ZodOptional<z.ZodObject<{
1739
+ url_16x16: z.ZodOptional<z.ZodString>;
1740
+ url_32x32: z.ZodOptional<z.ZodString>;
1741
+ url_64x64: z.ZodOptional<z.ZodString>;
1742
+ url_128x128: z.ZodOptional<z.ZodString>;
1743
+ }, "strip", z.ZodTypeAny, {
1744
+ url_16x16?: string | undefined;
1745
+ url_32x32?: string | undefined;
1746
+ url_64x64?: string | undefined;
1747
+ url_128x128?: string | undefined;
1748
+ }, {
1749
+ url_16x16?: string | undefined;
1750
+ url_32x32?: string | undefined;
1751
+ url_64x64?: string | undefined;
1752
+ url_128x128?: string | undefined;
1753
+ }>>;
1754
+ is_beta: z.ZodOptional<z.ZodBoolean>;
1755
+ is_built_in: z.ZodOptional<z.ZodBoolean>;
1756
+ is_featured: z.ZodOptional<z.ZodBoolean>;
1757
+ is_premium: z.ZodOptional<z.ZodBoolean>;
1758
+ is_public: z.ZodOptional<z.ZodBoolean>;
1759
+ is_upcoming: z.ZodOptional<z.ZodBoolean>;
1760
+ popularity: z.ZodOptional<z.ZodNumber>;
1761
+ primary_color: z.ZodOptional<z.ZodString>;
1762
+ slug: z.ZodString;
1763
+ auth_type: z.ZodOptional<z.ZodString>;
1764
+ is_deprecated: z.ZodOptional<z.ZodBoolean>;
1765
+ secondary_color: z.ZodOptional<z.ZodString>;
1766
+ has_filters: z.ZodOptional<z.ZodBoolean>;
1767
+ has_reads: z.ZodOptional<z.ZodBoolean>;
1768
+ has_searches: z.ZodOptional<z.ZodBoolean>;
1769
+ has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
1770
+ has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
1771
+ has_writes: z.ZodOptional<z.ZodBoolean>;
1772
+ is_invite: z.ZodOptional<z.ZodBoolean>;
1773
+ visibility: z.ZodOptional<z.ZodString>;
1774
+ classification: z.ZodOptional<z.ZodString>;
1775
+ } & {
1776
+ title: z.ZodString;
1777
+ key: z.ZodString;
1778
+ implementation_id: z.ZodString;
1779
+ version: z.ZodOptional<z.ZodString>;
1780
+ }, "strip", z.ZodTypeAny, {
1781
+ key: string;
1782
+ title: string;
1783
+ slug: string;
1784
+ implementation_id: string;
1785
+ categories?: {
1786
+ id: number;
1787
+ name: string;
1788
+ slug: string;
1789
+ }[] | undefined;
1790
+ actions?: {
1791
+ search?: number | undefined;
1792
+ filter?: number | undefined;
1793
+ read?: number | undefined;
1794
+ read_bulk?: number | undefined;
1795
+ search_and_write?: number | undefined;
1796
+ search_or_write?: number | undefined;
1797
+ write?: number | undefined;
1798
+ } | undefined;
1799
+ description?: string | undefined;
1800
+ is_hidden?: boolean | undefined;
1801
+ age_in_days?: number | undefined;
1802
+ api_docs_url?: string | undefined;
1803
+ banner?: string | undefined;
1804
+ image?: string | undefined;
1805
+ images?: {
1806
+ url_16x16?: string | undefined;
1807
+ url_32x32?: string | undefined;
1808
+ url_64x64?: string | undefined;
1809
+ url_128x128?: string | undefined;
1810
+ } | undefined;
1811
+ is_beta?: boolean | undefined;
1812
+ is_built_in?: boolean | undefined;
1813
+ is_featured?: boolean | undefined;
1814
+ is_premium?: boolean | undefined;
1815
+ is_public?: boolean | undefined;
1816
+ is_upcoming?: boolean | undefined;
1817
+ popularity?: number | undefined;
1818
+ primary_color?: string | undefined;
1819
+ auth_type?: string | undefined;
1820
+ is_deprecated?: boolean | undefined;
1821
+ secondary_color?: string | undefined;
1822
+ has_filters?: boolean | undefined;
1823
+ has_reads?: boolean | undefined;
1824
+ has_searches?: boolean | undefined;
1825
+ has_searches_or_writes?: boolean | undefined;
1826
+ has_upfront_fields?: boolean | undefined;
1827
+ has_writes?: boolean | undefined;
1828
+ is_invite?: boolean | undefined;
1829
+ version?: string | undefined;
1830
+ visibility?: string | undefined;
1831
+ classification?: string | undefined;
1832
+ }, {
1833
+ key: string;
1834
+ title: string;
1835
+ slug: string;
1836
+ implementation_id: string;
1837
+ categories?: {
1838
+ id: number;
1839
+ name: string;
1840
+ slug: string;
1841
+ }[] | undefined;
1842
+ actions?: {
1843
+ search?: number | undefined;
1844
+ filter?: number | undefined;
1845
+ read?: number | undefined;
1846
+ read_bulk?: number | undefined;
1847
+ search_and_write?: number | undefined;
1848
+ search_or_write?: number | undefined;
1849
+ write?: number | undefined;
1850
+ } | undefined;
1851
+ description?: string | undefined;
1852
+ is_hidden?: boolean | undefined;
1853
+ age_in_days?: number | undefined;
1854
+ api_docs_url?: string | undefined;
1855
+ banner?: string | undefined;
1856
+ image?: string | undefined;
1857
+ images?: {
1858
+ url_16x16?: string | undefined;
1859
+ url_32x32?: string | undefined;
1860
+ url_64x64?: string | undefined;
1861
+ url_128x128?: string | undefined;
1862
+ } | undefined;
1863
+ is_beta?: boolean | undefined;
1864
+ is_built_in?: boolean | undefined;
1865
+ is_featured?: boolean | undefined;
1866
+ is_premium?: boolean | undefined;
1867
+ is_public?: boolean | undefined;
1868
+ is_upcoming?: boolean | undefined;
1869
+ popularity?: number | undefined;
1870
+ primary_color?: string | undefined;
1871
+ auth_type?: string | undefined;
1872
+ is_deprecated?: boolean | undefined;
1873
+ secondary_color?: string | undefined;
1874
+ has_filters?: boolean | undefined;
1875
+ has_reads?: boolean | undefined;
1876
+ has_searches?: boolean | undefined;
1877
+ has_searches_or_writes?: boolean | undefined;
1878
+ has_upfront_fields?: boolean | undefined;
1879
+ has_writes?: boolean | undefined;
1880
+ is_invite?: boolean | undefined;
1881
+ version?: string | undefined;
1882
+ visibility?: string | undefined;
1883
+ classification?: string | undefined;
1884
+ }>;
1885
+ type AppItem$1 = z.infer<typeof AppItemSchema$1>;
1886
+
1887
+ /**
1888
+ * Authentication schemas
1889
+ */
1890
+
1891
+ /**
1892
+ * Public API schema for getAuthentication operation
1893
+ *
1894
+ * This is the user-facing schema that the SDK plugin accepts.
1895
+ */
1896
+ declare const GetAuthenticationOptionsSchema: z.ZodObject<{
1655
1897
  authenticationId: z.ZodNumber;
1656
1898
  }, "strip", z.ZodTypeAny, {
1657
1899
  authenticationId: number;
1658
1900
  }, {
1659
1901
  authenticationId: number;
1660
1902
  }>;
1661
- type GetAuthenticationOptions = z.infer<typeof GetAuthenticationSchema>;
1903
+ type GetAuthenticationOptions = z.infer<typeof GetAuthenticationOptionsSchema>;
1904
+ /**
1905
+ * Response schema for getAuthentication (single item)
1906
+ */
1907
+ declare const GetAuthenticationResponseSchema: z.ZodObject<{
1908
+ data: z.ZodLazy<z.ZodObject<Omit<{
1909
+ id: z.ZodNumber;
1910
+ date: z.ZodString;
1911
+ lastchanged: z.ZodOptional<z.ZodString>;
1912
+ account_id: z.ZodNumber;
1913
+ customuser_id: z.ZodOptional<z.ZodNumber>;
1914
+ selected_api: z.ZodString;
1915
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1916
+ is_invite_only: z.ZodBoolean;
1917
+ is_private: z.ZodBoolean;
1918
+ shared_with_all: z.ZodBoolean;
1919
+ is_stale: z.ZodOptional<z.ZodString>;
1920
+ is_shared: z.ZodOptional<z.ZodString>;
1921
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1922
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1923
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1924
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1925
+ url: z.ZodOptional<z.ZodString>;
1926
+ groups: z.ZodOptional<z.ZodString>;
1927
+ members: z.ZodOptional<z.ZodString>;
1928
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
1929
+ }, "customuser_id" | "selected_api"> & {
1930
+ implementation_id: z.ZodOptional<z.ZodString>;
1931
+ user_id: z.ZodOptional<z.ZodNumber>;
1932
+ is_expired: z.ZodOptional<z.ZodString>;
1933
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1934
+ app_key: z.ZodOptional<z.ZodString>;
1935
+ app_version: z.ZodOptional<z.ZodString>;
1936
+ }, "strip", z.ZodTypeAny, {
1937
+ account_id: number;
1938
+ id: number;
1939
+ date: string;
1940
+ is_invite_only: boolean;
1941
+ is_private: boolean;
1942
+ shared_with_all: boolean;
1943
+ url?: string | undefined;
1944
+ label?: string | null | undefined;
1945
+ lastchanged?: string | undefined;
1946
+ destination_selected_api?: string | null | undefined;
1947
+ is_stale?: string | undefined;
1948
+ is_shared?: string | undefined;
1949
+ marked_stale_at?: string | null | undefined;
1950
+ identifier?: string | null | undefined;
1951
+ title?: string | null | undefined;
1952
+ groups?: string | undefined;
1953
+ members?: string | undefined;
1954
+ permissions?: Record<string, boolean> | undefined;
1955
+ user_id?: number | undefined;
1956
+ implementation_id?: string | undefined;
1957
+ is_expired?: string | undefined;
1958
+ expired_at?: string | null | undefined;
1959
+ app_key?: string | undefined;
1960
+ app_version?: string | undefined;
1961
+ }, {
1962
+ account_id: number;
1963
+ id: number;
1964
+ date: string;
1965
+ is_invite_only: boolean;
1966
+ is_private: boolean;
1967
+ shared_with_all: boolean;
1968
+ url?: string | undefined;
1969
+ label?: string | null | undefined;
1970
+ lastchanged?: string | undefined;
1971
+ destination_selected_api?: string | null | undefined;
1972
+ is_stale?: string | undefined;
1973
+ is_shared?: string | undefined;
1974
+ marked_stale_at?: string | null | undefined;
1975
+ identifier?: string | null | undefined;
1976
+ title?: string | null | undefined;
1977
+ groups?: string | undefined;
1978
+ members?: string | undefined;
1979
+ permissions?: Record<string, boolean> | undefined;
1980
+ user_id?: number | undefined;
1981
+ implementation_id?: string | undefined;
1982
+ is_expired?: string | undefined;
1983
+ expired_at?: string | null | undefined;
1984
+ app_key?: string | undefined;
1985
+ app_version?: string | undefined;
1986
+ }>>;
1987
+ }, "strip", z.ZodTypeAny, {
1988
+ data: {
1989
+ account_id: number;
1990
+ id: number;
1991
+ date: string;
1992
+ is_invite_only: boolean;
1993
+ is_private: boolean;
1994
+ shared_with_all: boolean;
1995
+ url?: string | undefined;
1996
+ label?: string | null | undefined;
1997
+ lastchanged?: string | undefined;
1998
+ destination_selected_api?: string | null | undefined;
1999
+ is_stale?: string | undefined;
2000
+ is_shared?: string | undefined;
2001
+ marked_stale_at?: string | null | undefined;
2002
+ identifier?: string | null | undefined;
2003
+ title?: string | null | undefined;
2004
+ groups?: string | undefined;
2005
+ members?: string | undefined;
2006
+ permissions?: Record<string, boolean> | undefined;
2007
+ user_id?: number | undefined;
2008
+ implementation_id?: string | undefined;
2009
+ is_expired?: string | undefined;
2010
+ expired_at?: string | null | undefined;
2011
+ app_key?: string | undefined;
2012
+ app_version?: string | undefined;
2013
+ };
2014
+ }, {
2015
+ data: {
2016
+ account_id: number;
2017
+ id: number;
2018
+ date: string;
2019
+ is_invite_only: boolean;
2020
+ is_private: boolean;
2021
+ shared_with_all: boolean;
2022
+ url?: string | undefined;
2023
+ label?: string | null | undefined;
2024
+ lastchanged?: string | undefined;
2025
+ destination_selected_api?: string | null | undefined;
2026
+ is_stale?: string | undefined;
2027
+ is_shared?: string | undefined;
2028
+ marked_stale_at?: string | null | undefined;
2029
+ identifier?: string | null | undefined;
2030
+ title?: string | null | undefined;
2031
+ groups?: string | undefined;
2032
+ members?: string | undefined;
2033
+ permissions?: Record<string, boolean> | undefined;
2034
+ user_id?: number | undefined;
2035
+ implementation_id?: string | undefined;
2036
+ is_expired?: string | undefined;
2037
+ expired_at?: string | null | undefined;
2038
+ app_key?: string | undefined;
2039
+ app_version?: string | undefined;
2040
+ };
2041
+ }>;
2042
+ type GetAuthenticationResponse = z.infer<typeof GetAuthenticationResponseSchema>;
1662
2043
 
1663
2044
  declare const FindFirstAuthenticationSchema: z.ZodObject<{
1664
2045
  appKey: z.ZodOptional<z.ZodString & {
@@ -2034,239 +2415,6 @@ declare const GetAppSchema: z.ZodObject<{
2034
2415
  }>;
2035
2416
  type GetAppOptions = z.infer<typeof GetAppSchema>;
2036
2417
 
2037
- /**
2038
- * App and Service schemas
2039
- *
2040
- * Covers:
2041
- * - App metadata
2042
- * - Service definitions
2043
- * - App listings and searches
2044
- */
2045
-
2046
- /**
2047
- * Public API schema for listApps operation
2048
- *
2049
- * This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
2050
- * The plugin resolves these to implementation IDs before calling the handler.
2051
- */
2052
- declare const ListAppsOptionsSchema: z.ZodObject<{
2053
- appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2054
- search: z.ZodOptional<z.ZodString>;
2055
- pageSize: z.ZodOptional<z.ZodNumber>;
2056
- maxItems: z.ZodOptional<z.ZodNumber>;
2057
- cursor: z.ZodOptional<z.ZodString>;
2058
- }, "strip", z.ZodTypeAny, {
2059
- search?: string | undefined;
2060
- appKeys?: string[] | undefined;
2061
- pageSize?: number | undefined;
2062
- maxItems?: number | undefined;
2063
- cursor?: string | undefined;
2064
- }, {
2065
- search?: string | undefined;
2066
- appKeys?: string[] | undefined;
2067
- pageSize?: number | undefined;
2068
- maxItems?: number | undefined;
2069
- cursor?: string | undefined;
2070
- }>;
2071
- type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
2072
- /**
2073
- * Normalized app item returned by listApps
2074
- * This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
2075
- */
2076
- declare const AppItemSchema$1: z.ZodObject<{
2077
- categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
2078
- id: z.ZodNumber;
2079
- name: z.ZodString;
2080
- slug: z.ZodString;
2081
- }, "strip", z.ZodTypeAny, {
2082
- id: number;
2083
- name: string;
2084
- slug: string;
2085
- }, {
2086
- id: number;
2087
- name: string;
2088
- slug: string;
2089
- }>, "many">>;
2090
- actions: z.ZodOptional<z.ZodObject<{
2091
- read: z.ZodOptional<z.ZodNumber>;
2092
- read_bulk: z.ZodOptional<z.ZodNumber>;
2093
- write: z.ZodOptional<z.ZodNumber>;
2094
- search: z.ZodOptional<z.ZodNumber>;
2095
- search_or_write: z.ZodOptional<z.ZodNumber>;
2096
- search_and_write: z.ZodOptional<z.ZodNumber>;
2097
- filter: z.ZodOptional<z.ZodNumber>;
2098
- }, "strip", z.ZodTypeAny, {
2099
- search?: number | undefined;
2100
- filter?: number | undefined;
2101
- read?: number | undefined;
2102
- read_bulk?: number | undefined;
2103
- search_and_write?: number | undefined;
2104
- search_or_write?: number | undefined;
2105
- write?: number | undefined;
2106
- }, {
2107
- search?: number | undefined;
2108
- filter?: number | undefined;
2109
- read?: number | undefined;
2110
- read_bulk?: number | undefined;
2111
- search_and_write?: number | undefined;
2112
- search_or_write?: number | undefined;
2113
- write?: number | undefined;
2114
- }>>;
2115
- description: z.ZodOptional<z.ZodString>;
2116
- is_hidden: z.ZodOptional<z.ZodBoolean>;
2117
- age_in_days: z.ZodOptional<z.ZodNumber>;
2118
- api_docs_url: z.ZodOptional<z.ZodString>;
2119
- banner: z.ZodOptional<z.ZodString>;
2120
- image: z.ZodOptional<z.ZodString>;
2121
- images: z.ZodOptional<z.ZodObject<{
2122
- url_16x16: z.ZodOptional<z.ZodString>;
2123
- url_32x32: z.ZodOptional<z.ZodString>;
2124
- url_64x64: z.ZodOptional<z.ZodString>;
2125
- url_128x128: z.ZodOptional<z.ZodString>;
2126
- }, "strip", z.ZodTypeAny, {
2127
- url_16x16?: string | undefined;
2128
- url_32x32?: string | undefined;
2129
- url_64x64?: string | undefined;
2130
- url_128x128?: string | undefined;
2131
- }, {
2132
- url_16x16?: string | undefined;
2133
- url_32x32?: string | undefined;
2134
- url_64x64?: string | undefined;
2135
- url_128x128?: string | undefined;
2136
- }>>;
2137
- is_beta: z.ZodOptional<z.ZodBoolean>;
2138
- is_built_in: z.ZodOptional<z.ZodBoolean>;
2139
- is_featured: z.ZodOptional<z.ZodBoolean>;
2140
- is_premium: z.ZodOptional<z.ZodBoolean>;
2141
- is_public: z.ZodOptional<z.ZodBoolean>;
2142
- is_upcoming: z.ZodOptional<z.ZodBoolean>;
2143
- popularity: z.ZodOptional<z.ZodNumber>;
2144
- primary_color: z.ZodOptional<z.ZodString>;
2145
- slug: z.ZodString;
2146
- auth_type: z.ZodOptional<z.ZodString>;
2147
- is_deprecated: z.ZodOptional<z.ZodBoolean>;
2148
- secondary_color: z.ZodOptional<z.ZodString>;
2149
- has_filters: z.ZodOptional<z.ZodBoolean>;
2150
- has_reads: z.ZodOptional<z.ZodBoolean>;
2151
- has_searches: z.ZodOptional<z.ZodBoolean>;
2152
- has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
2153
- has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
2154
- has_writes: z.ZodOptional<z.ZodBoolean>;
2155
- is_invite: z.ZodOptional<z.ZodBoolean>;
2156
- visibility: z.ZodOptional<z.ZodString>;
2157
- classification: z.ZodOptional<z.ZodString>;
2158
- } & {
2159
- title: z.ZodString;
2160
- key: z.ZodString;
2161
- implementation_id: z.ZodString;
2162
- version: z.ZodOptional<z.ZodString>;
2163
- }, "strip", z.ZodTypeAny, {
2164
- key: string;
2165
- title: string;
2166
- slug: string;
2167
- implementation_id: string;
2168
- categories?: {
2169
- id: number;
2170
- name: string;
2171
- slug: string;
2172
- }[] | undefined;
2173
- actions?: {
2174
- search?: number | undefined;
2175
- filter?: number | undefined;
2176
- read?: number | undefined;
2177
- read_bulk?: number | undefined;
2178
- search_and_write?: number | undefined;
2179
- search_or_write?: number | undefined;
2180
- write?: number | undefined;
2181
- } | undefined;
2182
- description?: string | undefined;
2183
- is_hidden?: boolean | undefined;
2184
- age_in_days?: number | undefined;
2185
- api_docs_url?: string | undefined;
2186
- banner?: string | undefined;
2187
- image?: string | undefined;
2188
- images?: {
2189
- url_16x16?: string | undefined;
2190
- url_32x32?: string | undefined;
2191
- url_64x64?: string | undefined;
2192
- url_128x128?: string | undefined;
2193
- } | undefined;
2194
- is_beta?: boolean | undefined;
2195
- is_built_in?: boolean | undefined;
2196
- is_featured?: boolean | undefined;
2197
- is_premium?: boolean | undefined;
2198
- is_public?: boolean | undefined;
2199
- is_upcoming?: boolean | undefined;
2200
- popularity?: number | undefined;
2201
- primary_color?: string | undefined;
2202
- auth_type?: string | undefined;
2203
- is_deprecated?: boolean | undefined;
2204
- secondary_color?: string | undefined;
2205
- has_filters?: boolean | undefined;
2206
- has_reads?: boolean | undefined;
2207
- has_searches?: boolean | undefined;
2208
- has_searches_or_writes?: boolean | undefined;
2209
- has_upfront_fields?: boolean | undefined;
2210
- has_writes?: boolean | undefined;
2211
- is_invite?: boolean | undefined;
2212
- version?: string | undefined;
2213
- visibility?: string | undefined;
2214
- classification?: string | undefined;
2215
- }, {
2216
- key: string;
2217
- title: string;
2218
- slug: string;
2219
- implementation_id: string;
2220
- categories?: {
2221
- id: number;
2222
- name: string;
2223
- slug: string;
2224
- }[] | undefined;
2225
- actions?: {
2226
- search?: number | undefined;
2227
- filter?: number | undefined;
2228
- read?: number | undefined;
2229
- read_bulk?: number | undefined;
2230
- search_and_write?: number | undefined;
2231
- search_or_write?: number | undefined;
2232
- write?: number | undefined;
2233
- } | undefined;
2234
- description?: string | undefined;
2235
- is_hidden?: boolean | undefined;
2236
- age_in_days?: number | undefined;
2237
- api_docs_url?: string | undefined;
2238
- banner?: string | undefined;
2239
- image?: string | undefined;
2240
- images?: {
2241
- url_16x16?: string | undefined;
2242
- url_32x32?: string | undefined;
2243
- url_64x64?: string | undefined;
2244
- url_128x128?: string | undefined;
2245
- } | undefined;
2246
- is_beta?: boolean | undefined;
2247
- is_built_in?: boolean | undefined;
2248
- is_featured?: boolean | undefined;
2249
- is_premium?: boolean | undefined;
2250
- is_public?: boolean | undefined;
2251
- is_upcoming?: boolean | undefined;
2252
- popularity?: number | undefined;
2253
- primary_color?: string | undefined;
2254
- auth_type?: string | undefined;
2255
- is_deprecated?: boolean | undefined;
2256
- secondary_color?: string | undefined;
2257
- has_filters?: boolean | undefined;
2258
- has_reads?: boolean | undefined;
2259
- has_searches?: boolean | undefined;
2260
- has_searches_or_writes?: boolean | undefined;
2261
- has_upfront_fields?: boolean | undefined;
2262
- has_writes?: boolean | undefined;
2263
- is_invite?: boolean | undefined;
2264
- version?: string | undefined;
2265
- visibility?: string | undefined;
2266
- classification?: string | undefined;
2267
- }>;
2268
- type AppItem$1 = z.infer<typeof AppItemSchema$1>;
2269
-
2270
2418
  interface ListAppsPluginProvides {
2271
2419
  listApps: (options?: ListAppsOptions) => Promise<{
2272
2420
  data: AppItem$1[];
@@ -2395,13 +2543,11 @@ declare const listAuthenticationsPlugin: Plugin<GetSdkType<ManifestPluginProvide
2395
2543
  }, ListAuthenticationsPluginProvides>;
2396
2544
 
2397
2545
  interface GetAuthenticationPluginProvides {
2398
- getAuthentication: (options: GetAuthenticationOptions) => Promise<{
2399
- data: AuthenticationItem;
2400
- }>;
2546
+ getAuthentication: (options: GetAuthenticationOptions) => Promise<GetAuthenticationResponse>;
2401
2547
  context: {
2402
2548
  meta: {
2403
2549
  getAuthentication: {
2404
- inputSchema: typeof GetAuthenticationSchema;
2550
+ inputSchema: typeof GetAuthenticationOptionsSchema;
2405
2551
  };
2406
2552
  };
2407
2553
  };
@@ -3591,6 +3737,10 @@ interface AuthOptions {
3591
3737
  authBaseUrl?: string;
3592
3738
  authClientId?: string;
3593
3739
  }
3740
+ interface ResolveAuthTokenOptions extends AuthOptions {
3741
+ token?: string;
3742
+ getToken?: () => Promise<string | undefined> | string | undefined;
3743
+ }
3594
3744
  /**
3595
3745
  * Gets the ZAPIER_TOKEN from environment variables.
3596
3746
  * Returns undefined if not set.
@@ -3611,6 +3761,17 @@ declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | u
3611
3761
  * Returns undefined if no valid token is found.
3612
3762
  */
3613
3763
  declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
3764
+ /**
3765
+ * Resolves an auth token from all possible sources with the following precedence:
3766
+ * 1. Explicitly provided token in options
3767
+ * 2. Token from getToken callback in options
3768
+ * 3. ZAPIER_TOKEN environment variable
3769
+ * 4. CLI login package (if available)
3770
+ *
3771
+ * This is the canonical token resolution logic used throughout the SDK.
3772
+ * Returns undefined if no valid token is found.
3773
+ */
3774
+ declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
3614
3775
 
3615
3776
  /**
3616
3777
  * SDK Constants
@@ -3725,7 +3886,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3725
3886
  } & {
3726
3887
  meta: {
3727
3888
  getAuthentication: {
3728
- inputSchema: typeof GetAuthenticationSchema;
3889
+ inputSchema: typeof GetAuthenticationOptionsSchema;
3729
3890
  };
3730
3891
  };
3731
3892
  } & {
@@ -3767,4 +3928,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3767
3928
  }>;
3768
3929
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
3769
3930
 
3770
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getCiPlatform, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, isCi, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, runActionPlugin, toSnakeCase, toTitleCase };
3931
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getCiPlatform, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, isCi, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resolveAuthToken, runActionPlugin, toSnakeCase, toTitleCase };