You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
4
5
-
## Project Overview
5
+
**Full development guide:**`.github/copilot-instructions.md` - Contains detailed patterns, examples, JSON schemas, and best practices.
6
6
7
-
Appmixer Connectors is a collection of integrations for the Appmixer workflow engine. Each connector enables integration with an external service (Slack, GitHub, Salesforce, etc.) and contains components that perform specific actions.
7
+
## Quick Reference
8
8
9
-
## Commands
9
+
###Commands
10
10
11
11
```bash
12
-
# Install dependencies (required before running tests)
12
+
# Install dependencies
13
13
node scripts/npm_install.js
14
14
15
-
# Run all unit tests
15
+
# Run tests
16
16
npm run test-unit
17
-
18
-
# Run tests for a specific connector
19
17
npm run test-unit -- test/<connector_name>
20
18
21
-
#Run linting
19
+
#Linting
22
20
npm run lint
23
-
```
24
21
25
-
## Architecture
22
+
# Validate outputType components
23
+
npm run validate-outputtype
24
+
```
26
25
27
26
### Connector Structure
28
27
29
-
Each connector lives in `src/appmixer/<connector_name>/` with this structure:
30
-
31
28
```
32
-
<connector_name>/
33
-
├── service.json # Service metadata (name, label, icon, version)
34
-
├── auth.js # Authentication configuration (OAuth2 or API key)
29
+
src/appmixer/<connector_name>/
30
+
├── service.json # Service metadata
31
+
├── auth.js # Authentication (OAuth2 or API key)
35
32
├── bundle.json # Version and changelog
36
-
├── package.json # Dependencies (optional)
37
-
├── quota.js # Rate limiting rules (optional)
38
-
├── lib.js # Shared utilities (optional)
39
-
├── routes.js # HTTP routes for webhooks (optional)
40
-
├── jobs.js # Background jobs (optional)
41
-
└── <module>/ # Component module (usually "core")
33
+
├── lib.js # Shared utilities (REQUIRED for outputType components)
34
+
└── core/
42
35
└── <ComponentName>/
43
-
├── component.json # Component configuration and UI schema
44
-
└── <ComponentName>.js # Component behavior logic
36
+
├── component.json
37
+
└── <ComponentName>.js
45
38
```
46
39
47
-
### Component Types
48
-
49
-
**Action Components** (have `inPorts`):
50
-
-**Get**: Retrieve single item by ID (`GetTask`, `GetUser`)
51
-
-**List**: Retrieve all items, no filtering (`ListTasks`, `ListUsers`)
52
-
-**Find**: Search with filters, includes `outputType` and `notFound` port (`FindTasks`)
53
-
-**Create**: Create new item (`CreateTask`)
54
-
-**Update**: Modify existing item by ID (`UpdateTask`)
55
-
-**Delete**: Remove item by ID, returns empty object (`DeleteTask`)
56
-
57
-
**Trigger Components** (NO `inPorts`, use `properties` instead):
58
-
-**Polling** (`tick: true`): Use `tick(context)` method, called periodically
59
-
-**Webhook** (`webhook: true`): Use `start()`, `receive()`, `stop()` lifecycle methods
60
-
-**Hybrid**: Both `tick` and `webhook` for real-time events with maintenance
-`<Component>.js`: Implements `receive(context)` for actions, `tick(context)` for polling triggers
66
-
-`auth.js`: Either `type: 'apiKey'` or `type: 'oauth2'` with validation and profile fetching
67
-
-`lib.js`: Shared helpers like `sendArrayOutput()` for Find/List components with `outputType` support
68
-
69
-
## Testing
70
-
71
-
### Unit Tests
72
-
73
-
Tests use Mocha with the stub in `test/utils.js`. The `createMockContext()` function provides a mock Appmixer context with stubbed methods for `httpRequest`, `sendJson`, `stateGet/Set`, etc.
it's possible to test components locally using the Appmixer CLI.
98
+
Use **either**`schema` or `options` in outPorts, **NOT both**.
250
99
251
-
#### setup
100
+
See: `.github/copilot-instructions.md` section "Output Port Schema Definition"
252
101
253
-
before running a test, make sure the connector is authenticated. to check the authentication status, run `appmixer test auth validate <path to auth.js file>`
102
+
## Testing Components
254
103
255
-
for example:
256
-
`appmixer test auth validate ./src/appmixer/slack/auth.js`
257
-
258
-
if the authentication is not valid, stop and ask user to authenticate.
259
-
260
-
#### testng component
261
-
262
-
use command `appmixer test component <path to component>`
263
-
264
-
sage: appmixer test component [options][componentDir]
265
-
266
-
Options:
267
-
-c, --config [config] service configuration
268
-
-f, --transform [transform] specify transformer
269
-
-i, --input [input] input test message object of file path to the JSON file (default: [])
270
-
-m, --mime [mime] mime type, application/json by default
0 commit comments