Skip to content

Commit

Permalink
chore: update swagger proxy api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
manish339k committed Jan 10, 2025
1 parent 0cc278a commit fa1ba96
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 23 deletions.
6 changes: 4 additions & 2 deletions swagger/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ paths:
$ref: './routes/bulkUpload.yaml#/~1getWarningJobs'

#Delivery Routes
/{version}/destinations/{destination}/proxy:
$ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxy'
/v0/destinations/{destination}/proxy:
$ref: './routes/delivery.yaml#/~1v0~1destinations~1{destination}~1proxy'
/v1/destinations/{destination}/proxy:
$ref: './routes/delivery.yaml#/~1v1~1destinations~1{destination}~1proxy'
/{version}/destinations/{destination}/proxyTest:
$ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxyTest'

Expand Down
33 changes: 33 additions & 0 deletions swagger/components/examples/delivery/v0/request/request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
value:
version: v1
type: REST
method: POST
endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update"
userId: ""
headers:
Authorization: "Basic token"
params: {}
body:
JSON: {}
JSON_ARRAY:
batch:
- item_id: "222"
properties: { }
XML: {}
FORM: {}
files: {}
metadata:
userId: '<<>>12345<<>>12345'
jobId: 1
sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx'
sourceCategory: ''
destinationId: '2JIqVoWNvSOHa9ppKOqSxxx'
attemptNum: 0
receivedAt: '2024-07-17T16:45:40.114+05:30'
createdAt: '2024-07-17T11:15:41.140Z'
firstAttemptedAt: ''
transformAt: 'router'
workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx'
secret: null
workerAssignedTime: '2024-07-17T16:45:41.264239+05:30'
dontBatch: false
23 changes: 23 additions & 0 deletions swagger/components/examples/delivery/v0/response/failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
message: "[Generic Response Handler] Request failed for destination bloomreach_catalog with status: 401"
status: 401
destinationResponse:
response: "Could not verify your access level for that URL.\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)"
status: 401
headers:
server: "nginx"
date: "Fri, 1 Jan 2029 03:03:43 GMT"
content-type: "text/html; charset=utf-8"
content-length: "165"
www-authenticate: 'Basic realm="Login Required"'
vary: "Cookie"
via: "1.1 google"
alt-svc: 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'
statTags:
errorCategory: "network"
errorType: "aborted"
destType: "BLOOMREACH_CATALOG"
module: "destination"
implementation: "native"
feature: "dataDelivery"
destinationId: "2JIqVoWNvSOHa9ppKOqSxxx"
workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx"
20 changes: 20 additions & 0 deletions swagger/components/examples/delivery/v0/response/success.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
output:
status: 200
message: "[Generic Response Handler] Request for destination: bloomreach_catalog Processed Successfully"
destinationResponse:
response:
- queued: true
success: true
status: 200
headers:
server: "nginx"
date: "Mon, 01 Jan 2029 03:45:29 GMT"
content-type: "application/json"
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
x-ratelimit-reset: 1736135140
retry-after: "Mon, 06 Jan 2025 03:45:40 GMT"
strict-transport-security: "max-age=31536000; includeSubDomains"
via: "1.1 google"
alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
transfer-encoding: "chunked"
49 changes: 49 additions & 0 deletions swagger/components/examples/delivery/v1/request/request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
value:
version: v1
type: REST
method: POST
endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update"
userId: ""
headers:
Authorization: "Basic token"
params: {}
body:
JSON: {}
JSON_ARRAY:
batch:
- item_id: "222"
properties: {}
- item_id: "11234"
properties: {}
XML: {}
FORM: {}
files: {}
metadata:
- userId: '<<>>12345<<>>12345'
jobId: 1
sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx'
sourceCategory: ''
destinationId: '2JIqVoWNvSOHa9ppKOqSxxx'
attemptNum: 0
receivedAt: '2024-07-17T16:45:40.114+05:30'
createdAt: '2024-07-17T11:15:41.140Z'
firstAttemptedAt: ''
transformAt: 'router'
workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx'
secret: null
workerAssignedTime: '2024-07-17T16:45:41.264239+05:30'
dontBatch: false
- userId: '<<>>12345<<>>12345'
jobId: 2
sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx'
sourceCategory: ''
destinationId: '2JIqVoWNvSOHa9ppKOqSxxx'
attemptNum: 0
receivedAt: '2024-07-17T16:45:40.114+05:30'
createdAt: '2024-07-17T11:15:41.140Z'
firstAttemptedAt: ''
transformAt: 'router'
workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx'
secret: null
workerAssignedTime: '2024-07-17T16:45:41.264239+05:30'
dontBatch: false
29 changes: 29 additions & 0 deletions swagger/components/examples/delivery/v1/response/failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
response:
- error: "\"Could not verify your access level for that URL.\\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)\""
statusCode: 401
metadata:
userId: "<<>>12345<<>>12345"
jobId: 1
sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx"
sourceCategory: ""
destinationId: "2JIqVoWNvSOHa9ppKOqSxxx"
attemptNum: 0
receivedAt: "2024-07-17T16:45:40.114+05:30"
createdAt: "2024-07-17T11:15:41.140Z"
firstAttemptedAt: ""
transformAt: "router"
workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx"
secret: null
workerAssignedTime: "2024-07-17T16:45:41.264239+05:30"
dontBatch: false
statTags:
errorCategory: "network"
errorType: "aborted"
destType: "BLOOMREACH_CATALOG"
module: "destination"
implementation: "native"
feature: "dataDelivery"
destinationId: "2JIqVoWNvSOHa9ppKOqSxxx"
workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx"
message: "BLOOMREACH_CATALOG: Error encountered in transformer proxy V1"
status: 401
57 changes: 57 additions & 0 deletions swagger/components/examples/delivery/v1/response/success.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
output:
status: 200
message: "[BLOOMREACH_CATALOG Response V1 Handler] - Request Processed Successfully"
destinationResponse:
response:
- queued: true
success: true
- queued: true
success: true
status: 200
headers:
server: "nginx"
date: "Mon, 06 Jan 2025 03:45:29 GMT"
content-type: "application/json"
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
x-ratelimit-reset: 1736135140
retry-after: "Mon, 06 Jan 2025 03:45:40 GMT"
strict-transport-security: "max-age=31536000; includeSubDomains"
via: "1.1 google"
alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
transfer-encoding: "chunked"
response:
- statusCode: 200
error: "success"
metadata:
userId: "<<>>12345<<>>12345"
jobId: 1
sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx"
sourceCategory: ""
destinationId: "2JIqVoWNvSOHa9ppKOqSxxx"
attemptNum: 0
receivedAt: "2024-07-17T16:45:40.114+05:30"
createdAt: "2024-07-17T11:15:41.140Z"
firstAttemptedAt: ""
transformAt: "router"
workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx"
secret: null
workerAssignedTime: "2024-07-17T16:45:41.264239+05:30"
dontBatch: false
- statusCode: 200
error: "success"
metadata:
userId: "<<>>12345<<>>12345"
jobId: 2
sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx"
sourceCategory: ""
destinationId: "2JIqVoWNvSOHa9ppKOqSxxx"
attemptNum: 0
receivedAt: "2024-07-17T16:45:40.114+05:30"
createdAt: "2024-07-17T11:15:41.140Z"
firstAttemptedAt: ""
transformAt: "router"
workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx"
secret: null
workerAssignedTime: "2024-07-17T16:45:41.264239+05:30"
dontBatch: false
32 changes: 32 additions & 0 deletions swagger/components/schemas/v0DeliveryRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
title: Proxy Request
type: object
properties:
version:
type: string
type:
type: string
method:
type: string
endpoint:
type: string
userId:
type: string
headers:
type: object
params:
type: object
body:
type: object
properties:
JSON:
type: object
JSON_ARRAY:
type: object
XML:
type: object
FORM:
type: object
files:
type: object
metadata:
$ref: './metadata.yaml'
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ properties:
workspaceId:
type: string
authErrorCategory:
type: string
type: string
34 changes: 34 additions & 0 deletions swagger/components/schemas/v1DeliveryRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title: Proxy Request
type: object
properties:
version:
type: string
type:
type: string
method:
type: string
endpoint:
type: string
userId:
type: string
headers:
type: object
params:
type: object
body:
type: object
properties:
JSON:
type: object
JSON_ARRAY:
type: object
XML:
type: object
FORM:
type: object
files:
type: object
metadata:
type: array
items:
$ref: './metadata.yaml'
42 changes: 42 additions & 0 deletions swagger/components/schemas/v1DeliveryResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
title: Delivery response
type: object
properties:
status:
type: number
message:
type: string
statTags:
type: object
properties:
errorCategory:
type: string
errorType:
type: string
destType:
type: string
module:
type: string
implementation:
type: string
feature:
type: string
example: 'dataDelivery'
destinationId:
type: string
workspaceId:
type: string
destinationResponse:
type: object
authErrorCategory:
type: string
response:
type: array
items:
type: object
properties:
error:
type: string
statusCode:
type: number
metadata:
$ref: './metadata.yaml'
Loading

0 comments on commit fa1ba96

Please sign in to comment.