finch-api 0.1.0.pre.alpha.27 → 0.1.0.pre.alpha.28

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.
@@ -5,12 +5,16 @@ module FinchAPI
5
5
  class AccessTokens
6
6
  # Exchange the authorization code for an access token
7
7
  #
8
- # @overload create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {})
8
+ # @overload create(client_id:, client_secret:, code:, redirect_uri: nil, request_options: {})
9
+ #
10
+ # @param client_id [String] The client ID for your application
11
+ #
12
+ # @param client_secret [String] The client secret for your application
13
+ #
14
+ # @param code [String] The authorization code received from the authorization server
15
+ #
16
+ # @param redirect_uri [String] The redirect URI used in the authorization request (optional)
9
17
  #
10
- # @param code [String]
11
- # @param client_id [String]
12
- # @param client_secret [String]
13
- # @param redirect_uri [String]
14
18
  # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil]
15
19
  #
16
20
  # @return [FinchAPI::Models::CreateAccessTokenResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinchAPI
4
- VERSION = "0.1.0.pre.alpha.27"
4
+ VERSION = "0.1.0.pre.alpha.28"
5
5
  end
@@ -11,21 +11,19 @@ module FinchAPI
11
11
  T.any(FinchAPI::AccessTokenCreateParams, FinchAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The client ID for your application
14
15
  sig { returns(String) }
15
- attr_accessor :code
16
-
17
- sig { returns(T.nilable(String)) }
18
- attr_reader :client_id
16
+ attr_accessor :client_id
19
17
 
20
- sig { params(client_id: String).void }
21
- attr_writer :client_id
22
-
23
- sig { returns(T.nilable(String)) }
24
- attr_reader :client_secret
18
+ # The client secret for your application
19
+ sig { returns(String) }
20
+ attr_accessor :client_secret
25
21
 
26
- sig { params(client_secret: String).void }
27
- attr_writer :client_secret
22
+ # The authorization code received from the authorization server
23
+ sig { returns(String) }
24
+ attr_accessor :code
28
25
 
26
+ # The redirect URI used in the authorization request (optional)
29
27
  sig { returns(T.nilable(String)) }
30
28
  attr_reader :redirect_uri
31
29
 
@@ -34,17 +32,21 @@ module FinchAPI
34
32
 
35
33
  sig do
36
34
  params(
37
- code: String,
38
35
  client_id: String,
39
36
  client_secret: String,
37
+ code: String,
40
38
  redirect_uri: String,
41
39
  request_options: FinchAPI::RequestOptions::OrHash
42
40
  ).returns(T.attached_class)
43
41
  end
44
42
  def self.new(
43
+ # The client ID for your application
44
+ client_id:,
45
+ # The client secret for your application
46
+ client_secret:,
47
+ # The authorization code received from the authorization server
45
48
  code:,
46
- client_id: nil,
47
- client_secret: nil,
49
+ # The redirect URI used in the authorization request (optional)
48
50
  redirect_uri: nil,
49
51
  request_options: {}
50
52
  )
@@ -53,9 +55,9 @@ module FinchAPI
53
55
  sig do
54
56
  override.returns(
55
57
  {
56
- code: String,
57
58
  client_id: String,
58
59
  client_secret: String,
60
+ code: String,
59
61
  redirect_uri: String,
60
62
  request_options: FinchAPI::RequestOptions
61
63
  }
@@ -11,27 +11,17 @@ module FinchAPI
11
11
  )
12
12
  end
13
13
 
14
- # The access token for the connection.
14
+ # The access token for the connection
15
15
  sig { returns(String) }
16
16
  attr_accessor :access_token
17
17
 
18
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
19
- # account ID.
20
- sig { returns(String) }
21
- attr_accessor :account_id
22
-
23
18
  # The type of application associated with a token.
24
19
  sig do
25
20
  returns(FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol)
26
21
  end
27
22
  attr_accessor :client_type
28
23
 
29
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
30
- # company ID.
31
- sig { returns(String) }
32
- attr_accessor :company_id
33
-
34
- # The Finch UUID of the connection associated with the `access_token`.
24
+ # The Finch UUID of the connection associated with the `access_token`
35
25
  sig { returns(String) }
36
26
  attr_accessor :connection_id
37
27
 
@@ -46,69 +36,82 @@ module FinchAPI
46
36
  end
47
37
  attr_accessor :connection_type
48
38
 
49
- # An array of the authorized products associated with the `access_token`.
39
+ # An array of the authorized products associated with the `access_token`
50
40
  sig { returns(T::Array[String]) }
51
41
  attr_accessor :products
52
42
 
53
- # The ID of the provider associated with the `access_token`.
43
+ # The ID of the provider associated with the `access_token`
54
44
  sig { returns(String) }
55
45
  attr_accessor :provider_id
56
46
 
57
- # The ID of your customer you provided to Finch when a connect session was created
58
- # for this connection.
47
+ # The RFC 8693 token type (Finch uses `bearer` tokens)
48
+ sig { returns(String) }
49
+ attr_accessor :token_type
50
+
51
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
52
+ # account ID
59
53
  sig { returns(T.nilable(String)) }
60
- attr_accessor :customer_id
54
+ attr_reader :account_id
61
55
 
62
- # The RFC 8693 token type (Finch uses `bearer` tokens)
56
+ sig { params(account_id: String).void }
57
+ attr_writer :account_id
58
+
59
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
60
+ # company ID
63
61
  sig { returns(T.nilable(String)) }
64
- attr_reader :token_type
62
+ attr_reader :company_id
63
+
64
+ sig { params(company_id: String).void }
65
+ attr_writer :company_id
65
66
 
66
- sig { params(token_type: String).void }
67
- attr_writer :token_type
67
+ # The ID of your customer you provided to Finch when a connect session was created
68
+ # for this connection
69
+ sig { returns(T.nilable(String)) }
70
+ attr_accessor :customer_id
68
71
 
69
72
  sig do
70
73
  params(
71
74
  access_token: String,
72
- account_id: String,
73
75
  client_type:
74
76
  FinchAPI::CreateAccessTokenResponse::ClientType::OrSymbol,
75
- company_id: String,
76
77
  connection_id: String,
77
78
  connection_type:
78
79
  FinchAPI::CreateAccessTokenResponse::ConnectionType::OrSymbol,
79
80
  products: T::Array[String],
80
81
  provider_id: String,
81
- customer_id: T.nilable(String),
82
- token_type: String
82
+ token_type: String,
83
+ account_id: String,
84
+ company_id: String,
85
+ customer_id: T.nilable(String)
83
86
  ).returns(T.attached_class)
84
87
  end
85
88
  def self.new(
86
- # The access token for the connection.
89
+ # The access token for the connection
87
90
  access_token:,
88
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
89
- # account ID.
90
- account_id:,
91
91
  # The type of application associated with a token.
92
92
  client_type:,
93
- # [DEPRECATED] Use `connection_id` to identify the connection instead of this
94
- # company ID.
95
- company_id:,
96
- # The Finch UUID of the connection associated with the `access_token`.
93
+ # The Finch UUID of the connection associated with the `access_token`
97
94
  connection_id:,
98
95
  # The type of the connection associated with the token.
99
96
  #
100
97
  # - `provider` - connection to an external provider
101
98
  # - `finch` - finch-generated data.
102
99
  connection_type:,
103
- # An array of the authorized products associated with the `access_token`.
100
+ # An array of the authorized products associated with the `access_token`
104
101
  products:,
105
- # The ID of the provider associated with the `access_token`.
102
+ # The ID of the provider associated with the `access_token`
106
103
  provider_id:,
107
- # The ID of your customer you provided to Finch when a connect session was created
108
- # for this connection.
109
- customer_id: nil,
110
104
  # The RFC 8693 token type (Finch uses `bearer` tokens)
111
- token_type: nil
105
+ token_type:,
106
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
107
+ # account ID
108
+ account_id: nil,
109
+ # [DEPRECATED] Use `connection_id` to identify the connection instead of this
110
+ # company ID
111
+ company_id: nil,
112
+ # The ID of your customer you provided to Finch when a connect session was created
113
+ # for this connection
114
+ customer_id: nil
112
115
  )
113
116
  end
114
117
 
@@ -116,17 +119,17 @@ module FinchAPI
116
119
  override.returns(
117
120
  {
118
121
  access_token: String,
119
- account_id: String,
120
122
  client_type:
121
123
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol,
122
- company_id: String,
123
124
  connection_id: String,
124
125
  connection_type:
125
126
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol,
126
127
  products: T::Array[String],
127
128
  provider_id: String,
128
- customer_id: T.nilable(String),
129
- token_type: String
129
+ token_type: String,
130
+ account_id: String,
131
+ company_id: String,
132
+ customer_id: T.nilable(String)
130
133
  }
131
134
  )
132
135
  end
@@ -143,14 +146,14 @@ module FinchAPI
143
146
  end
144
147
  OrSymbol = T.type_alias { T.any(Symbol, String) }
145
148
 
146
- PRODUCTION =
149
+ DEVELOPMENT =
147
150
  T.let(
148
- :production,
151
+ :development,
149
152
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol
150
153
  )
151
- DEVELOPMENT =
154
+ PRODUCTION =
152
155
  T.let(
153
- :development,
156
+ :production,
154
157
  FinchAPI::CreateAccessTokenResponse::ClientType::TaggedSymbol
155
158
  )
156
159
  SANDBOX =
@@ -183,14 +186,14 @@ module FinchAPI
183
186
  end
184
187
  OrSymbol = T.type_alias { T.any(Symbol, String) }
185
188
 
186
- PROVIDER =
189
+ FINCH =
187
190
  T.let(
188
- :provider,
191
+ :finch,
189
192
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol
190
193
  )
191
- FINCH =
194
+ PROVIDER =
192
195
  T.let(
193
- :finch,
196
+ :provider,
194
197
  FinchAPI::CreateAccessTokenResponse::ConnectionType::TaggedSymbol
195
198
  )
196
199