Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .nx/version-plans/version-plan-1779246751432.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
portal-sdk: major
Comment thread
jarvis9443 marked this conversation as resolved.
---

Fix Developer Portal OpenAPI metadata and request body types.
104 changes: 101 additions & 3 deletions packages/portal-sdk/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
openapi: 3.0.1
info:
title: API7 Enterprise Developer Portal APIs
description: "API7 Enterprise Developer Portal APIs are RESTful APIs that allow you to create and manage developer portal resources. "
description: |-
API7 Enterprise Developer Portal APIs are RESTful APIs that allow you to create and manage developer portal resources.

## Base URL

All API paths are relative to your API7 Developer Portal address, e.g. `https://your-api7-developer-portal`.

## Authentication

Every request must include a Developer Portal token:

- **Bearer Token**: Pass a valid Developer Portal token in the `Authorization` HTTP header.

Most developer resource requests must also include the active developer ID:

- **Developer ID**: Pass the active developer ID in the `X-Portal-Developer-ID` HTTP header where required by the operation.
version: 0.11.0
servers: []
security:
Expand All @@ -13,6 +28,8 @@ paths:
- Developer
summary: List Developers
operationId: listDevelopers
security:
- BearerAuth: []
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PageSize"
Expand All @@ -33,7 +50,10 @@ paths:
- Developer
summary: Create a developer
operationId: createDeveloper
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -53,6 +73,8 @@ paths:
- Developer
summary: Delete a developer
operationId: deleteDeveloper
security:
- BearerAuth: []
parameters:
- $ref: "#/components/parameters/DeveloperID"
responses:
Expand All @@ -72,6 +94,8 @@ paths:
- API Product
summary: List all API products
operationId: listAPIProducts
security:
- BearerAuth: []
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PageSize"
Expand All @@ -95,6 +119,8 @@ paths:
- API Product
summary: Get an API Product for Developer Portal
operationId: getAPIProduct
security:
- BearerAuth: []
parameters:
- $ref: "#/components/parameters/APIProductID"
responses:
Expand All @@ -114,9 +140,13 @@ paths:
- API Product
summary: Create a subscription for an API Product.
operationId: createAPIProductSubscription
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/APIProductID"
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -136,6 +166,9 @@ paths:
- Subscription
summary: List subscriptions.
operationId: listSubscriptions
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/APIProductIDInQuery"
- $ref: "#/components/parameters/ApplicationIDInQuery"
Expand All @@ -159,7 +192,11 @@ paths:
- Subscription
summary: Create a subscription for an API Product
operationId: createSubscription
security:
- BearerAuth: []
DeveloperIDHeader: []
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -179,6 +216,9 @@ paths:
- Subscription
summary: Unsubscribe an API product for the given application
operationId: deleteSubscription
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/SubscriptionID"
responses:
Expand All @@ -198,7 +238,11 @@ paths:
- Application
summary: Create an application by the logged in developer.
operationId: createDeveloperApplication
security:
- BearerAuth: []
DeveloperIDHeader: []
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -217,6 +261,9 @@ paths:
- Application
summary: List all applications for the logged in developer.
operationId: listDeveloperApplications
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/APIProductIDInQuery"
- $ref: "#/components/parameters/Search"
Expand All @@ -240,6 +287,9 @@ paths:
- Application
summary: Get an application for the logged in developer.
operationId: getDeveloperApplication
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
responses:
Expand All @@ -258,9 +308,13 @@ paths:
- Application
summary: Update an application basic information by the logged in developer.
operationId: updateDeveloperApplication
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -281,6 +335,9 @@ paths:
- Application
summary: Delete an application by the logged in developer.
operationId: deleteDeveloperApplication
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
responses:
Expand All @@ -300,9 +357,13 @@ paths:
- Credential
summary: Create an application credential
operationId: createApplicationCredential
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -321,6 +382,9 @@ paths:
- Credential
summary: List all credentials for the logged in developer
operationId: listApplicationCredentials
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
- $ref: "#/components/parameters/AuthMethod"
Expand All @@ -346,6 +410,9 @@ paths:
- Credential
summary: Get an application credential for Developer Portal
operationId: getApplicationCredential
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
- $ref: "#/components/parameters/ApplicationCredentialID"
Expand All @@ -365,10 +432,14 @@ paths:
- Credential
summary: Update an application credential for Developer Portal
operationId: upsertApplicationCredential
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
- $ref: "#/components/parameters/ApplicationCredentialID"
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -389,6 +460,9 @@ paths:
- Credential
summary: Delete an application credential for Developer Portal
operationId: deleteApplicationCredential
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
- $ref: "#/components/parameters/ApplicationCredentialID"
Expand All @@ -409,10 +483,14 @@ paths:
- Credential
summary: Regenerate an application credential auth conf
operationId: regenerateApplicationCredential
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationID"
- $ref: "#/components/parameters/ApplicationCredentialID"
requestBody:
required: true
content:
application/json:
schema:
Expand All @@ -435,6 +513,9 @@ paths:
summary: Get API Calls
description: Retrieve a list of API calls made by the user.
operationId: getApiCalls
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationsIDs"
- $ref: "#/components/parameters/APIProductIDs"
Expand All @@ -456,6 +537,9 @@ paths:
- Credential
summary: List all Credentials
operationId: listCredentials
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/ApplicationsIDs"
- $ref: "#/components/parameters/AuthMethod"
Expand All @@ -481,6 +565,9 @@ paths:
- Label
summary: Get all labels of a resource type
operationId: listLabels
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/DeveloperPortalLabelResourceType"
responses:
Expand All @@ -498,6 +585,9 @@ paths:
- System Settings
summary: Get SMTP server settings status
operationId: getSMTPServerStatus
security:
- BearerAuth: []
DeveloperIDHeader: []
description: Get SMTP server settings status.
responses:
"200":
Expand All @@ -514,6 +604,8 @@ paths:
- System Settings
summary: Get public access settings
operationId: getPublicAccessSettings
security:
- BearerAuth: []
Comment thread
jarvis9443 marked this conversation as resolved.
responses:
"200":
$ref: "#/components/responses/PortalPublicAccessResponse"
Expand All @@ -529,6 +621,9 @@ paths:
- DCR Provider
summary: List all DCR providers
operationId: listDCRProviders
security:
- BearerAuth: []
DeveloperIDHeader: []
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PageSize"
Expand All @@ -549,6 +644,10 @@ components:
BearerAuth:
type: http
scheme: bearer
DeveloperIDHeader:
type: apiKey
in: header
name: X-Portal-Developer-ID
schemas:
ID:
description: The object ID.
Expand Down Expand Up @@ -615,7 +714,6 @@ components:
required:
- id
- name
- status
- created_at
- updated_at
properties:
Expand Down Expand Up @@ -1364,7 +1462,7 @@ components:
enum:
- created_at
- updated_at
description: "Ascending or descending order to list the resources, by `created_at` or `updated_by` configured in `order_by`."
description: "Field used to order resources, either `created_at` or `updated_at`."
Search:
name: search
in: query
Expand Down
12 changes: 6 additions & 6 deletions packages/portal-sdk/src/generated/sdk.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export const listDevelopers = <ThrowOnError extends boolean = false>(options?: O
/**
* Create a developer
*/
export const createDeveloper = <ThrowOnError extends boolean = false>(options?: Options<CreateDeveloperData, ThrowOnError>) => (options?.client ?? client).post<CreateDeveloperResponses, CreateDeveloperErrors, ThrowOnError>({
export const createDeveloper = <ThrowOnError extends boolean = false>(options: Options<CreateDeveloperData, ThrowOnError>) => (options.client ?? client).post<CreateDeveloperResponses, CreateDeveloperErrors, ThrowOnError>({
responseTransformer: createDeveloperResponseTransformer,
responseType: 'json',
url: '/api/developers',
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers
...options.headers
}
});

Expand Down Expand Up @@ -91,12 +91,12 @@ export const listSubscriptions = <ThrowOnError extends boolean = false>(options?
/**
* Create a subscription for an API Product
*/
export const createSubscription = <ThrowOnError extends boolean = false>(options?: Options<CreateSubscriptionData, ThrowOnError>) => (options?.client ?? client).post<CreateSubscriptionResponses, CreateSubscriptionErrors, ThrowOnError>({
export const createSubscription = <ThrowOnError extends boolean = false>(options: Options<CreateSubscriptionData, ThrowOnError>) => (options.client ?? client).post<CreateSubscriptionResponses, CreateSubscriptionErrors, ThrowOnError>({
url: '/api/subscriptions',
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers
...options.headers
}
});

Expand All @@ -118,14 +118,14 @@ export const listDeveloperApplications = <ThrowOnError extends boolean = false>(
/**
* Create an application by the logged in developer.
*/
export const createDeveloperApplication = <ThrowOnError extends boolean = false>(options?: Options<CreateDeveloperApplicationData, ThrowOnError>) => (options?.client ?? client).post<CreateDeveloperApplicationResponses, CreateDeveloperApplicationErrors, ThrowOnError>({
export const createDeveloperApplication = <ThrowOnError extends boolean = false>(options: Options<CreateDeveloperApplicationData, ThrowOnError>) => (options.client ?? client).post<CreateDeveloperApplicationResponses, CreateDeveloperApplicationErrors, ThrowOnError>({
responseTransformer: createDeveloperApplicationResponseTransformer,
responseType: 'json',
url: '/api/applications',
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers
...options.headers
}
});

Expand Down
Loading
Loading