From 71cfae32a386c17a95fd5d82a24ae70ec7f5417d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:31:57 +0000 Subject: [PATCH 1/6] feat(api): api update --- .stats.yml | 4 ++-- lib/whop_sdk/models/ai_chat_update_params.rb | 10 +++++++++- lib/whop_sdk/resources/ai_chats.rb | 4 +++- rbi/whop_sdk/models/ai_chat_update_params.rbi | 13 ++++++++++++- rbi/whop_sdk/resources/ai_chats.rbi | 3 +++ sig/whop_sdk/models/ai_chat_update_params.rbs | 7 ++++++- sig/whop_sdk/resources/ai_chats.rbs | 1 + 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b6db4a..2516a9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-333c68cc8619caa2ffdfed588a7d2b2c263f8910b7b682698da92c826932e7c7.yml -openapi_spec_hash: 8e2cc20f1e06b43ea220edbdf16eddbe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-e253efd689240c90cfb2ee6082df7ae60cb7562c9cb41a7dbc756bee34101ecc.yml +openapi_spec_hash: 976dec633bf869791c18f34e839f5668 config_hash: 48e5bec0f5659595abb38814aa0d9cc2 diff --git a/lib/whop_sdk/models/ai_chat_update_params.rb b/lib/whop_sdk/models/ai_chat_update_params.rb index e954024..8c457ad 100644 --- a/lib/whop_sdk/models/ai_chat_update_params.rb +++ b/lib/whop_sdk/models/ai_chat_update_params.rb @@ -7,13 +7,21 @@ class AIChatUpdateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute current_company_id + # The ID of the company to set as the current company in context for the AI chat + # + # @return [String, nil] + optional :current_company_id, String, nil?: true + # @!attribute title # The new title for the AI chat # # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(title: nil, request_options: {}) + # @!method initialize(current_company_id: nil, title: nil, request_options: {}) + # @param current_company_id [String, nil] The ID of the company to set as the current company in context for the AI chat + # # @param title [String, nil] The new title for the AI chat # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/whop_sdk/resources/ai_chats.rb b/lib/whop_sdk/resources/ai_chats.rb index fa1e7d3..cf1afaa 100644 --- a/lib/whop_sdk/resources/ai_chats.rb +++ b/lib/whop_sdk/resources/ai_chats.rb @@ -55,10 +55,12 @@ def retrieve(id, params = {}) # # - `ai_chat:update` # - # @overload update(id, title: nil, request_options: {}) + # @overload update(id, current_company_id: nil, title: nil, request_options: {}) # # @param id [String] The ID of the AI chat to update # + # @param current_company_id [String, nil] The ID of the company to set as the current company in context for the AI chat + # # @param title [String, nil] The new title for the AI chat # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/rbi/whop_sdk/models/ai_chat_update_params.rbi b/rbi/whop_sdk/models/ai_chat_update_params.rbi index c0b104e..737ec82 100644 --- a/rbi/whop_sdk/models/ai_chat_update_params.rbi +++ b/rbi/whop_sdk/models/ai_chat_update_params.rbi @@ -11,17 +11,24 @@ module WhopSDK T.any(WhopSDK::AIChatUpdateParams, WhopSDK::Internal::AnyHash) end + # The ID of the company to set as the current company in context for the AI chat + sig { returns(T.nilable(String)) } + attr_accessor :current_company_id + # The new title for the AI chat sig { returns(T.nilable(String)) } attr_accessor :title sig do params( + current_company_id: T.nilable(String), title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # The ID of the company to set as the current company in context for the AI chat + current_company_id: nil, # The new title for the AI chat title: nil, request_options: {} @@ -30,7 +37,11 @@ module WhopSDK sig do override.returns( - { title: T.nilable(String), request_options: WhopSDK::RequestOptions } + { + current_company_id: T.nilable(String), + title: T.nilable(String), + request_options: WhopSDK::RequestOptions + } ) end def to_hash diff --git a/rbi/whop_sdk/resources/ai_chats.rbi b/rbi/whop_sdk/resources/ai_chats.rbi index ba0e55b..d1d4521 100644 --- a/rbi/whop_sdk/resources/ai_chats.rbi +++ b/rbi/whop_sdk/resources/ai_chats.rbi @@ -43,6 +43,7 @@ module WhopSDK sig do params( id: String, + current_company_id: T.nilable(String), title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AIChat) @@ -50,6 +51,8 @@ module WhopSDK def update( # The ID of the AI chat to update id, + # The ID of the company to set as the current company in context for the AI chat + current_company_id: nil, # The new title for the AI chat title: nil, request_options: {} diff --git a/sig/whop_sdk/models/ai_chat_update_params.rbs b/sig/whop_sdk/models/ai_chat_update_params.rbs index 65ba0ca..270c840 100644 --- a/sig/whop_sdk/models/ai_chat_update_params.rbs +++ b/sig/whop_sdk/models/ai_chat_update_params.rbs @@ -1,20 +1,25 @@ module WhopSDK module Models type ai_chat_update_params = - { title: String? } & WhopSDK::Internal::Type::request_parameters + { current_company_id: String?, title: String? } + & WhopSDK::Internal::Type::request_parameters class AIChatUpdateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + attr_accessor current_company_id: String? + attr_accessor title: String? def initialize: ( + ?current_company_id: String?, ?title: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { + current_company_id: String?, title: String?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/resources/ai_chats.rbs b/sig/whop_sdk/resources/ai_chats.rbs index 3c8014c..5a324ef 100644 --- a/sig/whop_sdk/resources/ai_chats.rbs +++ b/sig/whop_sdk/resources/ai_chats.rbs @@ -13,6 +13,7 @@ module WhopSDK def update: ( String id, + ?current_company_id: String?, ?title: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AIChat From d581cb174e297c951ac30d0790d48d6a53c046e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:22:08 +0000 Subject: [PATCH 2/6] chore(docs): remove www prefix --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34fbab7..f4f9179 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g To install via git in your `Gemfile`: ```ruby -gem "whop_sdk", git: "https://www.github.com/whopio/whopsdk-ruby" +gem "whop_sdk", git: "https://github.com/whopio/whopsdk-ruby" ``` Alternatively, reference local copy of the repo: ```bash -$ git clone -- 'https://www.github.com/whopio/whopsdk-ruby' '' +$ git clone -- 'https://github.com/whopio/whopsdk-ruby' '' ``` ```ruby From 3bdf1117e8b6b434b77713fcf534dd112c743ff1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:32:03 +0000 Subject: [PATCH 3/6] feat(api): api update --- .stats.yml | 4 +- lib/whop_sdk/models/ai_chat_create_params.rb | 45 ++++++++++++- lib/whop_sdk/resources/ai_chats.rb | 13 +++- rbi/whop_sdk/models/ai_chat_create_params.rbi | 67 ++++++++++++++++++- rbi/whop_sdk/resources/ai_chats.rbi | 13 ++++ sig/whop_sdk/models/ai_chat_create_params.rbs | 30 ++++++++- sig/whop_sdk/resources/ai_chats.rbs | 3 + test/whop_sdk/resources/ai_chats_test.rb | 4 +- 8 files changed, 170 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2516a9c..6e452b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-e253efd689240c90cfb2ee6082df7ae60cb7562c9cb41a7dbc756bee34101ecc.yml -openapi_spec_hash: 976dec633bf869791c18f34e839f5668 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c6ec2aa283e833b7fc1e98f6d4c8e9a4b1c0010e6dbad75d33f7d56abdd8bd2c.yml +openapi_spec_hash: ef503f4771f3e00ee5d092cc252184b2 config_hash: 48e5bec0f5659595abb38814aa0d9cc2 diff --git a/lib/whop_sdk/models/ai_chat_create_params.rb b/lib/whop_sdk/models/ai_chat_create_params.rb index e2a66b5..91396c3 100644 --- a/lib/whop_sdk/models/ai_chat_create_params.rb +++ b/lib/whop_sdk/models/ai_chat_create_params.rb @@ -7,16 +7,59 @@ class AIChatCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute message_text + # The text content of the first message sent in the chat + # + # @return [String] + required :message_text, String + + # @!attribute current_company_id + # The ID of the company to set as the current company in context for the AI chat + # + # @return [String, nil] + optional :current_company_id, String, nil?: true + + # @!attribute message_attachments + # The IDs of existing uploaded attachments to include in the first message to the + # agent + # + # @return [Array, nil] + optional :message_attachments, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AIChatCreateParams::MessageAttachment] }, + nil?: true + # @!attribute title # The title of the AI chat # # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(title: nil, request_options: {}) + # @!method initialize(message_text:, current_company_id: nil, message_attachments: nil, title: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AIChatCreateParams} for more details. + # + # @param message_text [String] The text content of the first message sent in the chat + # + # @param current_company_id [String, nil] The ID of the company to set as the current company in context for the AI chat + # + # @param message_attachments [Array, nil] The IDs of existing uploaded attachments to include in the first message to the + # # @param title [String, nil] The title of the AI chat # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class MessageAttachment < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of an existing file object. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Input for an attachment + # + # @param id [String] The ID of an existing file object. + end end end end diff --git a/lib/whop_sdk/resources/ai_chats.rb b/lib/whop_sdk/resources/ai_chats.rb index cf1afaa..d48a78b 100644 --- a/lib/whop_sdk/resources/ai_chats.rb +++ b/lib/whop_sdk/resources/ai_chats.rb @@ -3,13 +3,22 @@ module WhopSDK module Resources class AIChats + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AIChatCreateParams} for more details. + # # Creates a new AI chat # # Required permissions: # # - `ai_chat:create` # - # @overload create(title: nil, request_options: {}) + # @overload create(message_text:, current_company_id: nil, message_attachments: nil, title: nil, request_options: {}) + # + # @param message_text [String] The text content of the first message sent in the chat + # + # @param current_company_id [String, nil] The ID of the company to set as the current company in context for the AI chat + # + # @param message_attachments [Array, nil] The IDs of existing uploaded attachments to include in the first message to the # # @param title [String, nil] The title of the AI chat # @@ -18,7 +27,7 @@ class AIChats # @return [WhopSDK::Models::AIChat] # # @see WhopSDK::Models::AIChatCreateParams - def create(params = {}) + def create(params) parsed, options = WhopSDK::AIChatCreateParams.dump_request(params) @client.request( method: :post, diff --git a/rbi/whop_sdk/models/ai_chat_create_params.rbi b/rbi/whop_sdk/models/ai_chat_create_params.rbi index 4877752..dc6e4e4 100644 --- a/rbi/whop_sdk/models/ai_chat_create_params.rbi +++ b/rbi/whop_sdk/models/ai_chat_create_params.rbi @@ -11,17 +11,47 @@ module WhopSDK T.any(WhopSDK::AIChatCreateParams, WhopSDK::Internal::AnyHash) end + # The text content of the first message sent in the chat + sig { returns(String) } + attr_accessor :message_text + + # The ID of the company to set as the current company in context for the AI chat + sig { returns(T.nilable(String)) } + attr_accessor :current_company_id + + # The IDs of existing uploaded attachments to include in the first message to the + # agent + sig do + returns( + T.nilable(T::Array[WhopSDK::AIChatCreateParams::MessageAttachment]) + ) + end + attr_accessor :message_attachments + # The title of the AI chat sig { returns(T.nilable(String)) } attr_accessor :title sig do params( + message_text: String, + current_company_id: T.nilable(String), + message_attachments: + T.nilable( + T::Array[WhopSDK::AIChatCreateParams::MessageAttachment::OrHash] + ), title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # The text content of the first message sent in the chat + message_text:, + # The ID of the company to set as the current company in context for the AI chat + current_company_id: nil, + # The IDs of existing uploaded attachments to include in the first message to the + # agent + message_attachments: nil, # The title of the AI chat title: nil, request_options: {} @@ -30,11 +60,46 @@ module WhopSDK sig do override.returns( - { title: T.nilable(String), request_options: WhopSDK::RequestOptions } + { + message_text: String, + current_company_id: T.nilable(String), + message_attachments: + T.nilable( + T::Array[WhopSDK::AIChatCreateParams::MessageAttachment] + ), + title: T.nilable(String), + request_options: WhopSDK::RequestOptions + } ) end def to_hash end + + class MessageAttachment < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::AIChatCreateParams::MessageAttachment, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of an existing file object. + sig { returns(String) } + attr_accessor :id + + # Input for an attachment + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID of an existing file object. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end end end end diff --git a/rbi/whop_sdk/resources/ai_chats.rbi b/rbi/whop_sdk/resources/ai_chats.rbi index d1d4521..0a9d0cb 100644 --- a/rbi/whop_sdk/resources/ai_chats.rbi +++ b/rbi/whop_sdk/resources/ai_chats.rbi @@ -10,11 +10,24 @@ module WhopSDK # - `ai_chat:create` sig do params( + message_text: String, + current_company_id: T.nilable(String), + message_attachments: + T.nilable( + T::Array[WhopSDK::AIChatCreateParams::MessageAttachment::OrHash] + ), title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AIChat) end def create( + # The text content of the first message sent in the chat + message_text:, + # The ID of the company to set as the current company in context for the AI chat + current_company_id: nil, + # The IDs of existing uploaded attachments to include in the first message to the + # agent + message_attachments: nil, # The title of the AI chat title: nil, request_options: {} diff --git a/sig/whop_sdk/models/ai_chat_create_params.rbs b/sig/whop_sdk/models/ai_chat_create_params.rbs index 2ee1a31..ed2fc9e 100644 --- a/sig/whop_sdk/models/ai_chat_create_params.rbs +++ b/sig/whop_sdk/models/ai_chat_create_params.rbs @@ -1,23 +1,51 @@ module WhopSDK module Models type ai_chat_create_params = - { title: String? } & WhopSDK::Internal::Type::request_parameters + { + message_text: String, + current_company_id: String?, + message_attachments: ::Array[WhopSDK::AIChatCreateParams::MessageAttachment]?, + title: String? + } + & WhopSDK::Internal::Type::request_parameters class AIChatCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + attr_accessor message_text: String + + attr_accessor current_company_id: String? + + attr_accessor message_attachments: ::Array[WhopSDK::AIChatCreateParams::MessageAttachment]? + attr_accessor title: String? def initialize: ( + message_text: String, + ?current_company_id: String?, + ?message_attachments: ::Array[WhopSDK::AIChatCreateParams::MessageAttachment]?, ?title: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { + message_text: String, + current_company_id: String?, + message_attachments: ::Array[WhopSDK::AIChatCreateParams::MessageAttachment]?, title: String?, request_options: WhopSDK::RequestOptions } + + type message_attachment = { id: String } + + class MessageAttachment < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end end end end diff --git a/sig/whop_sdk/resources/ai_chats.rbs b/sig/whop_sdk/resources/ai_chats.rbs index 5a324ef..8af2715 100644 --- a/sig/whop_sdk/resources/ai_chats.rbs +++ b/sig/whop_sdk/resources/ai_chats.rbs @@ -2,6 +2,9 @@ module WhopSDK module Resources class AIChats def create: ( + message_text: String, + ?current_company_id: String?, + ?message_attachments: ::Array[WhopSDK::AIChatCreateParams::MessageAttachment]?, ?title: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AIChat diff --git a/test/whop_sdk/resources/ai_chats_test.rb b/test/whop_sdk/resources/ai_chats_test.rb index 2d789d5..7f30ecb 100644 --- a/test/whop_sdk/resources/ai_chats_test.rb +++ b/test/whop_sdk/resources/ai_chats_test.rb @@ -3,10 +3,10 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::AIChatsTest < WhopSDK::Test::ResourceTest - def test_create + def test_create_required_params skip("Prism tests are disabled") - response = @whop.ai_chats.create + response = @whop.ai_chats.create(message_text: "message_text") assert_pattern do response => WhopSDK::AIChat From be694cff7f498f177f025c75292ce29c800c1658 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 15:31:35 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 +-- .../models/access_token_create_params.rb | 23 +++++++------ lib/whop_sdk/resources/access_tokens.rb | 18 +++++----- .../models/access_token_create_params.rbi | 34 ++++++++++--------- rbi/whop_sdk/resources/access_tokens.rbi | 27 ++++++++------- .../models/access_token_create_params.rbs | 16 ++++----- sig/whop_sdk/resources/access_tokens.rbs | 4 +-- test/whop_sdk/resources/access_tokens_test.rb | 4 +-- 8 files changed, 67 insertions(+), 63 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e452b7..bf703fa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c6ec2aa283e833b7fc1e98f6d4c8e9a4b1c0010e6dbad75d33f7d56abdd8bd2c.yml -openapi_spec_hash: ef503f4771f3e00ee5d092cc252184b2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-fca7a0ab5e2654e7367628fb8941aaa863c32cd84b42fb67cd4eecd18cecc7d4.yml +openapi_spec_hash: b49e2640fd7aacb9f1b4aba77018f13b config_hash: 48e5bec0f5659595abb38814aa0d9cc2 diff --git a/lib/whop_sdk/models/access_token_create_params.rb b/lib/whop_sdk/models/access_token_create_params.rb index 879ca4c..909c693 100644 --- a/lib/whop_sdk/models/access_token_create_params.rb +++ b/lib/whop_sdk/models/access_token_create_params.rb @@ -12,8 +12,8 @@ class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel # permission to access this Company, such as the being the company the API key # belongs to or a sub-merchant of it # - # @return [String] - required :company_id, String + # @return [String, nil] + optional :company_id, String, nil?: true # @!attribute expires_at # The expiration timestamp for the access token. If not provided, a default @@ -25,9 +25,10 @@ class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute scoped_actions # Array of desired scoped actions for the access token. If sent as an empty array - # or not provided, all permissions from the API key making the request will be - # available on the token. If sending an explicit list, they must be a subset of - # the API keys's existing permissions. Otherwise, an error will be raised. + # or not provided, all permissions from the authenticating credential (API key or + # OAuth token) will be available on the token. If sending an explicit list, they + # must be a subset of the credential's existing permissions. Otherwise, an error + # will be raised. # # @return [Array, nil] optional :scoped_actions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true @@ -36,21 +37,21 @@ class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel # The ID of the User to generate the token for. The API key must have permission # to access this User. # - # @return [String] - required :user_id, String + # @return [String, nil] + optional :user_id, String, nil?: true - # @!method initialize(company_id:, user_id:, expires_at: nil, scoped_actions: nil, request_options: {}) + # @!method initialize(company_id: nil, expires_at: nil, scoped_actions: nil, user_id: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccessTokenCreateParams} for more details. # - # @param company_id [String] The ID of the Company to generate the token for. The API key must have permissio - # - # @param user_id [String] The ID of the User to generate the token for. The API key must have permission t + # @param company_id [String, nil] The ID of the Company to generate the token for. The API key must have permissio # # @param expires_at [Time, nil] The expiration timestamp for the access token. If not provided, a default expira # # @param scoped_actions [Array, nil] Array of desired scoped actions for the access token. If sent as an empty array # + # @param user_id [String, nil] The ID of the User to generate the token for. The API key must have permission t + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/resources/access_tokens.rb b/lib/whop_sdk/resources/access_tokens.rb index 910c826..b4f08ce 100644 --- a/lib/whop_sdk/resources/access_tokens.rb +++ b/lib/whop_sdk/resources/access_tokens.rb @@ -6,27 +6,27 @@ class AccessTokens # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccessTokenCreateParams} for more details. # - # Create a short-lived access token to authenticate API requests on behalf of a - # Company or User. This token should be used with Whop's web and mobile embedded - # components. You must provide either a company_id or a user_id argument, but not - # both. + # Create a short-lived access token to authenticate API requests. When using API + # key authentication, provide company_id or user_id. When using OAuth + # authentication, the user is derived from the token. This token should be used + # with Whop's web and mobile embedded components. # - # @overload create(company_id:, user_id:, expires_at: nil, scoped_actions: nil, request_options: {}) + # @overload create(company_id: nil, expires_at: nil, scoped_actions: nil, user_id: nil, request_options: {}) # - # @param company_id [String] The ID of the Company to generate the token for. The API key must have permissio - # - # @param user_id [String] The ID of the User to generate the token for. The API key must have permission t + # @param company_id [String, nil] The ID of the Company to generate the token for. The API key must have permissio # # @param expires_at [Time, nil] The expiration timestamp for the access token. If not provided, a default expira # # @param scoped_actions [Array, nil] Array of desired scoped actions for the access token. If sent as an empty array # + # @param user_id [String, nil] The ID of the User to generate the token for. The API key must have permission t + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::AccessTokenCreateResponse] # # @see WhopSDK::Models::AccessTokenCreateParams - def create(params) + def create(params = {}) parsed, options = WhopSDK::AccessTokenCreateParams.dump_request(params) @client.request( method: :post, diff --git a/rbi/whop_sdk/models/access_token_create_params.rbi b/rbi/whop_sdk/models/access_token_create_params.rbi index fc1876d..331b207 100644 --- a/rbi/whop_sdk/models/access_token_create_params.rbi +++ b/rbi/whop_sdk/models/access_token_create_params.rbi @@ -14,7 +14,7 @@ module WhopSDK # The ID of the Company to generate the token for. The API key must have # permission to access this Company, such as the being the company the API key # belongs to or a sub-merchant of it - sig { returns(String) } + sig { returns(T.nilable(String)) } attr_accessor :company_id # The expiration timestamp for the access token. If not provided, a default @@ -24,23 +24,24 @@ module WhopSDK attr_accessor :expires_at # Array of desired scoped actions for the access token. If sent as an empty array - # or not provided, all permissions from the API key making the request will be - # available on the token. If sending an explicit list, they must be a subset of - # the API keys's existing permissions. Otherwise, an error will be raised. + # or not provided, all permissions from the authenticating credential (API key or + # OAuth token) will be available on the token. If sending an explicit list, they + # must be a subset of the credential's existing permissions. Otherwise, an error + # will be raised. sig { returns(T.nilable(T::Array[String])) } attr_accessor :scoped_actions # The ID of the User to generate the token for. The API key must have permission # to access this User. - sig { returns(String) } + sig { returns(T.nilable(String)) } attr_accessor :user_id sig do params( - company_id: String, - user_id: String, + company_id: T.nilable(String), expires_at: T.nilable(Time), scoped_actions: T.nilable(T::Array[String]), + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -48,19 +49,20 @@ module WhopSDK # The ID of the Company to generate the token for. The API key must have # permission to access this Company, such as the being the company the API key # belongs to or a sub-merchant of it - company_id:, - # The ID of the User to generate the token for. The API key must have permission - # to access this User. - user_id:, + company_id: nil, # The expiration timestamp for the access token. If not provided, a default # expiration time of 1 hour will be used. The expiration can be set to a maximum # of 3 hours from the current time. expires_at: nil, # Array of desired scoped actions for the access token. If sent as an empty array - # or not provided, all permissions from the API key making the request will be - # available on the token. If sending an explicit list, they must be a subset of - # the API keys's existing permissions. Otherwise, an error will be raised. + # or not provided, all permissions from the authenticating credential (API key or + # OAuth token) will be available on the token. If sending an explicit list, they + # must be a subset of the credential's existing permissions. Otherwise, an error + # will be raised. scoped_actions: nil, + # The ID of the User to generate the token for. The API key must have permission + # to access this User. + user_id: nil, request_options: {} ) end @@ -68,10 +70,10 @@ module WhopSDK sig do override.returns( { - company_id: String, + company_id: T.nilable(String), expires_at: T.nilable(Time), scoped_actions: T.nilable(T::Array[String]), - user_id: String, + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/resources/access_tokens.rbi b/rbi/whop_sdk/resources/access_tokens.rbi index c14b9df..8836a23 100644 --- a/rbi/whop_sdk/resources/access_tokens.rbi +++ b/rbi/whop_sdk/resources/access_tokens.rbi @@ -3,16 +3,16 @@ module WhopSDK module Resources class AccessTokens - # Create a short-lived access token to authenticate API requests on behalf of a - # Company or User. This token should be used with Whop's web and mobile embedded - # components. You must provide either a company_id or a user_id argument, but not - # both. + # Create a short-lived access token to authenticate API requests. When using API + # key authentication, provide company_id or user_id. When using OAuth + # authentication, the user is derived from the token. This token should be used + # with Whop's web and mobile embedded components. sig do params( - company_id: String, - user_id: String, + company_id: T.nilable(String), expires_at: T.nilable(Time), scoped_actions: T.nilable(T::Array[String]), + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::AccessTokenCreateResponse) end @@ -20,19 +20,20 @@ module WhopSDK # The ID of the Company to generate the token for. The API key must have # permission to access this Company, such as the being the company the API key # belongs to or a sub-merchant of it - company_id:, - # The ID of the User to generate the token for. The API key must have permission - # to access this User. - user_id:, + company_id: nil, # The expiration timestamp for the access token. If not provided, a default # expiration time of 1 hour will be used. The expiration can be set to a maximum # of 3 hours from the current time. expires_at: nil, # Array of desired scoped actions for the access token. If sent as an empty array - # or not provided, all permissions from the API key making the request will be - # available on the token. If sending an explicit list, they must be a subset of - # the API keys's existing permissions. Otherwise, an error will be raised. + # or not provided, all permissions from the authenticating credential (API key or + # OAuth token) will be available on the token. If sending an explicit list, they + # must be a subset of the credential's existing permissions. Otherwise, an error + # will be raised. scoped_actions: nil, + # The ID of the User to generate the token for. The API key must have permission + # to access this User. + user_id: nil, request_options: {} ) end diff --git a/sig/whop_sdk/models/access_token_create_params.rbs b/sig/whop_sdk/models/access_token_create_params.rbs index e4abd70..eb12831 100644 --- a/sig/whop_sdk/models/access_token_create_params.rbs +++ b/sig/whop_sdk/models/access_token_create_params.rbs @@ -2,10 +2,10 @@ module WhopSDK module Models type access_token_create_params = { - company_id: String, + company_id: String?, expires_at: Time?, scoped_actions: ::Array[String]?, - user_id: String + user_id: String? } & WhopSDK::Internal::Type::request_parameters @@ -13,27 +13,27 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor company_id: String + attr_accessor company_id: String? attr_accessor expires_at: Time? attr_accessor scoped_actions: ::Array[String]? - attr_accessor user_id: String + attr_accessor user_id: String? def initialize: ( - company_id: String, - user_id: String, + ?company_id: String?, ?expires_at: Time?, ?scoped_actions: ::Array[String]?, + ?user_id: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - company_id: String, + company_id: String?, expires_at: Time?, scoped_actions: ::Array[String]?, - user_id: String, + user_id: String?, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/resources/access_tokens.rbs b/sig/whop_sdk/resources/access_tokens.rbs index 44c0b3d..fd823b7 100644 --- a/sig/whop_sdk/resources/access_tokens.rbs +++ b/sig/whop_sdk/resources/access_tokens.rbs @@ -2,10 +2,10 @@ module WhopSDK module Resources class AccessTokens def create: ( - company_id: String, - user_id: String, + ?company_id: String?, ?expires_at: Time?, ?scoped_actions: ::Array[String]?, + ?user_id: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::AccessTokenCreateResponse diff --git a/test/whop_sdk/resources/access_tokens_test.rb b/test/whop_sdk/resources/access_tokens_test.rb index feefb4f..b0a2ec8 100644 --- a/test/whop_sdk/resources/access_tokens_test.rb +++ b/test/whop_sdk/resources/access_tokens_test.rb @@ -3,10 +3,10 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::AccessTokensTest < WhopSDK::Test::ResourceTest - def test_create_required_params + def test_create skip("Prism tests are disabled") - response = @whop.access_tokens.create(company_id: "biz_xxxxxxxxxxxxxx") + response = @whop.access_tokens.create assert_pattern do response => WhopSDK::Models::AccessTokenCreateResponse From 32441bff9dd037424c7e93be807c3e73250f5b78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 04:31:00 +0000 Subject: [PATCH 5/6] feat(api): api update --- .stats.yml | 4 ++-- lib/whop_sdk/models/card_brands.rb | 2 ++ rbi/whop_sdk/models/card_brands.rbi | 3 +++ sig/whop_sdk/models/card_brands.rbs | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bf703fa..5263715 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-fca7a0ab5e2654e7367628fb8941aaa863c32cd84b42fb67cd4eecd18cecc7d4.yml -openapi_spec_hash: b49e2640fd7aacb9f1b4aba77018f13b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-247b88b976ba875cb5f95779d2880a9d3c2939e22d8b7aac57d4fdb763c604f8.yml +openapi_spec_hash: 10f56de09042048ccff87bd2ecda6a75 config_hash: 48e5bec0f5659595abb38814aa0d9cc2 diff --git a/lib/whop_sdk/models/card_brands.rb b/lib/whop_sdk/models/card_brands.rb index 6a0f704..3c85282 100644 --- a/lib/whop_sdk/models/card_brands.rb +++ b/lib/whop_sdk/models/card_brands.rb @@ -38,6 +38,8 @@ module CardBrands FUEL_CARD = :fuel_card DANKORT = :dankort CARNET = :carnet + ATM_CARD = :atm_card + CHINA_UNION_PAYUZCARD = :china_union_payuzcard UNKNOWN = :unknown # @!method self.values diff --git a/rbi/whop_sdk/models/card_brands.rbi b/rbi/whop_sdk/models/card_brands.rbi index c0fec0c..e80796e 100644 --- a/rbi/whop_sdk/models/card_brands.rbi +++ b/rbi/whop_sdk/models/card_brands.rbi @@ -43,6 +43,9 @@ module WhopSDK FUEL_CARD = T.let(:fuel_card, WhopSDK::CardBrands::TaggedSymbol) DANKORT = T.let(:dankort, WhopSDK::CardBrands::TaggedSymbol) CARNET = T.let(:carnet, WhopSDK::CardBrands::TaggedSymbol) + ATM_CARD = T.let(:atm_card, WhopSDK::CardBrands::TaggedSymbol) + CHINA_UNION_PAYUZCARD = + T.let(:china_union_payuzcard, WhopSDK::CardBrands::TaggedSymbol) UNKNOWN = T.let(:unknown, WhopSDK::CardBrands::TaggedSymbol) sig { override.returns(T::Array[WhopSDK::CardBrands::TaggedSymbol]) } diff --git a/sig/whop_sdk/models/card_brands.rbs b/sig/whop_sdk/models/card_brands.rbs index 9d91563..d1dc70a 100644 --- a/sig/whop_sdk/models/card_brands.rbs +++ b/sig/whop_sdk/models/card_brands.rbs @@ -33,6 +33,8 @@ module WhopSDK | :fuel_card | :dankort | :carnet + | :atm_card + | :china_union_payuzcard | :unknown module CardBrands @@ -70,6 +72,8 @@ module WhopSDK FUEL_CARD: :fuel_card DANKORT: :dankort CARNET: :carnet + ATM_CARD: :atm_card + CHINA_UNION_PAYUZCARD: :china_union_payuzcard UNKNOWN: :unknown def self?.values: -> ::Array[WhopSDK::Models::card_brands] From 5e93b0eef292f1dc266f7387f77d6e104d425bd3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 04:31:19 +0000 Subject: [PATCH 6/6] release: 0.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/whop_sdk/version.rb | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de46504..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.26" + ".": "0.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e443cc3..f491505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.1.0 (2026-02-06) + +Full Changelog: [v0.0.26...v0.1.0](https://github.com/whopio/whopsdk-ruby/compare/v0.0.26...v0.1.0) + +### Features + +* **api:** api update ([32441bf](https://github.com/whopio/whopsdk-ruby/commit/32441bff9dd037424c7e93be807c3e73250f5b78)) +* **api:** api update ([be694cf](https://github.com/whopio/whopsdk-ruby/commit/be694cff7f498f177f025c75292ce29c800c1658)) +* **api:** api update ([3bdf111](https://github.com/whopio/whopsdk-ruby/commit/3bdf1117e8b6b434b77713fcf534dd112c743ff1)) +* **api:** api update ([71cfae3](https://github.com/whopio/whopsdk-ruby/commit/71cfae32a386c17a95fd5d82a24ae70ec7f5417d)) + + +### Chores + +* **docs:** remove www prefix ([d581cb1](https://github.com/whopio/whopsdk-ruby/commit/d581cb174e297c951ac30d0790d48d6a53c046e4)) + ## 0.0.26 (2026-02-03) Full Changelog: [v0.0.25...v0.0.26](https://github.com/whopio/whopsdk-ruby/compare/v0.0.25...v0.0.26) diff --git a/Gemfile.lock b/Gemfile.lock index 49b4488..160a43a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.26) + whop_sdk (0.1.0) cgi connection_pool jwt diff --git a/README.md b/README.md index e5bd38b..ba1cf81 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "whop_sdk", "~> 0.0.26" +gem "whop_sdk", "~> 0.1.0" ``` diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index 4adb604..dbfd179 100644 --- a/lib/whop_sdk/version.rb +++ b/lib/whop_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WhopSDK - VERSION = "0.0.26" + VERSION = "0.1.0" end