pug-sh 0.0.1

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.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +247 -0
  4. data/lib/pug/batcher.rb +384 -0
  5. data/lib/pug/client.rb +248 -0
  6. data/lib/pug/connect.rb +291 -0
  7. data/lib/pug/countries.rb +19 -0
  8. data/lib/pug/errors.rb +16 -0
  9. data/lib/pug/event_builder.rb +522 -0
  10. data/lib/pug/gen/buf/validate/validate_pb.rb +59 -0
  11. data/lib/pug/gen/common/events/v1/api_events_pb.rb +26 -0
  12. data/lib/pug/gen/common/events/v1/app_events_pb.rb +33 -0
  13. data/lib/pug/gen/common/events/v1/auth_events_pb.rb +32 -0
  14. data/lib/pug/gen/common/events/v1/billing_events_pb.rb +41 -0
  15. data/lib/pug/gen/common/events/v1/chat_events_pb.rb +56 -0
  16. data/lib/pug/gen/common/events/v1/commerce_events_pb.rb +38 -0
  17. data/lib/pug/gen/common/events/v1/discovery_events_pb.rb +31 -0
  18. data/lib/pug/gen/common/events/v1/error_events_pb.rb +26 -0
  19. data/lib/pug/gen/common/events/v1/file_events_pb.rb +29 -0
  20. data/lib/pug/gen/common/events/v1/form_events_pb.rb +27 -0
  21. data/lib/pug/gen/common/events/v1/integration_events_pb.rb +27 -0
  22. data/lib/pug/gen/common/events/v1/invitation_events_pb.rb +26 -0
  23. data/lib/pug/gen/common/events/v1/media_events_pb.rb +36 -0
  24. data/lib/pug/gen/common/events/v1/navigation_events_pb.rb +31 -0
  25. data/lib/pug/gen/common/events/v1/notification_events_pb.rb +28 -0
  26. data/lib/pug/gen/common/events/v1/options_pb.rb +25 -0
  27. data/lib/pug/gen/common/events/v1/social_events_pb.rb +25 -0
  28. data/lib/pug/gen/common/events/v1/support_events_pb.rb +33 -0
  29. data/lib/pug/gen/common/events/v1/workspace_events_pb.rb +30 -0
  30. data/lib/pug/gen/common/v1/filter_schema_pb.rb +29 -0
  31. data/lib/pug/gen/common/v1/filters_pb.rb +27 -0
  32. data/lib/pug/gen/common/v1/property_value_pb.rb +24 -0
  33. data/lib/pug/gen/common/v1/time_pb.rb +25 -0
  34. data/lib/pug/gen/sdk/devices/v1/devices_pb.rb +35 -0
  35. data/lib/pug/gen/sdk/events/v1/events_pb.rb +30 -0
  36. data/lib/pug/gen/sdk/profiles/v1/profiles_pb.rb +28 -0
  37. data/lib/pug/gen/shared/activity/v1/activity_pb.rb +46 -0
  38. data/lib/pug/gen/shared/insights/v1/insights_pb.rb +69 -0
  39. data/lib/pug/gen/shared/profiles/v1/profiles_pb.rb +43 -0
  40. data/lib/pug/log.rb +35 -0
  41. data/lib/pug/proto.rb +22 -0
  42. data/lib/pug/reads.rb +118 -0
  43. data/lib/pug/rpc.rb +73 -0
  44. data/lib/pug/validator.rb +475 -0
  45. data/lib/pug/version.rb +5 -0
  46. data/lib/pug/well_known.rb +33 -0
  47. data/lib/pug-sh.rb +3 -0
  48. data/lib/pug.rb +5 -0
  49. metadata +122 -0
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: shared/activity/v1/activity.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require_relative '../../../buf/validate/validate_pb'
8
+ require_relative '../../../common/v1/filter_schema_pb'
9
+ require_relative '../../../common/v1/filters_pb'
10
+ require_relative '../../../common/v1/time_pb'
11
+ require 'google/protobuf/struct_pb'
12
+ require 'google/protobuf/timestamp_pb'
13
+
14
+
15
+ descriptor_data = "\n!shared/activity/v1/activity.proto\x12\x12shared.activity.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1d\x63ommon/v1/filter_schema.proto\x1a\x17\x63ommon/v1/filters.proto\x1a\x14\x63ommon/v1/time.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\x04\n\x16GetActivityFeedRequest\x12\'\n\x0b\x64istinct_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\ndistinctId\x12\x1d\n\nsession_id\x18\x02 \x01(\tR\tsessionId\x12\x33\n\ntime_range\x18\x03 \x01(\x0b\x32\x14.common.v1.TimeRangeR\ttimeRange\x12N\n\x10property_filters\x18\x04 \x03(\x0b\x32\x19.common.v1.PropertyFilterB\x08\xbaH\x05\x92\x01\x02\x10\x14R\x0fpropertyFilters\x12\'\n\tpage_size\x18\x05 \x01(\x05\x42\n\xbaH\x07\x1a\x05\x18\xe8\x07(\x00R\x08pageSize\x12\x1d\n\npage_token\x18\x06 \x01(\tR\tpageToken\x12\x38\n\x06\x65vents\x18\x07 \x03(\x0b\x32\x16.common.v1.EventFilterB\x08\xbaH\x05\x92\x01\x02\x10\x32R\x06\x65vents\x12!\n\x0cinclude_bots\x18\x08 \x01(\x08R\x0bincludeBots:\xcb\x01\xbaH\xc7\x01\x1a\xc4\x01\n\'activity_feed.events_non_empty_in_multi\x12\x45\x65\x61\x63h event filter must specify a kind or at least one property filter\x1aRthis.events.size() <= 1|| this.events.all(e, e.kind != \'\' || e.filters.size() > 0)\"\xc1\x02\n\rActivityEvent\x12\x19\n\x08\x65vent_id\x18\x01 \x01(\tR\x07\x65ventId\x12\x12\n\x04kind\x18\x02 \x01(\tR\x04kind\x12\x1f\n\x0b\x64istinct_id\x18\x03 \x01(\tR\ndistinctId\x12\x39\n\noccur_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\toccurTime\x12\x1d\n\nsession_id\x18\x05 \x01(\tR\tsessionId\x12@\n\x0f\x61uto_properties\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructR\x0e\x61utoProperties\x12\x44\n\x11\x63ustom_properties\x18\x07 \x01(\x0b\x32\x17.google.protobuf.StructR\x10\x63ustomProperties\"|\n\x17GetActivityFeedResponse\x12\x39\n\x06\x65vents\x18\x01 \x03(\x0b\x32!.shared.activity.v1.ActivityEventR\x06\x65vents\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xd2\x04\n\x17GetEventExplorerRequest\x12\x1f\n\x0b\x64istinct_id\x18\x01 \x01(\tR\ndistinctId\x12\x1d\n\nsession_id\x18\x02 \x01(\tR\tsessionId\x12\x33\n\ntime_range\x18\x03 \x01(\x0b\x32\x14.common.v1.TimeRangeR\ttimeRange\x12N\n\x10property_filters\x18\x04 \x03(\x0b\x32\x19.common.v1.PropertyFilterB\x08\xbaH\x05\x92\x01\x02\x10\x14R\x0fpropertyFilters\x12\'\n\tpage_size\x18\x05 \x01(\x05\x42\n\xbaH\x07\x1a\x05\x18\xe8\x07(\x00R\x08pageSize\x12\x1d\n\npage_token\x18\x06 \x01(\tR\tpageToken\x12\x38\n\x06\x65vents\x18\x07 \x03(\x0b\x32\x16.common.v1.EventFilterB\x08\xbaH\x05\x92\x01\x02\x10\x32R\x06\x65vents\x12!\n\x0cinclude_bots\x18\x08 \x01(\x08R\x0bincludeBots:\xcc\x01\xbaH\xc8\x01\x1a\xc5\x01\n(event_explorer.events_non_empty_in_multi\x12\x45\x65\x61\x63h event filter must specify a kind or at least one property filter\x1aRthis.events.size() <= 1|| this.events.all(e, e.kind != \'\' || e.filters.size() > 0)\"}\n\x18GetEventExplorerResponse\x12\x39\n\x06\x65vents\x18\x01 \x03(\x0b\x32!.shared.activity.v1.ActivityEventR\x06\x65vents\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xe8\x01\n\x18GetPropertyValuesRequest\x12S\n\x0cproperty_key\x18\x01 \x01(\tB0\xbaH-r(2&^\\$?[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*$\xc8\x01\x01R\x0bpropertyKey\x12>\n\x06source\x18\x02 \x01(\x0e\x32\x19.common.v1.PropertySourceB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x06source\x12\x37\n\nevent_kind\x18\x03 \x01(\tB\x18\xbaH\x15r\x13\x32\x11^[a-zA-Z0-9_.-]*$R\teventKind\"3\n\x19GetPropertyValuesResponse\x12\x16\n\x06values\x18\x01 \x03(\tR\x06values\"\x9c\x01\n\x19GetActivityHeatmapRequest\x12\'\n\x0b\x64istinct_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\ndistinctId\x12\x33\n\ntime_range\x18\x02 \x01(\x0b\x32\x14.common.v1.TimeRangeR\ttimeRange\x12!\n\x0cinclude_bots\x18\x03 \x01(\x08R\x0bincludeBots\"6\n\nHeatmapDay\x12\x12\n\x04\x64\x61te\x18\x01 \x01(\tR\x04\x64\x61te\x12\x14\n\x05\x63ount\x18\x02 \x01(\x03R\x05\x63ount\"P\n\x1aGetActivityHeatmapResponse\x12\x32\n\x04\x64\x61ys\x18\x01 \x03(\x0b\x32\x1e.shared.activity.v1.HeatmapDayR\x04\x64\x61ys\"\xae\x02\n\x19GetProfileSessionsRequest\x12+\n\x0b\x64istinct_id\x18\x01 \x01(\tB\n\xbaH\x07r\x02\x10\x01\xc8\x01\x01R\ndistinctId\x12\'\n\tpage_size\x18\x02 \x01(\x05\x42\n\xbaH\x07\x1a\x05\x18\xe8\x07(\x00R\x08pageSize\x12\x1d\n\npage_token\x18\x03 \x01(\tR\tpageToken\x12\x44\n\x04sort\x18\x04 \x01(\x0e\x32&.shared.activity.v1.ProfileSessionSortB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04sort\x12!\n\x0cinclude_bots\x18\x05 \x01(\x08R\x0bincludeBots\x12\x33\n\ntime_range\x18\x06 \x01(\x0b\x32\x14.common.v1.TimeRangeR\ttimeRange\"\xb2\x02\n\x0eProfileSession\x12\x1d\n\nsession_id\x18\x01 \x01(\tR\tsessionId\x12\x39\n\nstarted_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartedAt\x12\x35\n\x08\x65nded_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x65ndedAt\x12\x1f\n\x0b\x65vent_count\x18\x04 \x01(\x03R\neventCount\x12\x18\n\x07\x62rowser\x18\x05 \x01(\tR\x07\x62rowser\x12\x0e\n\x02os\x18\x06 \x01(\tR\x02os\x12\x16\n\x06\x64\x65vice\x18\x07 \x01(\tR\x06\x64\x65vice\x12\x1a\n\x08platform\x18\x08 \x01(\tR\x08platform\x12\x10\n\x03\x62ot\x18\t \x01(\x08R\x03\x62ot\"\x84\x01\n\x1aGetProfileSessionsResponse\x12>\n\x08sessions\x18\x01 \x03(\x0b\x32\".shared.activity.v1.ProfileSessionR\x08sessions\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"d\n\x16GetProfileStatsRequest\x12\'\n\x0b\x64istinct_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\ndistinctId\x12!\n\x0cinclude_bots\x18\x02 \x01(\x08R\x0bincludeBots\"\xdd\x02\n\x0cProfileStats\x12\x39\n\nfirst_seen\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tfirstSeen\x12\x37\n\tlast_seen\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08lastSeen\x12!\n\x0ctotal_events\x18\x03 \x01(\x03R\x0btotalEvents\x12\x18\n\x07\x62rowser\x18\x04 \x01(\tR\x07\x62rowser\x12\'\n\x0f\x62rowser_version\x18\x05 \x01(\tR\x0e\x62rowserVersion\x12\x0e\n\x02os\x18\x06 \x01(\tR\x02os\x12\x1d\n\nos_version\x18\x07 \x01(\tR\tosVersion\x12\x16\n\x06\x64\x65vice\x18\x08 \x01(\tR\x06\x64\x65vice\x12\x18\n\x07\x63ountry\x18\t \x01(\tR\x07\x63ountry\x12\x12\n\x04\x63ity\x18\n \x01(\tR\x04\x63ity\"\xc4\x01\n\x17GetProfileStatsResponse\x12\x36\n\x05stats\x18\x01 \x01(\x0b\x32 .shared.activity.v1.ProfileStatsR\x05stats\x12\x38\n\x07heatmap\x18\x02 \x03(\x0b\x32\x1e.shared.activity.v1.HeatmapDayR\x07heatmap\x12\x37\n\nproperties\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\nproperties*\xa8\x01\n\x12ProfileSessionSort\x12$\n PROFILE_SESSION_SORT_UNSPECIFIED\x10\x00\x12#\n\x1fPROFILE_SESSION_SORT_STARTED_AT\x10\x01\x12!\n\x1dPROFILE_SESSION_SORT_DURATION\x10\x02\x12$\n PROFILE_SESSION_SORT_EVENT_COUNT\x10\x03\x32\x8e\x06\n\x0f\x41\x63tivityService\x12j\n\x0fGetActivityFeed\x12*.shared.activity.v1.GetActivityFeedRequest\x1a+.shared.activity.v1.GetActivityFeedResponse\x12m\n\x10GetEventExplorer\x12+.shared.activity.v1.GetEventExplorerRequest\x1a,.shared.activity.v1.GetEventExplorerResponse\x12X\n\x0fGetFilterSchema\x12!.common.v1.GetFilterSchemaRequest\x1a\".common.v1.GetFilterSchemaResponse\x12p\n\x11GetPropertyValues\x12,.shared.activity.v1.GetPropertyValuesRequest\x1a-.shared.activity.v1.GetPropertyValuesResponse\x12s\n\x12GetActivityHeatmap\x12-.shared.activity.v1.GetActivityHeatmapRequest\x1a..shared.activity.v1.GetActivityHeatmapResponse\x12s\n\x12GetProfileSessions\x12-.shared.activity.v1.GetProfileSessionsRequest\x1a..shared.activity.v1.GetProfileSessionsResponse\x12j\n\x0fGetProfileStats\x12*.shared.activity.v1.GetProfileStatsRequest\x1a+.shared.activity.v1.GetProfileStatsResponseB\xe5\x01\n\x16\x63om.shared.activity.v1B\rActivityProtoP\x01ZFgithub.com/pug-sh/pug/internal/gen/proto/shared/activity/v1;activityv1\xa2\x02\x03SAX\xaa\x02\x12Shared.Activity.V1\xca\x02\x12Shared\\Activity\\V1\xe2\x02\x1eShared\\Activity\\V1\\GPBMetadata\xea\x02 Pug::Proto::Shared::Activity::V1b\x08\x65\x64itionsp\xe8\x07"
16
+
17
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
18
+ pool.add_serialized_file(descriptor_data)
19
+
20
+ module Pug
21
+ module Proto
22
+ module Shared
23
+ module Activity
24
+ module V1
25
+ GetActivityFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetActivityFeedRequest").msgclass
26
+ ActivityEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.ActivityEvent").msgclass
27
+ GetActivityFeedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetActivityFeedResponse").msgclass
28
+ GetEventExplorerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetEventExplorerRequest").msgclass
29
+ GetEventExplorerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetEventExplorerResponse").msgclass
30
+ GetPropertyValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetPropertyValuesRequest").msgclass
31
+ GetPropertyValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetPropertyValuesResponse").msgclass
32
+ GetActivityHeatmapRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetActivityHeatmapRequest").msgclass
33
+ HeatmapDay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.HeatmapDay").msgclass
34
+ GetActivityHeatmapResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetActivityHeatmapResponse").msgclass
35
+ GetProfileSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetProfileSessionsRequest").msgclass
36
+ ProfileSession = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.ProfileSession").msgclass
37
+ GetProfileSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetProfileSessionsResponse").msgclass
38
+ GetProfileStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetProfileStatsRequest").msgclass
39
+ ProfileStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.ProfileStats").msgclass
40
+ GetProfileStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.GetProfileStatsResponse").msgclass
41
+ ProfileSessionSort = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.activity.v1.ProfileSessionSort").enummodule
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: shared/insights/v1/insights.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require_relative '../../../buf/validate/validate_pb'
8
+ require_relative '../../../common/v1/filter_schema_pb'
9
+ require_relative '../../../common/v1/filters_pb'
10
+ require_relative '../../../common/v1/time_pb'
11
+ require 'google/protobuf/duration_pb'
12
+ require 'google/protobuf/struct_pb'
13
+ require 'google/protobuf/timestamp_pb'
14
+
15
+
16
+ descriptor_data = "\n!shared/insights/v1/insights.proto\x12\x12shared.insights.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1d\x63ommon/v1/filter_schema.proto\x1a\x17\x63ommon/v1/filters.proto\x1a\x14\x63ommon/v1/time.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6W\n\x10InsightQuerySpec\x12Q\n\x0cinsight_type\x18\x01 \x01(\x0e\x32\x1f.shared.insights.v1.InsightTypeB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\x0binsightType\x12\x36\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x1e.shared.insights.v1.EventQueryR\x06\x65vents\x12G\n\nbreakdowns\x18\x03 \x03(\x0b\x32\x1d.shared.insights.v1.BreakdownB\x08\xbaH\x05\x92\x01\x02\x10\x05R\nbreakdowns\x12\x32\n\x0f\x62reakdown_limit\x18\x04 \x01(\x05\x42\t\xbaH\x06\x1a\x04\x18\x64(\x00R\x0e\x62reakdownLimit\x12\x44\n\rfilter_groups\x18\x05 \x03(\x0b\x32\x1f.shared.insights.v1.FilterGroupR\x0c\x66ilterGroups\x12P\n\x16\x66ilter_groups_operator\x18\x06 \x01(\x0e\x32\x1a.common.v1.LogicalOperatorR\x14\x66ilterGroupsOperator\x12\x88\x02\n\x11\x63onversion_window\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\xbf\x01\xbaH\xbb\x01\xaa\x01\x04\x32\x02\x08\x01\xba\x01\xb0\x01\n\x1f\x63onversion_window.whole_seconds\x12Zconversion_window must be a whole-second value (windowFunnel only accepts integer seconds)\x1a\x31this == duration(string(this.getSeconds()) + \'s\')R\x10\x63onversionWindow\x12.\n\x13include_step_timing\x18\x08 \x01(\x08R\x11includeStepTiming\x12:\n\x07session\x18\t \x01(\x0b\x32 .shared.insights.v1.SessionQueryR\x07session\x12>\n\tuser_flow\x18\n \x01(\x0b\x32!.shared.insights.v1.UserFlowQueryR\x08userFlow\x12\x32\n\x05top_k\x18\x0b \x01(\x0b\x32\x1d.shared.insights.v1.TopKQueryR\x04topK\x12-\n\x12include_cookieless\x18\x0c \x01(\x08R\x11includeCookieless\x12.\n\x03map\x18\r \x01(\x0b\x32\x1c.shared.insights.v1.MapQueryR\x03map\x12!\n\x0cinclude_bots\x18\x0e \x01(\x08R\x0bincludeBots:\xc4O\xbaH\xc0O\x1a\xa5\x02\n2insight_query_spec.funnel_retention_require_events\x12=funnel and retention insight types require at least one event\x1a\xaf\x01(this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_FUNNEL&& this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_RETENTION)|| this.events.size() > 0\x1a\xd3\x01\n0insight_query_spec.funnel_only_conversion_window\x12\x37\x63onversion_window is only valid for funnel insight type\x1a\x66this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_FUNNEL|| !has(this.conversion_window)\x1a\xcc\x01\n*insight_query_spec.funnel_only_step_timing\x12\x39include_step_timing is only valid for funnel insight type\x1a\x63this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_FUNNEL|| !this.include_step_timing\x1a\x95\x02\n3insight_query_spec.session_only_trends_segmentation\x12?session is only valid for trends and segmentation insight types\x1a\x9c\x01!has(this.session) || this.insight_type in [ shared.insights.v1.InsightType.INSIGHT_TYPE_TRENDS, shared.insights.v1.InsightType.INSIGHT_TYPE_SEGMENTATION]\x1a\x82\x01\n$insight_query_spec.session_no_events\x12+session insights cannot also specify events\x1a-!has(this.session) || this.events.size() == 0\x1a\x9c\x03\n@insight_query_spec.session_page_metrics_require_trends_breakdown\x12Hsession entry and exit metrics require trends with exactly one breakdown\x1a\x8d\x02!has(this.session)|| !(this.session.metric in [ shared.insights.v1.SessionMetric.SESSION_METRIC_ENTRY, shared.insights.v1.SessionMetric.SESSION_METRIC_EXIT])|| (this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_TRENDS && this.breakdowns.size() == 1)\x1a\xd8\x01\n-insight_query_spec.segmentation_no_breakdowns\x12:breakdowns are not supported for segmentation insight type\x1akthis.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_SEGMENTATION|| this.breakdowns.size() == 0\x1a\xd3\x01\n.insight_query_spec.unique_breakdown_properties\x12#breakdown properties must be unique\x1a|this.breakdowns.size() <= 1|| !this.breakdowns.exists(b, this.breakdowns.filter(x, x.property == b.property).size() > 1)\x1a\xa2\x01\n6insight_query_spec.breakdown_limit_requires_breakdowns\x12/breakdown_limit requires at least one breakdown\x1a\x37this.breakdown_limit == 0 || this.breakdowns.size() > 0\x1a\xdc\x01\n\'insight_query_spec.retention_max_events\x12Kretention supports at most 2 events (start event and optional return event)\x1a\x64this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_RETENTION|| this.events.size() <= 2\x1a\xab\x01\n#insight_query_spec.funnel_max_steps\x12 funnel supports at most 20 steps\x1a\x62this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_FUNNEL|| this.events.size() <= 20\x1a\xb4\x04\n7insight_query_spec.numeric_agg_only_trends_segmentation\x12PSUM/AVG/MIN/MAX aggregation types are only supported for trends and segmentation\x1a\xa6\x03this.insight_type in [ shared.insights.v1.InsightType.INSIGHT_TYPE_TRENDS, shared.insights.v1.InsightType.INSIGHT_TYPE_SEGMENTATION] || this.events.all(e, !(e.aggregation in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_SUM, shared.insights.v1.AggregationType.AGGREGATION_TYPE_AVG, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MIN, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MAX ]))\x1a\xc8\x01\n/insight_query_spec.user_flow_only_for_user_flow\x12\x32user_flow is only valid for user flow insight type\x1a\x61!has(this.user_flow)|| this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW\x1a\xb4\x01\n%insight_query_spec.user_flow_required\x12)user flow insight type requires user_flow\x1a`this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| has(this.user_flow)\x1a\xb8\x01\n&insight_query_spec.user_flow_no_events\x12(user flow insights cannot specify events\x1a\x64this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.events.size() == 0\x1a\xb5\x01\n\'insight_query_spec.user_flow_no_session\x12)user flow insights cannot specify session\x1a_this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| !has(this.session)\x1a\xcf\x01\n*insight_query_spec.user_flow_no_breakdowns\x12\x37\x62reakdowns are not supported for user flow insight type\x1ahthis.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.breakdowns.size() == 0\x1a\xd6\x01\n/insight_query_spec.user_flow_no_breakdown_limit\x12;breakdown_limit is not supported for user flow insight type\x1a\x66this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.breakdown_limit == 0\x1a\x80\x03\n.insight_query_spec.user_flow_property_required\x12\x34node_property is required when node_kind is PROPERTY\x1a\x97\x02this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.user_flow.node_kind != shared.insights.v1.UserFlowQuery.NodeKind.NODE_KIND_PROPERTY|| (this.user_flow.node_property.size() > 0 && this.user_flow.node_property.matches(\'^\\\\$?[a-zA-Z0-9_.-]+$\'))\x1a\x87\x02\n+insight_query_spec.user_flow_max_hops_range\x12*max_hops must be between 1 and 10 when set\x1a\xab\x01this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.user_flow.max_hops == 0|| (this.user_flow.max_hops >= 1 && this.user_flow.max_hops <= 10)\x1a\x8c\x02\n,insight_query_spec.user_flow_max_nodes_range\x12+max_nodes must be between 2 and 50 when set\x1a\xae\x01this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.user_flow.max_nodes == 0|| (this.user_flow.max_nodes >= 2 && this.user_flow.max_nodes <= 50)\x1a\x8e\x02\n,insight_query_spec.user_flow_max_links_range\x12,max_links must be between 1 and 500 when set\x1a\xaf\x01this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_USER_FLOW|| this.user_flow.max_links == 0|| (this.user_flow.max_links >= 1 && this.user_flow.max_links <= 500)\x1a\xb0\x01\n\'insight_query_spec.top_k_only_for_top_k\x12*top_k is only valid for top k insight type\x1aY!has(this.top_k)|| this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K\x1a\xa0\x01\n!insight_query_spec.top_k_required\x12!top k insight type requires top_k\x1aXthis.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| has(this.top_k)\x1a\xac\x01\n\"insight_query_spec.top_k_no_events\x12$top k insights cannot specify events\x1a`this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.events.size() == 0\x1a\xa9\x01\n#insight_query_spec.top_k_no_session\x12%top k insights cannot specify session\x1a[this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| !has(this.session)\x1a\xc3\x01\n&insight_query_spec.top_k_no_breakdowns\x12\x33\x62reakdowns are not supported for top k insight type\x1a\x64this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.breakdowns.size() == 0\x1a\xca\x01\n+insight_query_spec.top_k_no_breakdown_limit\x12\x37\x62reakdown_limit is not supported for top k insight type\x1a\x62this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.breakdown_limit == 0\x1a\xda\x02\n*insight_query_spec.top_k_property_required\x12/property is required when dimension is PROPERTY\x1a\xfa\x01this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.top_k.dimension != shared.insights.v1.TopKQuery.Dimension.DIMENSION_PROPERTY|| (this.top_k.property.size() > 0 && this.top_k.property.matches(\'^\\\\$?[a-zA-Z0-9_.-]+$\'))\x1a\xad\x02\n=insight_query_spec.top_k_property_only_for_property_dimension\x12\x31property is only valid when dimension is PROPERTY\x1a\xb8\x01this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.top_k.dimension == shared.insights.v1.TopKQuery.Dimension.DIMENSION_PROPERTY|| this.top_k.property == \'\'\x1a\xe4\x03\n1insight_query_spec.top_k_metric_property_required\x12>metric_property is required for SUM, AVG, MIN, and MAX metrics\x1a\xee\x02this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| !(this.top_k.metric in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_SUM, shared.insights.v1.AggregationType.AGGREGATION_TYPE_AVG, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MIN, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MAX]) || this.top_k.metric_property != \'\'\x1a\xbb\x03\n.insight_query_spec.top_k_user_dimension_metric\x12NUNIQUE_USERS and PER_USER_AVG metrics are not supported for the USER dimension\x1a\xb8\x02this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_TOP_K|| this.top_k.dimension != shared.insights.v1.TopKQuery.Dimension.DIMENSION_USER|| !(this.top_k.metric in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_UNIQUE_USERS, shared.insights.v1.AggregationType.AGGREGATION_TYPE_PER_USER_AVG])\x1a\xa4\x01\n#insight_query_spec.map_only_for_map\x12&map is only valid for map insight type\x1aU!has(this.map)|| this.insight_type == shared.insights.v1.InsightType.INSIGHT_TYPE_MAP\x1a\x96\x01\n\x1finsight_query_spec.map_required\x12\x1dmap insight type requires map\x1aTthis.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| has(this.map)\x1a\xa6\x01\n insight_query_spec.map_no_events\x12\"map insights cannot specify events\x1a^this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| this.events.size() == 0\x1a\xa3\x01\n!insight_query_spec.map_no_session\x12#map insights cannot specify session\x1aYthis.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| !has(this.session)\x1a\xbd\x01\n$insight_query_spec.map_no_breakdowns\x12\x31\x62reakdowns are not supported for map insight type\x1a\x62this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| this.breakdowns.size() == 0\x1a\xc4\x01\n)insight_query_spec.map_no_breakdown_limit\x12\x35\x62reakdown_limit is not supported for map insight type\x1a`this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| this.breakdown_limit == 0\x1a\xdc\x03\n/insight_query_spec.map_metric_property_required\x12>metric_property is required for SUM, AVG, MIN, and MAX metrics\x1a\xe8\x02this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| !(this.map.metric in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_SUM, shared.insights.v1.AggregationType.AGGREGATION_TYPE_AVG, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MIN, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MAX]) || this.map.metric_property != \'\'\x1a\xe2\x03\n7insight_query_spec.map_metric_property_only_for_numeric\x12@metric_property is only valid for SUM, AVG, MIN, and MAX metrics\x1a\xe4\x02this.insight_type != shared.insights.v1.InsightType.INSIGHT_TYPE_MAP|| this.map.metric_property == \'\'|| this.map.metric in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_SUM, shared.insights.v1.AggregationType.AGGREGATION_TYPE_AVG, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MIN, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MAX]\"\x9c\r\n\x0cQueryRequest\x12@\n\x04spec\x18\x01 \x01(\x0b\x32$.shared.insights.v1.InsightQuerySpecB\x06\xbaH\x03\xc8\x01\x01R\x04spec\x12;\n\ntime_range\x18\x02 \x01(\x0b\x32\x14.common.v1.TimeRangeB\x06\xbaH\x03\xc8\x01\x01R\ttimeRange\x12P\n\x0bgranularity\x18\x03 \x01(\x0e\x32\x1f.shared.insights.v1.GranularityB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\x0bgranularity\x12\x37\n\x08timezone\x18\x0c \x01(\tB\x1b\xbaH\x18r\x16\x18@2\x12^[A-Za-z0-9_+/-]*$R\x08timezone:\xcf\t\xbaH\xcb\t\x1a\xef\x01\n*query_request.granularity_minute_max_range\x12;GRANULARITY_MINUTE requires a time range of at most 6 hours\x1a\x83\x01this.granularity != shared.insights.v1.Granularity.GRANULARITY_MINUTE|| this.time_range.to - this.time_range.from <= duration(\'6h\')\x1a\xeb\x01\n(query_request.granularity_hour_max_range\x12\x39GRANULARITY_HOUR requires a time range of at most 14 days\x1a\x83\x01this.granularity != shared.insights.v1.Granularity.GRANULARITY_HOUR|| this.time_range.to - this.time_range.from <= duration(\'336h\')\x1a\xea\x01\n\'query_request.granularity_day_max_range\x12\x39GRANULARITY_DAY requires a time range of at most 365 days\x1a\x83\x01this.granularity != shared.insights.v1.Granularity.GRANULARITY_DAY|| this.time_range.to - this.time_range.from <= duration(\'8760h\')\x1a\xfa\x01\n(query_request.granularity_week_max_range\x12\x46GRANULARITY_WEEK requires a time range of at most 1461 days (~4 years)\x1a\x85\x01this.granularity != shared.insights.v1.Granularity.GRANULARITY_WEEK|| this.time_range.to - this.time_range.from <= duration(\'35064h\')\x1a\xfe\x01\n)query_request.granularity_month_max_range\x12HGRANULARITY_MONTH requires a time range of at most 3652 days (~10 years)\x1a\x86\x01this.granularity != shared.insights.v1.Granularity.GRANULARITY_MONTH|| this.time_range.to - this.time_range.from <= duration(\'87660h\')J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cR\x0cinsight_typeR\x06\x65ventsR\nbreakdownsR\x0f\x62reakdown_limitR\rfilter_groupsR\x16\x66ilter_groups_operatorR\x11\x63onversion_windowR\x13include_step_timing\"\xa4\x03\n\rQueryResponse\x12:\n\x06trends\x18\x02 \x01(\x0b\x32 .shared.insights.v1.TrendsResultH\x00R\x06trends\x12L\n\x0csegmentation\x18\x03 \x01(\x0b\x32&.shared.insights.v1.SegmentationResultH\x00R\x0csegmentation\x12:\n\x06\x66unnel\x18\x04 \x01(\x0b\x32 .shared.insights.v1.FunnelResultH\x00R\x06\x66unnel\x12\x43\n\tretention\x18\x05 \x01(\x0b\x32#.shared.insights.v1.RetentionResultH\x00R\tretention\x12\x41\n\tuser_flow\x18\x06 \x01(\x0b\x32\".shared.insights.v1.UserFlowResultH\x00R\x08userFlow\x12\x35\n\x05top_k\x18\x07 \x01(\x0b\x32\x1e.shared.insights.v1.TopKResultH\x00R\x04topKB\x08\n\x06resultJ\x04\x08\x01\x10\x02\"\xfa\x02\n\x13SegmentUsersRequest\x12;\n\ntime_range\x18\x01 \x01(\x0b\x32\x14.common.v1.TimeRangeB\x06\xbaH\x03\xc8\x01\x01R\ttimeRange\x12@\n\x06\x65vents\x18\x02 \x03(\x0b\x32\x1e.shared.insights.v1.EventQueryB\x08\xbaH\x05\x92\x01\x02\x08\x01R\x06\x65vents\x12\'\n\tpage_size\x18\x04 \x01(\x05\x42\n\xbaH\x07\x1a\x05\x18\xe8\x07(\x00R\x08pageSize\x12\x1d\n\npage_token\x18\x05 \x01(\tR\tpageToken\x12\x44\n\rfilter_groups\x18\x06 \x03(\x0b\x32\x1f.shared.insights.v1.FilterGroupR\x0c\x66ilterGroups\x12P\n\x16\x66ilter_groups_operator\x18\x07 \x01(\x0e\x32\x1a.common.v1.LogicalOperatorR\x14\x66ilterGroupsOperatorJ\x04\x08\x03\x10\x04\"a\n\x14SegmentUsersResponse\x12!\n\x0c\x64istinct_ids\x18\x01 \x03(\tR\x0b\x64istinctIds\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x86\x01\n\x0cSessionQuery\x12H\n\x06metric\x18\x01 \x01(\x0e\x32!.shared.insights.v1.SessionMetricB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\x06metric\x12,\n\x05scope\x18\x02 \x01(\x0b\x32\x16.common.v1.EventFilterR\x05scope\"\xf7\x03\n\rUserFlowQuery\x12G\n\tnode_kind\x18\x01 \x01(\x0e\x32*.shared.insights.v1.UserFlowQuery.NodeKindR\x08nodeKind\x12@\n\rnode_property\x18\x02 \x01(\tB\x1b\xbaH\x18r\x16\x32\x14^\\$?[a-zA-Z0-9_.-]*$R\x0cnodeProperty\x12\x44\n\x08group_by\x18\x03 \x01(\x0e\x32).shared.insights.v1.UserFlowQuery.GroupByR\x07groupBy\x12,\n\x05scope\x18\x04 \x01(\x0b\x32\x16.common.v1.EventFilterR\x05scope\x12\x19\n\x08max_hops\x18\x05 \x01(\x05R\x07maxHops\x12\x1b\n\tmax_nodes\x18\x06 \x01(\x05R\x08maxNodes\x12\x1b\n\tmax_links\x18\x07 \x01(\x05R\x08maxLinks\"W\n\x08NodeKind\x12\x19\n\x15NODE_KIND_UNSPECIFIED\x10\x00\x12\x18\n\x14NODE_KIND_EVENT_KIND\x10\x01\x12\x16\n\x12NODE_KIND_PROPERTY\x10\x02\"9\n\x07GroupBy\x12\x18\n\x14GROUP_BY_UNSPECIFIED\x10\x00\x12\x14\n\x10GROUP_BY_SESSION\x10\x01\"\x85\x04\n\tTopKQuery\x12T\n\tdimension\x18\x01 \x01(\x0e\x32\'.shared.insights.v1.TopKQuery.DimensionB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\tdimension\x12\x37\n\x08property\x18\x02 \x01(\tB\x1b\xbaH\x18r\x16\x32\x14^\\$?[a-zA-Z0-9_.-]*$R\x08property\x12,\n\x05scope\x18\x03 \x01(\x0b\x32\x16.common.v1.EventFilterR\x05scope\x12\x45\n\x06metric\x18\x04 \x01(\x0e\x32#.shared.insights.v1.AggregationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06metric\x12\x44\n\x0fmetric_property\x18\x05 \x01(\tB\x1b\xbaH\x18r\x16\x32\x14^\\$?[a-zA-Z0-9_.-]*$R\x0emetricProperty\x12\x1f\n\x05limit\x18\x06 \x01(\x05\x42\t\xbaH\x06\x1a\x04\x18\x64(\x00R\x05limit\x12\x1f\n\x0bomit_others\x18\x07 \x01(\x08R\nomitOthers\"l\n\tDimension\x12\x19\n\x15\x44IMENSION_UNSPECIFIED\x10\x00\x12\x16\n\x12\x44IMENSION_PROPERTY\x10\x01\x12\x18\n\x14\x44IMENSION_EVENT_KIND\x10\x02\x12\x12\n\x0e\x44IMENSION_USER\x10\x03\"=\n\nTopKResult\x12/\n\x04rows\x18\x01 \x03(\x0b\x32\x1b.shared.insights.v1.TopKRowR\x04rows\"\xa0\x01\n\x07TopKRow\x12\'\n\x0f\x64imension_value\x18\x01 \x01(\tR\x0e\x64imensionValue\x12\x14\n\x05value\x18\x02 \x01(\x01R\x05value\x12\x1b\n\tis_others\x18\x03 \x01(\x08R\x08isOthers\x12\x39\n\x07profile\x18\x04 \x01(\x0b\x32\x1f.shared.insights.v1.TopKProfileR\x07profile\"\xc5\x01\n\x08MapQuery\x12,\n\x05scope\x18\x01 \x01(\x0b\x32\x16.common.v1.EventFilterR\x05scope\x12\x45\n\x06metric\x18\x02 \x01(\x0e\x32#.shared.insights.v1.AggregationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06metric\x12\x44\n\x0fmetric_property\x18\x03 \x01(\tB\x1b\xbaH\x18r\x16\x32\x14^\\$?[a-zA-Z0-9_.-]*$R\x0emetricProperty\"w\n\x0bTopKProfile\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0b\x65xternal_id\x18\x02 \x01(\tR\nexternalId\x12\x37\n\nproperties\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\nproperties\"g\n\x0cUserFlowNode\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1b\n\tis_others\x18\x02 \x01(\x08R\x08isOthers\x12\x14\n\x05\x64\x65pth\x18\x03 \x01(\x05R\x05\x64\x65pth\x12\x14\n\x05label\x18\x04 \x01(\tR\x05label\"]\n\x0cUserFlowLink\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12\x16\n\x06target\x18\x02 \x01(\tR\x06target\x12\x1d\n\x05value\x18\x03 \x01(\x03\x42\x07\xbaH\x04\"\x02(\x01R\x05value\"\x80\x01\n\x0eUserFlowResult\x12\x36\n\x05nodes\x18\x01 \x03(\x0b\x32 .shared.insights.v1.UserFlowNodeR\x05nodes\x12\x36\n\x05links\x18\x02 \x03(\x0b\x32 .shared.insights.v1.UserFlowLinkR\x05links\"\x84\x01\n\x0b\x46ilterGroup\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32\x19.common.v1.PropertyFilterB\x08\xbaH\x05\x92\x01\x02\x08\x01R\x07\x66ilters\x12\x36\n\x08operator\x18\x02 \x01(\x0e\x32\x1a.common.v1.LogicalOperatorR\x08operator\"\x89\x05\n\nEventQuery\x12,\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x16.common.v1.EventFilterR\x05\x65vent\x12O\n\x0b\x61ggregation\x18\x02 \x01(\x0e\x32#.shared.insights.v1.AggregationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0b\x61ggregation\x12N\n\x14\x61ggregation_property\x18\x03 \x01(\tB\x1b\xbaH\x18r\x16\x32\x14^\\$?[a-zA-Z0-9_.-]*$R\x13\x61ggregationProperty:\xab\x03\xbaH\xa7\x03\x1a\xa4\x03\n-event_query.property_required_for_numeric_agg\x12Maggregation_property is required for SUM, AVG, MIN, and MAX aggregation types\x1a\xa3\x02!(this.aggregation in [ shared.insights.v1.AggregationType.AGGREGATION_TYPE_SUM, shared.insights.v1.AggregationType.AGGREGATION_TYPE_AVG, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MIN, shared.insights.v1.AggregationType.AGGREGATION_TYPE_MAX]) || this.aggregation_property != \'\'\"G\n\tBreakdown\x12:\n\x08property\x18\x01 \x01(\tB\x1e\xbaH\x1br\x16\x32\x14^\\$?[a-zA-Z0-9_.-]+$\xc8\x01\x01R\x08property\"G\n\x0cTrendsResult\x12\x37\n\x06series\x18\x01 \x03(\x0b\x32\x1f.shared.insights.v1.TrendSeriesR\x06series\"\xef\x01\n\x0bTrendSeries\x12\x1d\n\nevent_kind\x18\x01 \x01(\tR\teventKind\x12L\n\tbreakdown\x18\x02 \x03(\x0b\x32..shared.insights.v1.TrendSeries.BreakdownEntryR\tbreakdown\x12\x35\n\x06points\x18\x03 \x03(\x0b\x32\x1d.shared.insights.v1.DataPointR\x06points\x1a<\n\x0e\x42reakdownEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"*\n\x12SegmentationResult\x12\x14\n\x05total\x18\x01 \x01(\x01R\x05total\"H\n\x0c\x46unnelResult\x12\x38\n\x06series\x18\x01 \x03(\x0b\x32 .shared.insights.v1.FunnelSeriesR\x06series\"\xd1\x01\n\x0c\x46unnelSeries\x12M\n\tbreakdown\x18\x01 \x03(\x0b\x32/.shared.insights.v1.FunnelSeries.BreakdownEntryR\tbreakdown\x12\x34\n\x05steps\x18\x02 \x03(\x0b\x32\x1e.shared.insights.v1.FunnelStepR\x05steps\x1a<\n\x0e\x42reakdownEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x98\x01\n\x12\x44istributionBucket\x12\x1d\n\x05label\x18\x01 \x01(\tB\x07\xbaH\x04r\x02\x10\x01R\x05label\x12\x44\n\x0bupper_bound\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\nupperBound\x12\x1d\n\x05\x63ount\x18\x03 \x01(\x03\x42\x07\xbaH\x04\"\x02(\x00R\x05\x63ount\"\x8f\x02\n\nStepTiming\x12\x35\n\x03\x61vg\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x03\x61vg\x12;\n\x06median\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x06median\x12\x35\n\x03p95\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x03p95\x12V\n\x0c\x64istribution\x18\x04 \x03(\x0b\x32&.shared.insights.v1.DistributionBucketB\n\xbaH\x07\x92\x01\x04\x08\x08\x10\x08R\x0c\x64istribution\"y\n\nFunnelStep\x12\x1d\n\nevent_kind\x18\x01 \x01(\tR\teventKind\x12\x14\n\x05total\x18\x02 \x01(\x01R\x05total\x12\x36\n\x06timing\x18\x03 \x01(\x0b\x32\x1e.shared.insights.v1.StepTimingR\x06timing\"N\n\x0fRetentionResult\x12;\n\x06series\x18\x01 \x03(\x0b\x32#.shared.insights.v1.RetentionSeriesR\x06series\"\xe0\x01\n\x0fRetentionSeries\x12P\n\tbreakdown\x18\x01 \x03(\x0b\x32\x32.shared.insights.v1.RetentionSeries.BreakdownEntryR\tbreakdown\x12=\n\x07\x63ohorts\x18\x02 \x03(\x0b\x32#.shared.insights.v1.RetentionCohortR\x07\x63ohorts\x1a<\n\x0e\x42reakdownEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x81\x01\n\x0fRetentionCohort\x12\x16\n\x06\x63ohort\x18\x01 \x01(\tR\x06\x63ohort\x12\x1f\n\x0b\x63ohort_size\x18\x02 \x01(\x01R\ncohortSize\x12\x35\n\x06points\x18\x03 \x03(\x0b\x32\x1d.shared.insights.v1.DataPointR\x06points\"Q\n\tDataPoint\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x14\n\x05value\x18\x02 \x01(\x01R\x05value\"\xe8\x01\n\x18GetPropertyValuesRequest\x12S\n\x0cproperty_key\x18\x01 \x01(\tB0\xbaH-r(2&^\\$?[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*$\xc8\x01\x01R\x0bpropertyKey\x12>\n\x06source\x18\x02 \x01(\x0e\x32\x19.common.v1.PropertySourceB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x06source\x12\x37\n\nevent_kind\x18\x03 \x01(\tB\x18\xbaH\x15r\x13\x32\x11^[a-zA-Z0-9_.-]*$R\teventKind\"3\n\x19GetPropertyValuesResponse\x12\x16\n\x06values\x18\x01 \x03(\tR\x06values*\xe2\x01\n\x0bInsightType\x12\x1c\n\x18INSIGHT_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13INSIGHT_TYPE_TRENDS\x10\x01\x12\x1d\n\x19INSIGHT_TYPE_SEGMENTATION\x10\x02\x12\x17\n\x13INSIGHT_TYPE_FUNNEL\x10\x03\x12\x1a\n\x16INSIGHT_TYPE_RETENTION\x10\x04\x12\x1a\n\x16INSIGHT_TYPE_USER_FLOW\x10\x05\x12\x16\n\x12INSIGHT_TYPE_TOP_K\x10\x06\x12\x14\n\x10INSIGHT_TYPE_MAP\x10\x07*\x9a\x01\n\x0bGranularity\x12\x1b\n\x17GRANULARITY_UNSPECIFIED\x10\x00\x12\x16\n\x12GRANULARITY_MINUTE\x10\x01\x12\x14\n\x10GRANULARITY_HOUR\x10\x02\x12\x13\n\x0fGRANULARITY_DAY\x10\x03\x12\x14\n\x10GRANULARITY_WEEK\x10\x04\x12\x15\n\x11GRANULARITY_MONTH\x10\x05*\xfd\x01\n\x0f\x41ggregationType\x12 \n\x1c\x41GGREGATION_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41GGREGATION_TYPE_TOTAL\x10\x01\x12!\n\x1d\x41GGREGATION_TYPE_UNIQUE_USERS\x10\x02\x12!\n\x1d\x41GGREGATION_TYPE_PER_USER_AVG\x10\x03\x12\x18\n\x14\x41GGREGATION_TYPE_SUM\x10\x04\x12\x18\n\x14\x41GGREGATION_TYPE_AVG\x10\x05\x12\x18\n\x14\x41GGREGATION_TYPE_MIN\x10\x06\x12\x18\n\x14\x41GGREGATION_TYPE_MAX\x10\x07*\xeb\x01\n\rSessionMetric\x12\x1e\n\x1aSESSION_METRIC_UNSPECIFIED\x10\x00\x12\x1b\n\x17SESSION_METRIC_SESSIONS\x10\x01\x12\x1f\n\x1bSESSION_METRIC_AVG_DURATION\x10\x02\x12\x1e\n\x1aSESSION_METRIC_BOUNCE_RATE\x10\x03\x12\x18\n\x14SESSION_METRIC_ENTRY\x10\x04\x12\x17\n\x13SESSION_METRIC_EXIT\x10\x05\x12)\n%SESSION_METRIC_AVG_EVENTS_PER_SESSION\x10\x06\x32\x8e\x03\n\x0fInsightsService\x12L\n\x05Query\x12 .shared.insights.v1.QueryRequest\x1a!.shared.insights.v1.QueryResponse\x12\x61\n\x0cSegmentUsers\x12\'.shared.insights.v1.SegmentUsersRequest\x1a(.shared.insights.v1.SegmentUsersResponse\x12X\n\x0fGetFilterSchema\x12!.common.v1.GetFilterSchemaRequest\x1a\".common.v1.GetFilterSchemaResponse\x12p\n\x11GetPropertyValues\x12,.shared.insights.v1.GetPropertyValuesRequest\x1a-.shared.insights.v1.GetPropertyValuesResponseB\xe5\x01\n\x16\x63om.shared.insights.v1B\rInsightsProtoP\x01ZFgithub.com/pug-sh/pug/internal/gen/proto/shared/insights/v1;insightsv1\xa2\x02\x03SIX\xaa\x02\x12Shared.Insights.V1\xca\x02\x12Shared\\Insights\\V1\xe2\x02\x1eShared\\Insights\\V1\\GPBMetadata\xea\x02 Pug::Proto::Shared::Insights::V1b\x08\x65\x64itionsp\xe8\x07"
17
+
18
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
19
+ pool.add_serialized_file(descriptor_data)
20
+
21
+ module Pug
22
+ module Proto
23
+ module Shared
24
+ module Insights
25
+ module V1
26
+ InsightQuerySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.InsightQuerySpec").msgclass
27
+ QueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.QueryRequest").msgclass
28
+ QueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.QueryResponse").msgclass
29
+ SegmentUsersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.SegmentUsersRequest").msgclass
30
+ SegmentUsersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.SegmentUsersResponse").msgclass
31
+ SessionQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.SessionQuery").msgclass
32
+ UserFlowQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowQuery").msgclass
33
+ UserFlowQuery::NodeKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowQuery.NodeKind").enummodule
34
+ UserFlowQuery::GroupBy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowQuery.GroupBy").enummodule
35
+ TopKQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TopKQuery").msgclass
36
+ TopKQuery::Dimension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TopKQuery.Dimension").enummodule
37
+ TopKResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TopKResult").msgclass
38
+ TopKRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TopKRow").msgclass
39
+ MapQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.MapQuery").msgclass
40
+ TopKProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TopKProfile").msgclass
41
+ UserFlowNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowNode").msgclass
42
+ UserFlowLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowLink").msgclass
43
+ UserFlowResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.UserFlowResult").msgclass
44
+ FilterGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.FilterGroup").msgclass
45
+ EventQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.EventQuery").msgclass
46
+ Breakdown = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.Breakdown").msgclass
47
+ TrendsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TrendsResult").msgclass
48
+ TrendSeries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.TrendSeries").msgclass
49
+ SegmentationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.SegmentationResult").msgclass
50
+ FunnelResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.FunnelResult").msgclass
51
+ FunnelSeries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.FunnelSeries").msgclass
52
+ DistributionBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.DistributionBucket").msgclass
53
+ StepTiming = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.StepTiming").msgclass
54
+ FunnelStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.FunnelStep").msgclass
55
+ RetentionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.RetentionResult").msgclass
56
+ RetentionSeries = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.RetentionSeries").msgclass
57
+ RetentionCohort = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.RetentionCohort").msgclass
58
+ DataPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.DataPoint").msgclass
59
+ GetPropertyValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.GetPropertyValuesRequest").msgclass
60
+ GetPropertyValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.GetPropertyValuesResponse").msgclass
61
+ InsightType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.InsightType").enummodule
62
+ Granularity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.Granularity").enummodule
63
+ AggregationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.AggregationType").enummodule
64
+ SessionMetric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.insights.v1.SessionMetric").enummodule
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: shared/profiles/v1/profiles.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require_relative '../../../buf/validate/validate_pb'
8
+ require_relative '../../../common/v1/filters_pb'
9
+ require 'google/protobuf/struct_pb'
10
+ require 'google/protobuf/timestamp_pb'
11
+
12
+
13
+ descriptor_data = "\n!shared/profiles/v1/profiles.proto\x12\x12shared.profiles.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x17\x63ommon/v1/filters.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\'\n\rDeleteRequest\x12\x16\n\x02id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x02id\"C\n\x18\x44\x65leteDataSubjectRequest\x12\'\n\x0b\x65xternal_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\nexternalId\"t\n\x0e\x44\x65leteResponse\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\x12\x43\n\x06status\x18\x02 \x01(\x0e\x32+.shared.profiles.v1.ComplianceRequestStatusR\x06status\"\x7f\n\x19\x44\x65leteDataSubjectResponse\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\x12\x43\n\x06status\x18\x02 \x01(\x0e\x32+.shared.profiles.v1.ComplianceRequestStatusR\x06status\"B\n\x19GetDeletionRequestRequest\x12%\n\nrequest_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\trequestId\"\x81\x03\n\x1aGetDeletionRequestResponse\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\x12\x1f\n\x0b\x65xternal_id\x18\x02 \x01(\tR\nexternalId\x12\x1d\n\nprofile_id\x18\x03 \x01(\tR\tprofileId\x12\x43\n\x06status\x18\x04 \x01(\x0e\x32+.shared.profiles.v1.ComplianceRequestStatusR\x06status\x12+\n\x11\x65vents_identified\x18\x05 \x01(\x03R\x10\x65ventsIdentified\x12=\n\x0crequested_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0brequestedAt\x12=\n\x0c\x63ompleted_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0b\x63ompletedAt\x12\x14\n\x05\x65rror\x18\x08 \x01(\tR\x05\x65rror\"d\n\x16GetByExternalIdRequest\x12\'\n\x0b\x65xternal_id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\nexternalId\x12!\n\x0cinclude_bots\x18\x02 \x01(\x08R\x0bincludeBots\"P\n\x17GetByExternalIdResponse\x12\x35\n\x07profile\x18\x01 \x01(\x0b\x32\x1b.shared.profiles.v1.ProfileR\x07profile\"G\n\nGetRequest\x12\x16\n\x02id\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12!\n\x0cinclude_bots\x18\x02 \x01(\x08R\x0bincludeBots\"D\n\x0bGetResponse\x12\x35\n\x07profile\x18\x01 \x01(\x0b\x32\x1b.shared.profiles.v1.ProfileR\x07profile\"\x84\x01\n\x0b\x46ilterGroup\x12=\n\x07\x66ilters\x18\x01 \x03(\x0b\x32\x19.common.v1.PropertyFilterB\x08\xbaH\x05\x92\x01\x02\x08\x01R\x07\x66ilters\x12\x36\n\x08operator\x18\x02 \x01(\x0e\x32\x1a.common.v1.LogicalOperatorR\x08operator\"\xe7\x01\n\x0bListRequest\x12\x1d\n\npage_token\x18\x01 \x01(\tR\tpageToken\x12\x44\n\rfilter_groups\x18\x02 \x03(\x0b\x32\x1f.shared.profiles.v1.FilterGroupR\x0c\x66ilterGroups\x12P\n\x16\x66ilter_groups_operator\x18\x03 \x01(\x0e\x32\x1a.common.v1.LogicalOperatorR\x14\x66ilterGroupsOperator\x12!\n\x0cinclude_bots\x18\x04 \x01(\x08R\x0bincludeBots\"o\n\x0cListResponse\x12\x37\n\x08profiles\x18\x01 \x03(\x0b\x32\x1b.shared.profiles.v1.ProfileR\x08profiles\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xcb\x03\n\x16ProfileActivitySummary\x12\x39\n\nfirst_seen\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tfirstSeen\x12\x37\n\tlast_seen\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08lastSeen\x12!\n\x0ctotal_events\x18\x03 \x01(\x03R\x0btotalEvents\x12\x1c\n\tpageviews\x18\x04 \x01(\x03R\tpageviews\x12\x1a\n\x08sessions\x18\x05 \x01(\x03R\x08sessions\x12\x18\n\x07\x62rowser\x18\x06 \x01(\tR\x07\x62rowser\x12\'\n\x0f\x62rowser_version\x18\x07 \x01(\tR\x0e\x62rowserVersion\x12\x0e\n\x02os\x18\x08 \x01(\tR\x02os\x12\x1d\n\nos_version\x18\t \x01(\tR\tosVersion\x12\x16\n\x06\x64\x65vice\x18\n \x01(\tR\x06\x64\x65vice\x12\x18\n\x07\x63ountry\x18\x0b \x01(\tR\x07\x63ountry\x12\x16\n\x06region\x18\x0c \x01(\tR\x06region\x12\x12\n\x04\x63ity\x18\r \x01(\tR\x04\x63ity\x12\x10\n\x03\x62ot\x18\x0e \x01(\x08R\x03\x62ot\"\xd4\x02\n\x07Profile\x12;\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\ncreateTime\x12\x1f\n\x0b\x65xternal_id\x18\x02 \x01(\tR\nexternalId\x12\x0e\n\x02id\x18\x03 \x01(\tR\x02id\x12\x37\n\nproperties\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\nproperties\x12\x1d\n\nproject_id\x18\x05 \x01(\tR\tprojectId\x12;\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\nupdateTime\x12\x46\n\x08\x61\x63tivity\x18\x07 \x01(\x0b\x32*.shared.profiles.v1.ProfileActivitySummaryR\x08\x61\x63tivity*\xe4\x01\n\x17\x43omplianceRequestStatus\x12)\n%COMPLIANCE_REQUEST_STATUS_UNSPECIFIED\x10\x00\x12%\n!COMPLIANCE_REQUEST_STATUS_PENDING\x10\x01\x12(\n$COMPLIANCE_REQUEST_STATUS_PROCESSING\x10\x02\x12\'\n#COMPLIANCE_REQUEST_STATUS_COMPLETED\x10\x03\x12$\n COMPLIANCE_REQUEST_STATUS_FAILED\x10\x04\x32\xd6\x04\n\x0fProfilesService\x12H\n\x03Get\x12\x1e.shared.profiles.v1.GetRequest\x1a\x1f.shared.profiles.v1.GetResponse\"\x00\x12l\n\x0fGetByExternalId\x12*.shared.profiles.v1.GetByExternalIdRequest\x1a+.shared.profiles.v1.GetByExternalIdResponse\"\x00\x12M\n\x04List\x12\x1f.shared.profiles.v1.ListRequest\x1a .shared.profiles.v1.ListResponse\"\x00\x30\x01\x12Q\n\x06\x44\x65lete\x12!.shared.profiles.v1.DeleteRequest\x1a\".shared.profiles.v1.DeleteResponse\"\x00\x12r\n\x11\x44\x65leteDataSubject\x12,.shared.profiles.v1.DeleteDataSubjectRequest\x1a-.shared.profiles.v1.DeleteDataSubjectResponse\"\x00\x12u\n\x12GetDeletionRequest\x12-.shared.profiles.v1.GetDeletionRequestRequest\x1a..shared.profiles.v1.GetDeletionRequestResponse\"\x00\x42\xe5\x01\n\x16\x63om.shared.profiles.v1B\rProfilesProtoP\x01ZFgithub.com/pug-sh/pug/internal/gen/proto/shared/profiles/v1;profilesv1\xa2\x02\x03SPX\xaa\x02\x12Shared.Profiles.V1\xca\x02\x12Shared\\Profiles\\V1\xe2\x02\x1eShared\\Profiles\\V1\\GPBMetadata\xea\x02 Pug::Proto::Shared::Profiles::V1b\x08\x65\x64itionsp\xe8\x07"
14
+
15
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
16
+ pool.add_serialized_file(descriptor_data)
17
+
18
+ module Pug
19
+ module Proto
20
+ module Shared
21
+ module Profiles
22
+ module V1
23
+ DeleteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.DeleteRequest").msgclass
24
+ DeleteDataSubjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.DeleteDataSubjectRequest").msgclass
25
+ DeleteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.DeleteResponse").msgclass
26
+ DeleteDataSubjectResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.DeleteDataSubjectResponse").msgclass
27
+ GetDeletionRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetDeletionRequestRequest").msgclass
28
+ GetDeletionRequestResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetDeletionRequestResponse").msgclass
29
+ GetByExternalIdRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetByExternalIdRequest").msgclass
30
+ GetByExternalIdResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetByExternalIdResponse").msgclass
31
+ GetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetRequest").msgclass
32
+ GetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.GetResponse").msgclass
33
+ FilterGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.FilterGroup").msgclass
34
+ ListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.ListRequest").msgclass
35
+ ListResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.ListResponse").msgclass
36
+ ProfileActivitySummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.ProfileActivitySummary").msgclass
37
+ Profile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.Profile").msgclass
38
+ ComplianceRequestStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("shared.profiles.v1.ComplianceRequestStatus").enummodule
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
data/lib/pug/log.rb ADDED
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "logger"
4
+
5
+ module Pug
6
+ class Log
7
+ PREFIX = "[Pug SDK]"
8
+
9
+ def self.describe(error)
10
+ "#{error.class}: #{error.message}"
11
+ end
12
+
13
+ def initialize(logger)
14
+ @logger = logger || ::Logger.new($stderr, level: ::Logger::WARN)
15
+ end
16
+
17
+ def warn(message)
18
+ write(:warn, message)
19
+ end
20
+
21
+ def error(message)
22
+ write(:error, message)
23
+ end
24
+
25
+ private
26
+
27
+ # A broken logger must not break the never-raises contract of ingestion.
28
+ def write(level, message)
29
+ @logger.public_send(level, "#{PREFIX} #{message}")
30
+ nil
31
+ rescue StandardError
32
+ nil
33
+ end
34
+ end
35
+ end
data/lib/pug/proto.rb ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "google/protobuf"
4
+ require "google/protobuf/well_known_types"
5
+ require_relative "gen/buf/validate/validate_pb"
6
+ require_relative "gen/common/v1/property_value_pb"
7
+ require_relative "gen/sdk/events/v1/events_pb"
8
+ require_relative "gen/sdk/profiles/v1/profiles_pb"
9
+ require_relative "gen/shared/activity/v1/activity_pb"
10
+ require_relative "gen/shared/insights/v1/insights_pb"
11
+ require_relative "gen/shared/profiles/v1/profiles_pb"
12
+ Dir.glob("gen/common/events/v1/*_pb.rb", base: __dir__).sort.each { |path| require_relative path }
13
+
14
+ module Pug
15
+ module Proto
16
+ # Custom options (the event catalog's kind and platforms, buf.validate's rules) are
17
+ # extensions, read off a descriptor's options through the extension's FieldDescriptor.
18
+ def self.extension(name)
19
+ ::Google::Protobuf::DescriptorPool.generated_pool.lookup(name)
20
+ end
21
+ end
22
+ end
data/lib/pug/reads.rb ADDED
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "connect"
4
+ require_relative "errors"
5
+ require_relative "rpc"
6
+
7
+ module Pug
8
+ # Reads run in the caller's control flow: they raise Pug::Error and are never retried.
9
+ module Reads
10
+ def self.call
11
+ yield
12
+ rescue Connect::Passthrough => e
13
+ raise e.error, cause: e.error.cause
14
+ rescue Error
15
+ raise
16
+ rescue StandardError => e
17
+ raise Error, e.message
18
+ end
19
+
20
+ class Facade
21
+ def initialize(rpc)
22
+ @rpc = rpc
23
+ end
24
+
25
+ private
26
+
27
+ def unary(name, request)
28
+ Reads.call { @rpc.unary(name, request) }
29
+ end
30
+ end
31
+ end
32
+
33
+ class Profiles < Reads::Facade
34
+ def get(id, include_bots: false)
35
+ unary(:profiles_get, { id: id, **bots(include_bots) }).profile
36
+ end
37
+
38
+ def get_by_external_id(external_id, include_bots: false)
39
+ unary(:profiles_get_by_external_id, { external_id: external_id, **bots(include_bots) }).profile
40
+ end
41
+
42
+ def delete(id)
43
+ unary(:profiles_delete, { id: id })
44
+ end
45
+
46
+ # Auto-paginating: the server streams the pages of one request. The deadline covers the whole
47
+ # stream, the block's time included; timeout (seconds) overrides the client's. Keywords other
48
+ # than timeout are the request, given braceless.
49
+ def list(request = nil, timeout: nil, **fields, &block)
50
+ return enum_for(:list, request, timeout: timeout, **fields) unless block
51
+
52
+ Reads.call do
53
+ if request && fields.any?
54
+ raise ArgumentError, "list takes a request or keywords, not both: #{fields.keys.inspect}"
55
+ end
56
+ unless timeout.nil? || Connect.timeout?(timeout)
57
+ raise ArgumentError, "timeout must be a positive number of seconds, got #{timeout.inspect}"
58
+ end
59
+
60
+ @rpc.stream(:profiles_list, request || fields, timeout: timeout) { |page| page.profiles.each(&block) }
61
+ end
62
+ end
63
+
64
+ private
65
+
66
+ def bots(include_bots)
67
+ include_bots ? { include_bots: true } : {}
68
+ end
69
+ end
70
+
71
+ class Activity < Reads::Facade
72
+ def feed(request)
73
+ unary(:activity_feed, request)
74
+ end
75
+
76
+ def event_explorer(request)
77
+ unary(:activity_event_explorer, request)
78
+ end
79
+
80
+ def heatmap(request)
81
+ unary(:activity_heatmap, request)
82
+ end
83
+
84
+ def profile_sessions(request)
85
+ unary(:activity_profile_sessions, request)
86
+ end
87
+
88
+ def profile_stats(request)
89
+ unary(:activity_profile_stats, request)
90
+ end
91
+
92
+ def filter_schema(request = nil)
93
+ unary(:activity_filter_schema, request)
94
+ end
95
+
96
+ def property_values(request)
97
+ unary(:activity_property_values, request)
98
+ end
99
+ end
100
+
101
+ class Insights < Reads::Facade
102
+ def query(request)
103
+ unary(:insights_query, request)
104
+ end
105
+
106
+ def segment_users(request)
107
+ unary(:insights_segment_users, request)
108
+ end
109
+
110
+ def filter_schema(request = nil)
111
+ unary(:insights_filter_schema, request)
112
+ end
113
+
114
+ def property_values(request)
115
+ unary(:insights_property_values, request)
116
+ end
117
+ end
118
+ end
data/lib/pug/rpc.rb ADDED
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "connect"
4
+ require_relative "proto"
5
+
6
+ module Pug
7
+ class RPC
8
+ EventsV1 = Proto::Sdk::Events::V1
9
+ SdkProfilesV1 = Proto::Sdk::Profiles::V1
10
+ ProfilesV1 = Proto::Shared::Profiles::V1
11
+ ActivityV1 = Proto::Shared::Activity::V1
12
+ InsightsV1 = Proto::Shared::Insights::V1
13
+ CommonV1 = Proto::Common::V1
14
+
15
+ PROCEDURES = {
16
+ batch_create: ["sdk.events.v1.EventsService/BatchCreate", EventsV1::BatchCreateRequest,
17
+ EventsV1::BatchCreateResponse],
18
+ identify: ["sdk.profiles.v1.ProfilesSDKService/Identify", SdkProfilesV1::IdentifyRequest,
19
+ SdkProfilesV1::IdentifyResponse],
20
+ profiles_get: ["shared.profiles.v1.ProfilesService/Get", ProfilesV1::GetRequest, ProfilesV1::GetResponse],
21
+ profiles_get_by_external_id: ["shared.profiles.v1.ProfilesService/GetByExternalId",
22
+ ProfilesV1::GetByExternalIdRequest, ProfilesV1::GetByExternalIdResponse],
23
+ profiles_delete: ["shared.profiles.v1.ProfilesService/Delete", ProfilesV1::DeleteRequest,
24
+ ProfilesV1::DeleteResponse],
25
+ profiles_list: ["shared.profiles.v1.ProfilesService/List", ProfilesV1::ListRequest, ProfilesV1::ListResponse],
26
+ activity_feed: ["shared.activity.v1.ActivityService/GetActivityFeed", ActivityV1::GetActivityFeedRequest,
27
+ ActivityV1::GetActivityFeedResponse],
28
+ activity_event_explorer: ["shared.activity.v1.ActivityService/GetEventExplorer",
29
+ ActivityV1::GetEventExplorerRequest, ActivityV1::GetEventExplorerResponse],
30
+ activity_heatmap: ["shared.activity.v1.ActivityService/GetActivityHeatmap", ActivityV1::GetActivityHeatmapRequest,
31
+ ActivityV1::GetActivityHeatmapResponse],
32
+ activity_profile_sessions: ["shared.activity.v1.ActivityService/GetProfileSessions",
33
+ ActivityV1::GetProfileSessionsRequest, ActivityV1::GetProfileSessionsResponse],
34
+ activity_profile_stats: ["shared.activity.v1.ActivityService/GetProfileStats", ActivityV1::GetProfileStatsRequest,
35
+ ActivityV1::GetProfileStatsResponse],
36
+ activity_filter_schema: ["shared.activity.v1.ActivityService/GetFilterSchema", CommonV1::GetFilterSchemaRequest,
37
+ CommonV1::GetFilterSchemaResponse],
38
+ activity_property_values: ["shared.activity.v1.ActivityService/GetPropertyValues",
39
+ ActivityV1::GetPropertyValuesRequest, ActivityV1::GetPropertyValuesResponse],
40
+ insights_query: ["shared.insights.v1.InsightsService/Query", InsightsV1::QueryRequest, InsightsV1::QueryResponse],
41
+ insights_segment_users: ["shared.insights.v1.InsightsService/SegmentUsers", InsightsV1::SegmentUsersRequest,
42
+ InsightsV1::SegmentUsersResponse],
43
+ insights_filter_schema: ["shared.insights.v1.InsightsService/GetFilterSchema", CommonV1::GetFilterSchemaRequest,
44
+ CommonV1::GetFilterSchemaResponse],
45
+ insights_property_values: ["shared.insights.v1.InsightsService/GetPropertyValues",
46
+ InsightsV1::GetPropertyValuesRequest, InsightsV1::GetPropertyValuesResponse]
47
+ }.freeze
48
+
49
+ def self.request(name, request)
50
+ klass = PROCEDURES.fetch(name)[1]
51
+ case request
52
+ when nil then klass.new
53
+ when klass then request
54
+ when Hash then klass.new(request)
55
+ else raise ArgumentError, "expected a Hash or #{klass}, got #{request.class}"
56
+ end
57
+ end
58
+
59
+ def initialize(connect)
60
+ @connect = connect
61
+ end
62
+
63
+ def unary(name, request)
64
+ path, _, response = PROCEDURES.fetch(name)
65
+ @connect.unary(path, self.class.request(name, request), response)
66
+ end
67
+
68
+ def stream(name, request, timeout: nil, &)
69
+ path, _, response = PROCEDURES.fetch(name)
70
+ @connect.server_stream(path, self.class.request(name, request), response, timeout: timeout, &)
71
+ end
72
+ end
73
+ end