leal 0.0.14 → 0.0.15

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: e3a2732500c8c1b1883576904d52230e44d4519f0cb028d7daededbc33136971
4
- data.tar.gz: 02f7a1b104b6f134429e874a40fd9c280bd1019dd83b8d18380a5ec23abe3118
3
+ metadata.gz: 041ecf0ebe5dde00f2be312f6b3370c3061f09e3c7bd939d5188b280896a0b9c
4
+ data.tar.gz: e9a796a097d629b4208a22897e23ef2518b6380bfb27b7d7f58dd3f390289ce6
5
5
  SHA512:
6
- metadata.gz: 2eae523c1952ea245b021ecc561b83b11e72473c079e21b48750b28139eb323002c7d4118c73f2ec4827de16984672e20e43c60c0441d07d1b9f213d55075787
7
- data.tar.gz: 9d5ab64ba2e5184d295af1c73c2d99d0eabc8522f80845e895188a8835fa2b649c93046b2782ee76afdb0771e9aba0d34aa059717fcede8a951490318d99959c
6
+ metadata.gz: 02e7fd662bea9ac2def7bb857485148417e040eba292bb7bb0b478edba53e35e817a77359726a5fe21d14ed578c32b30bf92dda77fe09462b7b5409a60be0fca
7
+ data.tar.gz: ed17b2fc1af6d86ee1be7f351638b8fd0215deefc71bb3e9b8c31cc9c7aed322bcc1c72b51d12ace434c561c578270f0695339056f8d2ea90d4be6ce171928ac
data/.fern/metadata.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "cliVersion": "5.102.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
4
  "generatorVersion": "1.23.2",
5
- "originGitCommit": "cf2e805c2a9dd96e6e7e0632ed8a5e47243a8d4f",
5
+ "originGitCommit": "254da807428bdf6c997fa3a10a7e4a5960b0a6d9",
6
6
  "originGitCommitIsDirty": false,
7
7
  "invokedBy": "ci",
8
8
  "ciProvider": "github",
9
- "sdkVersion": "0.0.14"
9
+ "sdkVersion": "0.0.15"
10
10
  }
@@ -16,6 +16,14 @@ module Leal
16
16
 
17
17
  field :name, -> { String }, optional: false, nullable: false
18
18
 
19
+ field :qr_style, -> { Leal::Cards::Types::CreateCardsRequestCardQrStyle }, optional: true, nullable: false
20
+
21
+ field :referee_stamps, -> { Integer }, optional: true, nullable: false
22
+
23
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
24
+
25
+ field :referrer_stamps, -> { Integer }, optional: true, nullable: false
26
+
19
27
  field :show_member_field, -> { Internal::Types::Boolean }, optional: true, nullable: false
20
28
 
21
29
  field :show_stamps_to_reward_field, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module Cards
5
+ module Types
6
+ module CreateCardsRequestCardQrStyle
7
+ extend Leal::Internal::Types::Enum
8
+
9
+ LINK = "link"
10
+ CODE = "code"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -24,6 +24,14 @@ module Leal
24
24
 
25
25
  field :name, -> { String }, optional: false, nullable: false
26
26
 
27
+ field :qr_style, -> { String }, optional: false, nullable: false
28
+
29
+ field :referee_stamps, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
32
+
33
+ field :referrer_stamps, -> { Integer }, optional: false, nullable: false
34
+
27
35
  field :rewards_count, -> { Integer }, optional: false, nullable: false
28
36
 
29
37
  field :show_member_field, -> { Internal::Types::Boolean }, optional: false, nullable: false
@@ -24,6 +24,14 @@ module Leal
24
24
 
25
25
  field :name, -> { String }, optional: false, nullable: false
26
26
 
27
+ field :qr_style, -> { String }, optional: false, nullable: false
28
+
29
+ field :referee_stamps, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
32
+
33
+ field :referrer_stamps, -> { Integer }, optional: false, nullable: false
34
+
27
35
  field :rewards_count, -> { Integer }, optional: false, nullable: false
