blueticks 1.1.1 → 2.0.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/lib/blueticks/client.rb +27 -5
- data/lib/blueticks/resources/account.rb +2 -2
- data/lib/blueticks/resources/audiences.rb +31 -22
- data/lib/blueticks/resources/campaigns.rb +28 -23
- data/lib/blueticks/resources/chats.rb +37 -86
- data/lib/blueticks/resources/contacts.rb +18 -11
- data/lib/blueticks/resources/engines.rb +12 -19
- data/lib/blueticks/resources/groups.rb +54 -28
- data/lib/blueticks/resources/messages.rb +110 -31
- data/lib/blueticks/resources/newsletters.rb +43 -0
- data/lib/blueticks/resources/ping.rb +6 -3
- data/lib/blueticks/resources/scheduled_messages.rb +74 -30
- data/lib/blueticks/resources/suno.rb +56 -0
- data/lib/blueticks/resources/utils.rb +3 -13
- data/lib/blueticks/resources/webhooks.rb +21 -20
- data/lib/blueticks/types/account.rb +2 -1
- data/lib/blueticks/types/audiences.rb +15 -9
- data/lib/blueticks/types/campaigns.rb +13 -12
- data/lib/blueticks/types/chats.rb +19 -71
- data/lib/blueticks/types/contacts.rb +6 -7
- data/lib/blueticks/types/deleted_resource.rb +14 -0
- data/lib/blueticks/types/engines.rb +9 -8
- data/lib/blueticks/types/groups.rb +22 -6
- data/lib/blueticks/types/messages.rb +124 -11
- data/lib/blueticks/types/newsletter.rb +33 -0
- data/lib/blueticks/types/ok_result.rb +13 -0
- data/lib/blueticks/types/paginated.rb +70 -0
- data/lib/blueticks/types/ping.rb +11 -3
- data/lib/blueticks/types/scheduled_messages.rb +28 -14
- data/lib/blueticks/types/suno.rb +42 -0
- data/lib/blueticks/types/utils.rb +5 -12
- data/lib/blueticks/types/webhooks.rb +13 -11
- data/lib/blueticks/version.rb +1 -1
- data/lib/blueticks.rb +2 -2
- metadata +8 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "base"
|
|
4
|
+
|
|
5
|
+
module Blueticks
|
|
6
|
+
module Types
|
|
7
|
+
SONG_CLIP_STATUSES = %w[submitted queued running streaming complete error].freeze
|
|
8
|
+
|
|
9
|
+
# Suno credit / plan usage (AccountUsageResponse) from GET /v1/suno/account.
|
|
10
|
+
class SunoAccount < Base
|
|
11
|
+
field :credits_left, :number, wire_name: "creditsLeft"
|
|
12
|
+
field :monthly_limit, :number, nullable: true, wire_name: "monthlyLimit"
|
|
13
|
+
field :monthly_usage, :number, nullable: true, wire_name: "monthlyUsage"
|
|
14
|
+
field :plan, :string, nullable: true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# A generated song clip (SongClip / GetSongResponse).
|
|
18
|
+
class SongClip < Base
|
|
19
|
+
field :id, :string
|
|
20
|
+
field :status, [:enum, SONG_CLIP_STATUSES]
|
|
21
|
+
field :audio_url, :string, nullable: true, wire_name: "audioUrl"
|
|
22
|
+
field :image_url, :string, nullable: true, wire_name: "imageUrl"
|
|
23
|
+
field :title, :string, nullable: true
|
|
24
|
+
field :duration_sec, :number, nullable: true, wire_name: "durationSec"
|
|
25
|
+
field :model, :string, nullable: true
|
|
26
|
+
field :error_type, :string, nullable: true, optional: true, wire_name: "errorType"
|
|
27
|
+
field :error_message, :string, nullable: true, optional: true, wire_name: "errorMessage"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Result of submitting a song generation job (GenerateSongResponse).
|
|
31
|
+
class GenerateSongResult < Base
|
|
32
|
+
field :job_id, :string, wire_name: "jobId"
|
|
33
|
+
field :clips, [:array, SongClip]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Result of registering a reference-audio upload (CreateUploadResponse).
|
|
37
|
+
class CreateUploadResult < Base
|
|
38
|
+
field :upload_id, :string, wire_name: "uploadId"
|
|
39
|
+
field :status, :string
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
# Placeholder — UtilsResource exposes no /v1/utils/* methods in the
|
|
4
|
+
# current spec. This file exists because lib/blueticks.rb (MUST-NOT-TOUCH)
|
|
5
|
+
# requires it. Once the spec adds util operations, regenerate this file
|
|
6
|
+
# with the matching response types.
|
|
5
7
|
module Blueticks
|
|
6
8
|
module Types
|
|
7
|
-
|
|
8
|
-
field :valid, :boolean
|
|
9
|
-
field :formatted_chat_id, :string, nullable: true
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
class LinkPreview < Base
|
|
13
|
-
field :title, :string, nullable: true
|
|
14
|
-
field :description, :string, nullable: true
|
|
15
|
-
field :thumbnail, :string, nullable: true
|
|
16
|
-
field :canonical_url, :string, nullable: true
|
|
9
|
+
module Utils
|
|
17
10
|
end
|
|
18
11
|
end
|
|
19
12
|
end
|
|
@@ -10,27 +10,29 @@ module Blueticks
|
|
|
10
10
|
message.queued message.sending message.delivered message.failed message.read
|
|
11
11
|
session.connected session.disconnected
|
|
12
12
|
campaign.started campaign.paused campaign.resumed campaign.completed campaign.aborted
|
|
13
|
+
new_message_received_webhook message_reaction_webhook ack_changed_webhook
|
|
14
|
+
participant_joined_via_link_webhook participant_added_by_admin_webhook
|
|
15
|
+
participant_left_group_webhook participant_kicked_from_group_webhook
|
|
16
|
+
group_admin_changed_webhook group_name_changed_webhook group_description_changed_webhook
|
|
17
|
+
group_message_pinned_webhook poll_vote_webhook reply_to_my_message_webhook
|
|
18
|
+
message_deleted_revoked_webhook message_edited_webhook
|
|
13
19
|
].freeze
|
|
14
20
|
|
|
21
|
+
# A webhook subscription (WebhookResponse). The signing secret is returned
|
|
22
|
+
# only out-of-band at creation time in the dashboard; it is not part of the
|
|
23
|
+
# API response body in 2.x.
|
|
15
24
|
class Webhook < Base
|
|
16
25
|
field :id, :string
|
|
17
26
|
field :url, :string
|
|
18
27
|
field :events, %i[array string]
|
|
19
28
|
field :description, :string, nullable: true
|
|
20
29
|
field :status, [:enum, WEBHOOK_STATUSES]
|
|
21
|
-
field :created_at, :string
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
class WebhookCreateResult < Base
|
|
25
|
-
field :id, :string
|
|
26
|
-
field :url, :string
|
|
27
|
-
field :events, %i[array string]
|
|
28
|
-
field :description, :string, nullable: true
|
|
29
|
-
field :status, [:enum, WEBHOOK_STATUSES]
|
|
30
|
-
field :created_at, :string
|
|
31
|
-
field :secret, :string
|
|
30
|
+
field :created_at, :string, wire_name: "createdAt"
|
|
32
31
|
end
|
|
33
32
|
|
|
33
|
+
# A delivered webhook event, as parsed by Blueticks::Webhooks.verify. Note
|
|
34
|
+
# the webhook DELIVERY payload is snake_case (distinct from the REST API's
|
|
35
|
+
# camelCase), so `created_at` here has no wire mapping.
|
|
34
36
|
class WebhookEvent < Base
|
|
35
37
|
field :id, :string
|
|
36
38
|
field :type, :string
|
data/lib/blueticks/version.rb
CHANGED
data/lib/blueticks.rb
CHANGED
|
@@ -9,7 +9,7 @@ require_relative "blueticks/types/base"
|
|
|
9
9
|
require_relative "blueticks/types/page"
|
|
10
10
|
require_relative "blueticks/types/account"
|
|
11
11
|
require_relative "blueticks/types/ping"
|
|
12
|
-
require_relative "blueticks/types/
|
|
12
|
+
require_relative "blueticks/types/scheduled_messages"
|
|
13
13
|
require_relative "blueticks/types/webhooks"
|
|
14
14
|
require_relative "blueticks/types/chats"
|
|
15
15
|
require_relative "blueticks/types/audiences"
|
|
@@ -21,7 +21,7 @@ require_relative "blueticks/types/utils"
|
|
|
21
21
|
|
|
22
22
|
require_relative "blueticks/resources/account"
|
|
23
23
|
require_relative "blueticks/resources/ping"
|
|
24
|
-
require_relative "blueticks/resources/
|
|
24
|
+
require_relative "blueticks/resources/scheduled_messages"
|
|
25
25
|
require_relative "blueticks/resources/webhooks"
|
|
26
26
|
require_relative "blueticks/resources/chats"
|
|
27
27
|
require_relative "blueticks/resources/audiences"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: blueticks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Blueticks
|
|
@@ -74,8 +74,10 @@ files:
|
|
|
74
74
|
- lib/blueticks/resources/engines.rb
|
|
75
75
|
- lib/blueticks/resources/groups.rb
|
|
76
76
|
- lib/blueticks/resources/messages.rb
|
|
77
|
+
- lib/blueticks/resources/newsletters.rb
|
|
77
78
|
- lib/blueticks/resources/ping.rb
|
|
78
79
|
- lib/blueticks/resources/scheduled_messages.rb
|
|
80
|
+
- lib/blueticks/resources/suno.rb
|
|
79
81
|
- lib/blueticks/resources/utils.rb
|
|
80
82
|
- lib/blueticks/resources/webhooks.rb
|
|
81
83
|
- lib/blueticks/transport.rb
|
|
@@ -85,12 +87,17 @@ files:
|
|
|
85
87
|
- lib/blueticks/types/campaigns.rb
|
|
86
88
|
- lib/blueticks/types/chats.rb
|
|
87
89
|
- lib/blueticks/types/contacts.rb
|
|
90
|
+
- lib/blueticks/types/deleted_resource.rb
|
|
88
91
|
- lib/blueticks/types/engines.rb
|
|
89
92
|
- lib/blueticks/types/groups.rb
|
|
90
93
|
- lib/blueticks/types/messages.rb
|
|
94
|
+
- lib/blueticks/types/newsletter.rb
|
|
95
|
+
- lib/blueticks/types/ok_result.rb
|
|
91
96
|
- lib/blueticks/types/page.rb
|
|
97
|
+
- lib/blueticks/types/paginated.rb
|
|
92
98
|
- lib/blueticks/types/ping.rb
|
|
93
99
|
- lib/blueticks/types/scheduled_messages.rb
|
|
100
|
+
- lib/blueticks/types/suno.rb
|
|
94
101
|
- lib/blueticks/types/utils.rb
|
|
95
102
|
- lib/blueticks/types/webhooks.rb
|
|
96
103
|
- lib/blueticks/version.rb
|