Skip to content

W-18562616 Enhance Documentation Panel with Agent Metadata #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand All @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
36 changes: 14 additions & 22 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,24 @@ on:
branches:
- master
- main
types: [opened, synchronize, reopened]
jobs:
test_linux:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
# os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-22.04]
# os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
- uses: microsoft/playwright-github-action@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 18
cache: 'npm'
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Install dependencies
run: npm ci
- name: Run tests
Expand Down Expand Up @@ -61,22 +58,17 @@ jobs:
needs:
- test_linux
# - test_win
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'
- run: npm install
- name: Read version from package.json
uses: culshaw/read-package-node-version-actions@v1
Expand Down
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
registry=https://registry.npmjs.org/
@advanced-rest-client:registry=https://registry.npmjs.org/
@mulesoft:registry=https://registry.npmjs.org/
@salesforce:registry=https://registry.npmjs.org/
always-auth=false
strict-ssl=true
140 changes: 140 additions & 0 deletions demo/agents-api/agents-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
openapi: 3.0.0
info:
version: 1.0.0
title: Hotel Reservations API
description: API to manage hotel room bookings, check availability, and apply loyalty benefits.
x-sfdc:
agent:
topic:
name: Hotel_Room_Reservation
classificationDescription: This API allows agents to book, modify, and cancel hotel reservations, as well as apply loyalty upgrades.
scope: Your job is to assist customers in booking hotel rooms based on their preferences, loyalty status, and availability. You should also be able to recommend upgrades if the customer qualifies.
instructions:
- Always check the customer's loyalty status before finalizing the booking.
- If the preferred room type is unavailable, suggest alternative options with similar amenities.
- Never confirm a reservation without validating payment information.
- If the customer qualifies for an upgrade, apply it automatically and notify them.
paths:
/reservations:
post:
summary: Create a new hotel reservation
description: Book a hotel room with specified preferences and apply loyalty upgrades if eligible.
operationId: reservationCreate
x-sfdc:
agent:
action:
publishAsAgentAction: true
requestBody:
required: true
description: customer-reservation
content:
application/json:
schema:
additionalProperties: false
type: object
x-sfdc:
agent:
action:
isUserInput: true
properties:
customerId:
type: string
description: Unique identifier of the customer.
checkInDate:
type: string
format: date
description: Date of check-in.
checkOutDate:
type: string
format: date
description: Date of check-out.
roomType:
type: string
enum: [Standard, Deluxe, Suite]
description: Preferred room type.
specialRequests:
type: string
description: Additional requests like pillow type or air freshener choice.
responses:
'201':
description: Reservation successfully created
content:
application/json:
schema:
additionalProperties: false
type: object
x-sfdc:
agent:
action:
isDisplayable: true
privacy:
isPii: true
properties:
reservationId:
type: string
description: Unique ID of the created reservation.
upgradeApplied:
type: boolean
description: Indicates if a loyalty-based upgrade was applied.
totalPrice:
type: number
format: float
description: Final price after applying any discounts or upgrades.
'400':
description: Invalid input provided
/reservations/reservationlookup:
get:
summary: Retrieve reservation details
description: Get details of a specific reservation by ID.
x-sfdc:
agent:
action:
publishAsAgentAction: true
operationId: reservationRetrieve
requestBody:
required: true
description: customer-reservation
content:
application/json:
schema:
additionalProperties: false
type: object
x-sfdc:
agent:
action:
isUserInput: true
properties:
reservationID:
type: string
description: Unique identifier of the reservation.
responses:
'200':
description: Reservation details retrieved successfully
content:
application/json:
schema:
additionalProperties: false
x-sfdc:
agent:
action:
isDisplayable: true
privacy:
isPii: true
type: object
properties:
reservationId:
type: string
customerId:
type: string
roomType:
type: string
checkInDate:
type: string
format: date
checkOutDate:
type: string
format: date
upgradeApplied:
type: boolean
'404':
description: Reservation not found
3 changes: 2 additions & 1 deletion demo/apis.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"APIC-650/APIC-650.yaml": "OAS 3.0",
"APIC-758/APIC-758.yaml": "OAS 3.0",
"streetlights/streetlights.yaml": "ASYNC 2.0",
"W-11383870/W-11383870.json": { "type": "OAS 3.0", "mime": "application/json" }
"W-11383870/W-11383870.json": { "type": "OAS 3.0", "mime": "application/json" },
"agents-api/agents-api.yaml": { "type": "OAS 3.0", "mime": "application/yaml" }
}
1 change: 1 addition & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class ComponentDemo extends ApiDemoPage {
_apiListTemplate() {
return [
['demo-api', 'Demo API'],
['agents-api', 'Agents API'],
['jldAsync26', 'Async API 2.6'],
['multi-server', 'Multiple servers'],
['google-drive-api', 'Google Drive'],
Expand Down
Loading