28
36
 
29
37
  field :show_member_field, -> { Internal::Types::Boolean }, optional: false, nullable: false
@@ -24,6 +24,14 @@ module Leal
24
24
 
25
25
  field :name, -> { String }, optional: false, nullable: false
26
26
 
27
+ field :qr_style, -> { String }, optional: false, nullable: false
28
+
29
+ field :referee_stamps, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
32
+
33
+ field :referrer_stamps, -> { Integer }, optional: false, nullable: false
34
+
27
35
  field :rewards_count, -> { Integer }, optional: false, nullable: false
28
36
 
29
37
  field :show_member_field, -> { Internal::Types::Boolean }, optional: false, nullable: false
@@ -16,6 +16,14 @@ module Leal
16
16
 
17
17
  field :name, -> { String }, optional: true, nullable: false
18
18
 
19
+ field :qr_style, -> { Leal::Cards::Types::UpdateCardsRequestCardQrStyle }, optional: true, nullable: false
20
+
21
+ field :referee_stamps, -> { Integer }, optional: true, nullable: false
22
+
23
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
24
+
25
+ field :referrer_stamps, -> { Integer }, optional: true, nullable: false
26
+
19
27
  field :show_member_field, -> { Internal::Types::Boolean }, optional: true, nullable: false
20
28
 
21
29
  field :show_stamps_to_reward_field, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module Cards
5
+ module Types
6
+ module UpdateCardsRequestCardQrStyle
7
+ extend Leal::Internal::Types::Enum
8
+
9
+ LINK = "link"
10
+ CODE = "code"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -24,6 +24,14 @@ module Leal
24
24
 
25
25
  field :name, -> { String }, optional: false, nullable: false
26
26
 
27
+ field :qr_style, -> { String }, optional: false, nullable: false
28
+
29
+ field :referee_stamps, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :referrals_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
32
+
33
+ field :referrer_stamps, -> { Integer }, optional: false, nullable: false
34
+
27
35
  field :rewards_count, -> { Integer }, optional: false, nullable: false
28
36
 
29
37
  field :show_member_field, -> { Internal::Types::Boolean }, optional: false, nullable: false
