kit-rb 0.0.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -0
- data/README.md +56 -5
- data/Rakefile +17 -0
- data/lib/kit/client.rb +56 -0
- data/lib/kit/configuration.rb +7 -2
- data/lib/kit/connection.rb +37 -11
- data/lib/kit/errors.rb +15 -0
- data/lib/kit/oauth/client.rb +132 -0
- data/lib/kit/oauth/pkce.rb +42 -0
- data/lib/kit/oauth/token.rb +38 -0
- data/lib/kit/objects/broadcast.rb +26 -0
- data/lib/kit/objects/broadcast_click.rb +17 -0
- data/lib/kit/objects/broadcast_stats.rb +30 -0
- data/lib/kit/objects/creator_profile.rb +13 -0
- data/lib/kit/objects/custom_field.rb +14 -0
- data/lib/kit/objects/email_stats.rb +25 -0
- data/lib/kit/objects/email_template.rb +14 -0
- data/lib/kit/objects/form.rb +22 -0
- data/lib/kit/objects/growth_stats.rb +20 -0
- data/lib/kit/objects/post.rb +24 -0
- data/lib/kit/objects/purchase.rb +24 -0
- data/lib/kit/objects/segment.rb +12 -0
- data/lib/kit/objects/sequence.rb +26 -0
- data/lib/kit/objects/sequence_email.rb +23 -0
- data/lib/kit/objects/snippet.rb +21 -0
- data/lib/kit/objects/subscriber.rb +25 -0
- data/lib/kit/objects/subscriber_stats.rb +26 -0
- data/lib/kit/objects/tag.rb +17 -0
- data/lib/kit/objects/webhook.rb +15 -0
- data/lib/kit/objects/webhook_endpoint.rb +22 -0
- data/lib/kit/pagination.rb +66 -0
- data/lib/kit/resources/account.rb +27 -1
- data/lib/kit/resources/base.rb +38 -6
- data/lib/kit/resources/broadcasts.rb +56 -0
- data/lib/kit/resources/bulk.rb +63 -0
- data/lib/kit/resources/custom_fields.rb +29 -0
- data/lib/kit/resources/email_templates.rb +13 -0
- data/lib/kit/resources/forms.rb +31 -0
- data/lib/kit/resources/posts.rb +18 -0
- data/lib/kit/resources/purchases.rb +26 -0
- data/lib/kit/resources/segments.rb +13 -0
- data/lib/kit/resources/sequences.rb +78 -0
- data/lib/kit/resources/snippets.rb +29 -0
- data/lib/kit/resources/subscribers.rb +67 -0
- data/lib/kit/resources/tags.rb +52 -0
- data/lib/kit/resources/webhook_endpoints.rb +46 -0
- data/lib/kit/resources/webhooks.rb +24 -0
- data/lib/kit/version.rb +1 -1
- data/lib/kit-rb.rb +38 -0
- data/sig/kit-rb.rbs +429 -1
- metadata +43 -5
data/sig/kit-rb.rbs
CHANGED
|
@@ -32,6 +32,45 @@ module Kit
|
|
|
32
32
|
end
|
|
33
33
|
class ServerError < APIError
|
|
34
34
|
end
|
|
35
|
+
class OAuthError < APIError
|
|
36
|
+
attr_reader oauth_error: String?
|
|
37
|
+
attr_reader error_description: String?
|
|
38
|
+
def initialize: (status: Integer, ?body: untyped, ?response: untyped) -> void
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
module OAuth
|
|
42
|
+
class Challenge
|
|
43
|
+
attr_reader code_verifier: String
|
|
44
|
+
attr_reader code_challenge: String
|
|
45
|
+
attr_reader code_challenge_method: String
|
|
46
|
+
end
|
|
47
|
+
module PKCE
|
|
48
|
+
METHOD: String
|
|
49
|
+
def self.generate: () -> Challenge
|
|
50
|
+
def self.challenge_for: (String verifier) -> String
|
|
51
|
+
end
|
|
52
|
+
class Token
|
|
53
|
+
attr_reader access_token: String?
|
|
54
|
+
attr_reader refresh_token: String?
|
|
55
|
+
attr_reader token_type: String?
|
|
56
|
+
attr_reader expires_in: Integer?
|
|
57
|
+
attr_reader scope: String?
|
|
58
|
+
attr_reader created_at: Integer?
|
|
59
|
+
def self.from: (Hash[String, untyped] hash) -> Token
|
|
60
|
+
def expires_at: () -> Integer?
|
|
61
|
+
def expired?: (?now: Integer, ?leeway: Integer) -> bool
|
|
62
|
+
end
|
|
63
|
+
class Client
|
|
64
|
+
AUTHORIZE_PATH: String
|
|
65
|
+
TOKEN_PATH: String
|
|
66
|
+
def initialize: (client_id: String, ?client_secret: String?, ?redirect_uri: String?, ?base_url: String) -> void
|
|
67
|
+
def authorization_url: (?scope: String, ?state: String?, ?code_challenge: String?, ?code_challenge_method: String?, ?tenant_name: String?, ?redirect_uri: String?) -> String
|
|
68
|
+
def exchange_code: (String code, ?code_verifier: String?, ?redirect_uri: String?) -> Token
|
|
69
|
+
def client_credentials: (?scope: String?) -> Token
|
|
70
|
+
def refresh: (String refresh_token) -> Token
|
|
71
|
+
def revoke: (String token, ?token_type_hint: String?) -> bool
|
|
72
|
+
end
|
|
73
|
+
end
|
|
35
74
|
|
|
36
75
|
module Auth
|
|
37
76
|
class ApiKey
|
|
@@ -53,15 +92,39 @@ module Kit
|
|
|
53
92
|
attr_reader base_url: String
|
|
54
93
|
attr_reader open_timeout: Integer
|
|
55
94
|
attr_reader read_timeout: Integer
|
|
56
|
-
|
|
95
|
+
attr_reader max_retries: Integer
|
|
96
|
+
attr_reader retry_backoff: Float
|
|
97
|
+
attr_reader max_backoff: Numeric
|
|
98
|
+
def initialize: (?api_key: String?, ?access_token: String?, ?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?max_retries: Integer, ?retry_backoff: Float, ?max_backoff: Numeric) -> void
|
|
57
99
|
end
|
|
58
100
|
|
|
59
101
|
class Connection
|
|
60
102
|
JSON_TYPE: String
|
|
103
|
+
RETRYABLE: Array[singleton(APIError)]
|
|
61
104
|
def initialize: (Configuration config) -> void
|
|
62
105
|
def request: (Symbol method, String path, ?params: Hash[untyped, untyped], ?body: Hash[untyped, untyped]?) -> untyped
|
|
63
106
|
end
|
|
64
107
|
|
|
108
|
+
class Pagination
|
|
109
|
+
attr_reader has_previous_page: bool
|
|
110
|
+
attr_reader has_next_page: bool
|
|
111
|
+
attr_reader start_cursor: String?
|
|
112
|
+
attr_reader end_cursor: String?
|
|
113
|
+
attr_reader per_page: Integer?
|
|
114
|
+
def self.from: (Hash[String, untyped] hash) -> Pagination
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class Collection[T]
|
|
118
|
+
include Enumerable[T]
|
|
119
|
+
attr_reader data: Array[T]
|
|
120
|
+
attr_reader pagination: Pagination
|
|
121
|
+
def initialize: (data: Array[T], pagination: Pagination) { (String end_cursor) -> Collection[T] } -> void
|
|
122
|
+
def each: () { (T) -> void } -> void
|
|
123
|
+
def next_page: () -> Collection[T]?
|
|
124
|
+
def auto_paging_each: () { (T) -> void } -> void
|
|
125
|
+
| () -> Enumerator[T, void]
|
|
126
|
+
end
|
|
127
|
+
|
|
65
128
|
module Objects
|
|
66
129
|
class User
|
|
67
130
|
attr_reader email: String?
|
|
@@ -81,6 +144,249 @@ module Kit
|
|
|
81
144
|
attr_reader account: Account
|
|
82
145
|
def self.from: (Hash[String, untyped] hash) -> AccountInfo
|
|
83
146
|
end
|
|
147
|
+
class CreatorProfile
|
|
148
|
+
attr_reader name: String?
|
|
149
|
+
attr_reader byline: String?
|
|
150
|
+
attr_reader bio: String?
|
|
151
|
+
attr_reader image_url: String?
|
|
152
|
+
attr_reader profile_url: String?
|
|
153
|
+
def self.from: (Hash[String, untyped] hash) -> CreatorProfile
|
|
154
|
+
end
|
|
155
|
+
class Tag
|
|
156
|
+
attr_reader id: Integer?
|
|
157
|
+
attr_reader name: String?
|
|
158
|
+
attr_reader created_at: String?
|
|
159
|
+
attr_reader subscriber_count: Integer?
|
|
160
|
+
def self.from: (Hash[String, untyped] hash) -> Tag
|
|
161
|
+
end
|
|
162
|
+
class CustomField
|
|
163
|
+
attr_reader id: Integer?
|
|
164
|
+
attr_reader name: String?
|
|
165
|
+
attr_reader key: String?
|
|
166
|
+
attr_reader label: String?
|
|
167
|
+
def self.from: (Hash[String, untyped] hash) -> CustomField
|
|
168
|
+
end
|
|
169
|
+
class Form
|
|
170
|
+
attr_reader id: Integer?
|
|
171
|
+
attr_reader name: String?
|
|
172
|
+
attr_reader created_at: String?
|
|
173
|
+
attr_reader type: String?
|
|
174
|
+
attr_reader format: untyped
|
|
175
|
+
attr_reader embed_js: String?
|
|
176
|
+
attr_reader embed_url: String?
|
|
177
|
+
attr_reader archived: bool?
|
|
178
|
+
attr_reader uid: String?
|
|
179
|
+
attr_reader subscriber_count: Integer?
|
|
180
|
+
def self.from: (Hash[String, untyped] hash) -> Form
|
|
181
|
+
end
|
|
182
|
+
class Sequence
|
|
183
|
+
attr_reader id: Integer?
|
|
184
|
+
attr_reader name: String?
|
|
185
|
+
attr_reader hold: bool?
|
|
186
|
+
attr_reader repeat: bool?
|
|
187
|
+
attr_reader created_at: String?
|
|
188
|
+
attr_reader updated_at: String?
|
|
189
|
+
attr_reader email_address: String?
|
|
190
|
+
attr_reader email_template_id: Integer?
|
|
191
|
+
attr_reader send_days: Array[untyped]?
|
|
192
|
+
attr_reader send_hour: Integer?
|
|
193
|
+
attr_reader time_zone: String?
|
|
194
|
+
attr_reader active: bool?
|
|
195
|
+
attr_reader exclude_subscriber_sources: Array[untyped]?
|
|
196
|
+
attr_reader email_count: Integer?
|
|
197
|
+
attr_reader subscriber_count: Integer?
|
|
198
|
+
attr_reader stats: Hash[String, untyped]?
|
|
199
|
+
def self.from: (Hash[String, untyped] hash) -> Sequence
|
|
200
|
+
end
|
|
201
|
+
class Broadcast
|
|
202
|
+
attr_reader id: Integer?
|
|
203
|
+
attr_reader publication_id: Integer?
|
|
204
|
+
attr_reader created_at: String?
|
|
205
|
+
attr_reader subject: String?
|
|
206
|
+
attr_reader preview_text: String?
|
|
207
|
+
attr_reader description: String?
|
|
208
|
+
attr_reader content: String?
|
|
209
|
+
attr_reader public: bool?
|
|
210
|
+
attr_reader published_at: String?
|
|
211
|
+
attr_reader send_at: String?
|
|
212
|
+
attr_reader thumbnail_alt: String?
|
|
213
|
+
attr_reader thumbnail_url: String?
|
|
214
|
+
attr_reader public_url: String?
|
|
215
|
+
attr_reader email_address: String?
|
|
216
|
+
attr_reader email_template: Hash[String, untyped]?
|
|
217
|
+
attr_reader subscriber_filter: Array[untyped]?
|
|
218
|
+
attr_reader status: String?
|
|
219
|
+
def self.from: (Hash[String, untyped] hash) -> Broadcast
|
|
220
|
+
end
|
|
221
|
+
class Webhook
|
|
222
|
+
attr_reader id: Integer?
|
|
223
|
+
attr_reader account_id: Integer?
|
|
224
|
+
attr_reader event: Hash[String, untyped]?
|
|
225
|
+
attr_reader target_url: String?
|
|
226
|
+
def self.from: (Hash[String, untyped] hash) -> Webhook
|
|
227
|
+
end
|
|
228
|
+
class WebhookEndpoint
|
|
229
|
+
attr_reader id: Integer?
|
|
230
|
+
attr_reader name: String?
|
|
231
|
+
attr_reader url: String?
|
|
232
|
+
attr_reader events: Array[untyped]?
|
|
233
|
+
attr_reader status: String?
|
|
234
|
+
attr_reader source: String?
|
|
235
|
+
attr_reader description: String?
|
|
236
|
+
attr_reader created_by_app: untyped
|
|
237
|
+
attr_reader created_at: String?
|
|
238
|
+
attr_reader previous_secret_expires_at: String?
|
|
239
|
+
def self.from: (Hash[String, untyped] hash) -> WebhookEndpoint
|
|
240
|
+
end
|
|
241
|
+
class EmailTemplate
|
|
242
|
+
attr_reader id: Integer?
|
|
243
|
+
attr_reader name: String?
|
|
244
|
+
attr_reader is_default: bool?
|
|
245
|
+
attr_reader category: String?
|
|
246
|
+
def self.from: (Hash[String, untyped] hash) -> EmailTemplate
|
|
247
|
+
end
|
|
248
|
+
class Segment
|
|
249
|
+
attr_reader id: Integer?
|
|
250
|
+
attr_reader name: String?
|
|
251
|
+
attr_reader created_at: String?
|
|
252
|
+
def self.from: (Hash[String, untyped] hash) -> Segment
|
|
253
|
+
end
|
|
254
|
+
class Post
|
|
255
|
+
attr_reader id: Integer?
|
|
256
|
+
attr_reader publication_id: Integer?
|
|
257
|
+
attr_reader created_at: String?
|
|
258
|
+
attr_reader title: String?
|
|
259
|
+
attr_reader slug: String?
|
|
260
|
+
attr_reader description: String?
|
|
261
|
+
attr_reader meta_description: String?
|
|
262
|
+
attr_reader status: String?
|
|
263
|
+
attr_reader published_at: String?
|
|
264
|
+
attr_reader sent_at: String?
|
|
265
|
+
attr_reader thumbnail_alt: String?
|
|
266
|
+
attr_reader thumbnail_url: String?
|
|
267
|
+
attr_reader is_paid: bool?
|
|
268
|
+
attr_reader public_url: String?
|
|
269
|
+
def self.from: (Hash[String, untyped] hash) -> Post
|
|
270
|
+
end
|
|
271
|
+
class Snippet
|
|
272
|
+
attr_reader id: Integer?
|
|
273
|
+
attr_reader name: String?
|
|
274
|
+
attr_reader snippet_type: String?
|
|
275
|
+
attr_reader archived: bool?
|
|
276
|
+
attr_reader key: String?
|
|
277
|
+
attr_reader created_at: String?
|
|
278
|
+
attr_reader updated_at: String?
|
|
279
|
+
attr_reader content: String?
|
|
280
|
+
attr_reader document: untyped
|
|
281
|
+
def self.from: (Hash[String, untyped] hash) -> Snippet
|
|
282
|
+
end
|
|
283
|
+
class Purchase
|
|
284
|
+
attr_reader id: Integer?
|
|
285
|
+
attr_reader transaction_id: String?
|
|
286
|
+
attr_reader subscriber_id: Integer?
|
|
287
|
+
attr_reader status: String?
|
|
288
|
+
attr_reader email_address: String?
|
|
289
|
+
attr_reader currency: String?
|
|
290
|
+
attr_reader transaction_time: String?
|
|
291
|
+
attr_reader subtotal: Numeric?
|
|
292
|
+
attr_reader discount: Numeric?
|
|
293
|
+
attr_reader tax: Numeric?
|
|
294
|
+
attr_reader total: Numeric?
|
|
295
|
+
attr_reader products: Array[untyped]?
|
|
296
|
+
attr_reader source: String?
|
|
297
|
+
def self.from: (Hash[String, untyped] hash) -> Purchase
|
|
298
|
+
end
|
|
299
|
+
class SequenceEmail
|
|
300
|
+
attr_reader id: Integer?
|
|
301
|
+
attr_reader sequence_id: Integer?
|
|
302
|
+
attr_reader subject: String?
|
|
303
|
+
attr_reader preview_text: String?
|
|
304
|
+
attr_reader email_address: String?
|
|
305
|
+
attr_reader email_template_id: Integer?
|
|
306
|
+
attr_reader published: bool?
|
|
307
|
+
attr_reader position: Integer?
|
|
308
|
+
attr_reader delay_value: Integer?
|
|
309
|
+
attr_reader delay_unit: String?
|
|
310
|
+
attr_reader send_days: Array[untyped]?
|
|
311
|
+
attr_reader stats: Hash[String, untyped]?
|
|
312
|
+
def self.from: (Hash[String, untyped] hash) -> SequenceEmail
|
|
313
|
+
end
|
|
314
|
+
class BroadcastStats
|
|
315
|
+
attr_reader id: Integer?
|
|
316
|
+
attr_reader subject: String?
|
|
317
|
+
attr_reader send_at: String?
|
|
318
|
+
attr_reader recipients: Integer?
|
|
319
|
+
attr_reader open_rate: Numeric?
|
|
320
|
+
attr_reader emails_opened: Integer?
|
|
321
|
+
attr_reader click_rate: Numeric?
|
|
322
|
+
attr_reader unsubscribe_rate: Numeric?
|
|
323
|
+
attr_reader unsubscribes: Integer?
|
|
324
|
+
attr_reader total_clicks: Integer?
|
|
325
|
+
attr_reader show_total_clicks: bool?
|
|
326
|
+
attr_reader status: String?
|
|
327
|
+
attr_reader progress: Numeric?
|
|
328
|
+
attr_reader open_tracking_disabled: bool?
|
|
329
|
+
attr_reader click_tracking_disabled: bool?
|
|
330
|
+
def self.from: (Hash[String, untyped] hash) -> BroadcastStats
|
|
331
|
+
end
|
|
332
|
+
class BroadcastClick
|
|
333
|
+
attr_reader id: Integer?
|
|
334
|
+
attr_reader url: String?
|
|
335
|
+
attr_reader unique_clicks: Integer?
|
|
336
|
+
attr_reader click_to_delivery_rate: Numeric?
|
|
337
|
+
attr_reader click_to_open_rate: Numeric?
|
|
338
|
+
def self.from: (Hash[String, untyped] hash) -> BroadcastClick
|
|
339
|
+
end
|
|
340
|
+
class SubscriberStats
|
|
341
|
+
attr_reader id: Integer?
|
|
342
|
+
attr_reader sent: Integer?
|
|
343
|
+
attr_reader opened: Integer?
|
|
344
|
+
attr_reader clicked: Integer?
|
|
345
|
+
attr_reader bounced: Integer?
|
|
346
|
+
attr_reader open_rate: Numeric?
|
|
347
|
+
attr_reader click_rate: Numeric?
|
|
348
|
+
attr_reader last_sent: String?
|
|
349
|
+
attr_reader last_opened: String?
|
|
350
|
+
attr_reader last_clicked: String?
|
|
351
|
+
attr_reader sends_since_last_open: Integer?
|
|
352
|
+
attr_reader sends_since_last_click: Integer?
|
|
353
|
+
def self.from: (Hash[String, untyped] hash) -> SubscriberStats
|
|
354
|
+
end
|
|
355
|
+
class EmailStats
|
|
356
|
+
attr_reader sent: Integer?
|
|
357
|
+
attr_reader clicked: Integer?
|
|
358
|
+
attr_reader opened: Integer?
|
|
359
|
+
attr_reader email_stats_mode: String?
|
|
360
|
+
attr_reader open_tracking_enabled: bool?
|
|
361
|
+
attr_reader click_tracking_enabled: bool?
|
|
362
|
+
attr_reader starting: String?
|
|
363
|
+
attr_reader ending: String?
|
|
364
|
+
attr_reader open_rate: Numeric?
|
|
365
|
+
attr_reader click_rate: Numeric?
|
|
366
|
+
attr_reader unsubscribe_rate: Numeric?
|
|
367
|
+
attr_reader bounce_rate: Numeric?
|
|
368
|
+
def self.from: (Hash[String, untyped] hash) -> EmailStats
|
|
369
|
+
end
|
|
370
|
+
class GrowthStats
|
|
371
|
+
attr_reader cancellations: Integer?
|
|
372
|
+
attr_reader net_new_subscribers: Integer?
|
|
373
|
+
attr_reader new_subscribers: Integer?
|
|
374
|
+
attr_reader subscribers: Integer?
|
|
375
|
+
attr_reader starting: String?
|
|
376
|
+
attr_reader ending: String?
|
|
377
|
+
def self.from: (Hash[String, untyped] hash) -> GrowthStats
|
|
378
|
+
end
|
|
379
|
+
class Subscriber
|
|
380
|
+
attr_reader id: Integer?
|
|
381
|
+
attr_reader first_name: String?
|
|
382
|
+
attr_reader email_address: String?
|
|
383
|
+
attr_reader state: String?
|
|
384
|
+
attr_reader created_at: String?
|
|
385
|
+
attr_reader canceled_at: String?
|
|
386
|
+
attr_reader location: Hash[String, untyped]?
|
|
387
|
+
attr_reader fields: Hash[String, untyped]?
|
|
388
|
+
def self.from: (Hash[String, untyped] hash) -> Subscriber
|
|
389
|
+
end
|
|
84
390
|
end
|
|
85
391
|
|
|
86
392
|
module Resources
|
|
@@ -89,6 +395,114 @@ module Kit
|
|
|
89
395
|
end
|
|
90
396
|
class Account < Base
|
|
91
397
|
def get: () -> Objects::AccountInfo
|
|
398
|
+
def colors: () -> Array[String]
|
|
399
|
+
def update_colors: (Array[String] colors) -> Array[String]
|
|
400
|
+
def creator_profile: () -> Objects::CreatorProfile
|
|
401
|
+
def email_stats: () -> Objects::EmailStats
|
|
402
|
+
def growth_stats: (**untyped params) -> Objects::GrowthStats
|
|
403
|
+
end
|
|
404
|
+
class Subscribers < Base
|
|
405
|
+
def list: (**untyped params) -> Collection[Objects::Subscriber]
|
|
406
|
+
def get: (Integer id) -> Objects::Subscriber
|
|
407
|
+
def create: (email_address: String, ?first_name: String?, ?state: String?, ?fields: Hash[untyped, untyped]?) -> Objects::Subscriber
|
|
408
|
+
def update: (Integer id, ?first_name: String?, ?email_address: String?, ?fields: Hash[untyped, untyped]?) -> Objects::Subscriber
|
|
409
|
+
def unsubscribe: (Integer id) -> Objects::Subscriber
|
|
410
|
+
def filter: (**untyped params) -> Collection[Objects::Subscriber]
|
|
411
|
+
def tags: (Integer id, **untyped params) -> Collection[Objects::Tag]
|
|
412
|
+
def stats: (Integer id) -> Objects::SubscriberStats
|
|
413
|
+
def set_location: (Integer id, location: Hash[untyped, untyped]) -> Objects::Subscriber
|
|
414
|
+
def remove_location: (Integer id) -> void
|
|
415
|
+
end
|
|
416
|
+
class Tags < Base
|
|
417
|
+
def list: (**untyped params) -> Collection[Objects::Tag]
|
|
418
|
+
def create: (name: String) -> Objects::Tag
|
|
419
|
+
def update: (Integer id, name: String) -> Objects::Tag
|
|
420
|
+
def tag_subscriber: (Integer tag_id, Integer subscriber_id) -> Objects::Subscriber
|
|
421
|
+
def remove_subscriber: (Integer tag_id, Integer subscriber_id) -> untyped
|
|
422
|
+
def tag_subscriber_by_email: (Integer tag_id, email_address: String) -> Objects::Subscriber
|
|
423
|
+
def remove_subscriber_by_email: (Integer tag_id, email_address: String) -> void
|
|
424
|
+
def subscribers: (Integer tag_id, **untyped params) -> Collection[Objects::Subscriber]
|
|
425
|
+
end
|
|
426
|
+
class CustomFields < Base
|
|
427
|
+
def list: (**untyped params) -> Collection[Objects::CustomField]
|
|
428
|
+
def create: (label: String) -> Objects::CustomField
|
|
429
|
+
def update: (Integer id, label: String) -> Objects::CustomField
|
|
430
|
+
def delete: (Integer id) -> void
|
|
431
|
+
end
|
|
432
|
+
class Forms < Base
|
|
433
|
+
def list: (**untyped params) -> Collection[Objects::Form]
|
|
434
|
+
def subscribers: (Integer form_id, **untyped params) -> Collection[Objects::Subscriber]
|
|
435
|
+
def add_subscriber: (Integer form_id, Integer subscriber_id, ?referrer: String?) -> Objects::Subscriber
|
|
436
|
+
def add_subscriber_by_email: (Integer form_id, email_address: String, ?referrer: String?) -> Objects::Subscriber
|
|
437
|
+
end
|
|
438
|
+
class Sequences < Base
|
|
439
|
+
def list: (**untyped params) -> Collection[Objects::Sequence]
|
|
440
|
+
def get: (Integer id) -> Objects::Sequence
|
|
441
|
+
def create: (name: String, **untyped attributes) -> Objects::Sequence
|
|
442
|
+
def update: (Integer id, **untyped attributes) -> Objects::Sequence
|
|
443
|
+
def delete: (Integer id) -> void
|
|
444
|
+
def subscribers: (Integer sequence_id, **untyped params) -> Collection[Objects::Subscriber]
|
|
445
|
+
def add_subscriber: (Integer sequence_id, Integer subscriber_id) -> Objects::Subscriber
|
|
446
|
+
def add_subscriber_by_email: (Integer sequence_id, email_address: String) -> Objects::Subscriber
|
|
447
|
+
def emails: (Integer sequence_id, **untyped params) -> Collection[Objects::SequenceEmail]
|
|
448
|
+
def email: (Integer sequence_id, Integer id) -> Objects::SequenceEmail
|
|
449
|
+
def create_email: (Integer sequence_id, **untyped attributes) -> Objects::SequenceEmail
|
|
450
|
+
def update_email: (Integer sequence_id, Integer id, **untyped attributes) -> Objects::SequenceEmail
|
|
451
|
+
def delete_email: (Integer sequence_id, Integer id) -> void
|
|
452
|
+
end
|
|
453
|
+
class Broadcasts < Base
|
|
454
|
+
def list: (**untyped params) -> Collection[Objects::Broadcast]
|
|
455
|
+
def get: (Integer id) -> Objects::Broadcast
|
|
456
|
+
def create: (**untyped attributes) -> Objects::Broadcast
|
|
457
|
+
def update: (Integer id, **untyped attributes) -> Objects::Broadcast
|
|
458
|
+
def delete: (Integer id) -> void
|
|
459
|
+
def stats_list: (**untyped params) -> Collection[Objects::BroadcastStats]
|
|
460
|
+
def stats: (Integer id) -> Objects::BroadcastStats
|
|
461
|
+
def clicks: (Integer id, **untyped params) -> Collection[Objects::BroadcastClick]
|
|
462
|
+
end
|
|
463
|
+
class EmailTemplates < Base
|
|
464
|
+
def list: (**untyped params) -> Collection[Objects::EmailTemplate]
|
|
465
|
+
end
|
|
466
|
+
class Posts < Base
|
|
467
|
+
def list: (**untyped params) -> Collection[Objects::Post]
|
|
468
|
+
def get: (Integer id) -> Objects::Post
|
|
469
|
+
end
|
|
470
|
+
class Purchases < Base
|
|
471
|
+
def list: (**untyped params) -> Collection[Objects::Purchase]
|
|
472
|
+
def get: (Integer id) -> Objects::Purchase
|
|
473
|
+
def create: (**untyped attributes) -> Objects::Purchase
|
|
474
|
+
end
|
|
475
|
+
class Bulk < Base
|
|
476
|
+
def create_subscribers: (Array[untyped] subscribers, ?callback_url: String?) -> Hash[String, untyped]
|
|
477
|
+
def create_custom_fields: (Array[untyped] custom_fields, ?callback_url: String?) -> Hash[String, untyped]
|
|
478
|
+
def update_custom_field_values: (Array[untyped] custom_field_values, ?callback_url: String?) -> Hash[String, untyped]
|
|
479
|
+
def add_subscribers_to_forms: (Array[untyped] additions, ?callback_url: String?) -> Hash[String, untyped]
|
|
480
|
+
def create_tags: (Array[untyped] tags, ?callback_url: String?) -> Hash[String, untyped]
|
|
481
|
+
def delete_tags: (Array[untyped] tags, ?callback_url: String?) -> Hash[String, untyped]
|
|
482
|
+
def tag_subscribers: (Array[untyped] taggings, ?callback_url: String?) -> Hash[String, untyped]
|
|
483
|
+
def remove_tag_subscribers: (Array[untyped] taggings, ?callback_url: String?) -> Hash[String, untyped]
|
|
484
|
+
end
|
|
485
|
+
class Snippets < Base
|
|
486
|
+
def list: (**untyped params) -> Collection[Objects::Snippet]
|
|
487
|
+
def get: (Integer id) -> Objects::Snippet
|
|
488
|
+
def create: (**untyped attributes) -> Objects::Snippet
|
|
489
|
+
def update: (Integer id, **untyped attributes) -> Objects::Snippet
|
|
490
|
+
end
|
|
491
|
+
class Segments < Base
|
|
492
|
+
def list: (**untyped params) -> Collection[Objects::Segment]
|
|
493
|
+
end
|
|
494
|
+
class Webhooks < Base
|
|
495
|
+
def list: (**untyped params) -> Collection[Objects::Webhook]
|
|
496
|
+
def create: (target_url: String, event: Hash[untyped, untyped]) -> Objects::Webhook
|
|
497
|
+
def delete: (Integer id) -> void
|
|
498
|
+
end
|
|
499
|
+
class WebhookEndpoints < Base
|
|
500
|
+
def list: (**untyped params) -> Collection[Objects::WebhookEndpoint]
|
|
501
|
+
def get: (Integer id) -> Objects::WebhookEndpoint
|
|
502
|
+
def create: (url: String, events: Array[untyped], ?name: String?, ?description: String?) -> Objects::WebhookEndpoint
|
|
503
|
+
def delete: (Integer id) -> void
|
|
504
|
+
def rotate_secret: (Integer id, ?force: bool?) -> Objects::WebhookEndpoint
|
|
505
|
+
def revoke_previous_secret: (Integer id) -> Objects::WebhookEndpoint
|
|
92
506
|
end
|
|
93
507
|
end
|
|
94
508
|
|
|
@@ -96,5 +510,19 @@ module Kit
|
|
|
96
510
|
attr_reader config: Configuration
|
|
97
511
|
def initialize: (?api_key: String?, ?access_token: String?, **untyped options) -> void
|
|
98
512
|
def account: () -> Resources::Account
|
|
513
|
+
def subscribers: () -> Resources::Subscribers
|
|
514
|
+
def tags: () -> Resources::Tags
|
|
515
|
+
def custom_fields: () -> Resources::CustomFields
|
|
516
|
+
def forms: () -> Resources::Forms
|
|
517
|
+
def sequences: () -> Resources::Sequences
|
|
518
|
+
def broadcasts: () -> Resources::Broadcasts
|
|
519
|
+
def webhooks: () -> Resources::Webhooks
|
|
520
|
+
def webhook_endpoints: () -> Resources::WebhookEndpoints
|
|
521
|
+
def email_templates: () -> Resources::EmailTemplates
|
|
522
|
+
def segments: () -> Resources::Segments
|
|
523
|
+
def posts: () -> Resources::Posts
|
|
524
|
+
def snippets: () -> Resources::Snippets
|
|
525
|
+
def purchases: () -> Resources::Purchases
|
|
526
|
+
def bulk: () -> Resources::Bulk
|
|
99
527
|
end
|
|
100
528
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kit-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lawrence Lin
|
|
@@ -44,18 +44,56 @@ files:
|
|
|
44
44
|
- lib/kit/configuration.rb
|
|
45
45
|
- lib/kit/connection.rb
|
|
46
46
|
- lib/kit/errors.rb
|
|
47
|
+
- lib/kit/oauth/client.rb
|
|
48
|
+
- lib/kit/oauth/pkce.rb
|
|
49
|
+
- lib/kit/oauth/token.rb
|
|
47
50
|
- lib/kit/objects/account.rb
|
|
51
|
+
- lib/kit/objects/broadcast.rb
|
|
52
|
+
- lib/kit/objects/broadcast_click.rb
|
|
53
|
+
- lib/kit/objects/broadcast_stats.rb
|
|
54
|
+
- lib/kit/objects/creator_profile.rb
|
|
55
|
+
- lib/kit/objects/custom_field.rb
|
|
56
|
+
- lib/kit/objects/email_stats.rb
|
|
57
|
+
- lib/kit/objects/email_template.rb
|
|
58
|
+
- lib/kit/objects/form.rb
|
|
59
|
+
- lib/kit/objects/growth_stats.rb
|
|
60
|
+
- lib/kit/objects/post.rb
|
|
61
|
+
- lib/kit/objects/purchase.rb
|
|
62
|
+
- lib/kit/objects/segment.rb
|
|
63
|
+
- lib/kit/objects/sequence.rb
|
|
64
|
+
- lib/kit/objects/sequence_email.rb
|
|
65
|
+
- lib/kit/objects/snippet.rb
|
|
66
|
+
- lib/kit/objects/subscriber.rb
|
|
67
|
+
- lib/kit/objects/subscriber_stats.rb
|
|
68
|
+
- lib/kit/objects/tag.rb
|
|
69
|
+
- lib/kit/objects/webhook.rb
|
|
70
|
+
- lib/kit/objects/webhook_endpoint.rb
|
|
71
|
+
- lib/kit/pagination.rb
|
|
48
72
|
- lib/kit/resources/account.rb
|
|
49
73
|
- lib/kit/resources/base.rb
|
|
74
|
+
- lib/kit/resources/broadcasts.rb
|
|
75
|
+
- lib/kit/resources/bulk.rb
|
|
76
|
+
- lib/kit/resources/custom_fields.rb
|
|
77
|
+
- lib/kit/resources/email_templates.rb
|
|
78
|
+
- lib/kit/resources/forms.rb
|
|
79
|
+
- lib/kit/resources/posts.rb
|
|
80
|
+
- lib/kit/resources/purchases.rb
|
|
81
|
+
- lib/kit/resources/segments.rb
|
|
82
|
+
- lib/kit/resources/sequences.rb
|
|
83
|
+
- lib/kit/resources/snippets.rb
|
|
84
|
+
- lib/kit/resources/subscribers.rb
|
|
85
|
+
- lib/kit/resources/tags.rb
|
|
86
|
+
- lib/kit/resources/webhook_endpoints.rb
|
|
87
|
+
- lib/kit/resources/webhooks.rb
|
|
50
88
|
- lib/kit/version.rb
|
|
51
89
|
- sig/kit-rb.rbs
|
|
52
|
-
homepage: https://github.com/
|
|
90
|
+
homepage: https://github.com/linyiru/kit-rb
|
|
53
91
|
licenses:
|
|
54
92
|
- MIT
|
|
55
93
|
metadata:
|
|
56
|
-
homepage_uri: https://github.com/
|
|
57
|
-
source_code_uri: https://github.com/
|
|
58
|
-
changelog_uri: https://github.com/
|
|
94
|
+
homepage_uri: https://github.com/linyiru/kit-rb
|
|
95
|
+
source_code_uri: https://github.com/linyiru/kit-rb
|
|
96
|
+
changelog_uri: https://github.com/linyiru/kit-rb/blob/main/CHANGELOG.md
|
|
59
97
|
rubygems_mfa_required: 'true'
|
|
60
98
|
rdoc_options: []
|
|
61
99
|
require_paths:
|