mailmeteor 0.0.66 → 0.1.1

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/dist/index.mjs CHANGED
@@ -1056,6 +1056,22 @@ class HeyApiRegistry11 {
1056
1056
  }
1057
1057
  }
1058
1058
  class HeyApiRegistry12 {
1059
+ constructor() {
1060
+ this.defaultKey = 'default';
1061
+ this.instances = new Map();
1062
+ }
1063
+ get(key) {
1064
+ const instance = this.instances.get(key ?? this.defaultKey);
1065
+ if (!instance) {
1066
+ throw new Error(`No SDK client found. Create one with "new Automations2()" to fix this error.`);
1067
+ }
1068
+ return instance;
1069
+ }
1070
+ set(value, key) {
1071
+ this.instances.set(key ?? this.defaultKey, value);
1072
+ }
1073
+ }
1074
+ class HeyApiRegistry13 {
1059
1075
  constructor() {
1060
1076
  this.defaultKey = 'default';
1061
1077
  this.instances = new Map();
@@ -1693,7 +1709,7 @@ class PipelineConversations extends HeyApiClient {
1693
1709
  });
1694
1710
  }
1695
1711
  listMessages(pipeline_conversation_id, parameters, options) {
1696
- const params = buildClientParams([pipeline_conversation_id, parameters], [{ in: 'path', key: 'pipeline_conversation_id' }, { args: [{ in: 'query', key: 'owner' }] }]);
1712
+ const params = buildClientParams([pipeline_conversation_id, parameters], [{ in: 'path', key: 'pipeline_conversation_id' }, { args: [{ in: 'query', key: 'owner' }, { in: 'query', key: 'format' }] }]);
1697
1713
  return (options?.client ?? this.client).get({
1698
1714
  responseStyle: 'data',
1699
1715
  url: '/pipeline_conversations/{pipeline_conversation_id}/messages',
@@ -1842,13 +1858,26 @@ class Integrations extends HeyApiClient {
1842
1858
  ...params
1843
1859
  });
1844
1860
  }
1845
- disconnectAccount(integration_id, account_id, options) {
1846
- const params = buildClientParams([integration_id, account_id], [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'account_id' }]);
1861
+ disconnectAccount(integration_id, account_id, parameters, options) {
1862
+ const params = buildClientParams([
1863
+ integration_id,
1864
+ account_id,
1865
+ parameters
1866
+ ], [
1867
+ { in: 'path', key: 'integration_id' },
1868
+ { in: 'path', key: 'account_id' },
1869
+ { args: [{ in: 'body', key: 'reason' }] }
1870
+ ]);
1847
1871
  return (options?.client ?? this.client).post({
1848
1872
  responseStyle: 'data',
1849
1873
  url: '/integrations/{integration_id}/accounts/{account_id}/disconnect',
1850
1874
  ...options,
1851
- ...params
1875
+ ...params,
1876
+ headers: {
1877
+ 'Content-Type': 'application/json',
1878
+ ...options?.headers,
1879
+ ...params.headers
1880
+ }
1852
1881
  });
1853
1882
  }
1854
1883
  }
@@ -1901,6 +1930,96 @@ class Jobs2 extends HeyApiClient {
1901
1930
  }
1902
1931
  }
1903
1932
  Jobs2.__registry = new HeyApiRegistry11();
