Skip to content

Commit

Permalink
🐛 Fix header bug
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Feb 13, 2024
1 parent 972b973 commit da1f1ff
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 117 deletions.
2 changes: 1 addition & 1 deletion docs/core-concepts/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ We also recommend practising by looking at the specific verticals you want to in
--url https://api.panora.dev/crm/contacts \
--header 'Authorization: Bearer dfsdf' \
--header 'Content-Type: application/json' \
--header 'connection_token: <connection_token>' \
--header 'x-connection-token: <connection_token>' \
--data '{
"first_name": "Mark",
"last_name": "Zuckerbeg",
Expand Down
2 changes: 1 addition & 1 deletion docs/crm/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ description: "Read and write data to multiple CRM platforms using a single API"
--url https://api.panora.dev/crm/contacts \
--header 'Authorization: Bearer dfsdf' \
--header 'Content-Type: application/json' \
--header 'connection_token: <connection_token>' \
--header 'x-connection-token: <connection_token>' \
--data '{
"first_name": "Mark",
"last_name": "Zuckerbeg",
Expand Down
2 changes: 1 addition & 1 deletion docs/ticketing/try.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ description: "Learn how to write and read data from your multiple ticketing plat
--url https://api.panora.dev/ticketing/tickets \
--header 'Authorization: Bearer dfsdf' \
--header 'Content-Type: application/json' \
--header 'connection_token: <connection_token>' \
--header 'x-connection-token: <connection_token>' \
--data '{
"account_id": 'account_id',
"assigned_to": ['aliquip', 'enim'],
Expand Down
10 changes: 5 additions & 5 deletions packages/api/scripts/commonObject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ export class ${ObjectCap}Controller {
summary: 'List a batch of ${ObjectCap}s',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -718,7 +718,7 @@ export class ${ObjectCap}Controller {
//@UseGuards(ApiKeyAuthGuard)
@Get()
async get${ObjectCap}s(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try{
Expand Down Expand Up @@ -770,7 +770,7 @@ export class ${ObjectCap}Controller {
description: 'Create a ${objectType} in any supported ${VerticalCap} software',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -788,7 +788,7 @@ export class ${ObjectCap}Controller {
@Post()
async add${ObjectCap}(
@Body() unified${ObjectCap}Data: Unified${ObjectCap}Input,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try{
Expand All @@ -812,7 +812,7 @@ export class ${ObjectCap}Controller {
summary: 'Add a batch of ${ObjectCap}s',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand Down
14 changes: 7 additions & 7 deletions packages/api/src/crm/company/company.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Patch,
Param,
Headers,
UseGuards
UseGuards,
} from '@nestjs/common';
import { ApiKeyAuthGuard } from '@@core/auth/guards/api-key.guard';
import { LoggerService } from '@@core/logger/logger.service';
Expand Down Expand Up @@ -44,7 +44,7 @@ export class CompanyController {
summary: 'List a batch of Companies',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -59,7 +59,7 @@ export class CompanyController {
@UseGuards(ApiKeyAuthGuard)
@Get()
async getCompanies(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class CompanyController {
description: 'Create a company in any supported Crm software',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -127,7 +127,7 @@ export class CompanyController {
@Post()
async addCompany(
@Body() unifiedCompanyData: UnifiedCompanyInput,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand All @@ -151,7 +151,7 @@ export class CompanyController {
summary: 'Add a batch of Companies',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -168,7 +168,7 @@ export class CompanyController {
@Post('batch')
async addCompanies(
@Body() unfiedCompanyData: UnifiedCompanyInput[],
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down
14 changes: 7 additions & 7 deletions packages/api/src/crm/contact/contact.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ContactController {
summary: 'List a batch of CRM Contacts',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -59,7 +59,7 @@ export class ContactController {
@UseGuards(ApiKeyAuthGuard)
@Get()
async getContacts(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class ContactController {
description: 'Create a contact in any supported CRM',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -127,11 +127,11 @@ export class ContactController {
@Post()
async addContact(
@Body() unfiedContactData: UnifiedContactInput,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
this.logger.log('connection_token is ' + connection_token);
this.logger.log('x-connection-token is ' + connection_token);
const { linkedUserId, remoteSource } =
await this.connectionUtils.getConnectionMetadataFromConnectionToken(
connection_token,
Expand All @@ -152,7 +152,7 @@ export class ContactController {
summary: 'Add a batch of CRM Contacts',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -169,7 +169,7 @@ export class ContactController {
@Post('batch')
async addContacts(
@Body() unfiedContactData: UnifiedContactInput[],
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down
14 changes: 7 additions & 7 deletions packages/api/src/crm/deal/deal.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Patch,
Param,
Headers,
UseGuards
UseGuards,
} from '@nestjs/common';
import { ApiKeyAuthGuard } from '@@core/auth/guards/api-key.guard';
import { LoggerService } from '@@core/logger/logger.service';
Expand Down Expand Up @@ -41,7 +41,7 @@ export class DealController {
summary: 'List a batch of Deals',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -56,7 +56,7 @@ export class DealController {
@UseGuards(ApiKeyAuthGuard)
@Get()
async getDeals(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down Expand Up @@ -103,7 +103,7 @@ export class DealController {
description: 'Create a deal in any supported Crm software',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -120,7 +120,7 @@ export class DealController {
@Post()
async addDeal(
@Body() unifiedDealData: UnifiedDealInput,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand All @@ -144,7 +144,7 @@ export class DealController {
summary: 'Add a batch of Deals',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -161,7 +161,7 @@ export class DealController {
@Post('batch')
async addDeals(
@Body() unfiedDealData: UnifiedDealInput[],
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down
14 changes: 7 additions & 7 deletions packages/api/src/crm/engagement/engagement.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Patch,
Param,
Headers,
UseGuards
UseGuards,
} from '@nestjs/common';
import { LoggerService } from '@@core/logger/logger.service';
import { ApiKeyAuthGuard } from '@@core/auth/guards/api-key.guard';
Expand Down Expand Up @@ -44,7 +44,7 @@ export class EngagementController {
summary: 'List a batch of Engagements',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -59,7 +59,7 @@ export class EngagementController {
@UseGuards(ApiKeyAuthGuard)
@Get()
async getEngagements(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class EngagementController {
description: 'Create a engagement in any supported Crm software',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -127,7 +127,7 @@ export class EngagementController {
@Post()
async addEngagement(
@Body() unifiedEngagementData: UnifiedEngagementInput,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand All @@ -151,7 +151,7 @@ export class EngagementController {
summary: 'Add a batch of Engagements',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -168,7 +168,7 @@ export class EngagementController {
@Post('batch')
async addEngagements(
@Body() unfiedEngagementData: UnifiedEngagementInput[],
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down
14 changes: 7 additions & 7 deletions packages/api/src/crm/note/note.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Get,
Param,
Headers,
UseGuards
UseGuards,
} from '@nestjs/common';
import { ApiKeyAuthGuard } from '@@core/auth/guards/api-key.guard';
import { LoggerService } from '@@core/logger/logger.service';
Expand Down Expand Up @@ -40,7 +40,7 @@ export class NoteController {
summary: 'List a batch of Notes',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -55,7 +55,7 @@ export class NoteController {
@UseGuards(ApiKeyAuthGuard)
@Get()
async getNotes(
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down Expand Up @@ -102,7 +102,7 @@ export class NoteController {
description: 'Create a note in any supported Crm software',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -119,7 +119,7 @@ export class NoteController {
@Post()
async addNote(
@Body() unifiedNoteData: UnifiedNoteInput,
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand All @@ -143,7 +143,7 @@ export class NoteController {
summary: 'Add a batch of Notes',
})
@ApiHeader({
name: 'connection_token',
name: 'x-connection-token',
required: true,
description: 'The connection token',
example: 'b008e199-eda9-4629-bd41-a01b6195864a',
Expand All @@ -160,7 +160,7 @@ export class NoteController {
@Post('batch')
async addNotes(
@Body() unfiedNoteData: UnifiedNoteInput[],
@Headers('connection_token') connection_token: string,
@Headers('x-connection-token') connection_token: string,
@Query('remote_data') remote_data?: boolean,
) {
try {
Expand Down
Loading

0 comments on commit da1f1ff

Please sign in to comment.