mpql 0.0.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efb2efbefe64a0440d1fc21620820791b9c8dbf6298b6cc55b22cc70d54f4a55
4
- data.tar.gz: a4dc264a5b02f0b7d6ee6e07f754bfebd4ef18b205cbb27a199f6238d49dcdb9
3
+ metadata.gz: 92a4b924a0c0fafb25811a59d44b8dfd9b281b450a06d9547eb69859cf22eb2d
4
+ data.tar.gz: a2a9178c2b289bcbff5b6fcf39b4e2eeca39b6e9aa0cb6d8f8616db602e5d1b3
5
5
  SHA512:
6
- metadata.gz: bbeb54de0e804fffe71383d78edd38d44e28070e8f1b0b89ae309ca927bf76ab9e564819a0e498e19d4ce73f9813567172488c89a738d0b361a1143a921189d6
7
- data.tar.gz: 2441597897c95693cfe5b7a2fb41ffe628cf72afb3c9ec1d195af03b1dc7fb62a1650009f9d689a3da29cf14900c3cf49d840d900f6b81c160b405dc0e8961a6
6
+ metadata.gz: ef4ad93c709263dec06dae1a17cf9691d19a37fbc5807a516504100bc4c863c3c208ec945d0741d384a3e48d396e24cc3dd8b15a3421b9522033dd765c40bd87
7
+ data.tar.gz: f080578244e1a661aeb241c55793467fe673167f6265f5522b433bde8cffc1c7f82bd6014def1d48c02db30c9589160094e5add0c1d3db564619b08e05c63da4
data/README.md CHANGED
@@ -74,6 +74,7 @@ mpql export --project-id 123456 --event "Signed Up" --from 2026-03-01 --to 2026-
74
74
  mpql engage --project-id 123456
75
75
  mpql engage --project-id 123456 --where 'properties["$email"] == "test@example.com"'
76
76
  mpql engage --project-id 123456 --distinct-id "user123"
77
+ mpql engage --project-id 123456 --distinct-id "user123" "user456" "user789"
77
78
  ```
78
79
 
79
80
  ### Date Formats
data/lib/mpql/cli.rb CHANGED
@@ -160,13 +160,23 @@ module Mpql
160
160
  mpql engage --project-id 123456 --where 'properties["$email"] == "test@example.com"'
161
161
 
162
162
  mpql engage --project-id 123456 --distinct-id "user123"
163
+
164
+ mpql engage --project-id 123456 --distinct-id "user123" "user456" "user789"
163
165
  LONGDESC
164
166
  option :where, type: :string, desc: "Filter expression"
165
- option :distinct_id, type: :string, desc: "Specific user distinct ID"
167
+ option :distinct_id, type: :array, desc: "User distinct ID(s)"
166
168
  option :page, type: :numeric, desc: "Result page number (starting from 0)"
167
169
  option :session_id, type: :string, desc: "Session ID for pagination"
168
170
  def engage
169
- result = client.engage(**optional_params(:where, :distinct_id, :page, :session_id))
171
+ params = optional_params(:where, :page, :session_id)
172
+ distinct_ids = options[:distinct_id]
173
+ if distinct_ids && distinct_ids.length == 1
174
+ params[:distinct_id] = distinct_ids.first
175
+ elsif distinct_ids && distinct_ids.length > 1
176
+ where_clause = %(properties["$distinct_id"] in #{JSON.generate(distinct_ids)})
177
+ params[:where] = params[:where] ? "(#{params[:where]}) and (#{where_clause})" : where_clause
178
+ end
179
+ result = client.engage(**params)
170
180
  output(result)
171
181
  rescue Mpql::Error => e
172
182
  error_exit(e)
data/lib/mpql/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mpql
4
- VERSION = "0.0.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tomorrowkey