diff --git a/api/manager.yaml b/api/manager.yaml index 412cfe2..0db67f1 100644 --- a/api/manager.yaml +++ b/api/manager.yaml @@ -41,8 +41,12 @@ tags: name: Include Excludes (WordPress plugin) - description: Manage Accounts name: Accounts +- description: Manage Merchants + name: Merchants - description: Configure Google Search Console OAuth2 authorized access codes. name: Google Search Console OAuth2 +- description: Synchronize Products from the Merchant Feed + name: Merchant Syncs - description: Update Plugin Diagnostics data for WordPress clients. name: Plugin Diagnostics paths: @@ -356,7 +360,7 @@ paths: "401": description: Authentication Failure security: - - apiKey: [] + - ApiKey: [] summary: Create tags: - Analytics Imports @@ -526,7 +530,7 @@ paths: "404": description: Not Found security: - - apiKey: [] + - ApiKey: [] summary: Get an Access Code tags: - Google Search Console OAuth2 @@ -554,10 +558,257 @@ paths: "404": description: Not Found security: - - apiKey: [] + - ApiKey: [] summary: Create an Authorization URI tags: - Google Search Console OAuth2 + /merchants: + get: + description: "List the Merchants, optionally filtering by the `deleted` flag" + operationId: listMerchants + parameters: + - description: The cursor + in: query + name: cursor + required: false + schema: + type: string + - description: The maximum number of results + in: query + name: limit + required: false + schema: + type: integer + default: 10 + - description: Filter by the `deleted` flag + in: query + name: deleted + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PageMerchantView' + description: Found + "401": + description: Authentication Failure + security: + - OAuth2: [] + summary: List + tags: + - Merchants + post: + description: Create a Merchant + operationId: createMerchant + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MerchantRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Merchant' + description: Success + "401": + description: Authentication Failure + "404": + description: Not Found + security: + - OAuth2: [] + summary: Create + tags: + - Merchants + /merchants/{id}: + delete: + description: Delete a Merchant by its `id`. + operationId: deleteMerchant + parameters: + - description: The Merchant id + in: path + name: id + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: Deleted + "401": + description: Authentication Failure + security: + - OAuth2: [] + summary: Delete by id + tags: + - Merchants + get: + description: Get a Merchant by its `id`. + operationId: getMerchant + parameters: + - description: The Merchant id + in: path + name: id + required: true + schema: + type: integer + format: int64 + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Merchant' + description: Success + "401": + description: Authentication Failure + security: + - OAuth2: [] + summary: Get by id + tags: + - Merchants + put: + description: Update a Merchant + operationId: updateMerchant + parameters: + - description: The Merchant id + in: path + name: id + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MerchantRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Merchant' + description: Success + "401": + description: Authentication Failure + "404": + description: Not Found + security: + - OAuth2: [] + summary: Update + tags: + - Merchants + /merchants/{merchantId}/syncs: + get: + description: List the Merchants Syncs + operationId: listMerchantSyncs + parameters: + - description: The Merchant's `id` + in: path + name: merchantId + required: true + schema: + type: integer + format: int64 + - description: The cursor + in: query + name: cursor + required: false + schema: + type: string + - description: The maximum number of results + in: query + name: limit + required: false + schema: + type: integer + default: 10 + - description: "The sorting, `+id` or `-id`" + in: query + name: sort + required: false + schema: + type: string + default: +id + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PageMerchantSync' + description: Found + "401": + description: Authentication Failure + security: + - OAuth2: [] + summary: List + tags: + - Merchant Syncs + post: + operationId: createSync + parameters: + - description: The Merchant's `id` + in: path + name: merchantId + required: true + schema: + type: integer + format: int64 + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/MerchantSync' + description: Found. + "401": + description: Authentication Failure + security: + - OAuth2: [] + summary: Start + tags: + - Merchant Syncs + /merchants/{merchantId}/syncs/{id}: + get: + operationId: getMerchantSync + parameters: + - description: The Merchant's `id` + in: path + name: merchantId + required: true + schema: + type: integer + format: int64 + - description: The Merchant Sync `id`. + in: path + name: id + required: true + schema: + type: integer + format: int64 + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MerchantSync' + description: Found. + "401": + description: Authentication Failure + "404": + description: Not Found + security: + - OAuth2: [] + summary: Get by id + tags: + - Merchant Syncs /oauth2/authorized-clients: get: description: List OAuth2 Authorized Clients @@ -597,7 +848,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Request' + $ref: '#/components/schemas/OAuth2AuthorizedClientRequest' required: true responses: "200": @@ -677,7 +928,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Request' + $ref: '#/components/schemas/OAuth2AuthorizedClientRequest' required: true responses: "200": @@ -742,11 +993,17 @@ paths: required: true responses: "200": + content: + application/x-ndjson: + schema: + type: array + items: + $ref: '#/components/schemas/WebPage' description: Success "401": description: Authentication Failure security: - - apiKey: [] + - ApiKey: [] summary: Create tags: - Sitemap Imports @@ -1129,47 +1386,334 @@ components: required: - Include or Exclude - The URL - MerchantEntry: + Merchant: type: object - description: A Merchant Entry with the Google Merchant Id and the Website URL + description: A Merchant project. properties: + access_token: + type: string + description: The Google merchant access token + account_id: + type: integer + format: int64 + description: The account id + readOnly: true + automatic_synchronization: + type: boolean + description: Whether the Merchant data will be synchronized automatically + created_at: + type: string + format: date-time + description: The create date-time + readOnly: true + dataset_domain: + type: string + description: The custom domain (for example data.example.org) + dataset_name: + type: string + description: The dataset path (for example /data) + deleted: + type: boolean + default: false + description: True if the merchant has been deleted + deleted_at: + type: string + format: date-time + description: The delete date-time + readOnly: true google_merchant_id: type: integer format: int64 description: The Google Merchant id - website_url: - type: string - description: The Google Merchant Website URL - required: - - google_merchant_id - - website_url - NetworkAccountInfo: - type: object - description: Network Account Information - properties: - accountId: + id: type: integer format: int64 - description: The Account Id + description: The unique id readOnly: true - datasetId: + ignore_brand: + type: boolean + description: Whether to ignore the `brand` property during validation + ignore_image: + type: boolean + description: Whether to ignore the `image` property during validation + modified_at: type: string - description: The Dataset Id + format: date-time + description: The last modified date-time readOnly: true - datasetUri: + publisher_name: type: string - description: The Dataset URI - readOnly: true + description: The publisher name (shows in schema publisher) + refresh_token: + type: string + description: The Google merchant refresh token url: type: string description: The website URL - readOnly: true - readOnly: true required: - - datasetUri - OAuth2AuthorizedClient: + - access_token + - deleted + - google_merchant_id + - publisher_name + - refresh_token + MerchantEntry: type: object - description: A OAuth2 Authorized Client + description: A Merchant Entry with the Google Merchant Id and the Website URL + properties: + google_merchant_id: + type: integer + format: int64 + description: The Google Merchant id + website_url: + type: string + description: The Google Merchant Website URL + required: + - google_merchant_id + - website_url + MerchantRequest: + type: object + description: The Merchant request + properties: + access_token: + type: string + description: Google Merchant access token + dataset_domain: + type: string + description: The custom domain (for example data.example.org) + dataset_name: + type: string + description: The dataset path (for example "data") + deleted: + type: boolean + default: false + description: True if the merchant has been deleted + google_merchant_id: + type: integer + format: int64 + description: The Google Merchant id + ignore_brand: + type: boolean + description: Whether to ignore the `brand` property during validation + ignore_image: + type: boolean + description: Whether to ignore the `image` property during validation + publisher_name: + type: string + description: The publisher name (shows in schema publisher) + refresh_token: + type: string + description: Google Merchant refresh token + url: + type: string + description: The website URL + required: + - google_merchant_id + - publisher_name + - refresh_token + - url + MerchantSync: + type: object + description: A Merchant products data synchronization. + properties: + created_at: + type: string + format: date-time + description: The create date-time. + readOnly: true + has_errors: + type: boolean + description: Whether the sync encountered errors. + readOnly: true + id: + type: integer + format: int64 + description: The unique id. + readOnly: true + merchant_id: + type: integer + format: int64 + description: The parent Merchant id. + readOnly: true + modified_at: + type: string + format: date-time + description: The last modified date-time. + readOnly: true + products_created: + type: integer + format: int32 + description: The number of created products + readOnly: true + products_deleted: + type: integer + format: int32 + description: The number of deleted products + readOnly: true + products_errored: + type: integer + format: int32 + description: The number of errored products + readOnly: true + products_skipped: + type: integer + format: int32 + description: The number of skipped products + readOnly: true + products_total: + type: integer + format: int32 + description: "The total number of processed products, including the skipped\ + \ and errored." + readOnly: true + products_updated: + type: integer + format: int32 + description: The number of update products + readOnly: true + started_at: + type: string + format: date-time + description: The started date-time. + readOnly: true + stopped_at: + type: string + format: date-time + description: The stopped date-time. + readOnly: true + required: + - merchant_id + MerchantView: + type: object + description: An array of objects. + properties: + access_token: + type: string + description: The Google merchant access token + account_id: + type: integer + format: int64 + description: The account id + readOnly: true + automatic_synchronization: + type: boolean + description: Whether the Merchant data will be synchronized automatically + created_at: + type: string + format: date-time + description: The create date-time + readOnly: true + dataset_domain: + type: string + description: The custom domain (for example data.example.org) + dataset_name: + type: string + description: The dataset path (for example /data) + deleted: + type: boolean + default: false + description: True if the merchant has been deleted + deleted_at: + type: string + format: date-time + description: The delete date-time + readOnly: true + google_merchant_id: + type: integer + format: int64 + description: The Google Merchant id + id: + type: integer + format: int64 + description: The unique id + readOnly: true + ignore_brand: + type: boolean + description: Whether to ignore the `brand` property during validation + ignore_image: + type: boolean + description: Whether to ignore the `image` property during validation + modified_at: + type: string + format: date-time + description: The last modified date-time + readOnly: true + publisher_name: + type: string + description: The publisher name (shows in schema publisher) + refresh_token: + type: string + description: The Google merchant refresh token + sid: + type: string + sync_has_errors: + type: boolean + sync_id: + type: integer + format: int64 + sync_products_created: + type: integer + format: int32 + sync_products_deleted: + type: integer + format: int32 + sync_products_errored: + type: integer + format: int32 + sync_products_skipped: + type: integer + format: int32 + sync_products_total: + type: integer + format: int32 + sync_products_updated: + type: integer + format: int32 + sync_started_at: + type: string + format: date-time + description: The started date-time. + readOnly: true + sync_stopped_at: + type: string + format: date-time + description: The stopped date-time. + readOnly: true + url: + type: string + description: The website URL + required: + - access_token + - deleted + - google_merchant_id + - publisher_name + - refresh_token + NetworkAccountInfo: + type: object + description: Network Account Information + properties: + accountId: + type: integer + format: int64 + description: The Account Id + readOnly: true + datasetId: + type: string + description: The Dataset Id + readOnly: true + datasetUri: + type: string + description: The Dataset URI + readOnly: true + url: + type: string + description: The website URL + readOnly: true + readOnly: true + required: + - datasetUri + OAuth2AuthorizedClient: + type: object + description: A OAuth2 Authorized Client properties: access_token_expires_at: type: string @@ -1195,6 +1739,40 @@ components: format: date-time refresh_token_value: type: string + OAuth2AuthorizedClientRequest: + type: object + description: The OAuth2 Authorized Client request + properties: + access_token_expires_at: + type: string + format: date-time + description: When the Access Token expires + access_token_issued_at: + type: string + format: date-time + description: When the Access Token was issued + access_token_scopes: + type: string + description: The Access Token scopes + access_token_type: + type: string + description: The Access Token Type + access_token_value: + type: string + description: The Access Token Value + client_registration_id: + type: string + description: The Client Registration Id + principal_name: + type: string + description: The Principal Name + refresh_token_issued_at: + type: string + format: date-time + description: When the Access Token was issued + refresh_token_value: + type: string + description: The Refresh Token Value PageActiveAccount: type: object description: A page object with links to move to other pages and the list of @@ -1306,6 +1884,80 @@ components: - next - prev - self + PageMerchantSync: + type: object + description: A page object with links to move to other pages and the list of + objects. + properties: + first: + type: string + description: The link to the first page. + nullable: true + items: + type: array + description: An array of objects. + items: + $ref: '#/components/schemas/MerchantSync' + last: + type: string + description: The link to the last page. + nullable: true + next: + type: string + description: The link to the next page or `null` if there's no page. + nullable: true + prev: + type: string + description: The link to the previous page or `null` if there's no page. + nullable: true + self: + type: string + description: The link to the current page. + nullable: true + required: + - first + - items + - last + - next + - prev + - self + PageMerchantView: + type: object + description: A page object with links to move to other pages and the list of + objects. + properties: + first: + type: string + description: The link to the first page. + nullable: true + items: + type: array + description: An array of objects. + items: + $ref: '#/components/schemas/MerchantView' + last: + type: string + description: The link to the last page. + nullable: true + next: + type: string + description: The link to the next page or `null` if there's no page. + nullable: true + prev: + type: string + description: The link to the previous page or `null` if there's no page. + nullable: true + self: + type: string + description: The link to the current page. + nullable: true + required: + - first + - items + - last + - next + - prev + - self PageOAuth2AuthorizedClient: type: object description: A page object with links to move to other pages and the list of @@ -1439,38 +2091,9 @@ components: format: uri Request: type: object - description: The OAuth2 Authorized Client request properties: - access_token_expires_at: + redeem_code: type: string - format: date-time - description: When the Access Token expires - access_token_issued_at: - type: string - format: date-time - description: When the Access Token was issued - access_token_scopes: - type: string - description: The Access Token scopes - access_token_type: - type: string - description: The Access Token Type - access_token_value: - type: string - description: The Access Token Value - client_registration_id: - type: string - description: The Client Registration Id - principal_name: - type: string - description: The Principal Name - refresh_token_issued_at: - type: string - format: date-time - description: When the Access Token was issued - refresh_token_value: - type: string - description: The Refresh Token Value Response: type: object properties: @@ -1480,10 +2103,6 @@ components: type: object description: The Sitemap Import request properties: - analytics: - type: boolean - description: "If true, import also analytics from GSC (requires existing\ - \ GSC configuration in backend)" sitemap_url: type: string description: The sitemap URL @@ -1494,6 +2113,23 @@ components: type: string description: The URLs uniqueItems: true + WebPage: + type: object + properties: + abstract: + type: string + date_published: + type: string + format: date + headline: + type: string + image: + type: string + format: url + text: + type: string + url: + type: string Website: type: object description: A Website