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 +4 -4
- data/README.md +1 -0
- data/lib/mpql/cli.rb +12 -2
- data/lib/mpql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92a4b924a0c0fafb25811a59d44b8dfd9b281b450a06d9547eb69859cf22eb2d
|
|
4
|
+
data.tar.gz: a2a9178c2b289bcbff5b6fcf39b4e2eeca39b6e9aa0cb6d8f8616db602e5d1b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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: :
|
|
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
|
-
|
|
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