knockapi 0.4.10 → 0.4.12
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/Gemfile.lock +1 -1
- data/lib/knock/objects.rb +18 -0
- data/lib/knock/version.rb +1 -1
- data/lib/knock/workflows.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '068773528aedcda44f03ce1f2378bf78aef474f64fdaf036c92a2aea5c6e0c72'
|
4
|
+
data.tar.gz: 4bcb6204c07762d04460822b7bfb9a60ffc326c939ead527b7477b461a40c8e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2bd60b5658cbce9198b83276dec3e7539ba9e7ce434df0736d6abfe1f5365086cb31bf4803fbc881d27bfd123ac13643001fe07bc8b857b5324930a9be47f5a
|
7
|
+
data.tar.gz: 6ea8d6f2669a13f68e14636463ee054a8fab1ecc81dc6260c2831d8c774598ff46743f68f409ed4e0bcc125aad2ac8c955e480ba49e616ea31e663fef4317a02
|
data/Gemfile.lock
CHANGED
data/lib/knock/objects.rb
CHANGED
@@ -333,6 +333,7 @@ module Knock
|
|
333
333
|
# - page_size: size of page to be returned (max: 50)
|
334
334
|
# - after: after cursor for pagination
|
335
335
|
# - before: before cursor for pagination
|
336
|
+
# - recipients: list of recipient identifiers to filter subscribers of the object
|
336
337
|
#
|
337
338
|
# @return [Hash] Paginated subscriptions response
|
338
339
|
def list_subscriptions(collection:, id:, options: {})
|
@@ -363,6 +364,23 @@ module Knock
|
|
363
364
|
execute_request(request: request)
|
364
365
|
end
|
365
366
|
|
367
|
+
# Creates a bulk operation to create subscriptions for a set recipients to
|
368
|
+
# a set of objects within the given collection.
|
369
|
+
#
|
370
|
+
# @param [String] collection The collection the objects are in.
|
371
|
+
# @param [Array<Hash>] subscriptions The set of subscriptions to create.
|
372
|
+
#
|
373
|
+
# @return [Hash] a BulkOperation
|
374
|
+
def bulk_add_subscriptions(collection:, subscriptions: [])
|
375
|
+
request = post_request(
|
376
|
+
auth: true,
|
377
|
+
path: "/v1/objects/#{collection}/bulk/subscriptions/add",
|
378
|
+
body: { subscriptions: subscriptions }
|
379
|
+
)
|
380
|
+
|
381
|
+
execute_request(request: request)
|
382
|
+
end
|
383
|
+
|
366
384
|
# Removes subscriptions for the recipients on the object
|
367
385
|
#
|
368
386
|
# @param [String] collection The collection the object is in
|
data/lib/knock/version.rb
CHANGED
data/lib/knock/workflows.rb
CHANGED
@@ -18,12 +18,12 @@ module Knock
|
|
18
18
|
# @param [Hash] data The data to pass to the workflow
|
19
19
|
# @param [String] cancellation_key An optional key to identify this workflow
|
20
20
|
# invocation for cancelling
|
21
|
-
# @param [String] tenant An optional tenant identifier
|
21
|
+
# @param [String, Hash] tenant An optional tenant identifier or a set of tenant attributes
|
22
22
|
# @param [String] idempotency_key An optional idempotency key to prevent
|
23
23
|
# duplicate workflow invocations
|
24
24
|
#
|
25
25
|
# @return [Hash] A workflow trigger result
|
26
|
-
def trigger(key:,
|
26
|
+
def trigger(key:, recipients:, data: {}, actor: nil, cancellation_key: nil, tenant: nil, idempotency_key: nil)
|
27
27
|
attrs = {
|
28
28
|
actor: actor,
|
29
29
|
recipients: recipients,
|
@@ -72,7 +72,7 @@ module Knock
|
|
72
72
|
# @param [Array<String, Hash>] recipients The recipient identifiers
|
73
73
|
# @param [Array<Hash>] repeats The repeat rules for when to schedule the workflow run
|
74
74
|
# @param [Hash] data Parameters to be used as variables on the workflow run
|
75
|
-
# @param [String] tenant An optional tenant identifier
|
75
|
+
# @param [String, Hash] tenant An optional tenant identifier or a set of tenant attributes
|
76
76
|
|
77
77
|
def create_schedules(key:, recipients:, repeats:, scheduled_at: nil, data: {}, actor: nil, tenant: nil)
|
78
78
|
attrs = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knockapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Knock Labs, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
111
|
+
rubygems_version: 3.5.3
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: API client for Knock
|