From 134f289802ce7b9fd8f96712a3c7c9cc32cee9ee Mon Sep 17 00:00:00 2001 From: citin Date: Tue, 22 Oct 2024 13:20:14 +1300 Subject: [PATCH] Adds Storefront API endpoints --- .../services/storefront/newsletter_target.rb | 66 +++++ .../services/storefront/script_tag.rb | 63 ++++- .../storefront/newsletter_target_spec.rb | 48 ++++ .../services/storefront/script_tag_spec.rb | 18 ++ ...rns_the_details_of_a_newsletter_target.yml | 124 +++++++++ .../creates_a_new_newsletter_target.yml | 180 +++++++++++++ .../_delete/deletes_a_newsletter_target.yml | 240 +++++++++++++++++ .../_show/returns_a_newsletter_target.yml | 242 +++++++++++++++++ .../_update/updates_a_newsletter_target.yml | 242 +++++++++++++++++ .../_show/returns_a_script_tag.yml | 246 ++++++++++++++++++ .../_show_details/returns_a_script_tag.yml | 182 +++++++++++++ .../_update/updates_a_script_tag.yml | 246 ++++++++++++++++++ 12 files changed, 1896 insertions(+), 1 deletion(-) create mode 100644 lib/beyond_api/services/storefront/newsletter_target.rb create mode 100644 spec/beyond_api/services/storefront/newsletter_target_spec.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/_show/returns_the_details_of_a_newsletter_target.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_create/creates_a_new_newsletter_target.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_delete/deletes_a_newsletter_target.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_show/returns_a_newsletter_target.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_update/updates_a_newsletter_target.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show/returns_a_script_tag.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show_details/returns_a_script_tag.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_update/updates_a_script_tag.yml diff --git a/lib/beyond_api/services/storefront/newsletter_target.rb b/lib/beyond_api/services/storefront/newsletter_target.rb new file mode 100644 index 0000000..bf25132 --- /dev/null +++ b/lib/beyond_api/services/storefront/newsletter_target.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module BeyondApi + module Storefront + # @example How to instantiate a client + # @client = BeyondApi::Storefront::NewsletterTarget.new(api_url: 'https://example.com/api', access_token: 'your_token') + class NewsletterTarget < BaseService + # Retrieve the details of a newsletter target. + # + # @see https://developer.epages.com/beyond-docs/#show_newsletter_target_details + # + # @param id [String] The newsletter target id. + # + # @return [Hash] + # + # @example + # newsletter_target = @client.show('id') + def show(id) + get("newsletter-target/#{id}") + end + + # Create a newsletter target. + # + # @see https://developer.epages.com/beyond-docs/#create_newsletter_target + # + # @param submit_url [String] The URL stating where to submit the newsletter form to. + # + # @return [Hash] + # + # @example + # newsletter_target = @client.create('https://example.com/cgi-bin/subscribe.php') + def create(submit_url) + post('newsletter-target', submit_url:) + end + + # Update a newsletter target. + # + # @see https://developer.epages.com/beyond-docs/#update_newsletter_target + # + # @param id [String] The newsletter target id. + # @param submit_url [String] The URL stating where to submit the newsletter form to. + # + # @return [Hash] + # + # @example + # newsletter_target = @client.update('id', 'https://example.com/cgi-bin/otherSubscribe.php') + def update(id, submit_url) + put("newsletter-target/#{id}", submit_url:) + end + + # Delete a newsletter target. + # + # @see https://developer.epages.com/beyond-docs/#delete_newsletter_target + # + # @param id [String] The newsletter target id. + # + # @return [Hash] + # + # @example + # newsletter_target = @client.delete('id') + def delete(id) + super("newsletter-target/#{id}") + end + end + end +end diff --git a/lib/beyond_api/services/storefront/script_tag.rb b/lib/beyond_api/services/storefront/script_tag.rb index d101d7e..17bc6e2 100644 --- a/lib/beyond_api/services/storefront/script_tag.rb +++ b/lib/beyond_api/services/storefront/script_tag.rb @@ -5,18 +5,79 @@ module Storefront # @example How to instantiate a client # @client = BeyondApi::Storefront::ScriptTag.new(api_url: 'https://example.com/api', access_token: 'your_token') class ScriptTag < BaseService + # Retrieve all script tags. + # + # @see https://developer.epages.com/beyond-docs/#list_script_tags + # + # @param params [Hash] A customizable set of options. + # @option params [Boolean] :only_own If set to true, only the script tags created by the client will be returned. + # + # @return [Hash] + # + # @example + # script_tags = @client.all + # script_tags = @client.all(only_own: true) def all(params = {}) params.merge!(client_id: BeyondApi.configuration.client_id) if params[:only_own] get('script-tags', params) end + # Retrieve the details of a script tag. + # + # @see https://developer.epages.com/beyond-docs/#show_script_tag_details + # + # @param id [String] The script tag id. + # + # @return [Hash] + # + # @example + # script_tag = @client.show('id') + def show(id) + get("script-tags/#{id}") + end + + # Create a script tag. + # + # @see https://developer.epages.com/beyond-docs/#create_script_tag + # + # @param script_url [String] The URL of the script. + # + # @return [Hash] + # + # @example + # script_tag = @client.create('https://example.com/scripts/exampleScript.js') def create(script_url) post('script-tags', script_url:) end + # Update a script tag. + # + # @see https://developer.epages.com/beyond-docs/#update_script_tag + # + # @param id [String] The script tag id. + # @param script_url [String] The URL of the script. + # + # @return [Hash] + # + # @example + # script_tag = @client.update('id', 'https://example.com/scripts/otherExampleScript.js') + def update(id, script_url) + put("script-tags/#{id}", script_url:) + end + + # Delete a script tag. + # + # @see https://developer.epages.com/beyond-docs/#delete_script_tag + # + # @param id [String] The script tag id. + # + # @return [Hash] + # + # @example + # script_tag = @client.delete('id') def delete(id) - super("script-tags/#{id}") # Concerns::Connection delete method + super("script-tags/#{id}") end end end diff --git a/spec/beyond_api/services/storefront/newsletter_target_spec.rb b/spec/beyond_api/services/storefront/newsletter_target_spec.rb new file mode 100644 index 0000000..3110229 --- /dev/null +++ b/spec/beyond_api/services/storefront/newsletter_target_spec.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Storefront::NewsletterTarget, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + context 'with newsletter target' do + before(:each) do + @newsletter_target = client.create('https://example.com/cgi-bin/subscribe.php') + end + + describe '.create' do + it 'creates a new newsletter target' do + expect(@newsletter_target).not_to be nil + expect(@newsletter_target[:submit_url]).to eq('https://example.com/cgi-bin/subscribe.php') + end + end + + describe '.delete' do + it 'deletes a newsletter target' do + response = client.delete(@newsletter_target[:id]) + expect(response).to eq({}) + end + end + + describe '.show' do + it 'returns a newsletter target' do + response = client.show(@newsletter_target[:id]) + + expect(response).not_to be nil + expect(response[:submit_url]).to eq('https://example.com/cgi-bin/subscribe.php') + end + end + + describe '.update' do + it 'updates a newsletter target' do + response = client.update(@newsletter_target[:id], 'https://example.com/cgi-bin/otherSubscribe.php') + + expect(response).not_to be nil + expect(response[:submit_url]).to eq('https://example.com/cgi-bin/otherSubscribe.php') + end + end + + after(:each) do + client.delete(@newsletter_target[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/storefront/script_tag_spec.rb b/spec/beyond_api/services/storefront/script_tag_spec.rb index 36b497f..a17c77e 100644 --- a/spec/beyond_api/services/storefront/script_tag_spec.rb +++ b/spec/beyond_api/services/storefront/script_tag_spec.rb @@ -32,6 +32,24 @@ end end + describe '.show' do + it 'returns a script tag' do + response = client.show(@script_tag[:id]) + + expect(response).not_to be nil + expect(response[:script_url]).to eq('https://example.com/scripts/exampleScript.js') + end + end + + describe '.update' do + it 'updates a script tag' do + response = client.update(@script_tag[:id], 'https://example.com/scripts/exampleScriptUpdated.js') + + expect(response).not_to be nil + expect(response[:script_url]).to eq('https://example.com/scripts/exampleScriptUpdated.js') + end + end + after(:each) do client.delete(@script_tag[:id]) rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/_show/returns_the_details_of_a_newsletter_target.yml b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/_show/returns_the_details_of_a_newsletter_target.yml new file mode 100644 index 0000000..bad5547 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/_show/returns_the_details_of_a_newsletter_target.yml @@ -0,0 +1,124 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:34:48 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.070' + X-B3-Traceid: + - f276e1ca1639877c25b041aa0c5252c2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729553688, + "jti" : "jqZopeIqsJQL+Ma0i0KoAPGeNVM=" + } + recorded_at: Mon, 21 Oct 2024 23:34:48 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/some_id + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 21 Oct 2024 23:34:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Pragma: + - no-cache + X-Frame-Options: + - DENY + Cache-Control: + - must-revalidate,no-cache,no-store + Server: + - epages-beyond + X-Request-Time: + - '0.429' + X-B3-Traceid: + - c09bc65858f6bc34073fcee59e57a403 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "timestamp" : "2024-10-21T23:34:49.292+00:00", + "status" : 404, + "error" : "Not Found", + "path" : "/newsletter-target/some_id" + } + recorded_at: Mon, 21 Oct 2024 23:34:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_create/creates_a_new_newsletter_target.yml b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_create/creates_a_new_newsletter_target.yml new file mode 100644 index 0000000..2ea8aa4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_create/creates_a_new_newsletter_target.yml @@ -0,0 +1,180 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:34:50 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.079' + X-B3-Traceid: + - 92c183a19d45b85e2e962697c820a626 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729553690, + "jti" : "naeZtAYXhKEhJoT3IvfPIVq+2jg=" + } + recorded_at: Mon, 21 Oct 2024 23:34:50 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + body: + encoding: UTF-8 + string: '{"submitUrl":"https://example.com/cgi-bin/subscribe.php"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:34:51 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.154' + X-B3-Traceid: + - d001262204d99ccdd0e7adc3b58fef06 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/subscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:34:51 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:34:52 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - f5c4dd9388bab35ead1ba51b9618f922 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:34:52 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_delete/deletes_a_newsletter_target.yml b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_delete/deletes_a_newsletter_target.yml new file mode 100644 index 0000000..2c9d1e3 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_delete/deletes_a_newsletter_target.yml @@ -0,0 +1,240 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:34:53 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.077' + X-B3-Traceid: + - 78710f26f68b12bf1690057d5c59b6b2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729553693, + "jti" : "qSrK5klxBbkvBdnkl6gmgVkkvq8=" + } + recorded_at: Mon, 21 Oct 2024 23:34:53 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + body: + encoding: UTF-8 + string: '{"submitUrl":"https://example.com/cgi-bin/subscribe.php"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:34:54 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.113' + X-B3-Traceid: + - cd3ba6f0f52ad9c393ecd6b8f33dc637 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/subscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:34:54 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:34:55 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.024' + X-B3-Traceid: + - 83b1d73d2fb0b4b85aff22f2b3579056 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:34:55 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 21 Oct 2024 23:34:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.016' + X-B3-Traceid: + - 8867204677a83e35399b29e1f109c82b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "newsletter-target.not-found", + "details" : { }, + "message" : "No newsletter-target could be found for this shop", + "traceId" : "8867204677a83e35399b29e1f109c82b" + } + recorded_at: Mon, 21 Oct 2024 23:34:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_show/returns_a_newsletter_target.yml b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_show/returns_a_newsletter_target.yml new file mode 100644 index 0000000..5f203fd --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_show/returns_a_newsletter_target.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:34:57 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.072' + X-B3-Traceid: + - 49305afda59af13eb233fb9ade9230ba + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729553697, + "jti" : "e7i8dSJ2T1mt3aP5v928xk9PvZM=" + } + recorded_at: Mon, 21 Oct 2024 23:34:57 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + body: + encoding: UTF-8 + string: '{"submitUrl":"https://example.com/cgi-bin/subscribe.php"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:34:58 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - a655c32f6bff46cec95d9c6bed8cb4d6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/subscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:34:58 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:34:59 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.022' + X-B3-Traceid: + - 97342d45b48e9cc482773a837e96036c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/subscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:34:59 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:35:00 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.024' + X-B3-Traceid: + - b1268807acf3bae98f35713c51f4ae69 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:35:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_update/updates_a_newsletter_target.yml b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_update/updates_a_newsletter_target.yml new file mode 100644 index 0000000..39f186f --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_NewsletterTarget/with_newsletter_target/_update/updates_a_newsletter_target.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:35:01 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.148' + X-B3-Traceid: + - 8b049b22a648fe2a200a009405f8a6c9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729553701, + "jti" : "6xqdY5nSUU6oxNtccV+N8tlA0sg=" + } + recorded_at: Mon, 21 Oct 2024 23:35:01 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + body: + encoding: UTF-8 + string: '{"submitUrl":"https://example.com/cgi-bin/subscribe.php"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:35:02 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/newsletter-target + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.027' + X-B3-Traceid: + - 7c299073ff6230f8d19fb84476ce8aa8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/subscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:35:02 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: UTF-8 + string: '{"submitUrl":"https://example.com/cgi-bin/otherSubscribe.php"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:35:03 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - 9c9a1490eb464a074dcf8c1a2de4a5e4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "submitUrl" : "https://example.com/cgi-bin/otherSubscribe.php", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/newsletter-target" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:35:03 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/newsletter-target/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:35:04 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - ff66894ed7519b8b541c4dd72f0e19d6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:35:04 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show/returns_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show/returns_a_script_tag.yml new file mode 100644 index 0000000..84b5a69 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show/returns_a_script_tag.yml @@ -0,0 +1,246 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:11:09 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.078' + X-B3-Traceid: + - 8a34988dbbcaac92a456c58f0ea6cb9e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729552269, + "jti" : "WAmO7n/1uju6aoF/0uoJUGKqhMk=" + } + recorded_at: Mon, 21 Oct 2024 23:11:09 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:11:10 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.032' + X-B3-Traceid: + - 1934a7b7033f5189cd6a2d117f9db991 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:11:11 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:11:11 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - 93cb0d73f502f11a9cb9224dcf51324f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:11:11 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/45ad8616-b7c4-4aeb-bf2a-9ae9124a5aa5 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:11:12 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - 6eeb6adf2ba5db6e0775fe47ca3847e3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:11:13 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show_details/returns_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show_details/returns_a_script_tag.yml new file mode 100644 index 0000000..a6343b2 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_show_details/returns_a_script_tag.yml @@ -0,0 +1,182 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:10:44 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 873050b8666b97dfe4aae56cc21c4a87 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729552244, + "jti" : "G3jSQ0RkRKNhE8rkr4fWI3S2zTA=" + } + recorded_at: Mon, 21 Oct 2024 23:10:44 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:10:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/9f9cc6b0-44af-4c09-a935-cefe87b93548 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - 666d5aa090b1bbcb46ab58472efc9e74 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "9f9cc6b0-44af-4c09-a935-cefe87b93548", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/9f9cc6b0-44af-4c09-a935-cefe87b93548" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:10:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/9f9cc6b0-44af-4c09-a935-cefe87b93548 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:10:46 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.031' + X-B3-Traceid: + - 57e10b4a0bee574bf9735e033fb58623 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:10:46 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_update/updates_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_update/updates_a_script_tag.yml new file mode 100644 index 0000000..ffa8089 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_update/updates_a_script_tag.yml @@ -0,0 +1,246 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:10:47 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.114' + X-B3-Traceid: + - 9194634454ac5d031c79fe10c2e76073 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1729552247, + "jti" : "BytQ3hljnpKedVkFKGHcR2luzWs=" + } + recorded_at: Mon, 21 Oct 2024 23:10:47 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 21 Oct 2024 23:10:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.057' + X-B3-Traceid: + - '097d391b8f846bbc282f7a0ce069f345' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:10:48 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5 + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScriptUpdated.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 21 Oct 2024 23:10:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - 6df638913fdcd0dedf6f72fcf29af197 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScriptUpdated.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5" + } + } + } + recorded_at: Mon, 21 Oct 2024 23:10:49 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/06a30a58-6a6a-40c8-8e8e-fd0d6d85b7e5 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 21 Oct 2024 23:10:50 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.028' + X-B3-Traceid: + - 502efd9cd56eaa99a15ddad2469b683b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 21 Oct 2024 23:10:50 GMT +recorded_with: VCR 6.2.0