1933
+ class Automations extends HeyApiClient {
1934
+ list(parameters, options) {
1935
+ const params = buildClientParams([parameters], [{ args: [
1936
+ { in: 'query', key: 'owner' },
1937
+ { in: 'query', key: 'status' },
1938
+ { in: 'query', key: 'limit' },
1939
+ { in: 'query', key: 'starting_after' },
1940
+ { in: 'query', key: 'ending_before' }
1941
+ ] }]);
1942
+ return (options?.client ?? this.client).get({
1943
+ responseStyle: 'data',
1944
+ url: '/automations',
1945
+ ...options,
1946
+ ...params
1947
+ });
1948
+ }
1949
+ create(parameters, options) {
1950
+ const params = buildClientParams([parameters], [{ args: [
1951
+ { in: 'body', key: 'owner' },
1952
+ { in: 'body', key: 'name' },
1953
+ { in: 'body', key: 'draft_definition' }
1954
+ ] }]);
1955
+ return (options?.client ?? this.client).post({
1956
+ responseStyle: 'data',
1957
+ url: '/automations',
1958
+ ...options,
1959
+ ...params,
1960
+ headers: {
1961
+ 'Content-Type': 'application/json',
1962
+ ...options?.headers,
1963
+ ...params.headers
1964
+ }
1965
+ });
1966
+ }
1967
+ count(parameters, options) {
1968
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'owner' }, { in: 'query', key: 'status' }] }]);
1969
+ return (options?.client ?? this.client).get({
1970
+ responseStyle: 'data',
1971
+ url: '/automations/count',
1972
+ ...options,
1973
+ ...params
1974
+ });
1975
+ }
1976
+ del(automation_id, parameters, options) {
1977
+ const params = buildClientParams([automation_id, parameters], [{ in: 'path', key: 'automation_id' }, { args: [{ in: 'query', key: 'owner' }] }]);
1978
+ return (options?.client ?? this.client).delete({
1979
+ responseStyle: 'data',
1980
+ url: '/automations/{automation_id}',
1981
+ ...options,
1982
+ ...params
1983
+ });
1984
+ }
1985
+ retrieve(automation_id, parameters, options) {
1986
+ const params = buildClientParams([automation_id, parameters], [{ in: 'path', key: 'automation_id' }, { args: [{ in: 'query', key: 'owner' }] }]);
1987
+ return (options?.client ?? this.client).get({
1988
+ responseStyle: 'data',
1989
+ url: '/automations/{automation_id}',
1990
+ ...options,
1991
+ ...params
1992
+ });
1993
+ }
1994
+ update(automation_id, parameters, options) {
1995
+ const params = buildClientParams([automation_id, parameters], [{ in: 'path', key: 'automation_id' }, { args: [
1996
+ { in: 'body', key: 'owner' },
1997
+ { in: 'body', key: 'name' },
1998
+ { in: 'body', key: 'draft_definition' }
1999
+ ] }]);
2000
+ return (options?.client ?? this.client).patch({
2001
+ responseStyle: 'data',
2002
+ url: '/automations/{automation_id}',
2003
+ ...options,
2004
+ ...params,
2005
+ headers: {
2006
+ 'Content-Type': 'application/json',
2007
+ ...options?.headers,
2008
+ ...params.headers
2009
+ }
2010
+ });
2011
+ }
2012
+ }
2013
+ class Automations2 extends HeyApiClient {
2014
+ constructor(args) {
2015
+ super(args);
2016
+ Automations2.__registry.set(this, args?.key);
2017
+ }
2018
+ get automations() {
2019
+ return this._automations ?? (this._automations = new Automations({ client: this.client }));
2020
+ }
2021
+ }
2022
+ Automations2.__registry = new HeyApiRegistry12();
1904
2023
  class Default extends HeyApiClient {
1905
2024
  constructor(args) {
1906
2025
  super(args);
@@ -1914,7 +2033,7 @@ class Default extends HeyApiClient {
1914
2033
  });
1915
2034
  }
1916
2035
  }
1917
- Default.__registry = new HeyApiRegistry12();
2036
+ Default.__registry = new HeyApiRegistry13();
1918
2037
 
1919
2038
  function querySerializer(query) {
1920
2039
  const parts = [];
@@ -1974,6 +2093,7 @@ class Mailmeteor {
1974
2093
  this.integrations = new Integrations({ client: this.client });
1975
2094
  this.pipelineConversations = new PipelineConversations({ client: this.client });
1976
2095
  this.jobs = new Jobs({ client: this.client });
2096
+ this.automations = new Automations({ client: this.client });
1977
2097
  }
1978
2098
  setApiKey(key) {
1979
2099
  const currentConfig = this.client.getConfig();