Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
fix: insert seq state
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Jan 31, 2024
1 parent fb2aeef commit 9b7c167
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 7 deletions.
24 changes: 17 additions & 7 deletions main/scripts/test-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {initBYOSupaglueSDK} from '@supaglue/sdk'

const supaglue = initBYOSupaglueSDK({
headers: {
// 'x-connection-id': 'outreach1',
// 'x-provider-name': 'outreach',
'x-connection-id': 'test-connection-id',
'x-provider-name': 'salesforce',
'x-connection-id': 'outreach1',
'x-provider-name': 'outreach',
// 'x-connection-id': 'test-connection-id',
// 'x-provider-name': 'salesforce',
},
})

Expand Down Expand Up @@ -33,10 +33,20 @@ async function main() {
// })
// console.log('Success', res.data)

const res = await supaglue.GET('/crm/v2/companies/{id}', {
params: {path: {id: '0033x00003D6SBOAA3'}},
// const res = await supaglue.GET('/crm/v2/companies/{id}', {
// params: {path: {id: '0033x00003D6SBOAA3'}},
// })
const res = await supaglue.POST('/engagement/v2/sequenceState', {
body: {
record: {
contact_id: '41834',
mailbox_id: '1',
sequence_id: '38',
},
},
})
res.data.record.name
console.log('Success', res.data)
// res.data.record.name
}

main()
Expand Down
94 changes: 94 additions & 0 deletions packages/sdk/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,100 @@
}
}
},
"/engagement/v2/sequenceState": {
"post": {
"operationId": "salesEngagement-insertSequenceState",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"record": {
"type": "object",
"properties": {
"contact_id": {
"type": "string",
"example": "9f3e97fd-4d5d-4efc-959d-bbebfac079f5"
},
"mailbox_id": {
"type": "string",
"example": "ae4be028-9078-4850-a0bf-d2112b7c4d11"
},
"sequence_id": {
"type": "string",
"example": "b854e510-1c40-4ef6-ade4-8eb35f49d331"
},
"user_id": {
"type": [
"string",
"null"
],
"example": "c590dc63-8e43-48a4-8154-1fbb00ac936b"
}
},
"required": [
"contact_id",
"mailbox_id",
"sequence_id"
]
}
},
"required": [
"record"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"record": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
]
}
}
}
}
}
},
"400": {
"description": "Invalid input data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error.BAD_REQUEST"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
}
}
}
}
}
}
},
"/crm/v2/contacts": {
"get": {
"operationId": "crm-listContacts",
Expand Down
45 changes: 45 additions & 0 deletions packages/sdk/openapi.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export interface paths {
'/engagement/v2/accounts/_upsert': {
post: operations['salesEngagement-upsertAccount']
}
'/engagement/v2/sequenceState': {
post: operations['salesEngagement-insertSequenceState']
}
'/crm/v2/contacts': {
get: operations['crm-listContacts']
}
Expand Down Expand Up @@ -310,6 +313,48 @@ export interface operations {
}
}
}
'salesEngagement-insertSequenceState': {
requestBody: {
content: {
'application/json': {
record: {
/** @example 9f3e97fd-4d5d-4efc-959d-bbebfac079f5 */
contact_id: string
/** @example ae4be028-9078-4850-a0bf-d2112b7c4d11 */
mailbox_id: string
/** @example b854e510-1c40-4ef6-ade4-8eb35f49d331 */
sequence_id: string
/** @example c590dc63-8e43-48a4-8154-1fbb00ac936b */
user_id?: string | null
}
}
}
}
responses: {
/** @description Successful response */
200: {
content: {
'application/json': {
record?: {
id: string
}
}
}
}
/** @description Invalid input data */
400: {
content: {
'application/json': components['schemas']['error.BAD_REQUEST']
}
}
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['error.INTERNAL_SERVER_ERROR']
}
}
}
}
'crm-listContacts': {
parameters: {
query?: {
Expand Down

0 comments on commit 9b7c167

Please sign in to comment.