diff --git a/lib/beyond_api/concerns/connection.rb b/lib/beyond_api/concerns/connection.rb index 9109a51..7581096 100644 --- a/lib/beyond_api/concerns/connection.rb +++ b/lib/beyond_api/concerns/connection.rb @@ -32,10 +32,10 @@ def delete(path, params = {}) handle_request { agent.delete(path, parse_request(params)) } end - def upload_file(path, file_path, params = {}) + def upload_file(path, file_path, content_type, params = {}) handle_request do agent.post(path) do |request| - request.headers['Content-Type'] = Utils.file_content_type(file_path) + request.headers['Content-Type'] = content_type request.params = parse_request(params) request.body = File.binread(file_path) end diff --git a/lib/beyond_api/services/product_management/image.rb b/lib/beyond_api/services/product_management/image.rb index 94360a9..b681d9f 100644 --- a/lib/beyond_api/services/product_management/image.rb +++ b/lib/beyond_api/services/product_management/image.rb @@ -25,16 +25,19 @@ def all(id, params = {}) # # @see https://developer.epages.com/beyond-docs/#upload_product_image # - # @param id [String] the product UUID - # @param id [String] the image path - # @param id [String] the image file name + # @param product_id [String] the product UUID + # @param image_path [String] the image path + # @param image_name [String] the image file name # # @return [Hash] # # @example - # client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', '/home/epages/file.png', 'file.png') + # @client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', '/home/epages/file.png', 'file.png') def upload(product_id, image_path, image_name) - upload_file("products/#{product_id}/images", image_path, file_name: image_name) + upload_file("products/#{product_id}/images", + image_path, + Utils.file_content_type(image_path), + file_name: image_name) end # Upload up to 10 images and add them to a product. The body of the request must contain the content of the images. @@ -51,7 +54,7 @@ def upload(product_id, image_path, image_name) # @example # image_paths = ['/home/epages/file1.png', '/home/epages/file2.png'] # image_names = ['file1.png', 'file2.png'] - # client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', image_paths, image_names) + # @client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', image_paths, image_names) def upload_multiple(product_id, image_paths, image_names) upload_files("products/#{product_id}/images", { image: Utils.faraday_file_parts(image_paths) }, # body diff --git a/lib/beyond_api/services/shop/attribute.rb b/lib/beyond_api/services/shop/attribute.rb new file mode 100644 index 0000000..2070a77 --- /dev/null +++ b/lib/beyond_api/services/shop/attribute.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Attribute.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Attribute < BaseService + # Create a shop attribute. + # + # @see https://developer.epages.com/beyond-docs/#create_shop_attribute + # + # @param name [String] the attribute name + # @param value [String] the attribute value + # @param public [Boolean] flag to indicate if the attribute is public + # + # @return [Hash] + # + # @example + # @client.create('createSku', 'autogenerateSku', true) + def create(name, value, public) + post('shop/attributes', { name:, value:, public: }) + end + + # List of all shop attributes. + # + # @see https://developer.epages.com/beyond-docs/#list_shop_attributes + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/attributes', params) + end + + # Retrieve a particular shop attribute by its name. + # + # @see https://developer.epages.com/beyond-docs/#show_shop_attribute_details + # + # @param name [String] the attribute name + # + # @return [Hash] + # + # @example + # @client.find('createSku') + def find(name) + get("shop/attributes/#{name}") + end + + # Update a shop attribute. This operation is idempotent and will create a new shop attribute if required. + # + # @see https://developer.epages.com/beyond-docs/#update_shop_attribute + # + # @param name [String] the attribute name + # @param value [String] the attribute value + # @param public [Boolean] flag to indicate if the attribute is public + # + # @return [Hash] + # + # @example + # @client.update('createSku', 'autogenerateSku', false) + def update(name, value, public) + put("shop/attributes/#{name}", { value:, public: }) + end + + # Delete a shop attribute. + # + # @see https://developer.epages.com/beyond-docs/#delete_shop_attribute + # + # @param name [String] the attribute name + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('createSku') + def delete(name) + super("shop/attributes/#{name}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/image.rb b/lib/beyond_api/services/shop/image.rb new file mode 100644 index 0000000..c4d4c32 --- /dev/null +++ b/lib/beyond_api/services/shop/image.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Image.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Image < BaseService + # Create a shop image. + # + # @see https://developer.epages.com/beyond-docs/#create_shop_image + # + # @param body [String] the request body + # + # @return [Hash] + # + # @example + # @client.create(data_uri: 'file.png?hash=212-2323-4343', width: 250, height: 300, label: 'logo') + def create(body) + post('shop/images', body) + end + + # Retrieve the images of a shop. + # + # @see https://developer.epages.com/beyond-docs/#list_shop_images + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/images', params) + end + + # Search for shop images by label. + # + # @see https://developer.epages.com/beyond-docs/#find_shop_images_by_label + # + # @param label [String] the label to search for + # + # @return [Hash] + # + # @example + # @client.find_by_label('logo') + def find_by_label(label) + get('shop/images/search/find-by-label', label:) + end + + # Retrieve a single shop image. + # + # @see https://developer.epages.com/beyond-docs/#show_shop_image_details + # + # @param id [String] the image UUID + # + # @return [Hash] + # + # @example + # @client.find('de5eaacf-8e85-46cf-8bea-d629e52cf987') + def find(id) + get("shop/images/#{id}") + end + + # Upload a shop image. The request body must contain the content of the shop image. The maximum image size for shop images is 8 MB. + # + # @see https://developer.epages.com/beyond-docs/#upload_shop_image + # + # @param image_path [String] the image path + # @param image_name [String] the image file name + # @param label [String] the image label + # + # @return [Hash] + # + # @example + # @client.upload('/home/epages/file.png', 'file.png', 'logo') + def upload(image_path, image_name, label) + upload_file('shop/images', + image_path, + 'multipart/form-data', + { file_name: image_name, label: }) + end + + # Delete a shop image. + # + # @see https://developer.epages.com/beyond-docs/#delete_shop_image + # + # @param id [String] the image UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('ec535cb3-3155-4c8f-b3cc-2bb94db7c530') + def delete(id) + super("shop/images/#{id}") + end + end + end +end diff --git a/spec/beyond_api/services/shop/attribute_spec.rb b/spec/beyond_api/services/shop/attribute_spec.rb new file mode 100644 index 0000000..43366ab --- /dev/null +++ b/spec/beyond_api/services/shop/attribute_spec.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Attribute, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop attributes' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :attributes)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with shop attribute' do + before(:each) do + @shop_attribute = client.create('createSku', 'autogenerateSku', true) + end + + describe '.create' do + it 'creates a new shop attribute' do + expect(@shop_attribute).not_to be nil + expect(@shop_attribute[:name]).to eq('createSku') + expect(@shop_attribute[:value]).to eq('autogenerateSku') + expect(@shop_attribute[:public]).to eq(true) + end + end + + describe '.find' do + it 'returns a shop attribute' do + response = client.find('createSku') + expect(response[:value]).to eq('autogenerateSku') + end + end + + describe '.update' do + it 'updates an existing shop attribute' do + response = client.update('createSku', 'autogenerateSku', false) + expect(response).not_to be nil + expect(response[:name]).to eq('createSku') + expect(response[:value]).to eq('autogenerateSku') + expect(response[:public]).to eq(false) + end + end + + describe '.delete' do + it 'deletes a shop attribute' do + expect(client.delete('createSku')).to eq({}) + end + end + + after(:each) do + client.delete('createSku') + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/shop/image_spec.rb b/spec/beyond_api/services/shop/image_spec.rb new file mode 100644 index 0000000..2249447 --- /dev/null +++ b/spec/beyond_api/services/shop/image_spec.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Image, vcr: { match_requests_on: [:method, :uri] } do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop images' do + response = client.all + puts response.dig(:embedded, :images).first[:id] + + expect(response).not_to be nil + puts response.dig(:embedded, :images) + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + describe '.find_by_label' do + it 'finds a shop image by label' do + response = client.find_by_label('logo') + + expect(response).not_to be nil + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + end + end + + context 'with a shop image' do + before(:each) do + @image = client.upload('spec/files/image1.png', 'new-image.png', 'logo') + end + + describe '.upload' do + it 'uploads an image' do + expect(@image).not_to be nil + expect(@image.dig(:links, :data, :href)).to include('new-image.png') + end + end + + describe '.find' do + it 'finds a shop image' do + response = client.find(@image[:id]) + + expect(response).not_to be nil + expect(response[:id]).to eq(@image[:id]) + end + end + + describe '.delete' do + it 'deletes a shop image' do + expect(client.delete(@image[:id])).to eq({}) + end + end + + after(:each) do + client.delete(@image[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml new file mode 100644 index 0000000..d55f7c6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml @@ -0,0 +1,150 @@ +--- +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, 07 Oct 2024 13:26:25 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.119' + X-B3-Traceid: + - 8061fb12abaaaed969b01e87ebb70d3f + 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" : 1728307585, + "jti" : "S2OvWnGiX3IS8Vy8xozQLNpT0Vw=" + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + 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, 07 Oct 2024 13:26:25 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.207' + X-B3-Traceid: + - 193217d6206c887afd0b7124e2cf54a8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "attributes" : [ { + "name" : "ecommerce:disabled", + "value" : "true", + "public" : true, + "readOnly" : true, + "owner" : "cockpit", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/ecommerce:disabled" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml new file mode 100644 index 0000000..c3436f7 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml @@ -0,0 +1,187 @@ +--- +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, 07 Oct 2024 13:26:25 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.112' + X-B3-Traceid: + - 21a8957760d94780732768d41a857dc0 + 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" : 1728307585, + "jti" : "yWoz0EMkisjH/6gDxvfSlCLDeS4=" + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + 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, 07 Oct 2024 13:26:26 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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.208' + X-B3-Traceid: + - d875c07eaa14d112deea30d14ee43f91 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:26 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.202' + X-B3-Traceid: + - 60d7f72a94f2551603db4d7be6067ec6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml new file mode 100644 index 0000000..3277186 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml @@ -0,0 +1,237 @@ +--- +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, 07 Oct 2024 13:26:29 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.134' + X-B3-Traceid: + - 27498e04a98671ce64f297e146eaf723 + 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" : 1728307589, + "jti" : "glJyw4D/ZD6mizXfRm+LEj0mNsw=" + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + 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, 07 Oct 2024 13:26:29 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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.173' + X-B3-Traceid: + - 3be4c542f3eb80439cb4cb005dc02d38 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:29 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.181' + X-B3-Traceid: + - 8d062fbd066e494dfa88ea3e45fffb8d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:29 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.178' + X-B3-Traceid: + - fa723e03c37975230baf25b59f1db5f4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml new file mode 100644 index 0000000..4af3c9a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml @@ -0,0 +1,256 @@ +--- +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, 07 Oct 2024 13:26:26 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.106' + X-B3-Traceid: + - 000ded4eccef126b9a897f5aae802a79 + 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" : 1728307586, + "jti" : "gzd6nSZWYtGyJmR1lAKgemldHB0=" + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + 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, 07 Oct 2024 13:26:26 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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.190' + X-B3-Traceid: + - d0cd310231424bd144ffff75ebc92ef2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:27 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.193' + X-B3-Traceid: + - 496496367788b532d3db9f32667fedfa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:27 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.213' + X-B3-Traceid: + - ef23fb78830fecdf3833a10bde410450 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml new file mode 100644 index 0000000..fcc6d82 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml @@ -0,0 +1,256 @@ +--- +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, 07 Oct 2024 13:26:27 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.127' + X-B3-Traceid: + - 5dbd1a808402666a12fe5013190439e8 + 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" : 1728307587, + "jti" : "Wc5DG2H6ucrWbgK/HG/kl6ahon0=" + } + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + 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, 07 Oct 2024 13:26:28 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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.252' + X-B3-Traceid: + - bae8f8609a69f4ba4d641ef9691c15cd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: UTF-8 + string: '{"value":"autogenerateSku","public":false}' + 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, 07 Oct 2024 13:26:28 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.214' + X-B3-Traceid: + - 7667e5211a5dddda7ed58fc69c29573d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : false, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + 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, 07 Oct 2024 13:26:28 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.322' + X-B3-Traceid: + - 2a674e744b82b42c6e331abe21ff4758 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml new file mode 100644 index 0000000..9963871 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml @@ -0,0 +1,153 @@ +--- +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, 07 Oct 2024 19:02:03 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.159' + X-B3-Traceid: + - 9fa4b5497c2d2627a2c6e02e7d2c56f4 + 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" : 1728327723, + "jti" : "rvLiOICi0krh2q8oUCmmj4tYixI=" + } + recorded_at: Mon, 07 Oct 2024 19:02:03 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images + 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, 07 Oct 2024 19:02:04 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.020' + X-B3-Traceid: + - a6eaa8d55b5fb060f31804d759b87edc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ { + "_id" : "5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9", + "label" : "invoice logo", + "width" : 1140, + "height" : 420, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/logo.png?hash=e4f3d85e586988cb6acc53da319ee8c9d0f3c697{&width,height,upscale}", + "templated" : true + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 07 Oct 2024 19:02:04 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml new file mode 100644 index 0000000..bfe1492 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml @@ -0,0 +1,153 @@ +--- +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: + - Fri, 11 Oct 2024 08:57:35 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.093' + X-B3-Traceid: + - beb2caaff28153fea3a51b881cb3a55a + 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" : 1728637055, + "jti" : "PKkxY2Rg0G39s9Zi7bheFh6myiE=" + } + recorded_at: Fri, 11 Oct 2024 08:57:35 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/search/find-by-label?label=logo + 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: + - Fri, 11 Oct 2024 08:57:35 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.015' + X-B3-Traceid: + - 694a309ec0393f6bf310a965823d53b6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ { + "_id" : "0fde5629-ba76-412d-898c-f127b733958b", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0fde5629-ba76-412d-898c-f127b733958b" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0fde5629-ba76-412d-898c-f127b733958b" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/search/find-by-label?label=logo&page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Fri, 11 Oct 2024 08:57:35 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml new file mode 100644 index 0000000..c42f6f2 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml @@ -0,0 +1,143 @@ +--- +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: + - Tue, 08 Oct 2024 12:30:55 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.069' + X-B3-Traceid: + - ae2d798ba684d58f600ebf34e6c42ddd + 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" : 1728390655, + "jti" : "qNz1tE3wjWryHTCXHSa+Xx41emM=" + } + recorded_at: Tue, 08 Oct 2024 12:30:55 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image-2.png&label=test + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTE3MWRhY2Q5NGQxOGJlOWE5NTFkODc4OTNhNzY0MmI0DQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMi5wbmciDQpDb250ZW50LUxlbmd0aDogMTc4Mw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAACWAAAAZ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tP/tWzZ80vXd47f/Z983uSUnZdmfCcUgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/7l/Aav8Mq93IWbxAAAAAElFTkSuQmCCDQotLS0tLS0tLS0tLS0tUnVieU11bHRpcGFydFBvc3QtMTcxZGFjZDk0ZDE4YmU5YTk1MWQ4Nzg5M2E3NjQyYjQtLQ0K + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-171dacd94d18be9a951d87893a7642b4 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '2070' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 08 Oct 2024 12:30:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c + 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.168' + X-B3-Traceid: + - 600a3aac128d942a1c52cf2fcdce2e6e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ff1a5fbd-67ed-49a8-8026-a6e5df02d05c", + "label" : "test", + "width" : 600, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image-2.png?hash=69edee39d8acbbb605eb5116c46c3a2eb6b2429f{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Tue, 08 Oct 2024 12:30:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml new file mode 100644 index 0000000..a40d9a6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml @@ -0,0 +1,245 @@ +--- +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, 07 Oct 2024 19:02:06 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.175' + X-B3-Traceid: + - 3c7df241da651b776ed71288e7759a17 + 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" : 1728327726, + "jti" : "Po9mxmRGMwTEPxx+cSBNg6t0Y0k=" + } + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWNkNzVmZWQwMTk2NmYyNGUwMzc5YTUwMzY0NjczNzI3DQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA5Nw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAABkAAAAZAEAwAAAHKRK/8AAAAbUExURQAAAP///x8fH7+/v9/f339/fz8/P5+fn19fX8TDkjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAPUSURBVHic7dnPT9swFMBxK9C0x5lmP45tVaEd6Q7bjg1iP45UGoJjizhwpNp2p9M28Wcv9ntOUjaWKEpWNH0/BxpX8Ytf7NhuMAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgP9DNApH12cX+bGJf5x9qxdgkh81DNCS2VwPPllrk1Mt9NKs9K5O/b0kHDUM0JKencvBlX13d54mI1+I0+Tixxd7XCPAIiTSNEBLVppIbN9nfwepXHqVLLO/37VVfxPbJBw0C9CWVIfWdCgfvllReiQf88r6+0NNpGmAlvSHK7nWWu5kZN0g7+udHD+tDLB+rYk0DdCSzbEkEtlb+WLhiuMXUuglf6pTNkgO5ZymAVoS2aUkkl/RN8E3pty6B42fxVKzaYCW7D01ksh+GAN9N9TTMImujyoCzE41kaYBWrI40kTGB/rNwLr7ONLS5kk4s5fXOTWF3tBoIpUBOhVnF5RENnP9yrVhkI/svHnFre0PSwFWByGRygCd2s/GsySyyIdAeuvuc+kEMQ3frZ+VAmQnayKVATq1vgmJuCMxOzX956Gwl0+fujKYvl0W9d2JmkhlgC75ESCJzPKRn7WouHrRotAlWx3ixpMmUh2gQ2PXKEkkGw9FO4rxUGqHdMlWh0SuoIlUB+iQv4v3E8kGe9GOXunJ9l2y1SH+xv+WyIMBOiMXqZ2I65KtDpEH/BEksvK7o9qJuC7Z6pDYb6h2n0iULt1H/USi9M1Wh0x9VrtPZE+eQ5218na4SeeBZ3Vqyx1iZn7GDbNWnQDd0LW47vTrSra8c9Lle+fTb9gP1VwQ/UlJeaDo7mPnC2IYxzW3KMZ1yGVa6hJ9Kna+RdkkJ16afd7U2vNlU9a06JKBlfon2eeHXW4aN7ZwJIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWNkNzVmZWQwMTk2NmYyNGUwMzc5YTUwMzY0NjczNzI3LS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-cd75fed01966f24e0379a50364673727 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:06 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + 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.120' + X-B3-Traceid: + - 2949e8a078daefd5893c933b0ce1f988 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "59b627d7-7738-4ac0-b051-4cfcc39cb06c", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + 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, 07 Oct 2024 19:02:06 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.045' + X-B3-Traceid: + - 5e5b2cbd79b920e3d51b62562b058896 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + 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, 07 Oct 2024 19:02:06 GMT + Content-Length: + - '0' + 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.053' + X-B3-Traceid: + - '000438f00875295a1a3b0100b32bf884' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml new file mode 100644 index 0000000..71c38b1 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml @@ -0,0 +1,265 @@ +--- +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, 07 Oct 2024 19:02:05 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.124' + X-B3-Traceid: + - eaa0da0a77b0ba2e678922f41a644afe + 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" : 1728327725, + "jti" : "ehLS8L/42F6CJBOoyVeqXKJiWZA=" + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTgzN2E2ZGZiMjE2NDgxMjNmMTE4NDhhZmIxOGI0NmUwDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA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eaDo7mPnC2IYxzW3KMZ1yGVa6hJ9Kna+RdkkJ16afd7U2vNlU9a06JKBlfon2eeHXW4aN7ZwJIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTgzN2E2ZGZiMjE2NDgxMjNmMTE4NDhhZmIxOGI0NmUwLS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-837a6dfb21648123f11848afb18b46e0 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/80952e3a-4561-44e5-b62e-8c9b0237512d + 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.136' + X-B3-Traceid: + - 5f6b99a61cae04f37fef367afb673a46 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "80952e3a-4561-44e5-b62e-8c9b0237512d", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d + 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, 07 Oct 2024 19:02:05 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: + - 4c869d42aa484663f42c8fdeb3c9e7ce + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "80952e3a-4561-44e5-b62e-8c9b0237512d", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d + 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, 07 Oct 2024 19:02:05 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.038' + X-B3-Traceid: + - 85eccf9257d41ae655b3c7405f57cf08 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml new file mode 100644 index 0000000..66388c6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml @@ -0,0 +1,193 @@ +--- +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, 07 Oct 2024 19:02:04 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.096' + X-B3-Traceid: + - a6e693b690fa848bc1cfd7a85a9594f7 + 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" : 1728327724, + "jti" : "0IogORUK/whqV/Hoz0rUJIbuBs4=" + } + recorded_at: Mon, 07 Oct 2024 19:02:04 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWQ2NGRjMDJhZGYxOTBhZmI4OGRmMTM0MTkxZTY2NzkxDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA5Nw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6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JIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWQ2NGRjMDJhZGYxOTBhZmI4OGRmMTM0MTkxZTY2NzkxLS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-d64dc02adf190afb88df134191e66791 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/0121a830-6643-4793-b174-e85ea905f518 + 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.293' + X-B3-Traceid: + - 84eef16d400978968d166ce4590ff8e0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "0121a830-6643-4793-b174-e85ea905f518", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518 + 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, 07 Oct 2024 19:02:05 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.037' + X-B3-Traceid: + - b04208975f7ae95f6385c1f28b01e475 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +recorded_with: VCR 6.2.0