cekat-event-sdk 0.2.0 → 0.3.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: a6adabdca7dc48bd4594f7368316096ea0bb0bd5d928ad0ccf36d9866ee555b6
4
- data.tar.gz: 66e3f5464caf285279b3910ce02ea649286d28830e5119a7de3d2977745aa6e5
3
+ metadata.gz: 7f9238be53f82b0d930ef3504555edaac544bf5743094a78cbcea5d8c470f4a6
4
+ data.tar.gz: 6f7f015e3391ad9782cfd0067208a5eda7250b19b030be4e5d67ef5b309cd124
5
5
  SHA512:
6
- metadata.gz: b7c30741a7eb8a011206329680efc87c1e3d504db9953390b3e482c40719f536dd8f50b8189b709f41d0eea9d46849f0c76d0654170f680d21fd21b64cb91556
7
- data.tar.gz: c27f710403a0efebad517e77be27ed6cb17076be9d50abb7a0d1d70301b97303a6a01512e1ed80ca7661dc740b3553a8639a963f4c958b441b70b97bd9a35bae
6
+ metadata.gz: 457d2f820006ad24fb3fd5420765dd4b16d96d3970051cddcb278268d70c240290ceeba17e8b9dfa08d7df36adf2e63e4457f9e97a153f0469a130d5cb0b0e95
7
+ data.tar.gz: afd34ab171c2eec29a7e312360dee784108feeac0617e9c63628ced136b83914f6e063afd046201c80ecebe9cfc08035c32796998534d5430822a9020e27ed81
data/README.md CHANGED
@@ -20,11 +20,12 @@ CEKAT = CekatEventSdk::Client.new(access_token: ENV.fetch("CEKAT_ACCESS_TOKEN"))
20
20
  CEKAT.user_registration(email: "person@example.com", contact_name: "Person")
21
21
  CEKAT.user_login(phone_number: "+628123456789")
22
22
  CEKAT.order_created(email: "person@example.com", properties: { order_id: "o-1" })
23
+ CEKAT.form_submitted(email: "person@example.com", properties: { form_id: "contact" })
23
24
  CEKAT.order_paid(email: "person@example.com", properties: { order_id: "o-1" }, amount: 125_000, currency: "IDR")
24
25
  ack = CEKAT.custom_event("wishlist_updated", email: "person@example.com")
25
26
  ```
26
27
 
27
- Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_paid` additionally requires a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`.
28
+ `form_submitted` sends the common `form_submitted` event (`is_common: true`). Every event method also accepts a `CekatEventSdk::EventInput` or a Hash instead of keyword attributes. `order_paid` additionally requires a finite `amount:` (Integer, Float, BigDecimal, or Rational) and a nonblank `currency:`, sent as the `amount` and `currency` properties; do not also put those keys in `properties`.
28
29
 
29
30
  An `Acknowledgement` means Cekat accepted the event for **asynchronous processing**. It does not confirm durable storage, identity resolution, delivery completion, or analytics availability.
30
31
 
@@ -131,7 +132,7 @@ Transport failures, timeouts, and HTTP 429, 500, 502, 503, and 504 are retried,
131
132
  ## Configuration
132
133
 
133
134
  ```ruby
134
- CekatEventSdk::Client.new(access_token: token, base_url: "https://server.cekat.ai", timeout: 3, retry_count: 2)
135
+ CekatEventSdk::Client.new(access_token: token, base_url: "https://t.cekat.ai", timeout: 3, retry_count: 2)
135
136
  ```
136
137
 
137
138
  `base_url` must be an absolute HTTP(S) origin without credentials, path, query, or fragment; the SDK always posts to `/api/events/ingest`. Requests send `User-Agent: cekat-event-sdk-ruby/<version>`.
@@ -144,7 +145,7 @@ The Net::HTTP transport opens a fresh connection per attempt, never follows redi
144
145
  bundle install
145
146
  bundle exec rake # core, Rack, and Rails specs plus RuboCop
146
147
  RAILS_VERSION="~> 8.0.0" RACK_VERSION="~> 2.2" bundle update && bundle exec rake spec
147
- ./scripts/package --version 0.2.0 --output /absolute/empty-directory
148
+ ./scripts/package --version 0.3.0 --output /absolute/empty-directory
148
149
  ```
149
150
 
150
151
  `scripts/package` runs the specs, RuboCop, and `bundle-audit`, then builds the gem and a SHA-256 `manifest.json`. It never pushes, signs, or tags; releases to RubyGems run from the repository's `release-ruby.yml` workflow when a `ruby/vX.Y.Z` tag is pushed. `scripts/conformance` runs the shared conformance fixtures (see `conformance/README.md`); the three caller-cancellation cases are reported as `not_applicable` for Ruby.
@@ -48,6 +48,10 @@ module CekatEventSdk
48
48
  track("order_created", true, event_from(event, attributes))
49
49
  end
50
50
 
51
+ def form_submitted(event = nil, **attributes)
52
+ track("form_submitted", true, event_from(event, attributes))
53
+ end
54
+
51
55
  # The required finite amount and nonblank currency are sent as the "amount" and "currency"
52
56
  # properties; the event's properties must not already contain either key.
53
57
  def order_paid(event = nil, amount:, currency:, **attributes)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CekatEventSdk
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -4,7 +4,7 @@ require_relative "cekat_event_sdk/version"
4
4
 
5
5
  # Cekat event SDK: submit identity-bearing events and correlate them with the browser visitor.
6
6
  module CekatEventSdk
7
- DEFAULT_BASE_URL = "https://server.cekat.ai"
7
+ DEFAULT_BASE_URL = "https://t.cekat.ai"
8
8
  INGEST_PATH = "/api/events/ingest"
9
9
  VISITOR_HEADER = "X-Cekat-Visitor-ID"
10
10
  VISITOR_COOKIE = "_cekat_visitor_id"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cekat-event-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cekat