Skip to content

Commit 41618f9

Browse files
feat(telemetry): consume @uipath/telemetry from SDK and Coded Action Apps (#413)
Co-authored-by: Claude <claude@users.noreply.github.com>
1 parent 03e5180 commit 41618f9

33 files changed

Lines changed: 3951 additions & 450 deletions

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,37 @@ jobs:
1919
uses: actions/setup-node@v4
2020
with:
2121
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
lint-packages:
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
package:
38+
- telemetry
39+
- coded-action-app
40+
defaults:
41+
run:
42+
working-directory: packages/${{ matrix.package }}
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: '20'
51+
cache: 'npm'
52+
cache-dependency-path: packages/${{ matrix.package }}/package-lock.json
2253

2354
- name: Install dependencies
2455
run: npm ci
@@ -38,9 +69,39 @@ jobs:
3869
uses: actions/setup-node@v4
3970
with:
4071
node-version: '20'
72+
cache: 'npm'
4173

4274
- name: Install dependencies
4375
run: npm ci
4476

4577
- name: Run SDK Tests
4678
run: npm run test:coverage -- --run
79+
80+
test-packages:
81+
runs-on: ubuntu-latest
82+
permissions:
83+
contents: read
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
package:
88+
- telemetry
89+
defaults:
90+
run:
91+
working-directory: packages/${{ matrix.package }}
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v4
95+
96+
- name: Setup Node.js
97+
uses: actions/setup-node@v4
98+
with:
99+
node-version: '20'
100+
cache: 'npm'
101+
cache-dependency-path: packages/${{ matrix.package }}/package-lock.json
102+
103+
- name: Install dependencies
104+
run: npm ci
105+
106+
- name: Run tests
107+
run: npm test

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
run: |
3232
npm ci
3333
34+
- name: Install Coded Action Apps Dependencies
35+
working-directory: packages/coded-action-app
36+
run: npm ci
37+
3438
- name: Setup Python Virtual Environment
3539
run: |
3640
python3 -m venv docs-env
@@ -40,10 +44,6 @@ jobs:
4044
- name: Generate API Documentation
4145
run: npm run docs:api
4246

43-
- name: Generate Documentation for coded action apps sdk
44-
working-directory: packages/coded-action-apps
45-
run: npm run docs
46-
4747
- name: Build MkDocs Documentation
4848
run: |
4949
source docs-env/bin/activate

.github/workflows/pr-checks.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,32 @@ jobs:
142142
echo "" >> $GITHUB_STEP_SUMMARY
143143
echo "Please review the logs above to identify and fix the issues." >> $GITHUB_STEP_SUMMARY
144144
145+
test-packages:
146+
runs-on: ubuntu-latest
147+
permissions:
148+
contents: read
149+
strategy:
150+
fail-fast: false
151+
matrix:
152+
package:
153+
- telemetry
154+
defaults:
155+
run:
156+
working-directory: packages/${{ matrix.package }}
157+
steps:
158+
- name: Checkout
159+
uses: actions/checkout@v4
160+
161+
- name: Setup Node.js
162+
uses: actions/setup-node@v4
163+
with:
164+
node-version: '20'
165+
cache: 'npm'
166+
cache-dependency-path: packages/${{ matrix.package }}/package-lock.json
167+
168+
- name: Install dependencies
169+
run: npm ci
170+
171+
- name: Run tests
172+
run: npm test
173+

.github/workflows/publish.yml

Lines changed: 162 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ name: Publish SDK package
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
package:
7+
description: 'select package to publish'
8+
required: true
9+
default: 'ts-sdk'
10+
type: choice
11+
options:
12+
- ts-sdk
13+
- coded-action-app-sdk
14+
- telemetry
515

616
permissions: {}
717

818
jobs:
919
publish-sdk:
20+
if: github.event.inputs.package == 'ts-sdk'
1021
runs-on: ubuntu-latest
1122
environment: production
1223
permissions:
@@ -32,12 +43,9 @@ jobs:
3243
run: |
3344
SDK_VERSION=$(node -p "require('./package.json').version")
3445
35-
# SDK core constants - uses SDK_VERSION from root package.json
36-
sed -i 's|\$CONNECTION_STRING|${{ secrets.CONNECTION_STRING }}|g' src/core/telemetry/constants.ts
3746
sed -i "s|\$SDK_VERSION|$SDK_VERSION|g" src/core/telemetry/constants.ts
3847
3948
echo "Updated telemetry constants with:"
40-
echo "CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }}"
4149
echo "- SDK_VERSION (from root package): $SDK_VERSION"
4250
4351
- name: Build
@@ -105,3 +113,154 @@ jobs:
105113
echo "- Triggered deploy-api-cors.yml in UiPath/apps-dev-tools" >> $GITHUB_STEP_SUMMARY
106114
echo "- Environments: staging, production" >> $GITHUB_STEP_SUMMARY
107115
echo "- [View Runs](https://github.com/UiPath/apps-dev-tools/actions/workflows/deploy-api-cors.yml)" >> $GITHUB_STEP_SUMMARY
116+
117+
publish-coded-action-app-sdk:
118+
if: github.event.inputs.package == 'coded-action-app-sdk'
119+
runs-on: ubuntu-latest
120+
environment: production
121+
permissions:
122+
contents: read
123+
packages: write
124+
id-token: write
125+
defaults:
126+
run:
127+
working-directory: packages/coded-action-app
128+
steps:
129+
- name: Checkout
130+
uses: actions/checkout@v4
131+
with:
132+
fetch-depth: 0
133+
134+
- name: Setup Node.js
135+
uses: actions/setup-node@v4
136+
with:
137+
node-version: '24'
138+
139+
- name: Install Dependencies
140+
run: npm ci
141+
142+
- name: Update telemetry constants
143+
shell: bash
144+
run: |
145+
SDK_VERSION=$(node -p "require('./package.json').version")
146+
147+
sed -i "s|\$CODED_ACTION_APP_SDK_VERSION|$SDK_VERSION|g" src/telemetry/constants.ts
148+
149+
echo "Updated telemetry constants with:"
150+
echo "- CODED_ACTION_APP_SDK_VERSION: $SDK_VERSION"
151+
152+
- name: Build
153+
run: npm run build
154+
155+
- name: Setup registry for npm
156+
uses: actions/setup-node@v4
157+
with:
158+
node-version: '24'
159+
registry-url: 'https://registry.npmjs.org'
160+
161+
- name: Publish to npm
162+
run: |
163+
echo "@uipath:registry=https://registry.npmjs.org" > .npmrc
164+
npm publish --provenance --access public
165+
166+
- name: Publish to GitHub Packages
167+
run: |
168+
echo "@uipath:registry=https://npm.pkg.github.com" > .npmrc
169+
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
170+
npm publish
171+
env:
172+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173+
174+
- name: Generate Summary
175+
run: |
176+
SDK_VERSION=$(node -p "require('./package.json').version")
177+
echo "## Coded Action Apps SDK Published Successfully" >> $GITHUB_STEP_SUMMARY
178+
echo "" >> $GITHUB_STEP_SUMMARY
179+
echo "### Version: $SDK_VERSION" >> $GITHUB_STEP_SUMMARY
180+
echo "" >> $GITHUB_STEP_SUMMARY
181+
echo "### Completed Steps:" >> $GITHUB_STEP_SUMMARY
182+
echo "- Updated telemetry constants" >> $GITHUB_STEP_SUMMARY
183+
echo "- Built coded-action-app package" >> $GITHUB_STEP_SUMMARY
184+
echo "- Published to npm registry (public access, with provenance)" >> $GITHUB_STEP_SUMMARY
185+
echo "- Published to GitHub Packages" >> $GITHUB_STEP_SUMMARY
186+
echo "" >> $GITHUB_STEP_SUMMARY
187+
echo "### Package Details:" >> $GITHUB_STEP_SUMMARY
188+
echo "- **Package:** @uipath/coded-action-app" >> $GITHUB_STEP_SUMMARY
189+
echo "- **Version:** $SDK_VERSION" >> $GITHUB_STEP_SUMMARY
190+
191+
publish-telemetry:
192+
if: github.event.inputs.package == 'telemetry'
193+
runs-on: ubuntu-latest
194+
environment: production
195+
permissions:
196+
contents: read
197+
packages: write
198+
id-token: write
199+
defaults:
200+
run:
201+
working-directory: packages/telemetry
202+
steps:
203+
- name: Checkout
204+
uses: actions/checkout@v4
205+
with:
206+
fetch-depth: 0
207+
208+
- name: Setup Node.js
209+
uses: actions/setup-node@v4
210+
with:
211+
node-version: '24'
212+
213+
- name: Install Dependencies
214+
run: npm ci
215+
216+
- name: Update telemetry constants
217+
shell: bash
218+
env:
219+
CONNECTION_STRING_VALUE: ${{ secrets.CONNECTION_STRING }}
220+
run: |
221+
sed -i "s|\$CONNECTION_STRING|$CONNECTION_STRING_VALUE|g" src/constants.ts
222+
223+
echo "Replaced connection string"
224+
225+
- name: Build
226+
run: npm run build
227+
228+
- name: Test
229+
run: npm test
230+
231+
- name: Setup registry for npm
232+
uses: actions/setup-node@v4
233+
with:
234+
node-version: '24'
235+
registry-url: 'https://registry.npmjs.org'
236+
237+
- name: Publish to npm
238+
run: |
239+
echo "@uipath:registry=https://registry.npmjs.org" > .npmrc
240+
npm publish --provenance --access public
241+
242+
- name: Publish to GitHub Packages
243+
run: |
244+
echo "@uipath:registry=https://npm.pkg.github.com" > .npmrc
245+
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
246+
npm publish
247+
env:
248+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
249+
250+
- name: Generate Summary
251+
run: |
252+
TELEMETRY_VERSION=$(node -p "require('./package.json').version")
253+
echo "## Telemetry Published Successfully" >> $GITHUB_STEP_SUMMARY
254+
echo "" >> $GITHUB_STEP_SUMMARY
255+
echo "### Version: $TELEMETRY_VERSION" >> $GITHUB_STEP_SUMMARY
256+
echo "" >> $GITHUB_STEP_SUMMARY
257+
echo "### Completed Steps:" >> $GITHUB_STEP_SUMMARY
258+
echo "- Replaced connection string" >> $GITHUB_STEP_SUMMARY
259+
echo "- Built telemetry package" >> $GITHUB_STEP_SUMMARY
260+
echo "- Ran unit tests" >> $GITHUB_STEP_SUMMARY
261+
echo "- Published to npm registry (public access, with provenance)" >> $GITHUB_STEP_SUMMARY
262+
echo "- Published to GitHub Packages" >> $GITHUB_STEP_SUMMARY
263+
echo "" >> $GITHUB_STEP_SUMMARY
264+
echo "### Package Details:" >> $GITHUB_STEP_SUMMARY
265+
echo "- **Package:** @uipath/core-telemetry" >> $GITHUB_STEP_SUMMARY
266+
echo "- **Version:** $TELEMETRY_VERSION" >> $GITHUB_STEP_SUMMARY

Agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ TypeScript SDK for UiPath platform APIs. Provides typed clients for Action Cente
88
npm install # install deps
99
npm run build # rollup build → dist/ (ESM, CJS, UMD, .d.ts)
1010
npm test # vitest
11-
npm run test:unit # unit tests (root tests/unit/ + packages/telemetry/tests/)
11+
npm run test:unit # unit tests (root tests/unit/)
1212
npm run test:integration # integration tests (vitest.integration.config.ts)
1313
npm run test:all # unit + integration tests
1414
npm run test:coverage # with v8 coverage

docs/coded-action-apps/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ A coded action app is a standard browser-based web application that runs in UiPa
7474

7575
## Overview
7676

77-
Action Center renders a coded action app within an iframe. `@uipath/coded-action-app` provides `CodedActionAppsService` which offers the following capabilities:
77+
Action Center renders a coded action app within an iframe. `@uipath/coded-action-app` provides `CodedActionAppService` which offers the following capabilities:
7878

7979
- **Receive**`getTask()` — On app load, UiPath Action Center provides the task details along with task data.
8080
- **Notify**`setTaskData()` — Notify Action Center when task data changes (e.g. to enable the Save button).
@@ -84,17 +84,17 @@ Action Center renders a coded action app within an iframe. `@uipath/coded-action
8484
## Import & Initialize
8585

8686
```typescript
87-
import { CodedActionAppsService } from '@uipath/coded-action-app';
87+
import { CodedActionAppService } from '@uipath/coded-action-app';
8888

89-
const service = new CodedActionAppsService();
89+
const service = new CodedActionAppService();
9090
```
9191

92-
The class is also exported under the alias `CodedActionApps` for convenience:
92+
The class is also exported under the alias `CodedActionApp` for convenience:
9393

9494
```typescript
95-
import { CodedActionApps } from '@uipath/coded-action-app';
95+
import { CodedActionApp } from '@uipath/coded-action-app';
9696

97-
const service = new CodedActionApps();
97+
const service = new CodedActionApp();
9898
```
9999

100100
## Usage

mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ plugins:
7575
full_output: "coded-action-apps/llms.txt"
7676
sections:
7777
Coded Action Apps:
78-
- coded-action-apps/getting-started.md: Getting started with Coded Action Apps SDK
79-
- coded-action-apps/interfaces/CodedActionAppsServiceModel.md: Coded Action Apps service methods
78+
- coded-action-apps/getting-started.md: Getting started with Coded Action App SDK
79+
- coded-action-apps/interfaces/CodedActionAppServiceModel.md: Coded Action App service methods
8080
- llmstxt:
8181
full_output: "llms-full-content.txt"
8282
preprocess: "scripts/llms-preprocess.py"
@@ -207,9 +207,9 @@ nav:
207207
- Coded Apps:
208208
- Getting Started: coded-apps/getting-started.md
209209
- CLI Reference: coded-apps/cli-reference.md
210-
- Coded Action Apps SDK:
210+
- Coded Action App SDK:
211211
- Getting Started: coded-action-apps/getting-started.md
212-
- Coded Action Apps: coded-action-apps/interfaces/CodedActionAppsServiceModel.md
212+
- Coded Action Apps: coded-action-apps/interfaces/CodedActionAppServiceModel.md
213213
- Sample Application: https://github.com/UiPath/uipath-typescript/tree/main/samples
214214
- FAQ: FAQ.md
215215
- How To Contribute: CONTRIBUTING.md

0 commit comments

Comments
 (0)