Skip to content

Commit 1fe509d

Browse files
authored
Merge pull request #49 from advanced-rest-client/W-18562610/Implement-Agent-Flags-in-Endpoint-Summaries
W-18562610 [Agent] Implement Agent Flags in Endpoint Summaries
2 parents 44d59db + c6c206c commit 1fe509d

File tree

11 files changed

+16358
-6914
lines changed

11 files changed

+16358
-6914
lines changed

.github/workflows/deployment.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,54 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ubuntu-20.04]
21-
# os: [ubuntu-18.04, ubuntu-20.04]
20+
os: [ubuntu-22.04]
2221
runs-on: ${{ matrix.os }}
2322
steps:
2423
- uses: actions/checkout@v2
2524
- uses: actions/setup-node@v1
2625
with:
27-
node-version: 14
28-
- uses: microsoft/playwright-github-action@v1
29-
- uses: actions/cache@v1
26+
node-version: 18
27+
- uses: actions/cache@v3
3028
with:
3129
path: ~/.npm
3230
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
3331
restore-keys: |
3432
${{ runner.os }}-node-
3533
- name: Install dependencies
36-
run: npm ci
34+
run: |
35+
rm -f package-lock.json
36+
npm install
3737
- name: Run tests
3838
run: npm test
3939
test_win:
4040
name: "Windows"
41-
runs-on: windows-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [windows-latest]
45+
runs-on: ${{ matrix.os }}
4246
steps:
4347
- uses: actions/checkout@v2
4448
- uses: actions/setup-node@v1
4549
with:
46-
node-version: 14
47-
- uses: microsoft/playwright-github-action@v1
48-
- uses: actions/cache@v1
50+
node-version: 18
51+
- uses: actions/cache@v3
4952
with:
5053
path: ~/.npm
5154
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
5255
restore-keys: |
5356
${{ runner.os }}-node-
5457
- name: Install dependencies
55-
run: npm ci
58+
run: |
59+
if (Test-Path package-lock.json) { del package-lock.json }
60+
npm install
61+
shell: pwsh
5662
- name: Run tests
5763
run: npm test
5864
tag:
5965
name: "Publishing release"
6066
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
61-
needs:
67+
needs:
6268
- test_linux
6369
- test_win
6470
runs-on: ubuntu-latest
@@ -69,9 +75,9 @@ jobs:
6975
fetch-depth: 0
7076
- uses: actions/setup-node@v2
7177
with:
72-
node-version: '14.x'
78+
node-version: '18.x'
7379
registry-url: 'https://registry.npmjs.org'
74-
- uses: actions/cache@v1
80+
- uses: actions/cache@v3
7581
with:
7682
path: ~/.npm
7783
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -98,4 +104,4 @@ jobs:
98104
prerelease: false
99105
- run: npm publish --access public
100106
env:
101-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

demo/agents-api/agents-api.yaml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
openapi: 3.0.0
2+
info:
3+
version: 1.0.0
4+
title: Hotel Reservations API
5+
description: API to manage hotel room bookings, check availability, and apply loyalty benefits.
6+
x-sfdc:
7+
agent:
8+
topic:
9+
name: Hotel_Room_Reservation
10+
classificationDescription: This API allows agents to book, modify, and cancel hotel reservations, as well as apply loyalty upgrades.
11+
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.
12+
instructions:
13+
- Always check the customer's loyalty status before finalizing the booking.
14+
- If the preferred room type is unavailable, suggest alternative options with similar amenities.
15+
- Never confirm a reservation without validating payment information.
16+
- If the customer qualifies for an upgrade, apply it automatically and notify them.
17+
paths:
18+
/reservations:
19+
post:
20+
summary: Create a new hotel reservation
21+
description: Book a hotel room with specified preferences and apply loyalty upgrades if eligible.
22+
operationId: reservationCreate
23+
x-sfdc:
24+
agent:
25+
action:
26+
publishAsAgentAction: true
27+
requestBody:
28+
required: true
29+
description: customer-reservation
30+
content:
31+
application/json:
32+
schema:
33+
additionalProperties: false
34+
type: object
35+
x-sfdc:
36+
agent:
37+
action:
38+
isUserInput: true
39+
properties:
40+
customerId:
41+
type: string
42+
description: Unique identifier of the customer.
43+
checkInDate:
44+
type: string
45+
format: date
46+
description: Date of check-in.
47+
checkOutDate:
48+
type: string
49+
format: date
50+
description: Date of check-out.
51+
roomType:
52+
type: string
53+
enum: [Standard, Deluxe, Suite]
54+
description: Preferred room type.
55+
specialRequests:
56+
type: string
57+
description: Additional requests like pillow type or air freshener choice.
58+
responses:
59+
'201':
60+
description: Reservation successfully created
61+
content:
62+
application/json:
63+
schema:
64+
additionalProperties: false
65+
type: object
66+
x-sfdc:
67+
agent:
68+
action:
69+
isDisplayable: true
70+
privacy:
71+
isPii: true
72+
properties:
73+
reservationId:
74+
type: string
75+
description: Unique ID of the created reservation.
76+
upgradeApplied:
77+
type: boolean
78+
description: Indicates if a loyalty-based upgrade was applied.
79+
totalPrice:
80+
type: number
81+
format: float
82+
description: Final price after applying any discounts or upgrades.
83+
'400':
84+
description: Invalid input provided
85+
/reservations/reservationlookup:
86+
get:
87+
summary: Retrieve reservation details
88+
description: Get details of a specific reservation by ID.
89+
x-sfdc:
90+
agent:
91+
action:
92+
publishAsAgentAction: true
93+
operationId: reservationRetrieve
94+
requestBody:
95+
required: true
96+
description: customer-reservation
97+
content:
98+
application/json:
99+
schema:
100+
additionalProperties: false
101+
type: object
102+
x-sfdc:
103+
agent:
104+
action:
105+
isUserInput: true
106+
properties:
107+
reservationID:
108+
type: string
109+
description: Unique identifier of the reservation.
110+
responses:
111+
'200':
112+
description: Reservation details retrieved successfully
113+
content:
114+
application/json:
115+
schema:
116+
additionalProperties: false
117+
x-sfdc:
118+
agent:
119+
action:
120+
isDisplayable: true
121+
privacy:
122+
isPii: true
123+
type: object
124+
properties:
125+
reservationId:
126+
type: string
127+
customerId:
128+
type: string
129+
roomType:
130+
type: string
131+
checkInDate:
132+
type: string
133+
format: date
134+
checkOutDate:
135+
type: string
136+
format: date
137+
upgradeApplied:
138+
type: boolean
139+
'404':
140+
description: Reservation not found

demo/apis.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"mime": "application/yaml"
1818
},
1919
"APIC-641/APIC-641.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
20-
"APIC-711/APIC-711.raml": "RAML 1.0"
20+
"APIC-711/APIC-711.raml": "RAML 1.0",
21+
"agents-api/agents-api.yaml": { "type": "OAS 3.0", "mime": "application/yaml" }
2122
}

demo/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
--http-method-label-delete-color: #fff;
3737
--http-method-label-patch-background-color: #811f92;
3838
--http-method-label-patch-color: #F2F1EF;
39+
40+
--arc-icon-method-icon-color: #fff;
3941
}
4042

4143
body.styled.api.dark {

demo/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ApiDemo extends ApiDemoPage {
1313

1414
_apiListTemplate() {
1515
return [
16+
["agents-api", "Agents API"],
1617
["google-drive-api", "Google Drive"],
1718
["exchange-experience-api", "Exchange xAPI"],
1819
["demo-api", "Demo API"],

0 commit comments

Comments
 (0)