data/lib/leal/client.rb CHANGED
@@ -11,7 +11,7 @@ module Leal
11
11
  @raw_client = Leal::Internal::Http::RawClient.new(
12
12
  base_url: base_url || Leal::Environment::PRODUCTION,
13
13
  headers: {
14
- "User-Agent" => "leal/0.0.14",
14
+ "User-Agent" => "leal/0.0.15",
15
15
  "X-Fern-Language" => "Ruby",
16
16
  Authorization: "Bearer #{token}"
17
17
  },
@@ -149,8 +149,10 @@ module Leal
149
149
  end
150
150
  end
151
151
 
152
- # Adds stamps to a customer's loyalty card. Triggers ledger entries, wallet pass updates,
153
- # and push notifications. Pass `skip_notifications` to stamp silently.
152
+ # Adds stamps to a customer's loyalty card. Triggers ledger entries (`entry_type` `api`),
153
+ # wallet pass updates, and push notifications. Pass `skip_notifications` to stamp silently.
154
+ # Call it for real visits or purchases: if this customer joined with a friend's invite, the
155
+ # first call pays out the referral to both of them.
154
156
  #
155
157
  # @param request_options [Hash]
156
158
  # @param params [Leal::CustomerCards::Types::StampCustomerCardsRequest]
@@ -28,6 +28,12 @@ module Leal
28
28
 
29
29
  field :progress_percentage, -> { Integer }, optional: false, nullable: false
30
30
 
31
+ field :referral_url, -> { String }, optional: false, nullable: false
32
+
33
+ field :referrals_count, -> { Integer }, optional: false, nullable: false
34
+
35
+ field :referred_by, -> { Leal::CustomerCards::Types::GetCustomerCardsResponseReferredBy }, optional: false, nullable: false
36
+
31
37
  field :stamps_count, -> { Integer }, optional: false, nullable: false
32
38
 
33
39
  field :stamps_remaining, -> { Integer }, optional: false, nullable: false
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module CustomerCards
5
+ module Types
6
+ class GetCustomerCardsResponseReferredBy < Internal::Types::Model
7
+ field :customer_card_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :customer_id, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :referral_id, -> { Integer }, optional: false, nullable: false
12
+
13
+ field :rewarded_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :status, -> { String }, optional: false, nullable: false
16
+ end
17
+ end
18
+ end
19
+ end
@@ -22,6 +22,8 @@ module Leal
22
22
 
23
23
  field :progress_percentage, -> { Integer }, optional: false, nullable: false
24
24
 
25
+ field :referral_url, -> { String }, optional: false, nullable: false
26
+
25
27
  field :stamps_count, -> { Integer }, optional: false, nullable: false
26
28
 
27
29
  field :stamps_remaining, -> { Integer }, optional: false, nullable: false
@@ -28,6 +28,12 @@ module Leal
28
28
 
29
29
  field :progress_percentage, -> { Integer }, optional: false, nullable: false
30
30
 
31
+ field :referral_url, -> { String }, optional: false, nullable: false
32
+
33
+ field :referrals_count, -> { Integer }, optional: false, nullable: false
34
+
35
+ field :referred_by, -> { Leal::CustomerCards::Types::StampCustomerCardsResponseReferredBy }, optional: false, nullable: false
36
+
31
37
  field :stamps_count, -> { Integer }, optional: false, nullable: false
32
38
 
33
39
  field :stamps_remaining, -> { Integer }, optional: false, nullable: false
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module CustomerCards
5
+ module Types
6
+ class StampCustomerCardsResponseReferredBy < Internal::Types::Model
7
+ field :customer_card_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :customer_id, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :referral_id, -> { Integer }, optional: false, nullable: false
12
+
13
+ field :rewarded_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :status, -> { String }, optional: false, nullable: false
16
+ end
17
+ end
18
+ end
19
+ end
@@ -11,7 +11,9 @@ module Leal
11
11
  end
12
12
 
13
13
  # Returns a paginated list of customers for the store. Use the `search` parameter to filter
14
- # by name, email, phone, card code (barcode), or external reference ID. Alternatively, pass
14
+ # by name, email, phone, card code (barcode), or external reference ID. A scanned wallet pass
15
+ # QR can be passed as it is: newer passes hold a link with the card code after the `#`, and
16
+ # that is matched to the card exactly. Alternatively, pass
15
17
  # `source` AND `external_id` together to perform an exact lookup by an external reference -
16
18
  # the response will contain at most one customer.
17
19
  #
@@ -10,6 +10,8 @@ module Leal
10
10
 
11
11
  field :customer, -> { Leal::Customers::Types::CreateCustomersRequestCustomer }, optional: false, nullable: false
12
12
 
13
+ field :referral_code, -> { String }, optional: true, nullable: false
14
+
13
15
  field :send_card_links, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
16
  end
15
17
  end
data/lib/leal/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leal
4
- VERSION = "0.0.14"
4
+ VERSION = "0.0.15"
5
5
  end
@@ -55,7 +55,7 @@ module Leal
55
55
  # verify deliveries. The URL must be publicly reachable over https.
56
56
  #
57
57
  # Events: `customer.created`, `customer.updated`, `customer_card.created`, `stamp.earned`, `stamp.removed`,
58
- # `reward.unlocked`, `reward.redeemed`, or `*` for all of them.
58
+ # `reward.unlocked`, `reward.redeemed`, `referral.created`, `referral.rewarded`, or `*` for all of them.
59
59
  #
60
60
  # @param request_options [Hash]
61
61
  # @param params [Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsRequest]
data/lib/leal.rb CHANGED
@@ -40,9 +40,11 @@ require_relative "leal/stores/types/get_stores_response"
40
40
  require_relative "leal/stores/types/update_stores_request_account"
41
41
  require_relative "leal/stores/types/update_stores_response"
42
42
  require_relative "leal/cards/types/list_cards_response_item"
43
+ require_relative "leal/cards/types/create_cards_request_card_qr_style"
43
44
  require_relative "leal/cards/types/create_cards_request_card"
44
45
  require_relative "leal/cards/types/create_cards_response"
45
46
  require_relative "leal/cards/types/get_cards_response"
47
+ require_relative "leal/cards/types/update_cards_request_card_qr_style"
46
48
  require_relative "leal/cards/types/update_cards_request_card"
47
49
  require_relative "leal/cards/types/update_cards_response"
48
50
  require_relative "leal/customers/types/list_customers_response_pagination"
@@ -53,9 +55,11 @@ require_relative "leal/customers/types/get_customers_response"
53
55
  require_relative "leal/customers/types/update_customers_request_customer"
54
56
  require_relative "leal/customers/types/update_customers_response"
55
57
  require_relative "leal/customer_cards/types/list_customer_cards_response_item"
58
+ require_relative "leal/customer_cards/types/get_customer_cards_response_referred_by"
56
59
  require_relative "leal/customer_cards/types/get_customer_cards_response"
57
60
  require_relative "leal/customer_cards/types/redeem_customer_cards_response_redemption"
58
61
  require_relative "leal/customer_cards/types/redeem_customer_cards_response"
62
+ require_relative "leal/customer_cards/types/stamp_customer_cards_response_referred_by"
59
63
  require_relative "leal/customer_cards/types/stamp_customer_cards_response"
60
64
  require_relative "leal/locations/types/list_locations_response_item"
61
65
  require_relative "leal/locations/types/create_locations_request_location"
data/reference.md CHANGED
@@ -508,7 +508,9 @@ client.cards.update(
508
508
  <dd>
509
509
 
510
510
  Returns a paginated list of customers for the store. Use the `search` parameter to filter
511
- by name, email, phone, card code (barcode), or external reference ID. Alternatively, pass
511
+ by name, email, phone, card code (barcode), or external reference ID. A scanned wallet pass
512
+ QR can be passed as it is: newer passes hold a link with the card code after the `#`, and
513
+ that is matched to the card exactly. Alternatively, pass
512
514
  `source` AND `external_id` together to perform an exact lookup by an external reference -
513
515
  the response will contain at most one customer.
514
516
  </dd>
@@ -548,7 +550,7 @@ client.customers.list(account_id: 1)
548
550
  <dl>
549
551
  <dd>
550
552
 
551
- **search:** `String` — Search query to filter customers by name, email, phone, card code (barcode), or external reference ID
553
+ **search:** `String` — Search query to filter customers by name, email, phone, card code (barcode, or the full scanned QR text), or external reference ID
552
554
 
553
555
  </dd>
554
556
  </dl>
@@ -678,6 +680,14 @@ client.customers.create(
678
680
  <dl>
679
681
  <dd>
680
682
 
683
+ **referral_code:** `String` — Records the new customer as invited by another customer: the code is the last part of that customer's `referral_url`. Needs `card_id`, for the same card, with referrals on. Nothing is given now; both customers get their stamps when the new customer's card is first stamped for a visit
684
+
685
+ </dd>
686
+ </dl>
687
+
688
+ <dl>
689
+ <dd>
690
+
681
691
  **send_card_links:** `Internal::Types::Boolean` — When true, sends the card links to the customer via email/SMS after enrollment. Note: even without this flag, the response includes `apple_wallet_url` and `google_wallet_url` in each customer card object so you can deliver them yourself.
682
692
 
683
693
  </dd>
@@ -1128,8 +1138,10 @@ client.customer_cards.redeem(
1128
1138
  <dl>
1129
1139
  <dd>
1130
1140
 
1131
- Adds stamps to a customer's loyalty card. Triggers ledger entries, wallet pass updates,
1132
- and push notifications. Pass `skip_notifications` to stamp silently.
1141
+ Adds stamps to a customer's loyalty card. Triggers ledger entries (`entry_type` `api`),
1142
+ wallet pass updates, and push notifications. Pass `skip_notifications` to stamp silently.
1143
+ Call it for real visits or purchases: if this customer joined with a friend's invite, the
1144
+ first call pays out the referral to both of them.
1133
1145
  </dd>
1134
1146
  </dl>
1135
1147
  </dd>
@@ -2439,7 +2451,7 @@ client.webhook_subscriptions.get_api_v1accounts_account_id_webhook_subscriptions
2439
2451
  Subscribes a URL to one or more events. The response includes the signing `secret`; store it to
2440
2452
  verify deliveries. The URL must be publicly reachable over https.
2441
2453
 
2442
- Events: `customer.created`, `customer.updated`, `customer_card.created`, `stamp.earned`, `stamp.removed`, `reward.unlocked`, `reward.redeemed`, or `*` for all of them.
2454
+ Events: `customer.created`, `customer.updated`, `customer_card.created`, `stamp.earned`, `stamp.removed`, `reward.unlocked`, `reward.redeemed`, `referral.created`, `referral.rewarded`, or `*` for all of them.
2443
2455
  </dd>
2444
2456
  </dl>
2445
2457
  </dd>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-30 00:00:00.000000000 Z
11
+ date: 2026-11-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Leal Ruby library provides convenient access to the Leal API from
14
14
  Ruby.
@@ -29,6 +29,7 @@ files:
29
29
  - lib/leal/cards/client.rb
30
30
  - lib/leal/cards/types/create_cards_request.rb
31
31
  - lib/leal/cards/types/create_cards_request_card.rb
32
+ - lib/leal/cards/types/create_cards_request_card_qr_style.rb
32
33
  - lib/leal/cards/types/create_cards_response.rb
33
34
  - lib/leal/cards/types/get_cards_request.rb
34
35
  - lib/leal/cards/types/get_cards_response.rb
@@ -36,11 +37,13 @@ files:
36
37
  - lib/leal/cards/types/list_cards_response_item.rb
37
38
  - lib/leal/cards/types/update_cards_request.rb
38
39
  - lib/leal/cards/types/update_cards_request_card.rb
40
+ - lib/leal/cards/types/update_cards_request_card_qr_style.rb
39
41
  - lib/leal/cards/types/update_cards_response.rb
40
42
  - lib/leal/client.rb
41
43
  - lib/leal/customer_cards/client.rb
42
44
  - lib/leal/customer_cards/types/get_customer_cards_request.rb
43
45
  - lib/leal/customer_cards/types/get_customer_cards_response.rb
46
+ - lib/leal/customer_cards/types/get_customer_cards_response_referred_by.rb
44
47
  - lib/leal/customer_cards/types/list_customer_cards_request.rb
45
48
  - lib/leal/customer_cards/types/list_customer_cards_response_item.rb
46
49
  - lib/leal/customer_cards/types/redeem_customer_cards_request.rb
@@ -48,6 +51,7 @@ files:
48
51
  - lib/leal/customer_cards/types/redeem_customer_cards_response_redemption.rb
49
52
  - lib/leal/customer_cards/types/stamp_customer_cards_request.rb
50
53
  - lib/leal/customer_cards/types/stamp_customer_cards_response.rb
54
+ - lib/leal/customer_cards/types/stamp_customer_cards_response_referred_by.rb
51
55
  - lib/leal/customers/client.rb
52
56
  - lib/leal/customers/types/create_customers_request.rb
53
57
  - lib/leal/customers/types/create_customers_request_customer.rb