@coasy/piece-coasy 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +33 -0
- package/README.md +143 -4
- package/package.json +2 -17
- package/project.json +38 -0
- package/src/index.ts +35 -0
- package/src/lib/actions/create-funnel-participant.ts +42 -0
- package/src/lib/common/coasyClient.ts +56 -0
- package/src/lib/common/triggers.ts +58 -0
- package/src/lib/triggers/new-auth-event.ts +77 -0
- package/src/lib/triggers/new-funnel-participant.ts +36 -0
- package/src/lib/triggers/new-webinar-participant.ts +50 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +11 -0
- package/src/index.d.ts +0 -8
- package/src/index.js +0 -35
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-funnel-participant.d.ts +0 -9
- package/src/lib/actions/create-funnel-participant.js +0 -48
- package/src/lib/actions/create-funnel-participant.js.map +0 -1
- package/src/lib/common/coasyClient.d.ts +0 -10
- package/src/lib/common/coasyClient.js +0 -59
- package/src/lib/common/coasyClient.js.map +0 -1
- package/src/lib/common/triggers.d.ts +0 -29
- package/src/lib/common/triggers.js +0 -31
- package/src/lib/common/triggers.js.map +0 -1
- package/src/lib/triggers/new-auth-event.d.ts +0 -20
- package/src/lib/triggers/new-auth-event.js +0 -82
- package/src/lib/triggers/new-auth-event.js.map +0 -1
- package/src/lib/triggers/new-funnel-participant.d.ts +0 -17
- package/src/lib/triggers/new-funnel-participant.js +0 -41
- package/src/lib/triggers/new-funnel-participant.js.map +0 -1
- package/src/lib/triggers/new-webinar-participant.d.ts +0 -20
- package/src/lib/triggers/new-webinar-participant.js +0 -55
- package/src/lib/triggers/new-webinar-participant.js.map +0 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"../../../../.eslintrc.base.json"
|
|
4
|
+
],
|
|
5
|
+
"ignorePatterns": [
|
|
6
|
+
"!**/*"
|
|
7
|
+
],
|
|
8
|
+
"overrides": [
|
|
9
|
+
{
|
|
10
|
+
"files": [
|
|
11
|
+
"*.ts",
|
|
12
|
+
"*.tsx",
|
|
13
|
+
"*.js",
|
|
14
|
+
"*.jsx"
|
|
15
|
+
],
|
|
16
|
+
"rules": {}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"files": [
|
|
20
|
+
"*.ts",
|
|
21
|
+
"*.tsx"
|
|
22
|
+
],
|
|
23
|
+
"rules": {}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"files": [
|
|
27
|
+
"*.js",
|
|
28
|
+
"*.jsx"
|
|
29
|
+
],
|
|
30
|
+
"rules": {}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
package/README.md
CHANGED
|
@@ -1,7 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Coasy Piece for Activepieces
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is the Coasy integration piece for Activepieces, providing actions and triggers to interact with the Coasy platform for funnel and webinar management.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The Coasy piece includes:
|
|
8
|
+
- **Actions**: Create funnel participants
|
|
9
|
+
- **Triggers**: New funnel participants, new webinar participants, new auth events
|
|
10
|
+
- **Authentication**: Custom auth with base URL and API key
|
|
11
|
+
|
|
12
|
+
## Development Setup
|
|
13
|
+
|
|
14
|
+
### Prerequisites
|
|
15
|
+
1. Clone the activepieces repository
|
|
16
|
+
2. Install dependencies: `npm install`
|
|
17
|
+
3. Ensure you're in the root directory of the activepieces monorepo
|
|
18
|
+
|
|
19
|
+
### Development Commands
|
|
20
|
+
|
|
21
|
+
#### Building the Piece
|
|
22
|
+
```bash
|
|
23
|
+
# Build the coasy piece specifically
|
|
24
|
+
nx build pieces-coasy
|
|
25
|
+
|
|
26
|
+
# Build with watch mode for development
|
|
27
|
+
nx build pieces-coasy --watch
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Testing
|
|
31
|
+
```bash
|
|
32
|
+
# Run tests for the coasy piece
|
|
33
|
+
nx test pieces-coasy
|
|
34
|
+
|
|
35
|
+
# Run tests with watch mode
|
|
36
|
+
nx test pieces-coasy --watch
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Linting
|
|
40
|
+
```bash
|
|
41
|
+
# Lint the coasy piece
|
|
42
|
+
nx lint pieces-coasy
|
|
43
|
+
|
|
44
|
+
# Auto-fix lint issues
|
|
45
|
+
nx lint pieces-coasy --fix
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Development Workflow
|
|
49
|
+
|
|
50
|
+
#### 1. Start Development Environment
|
|
51
|
+
```bash
|
|
52
|
+
# Start the full development environment (frontend + backend + engine + pieces)
|
|
53
|
+
npm run dev
|
|
54
|
+
|
|
55
|
+
# Or start just backend services if only testing the piece
|
|
56
|
+
npm run dev:backend
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### 2. Testing Your Changes
|
|
60
|
+
- Navigate to `http://localhost:4200` (frontend)
|
|
61
|
+
- Create a new flow and add Coasy actions/triggers
|
|
62
|
+
- Test authentication with your Coasy credentials
|
|
63
|
+
- Verify actions and triggers work as expected
|
|
64
|
+
|
|
65
|
+
#### 3. Adding New Features
|
|
66
|
+
|
|
67
|
+
**Adding a New Action:**
|
|
68
|
+
1. Create a new file in `src/lib/actions/`
|
|
69
|
+
2. Export the action from `src/index.ts`
|
|
70
|
+
3. Follow the existing patterns in `create-funnel-participant.ts`
|
|
71
|
+
|
|
72
|
+
**Adding a New Trigger:**
|
|
73
|
+
1. Create a new file in `src/lib/triggers/`
|
|
74
|
+
2. Export the trigger from `src/index.ts`
|
|
75
|
+
3. Follow the existing patterns in `new-funnel-participant.ts`
|
|
76
|
+
|
|
77
|
+
#### 4. File Structure
|
|
78
|
+
```
|
|
79
|
+
packages/pieces/community/coasy/
|
|
80
|
+
├── README.md # This file
|
|
81
|
+
├── package.json # Package configuration
|
|
82
|
+
├── project.json # Nx project configuration
|
|
83
|
+
├── tsconfig.json # TypeScript config
|
|
84
|
+
└── src/
|
|
85
|
+
├── index.ts # Main piece definition and exports
|
|
86
|
+
└── lib/
|
|
87
|
+
├── actions/ # Action implementations
|
|
88
|
+
├── triggers/ # Trigger implementations
|
|
89
|
+
└── common/ # Shared utilities
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Code Standards
|
|
93
|
+
|
|
94
|
+
### Authentication
|
|
95
|
+
The piece uses custom authentication with:
|
|
96
|
+
- `baseUrl`: Coasy instance base URL
|
|
97
|
+
- `apiKey`: API key for authentication
|
|
98
|
+
|
|
99
|
+
### Error Handling
|
|
100
|
+
- Use proper error messages for user-facing errors
|
|
101
|
+
- Handle API errors gracefully
|
|
102
|
+
- Validate inputs before making API calls
|
|
103
|
+
|
|
104
|
+
### Properties
|
|
105
|
+
- Use descriptive `displayName` and `description` for all properties
|
|
106
|
+
- Mark required fields appropriately
|
|
107
|
+
- Use proper property types from `@activepieces/pieces-framework`
|
|
108
|
+
|
|
109
|
+
## Testing in Activepieces
|
|
110
|
+
|
|
111
|
+
1. **Authentication Testing**:
|
|
112
|
+
- Verify connection works with valid credentials
|
|
113
|
+
- Test error handling with invalid credentials
|
|
114
|
+
|
|
115
|
+
2. **Action Testing**:
|
|
116
|
+
- Test with valid inputs
|
|
117
|
+
- Test error scenarios
|
|
118
|
+
- Verify data transformation
|
|
119
|
+
|
|
120
|
+
3. **Trigger Testing**:
|
|
121
|
+
- Set up webhooks/polling as needed
|
|
122
|
+
- Test trigger conditions
|
|
123
|
+
- Verify payload structure
|
|
124
|
+
|
|
125
|
+
## Publishing
|
|
126
|
+
|
|
127
|
+
The piece is published as `@coasy/piece-coasy` to npm. Version is currently `0.0.11`.
|
|
128
|
+
|
|
129
|
+
To publish a new version:
|
|
130
|
+
1. Navigate to the coasy piece directory:
|
|
131
|
+
```bash
|
|
132
|
+
cd packages/pieces/community/coasy
|
|
133
|
+
```
|
|
134
|
+
2. Update the `version` in `package.json` (e.g., from `0.0.11` to `0.0.12`)
|
|
135
|
+
3. Publish directly to npm:
|
|
136
|
+
```bash
|
|
137
|
+
npm publish
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Note**: The monorepo's `npm run publish-piece` script currently has dependency resolution issues. Use the direct `npm publish` method above instead.
|
|
141
|
+
|
|
142
|
+
## Resources
|
|
143
|
+
|
|
144
|
+
- [Activepieces Documentation](https://www.activepieces.com/docs)
|
|
145
|
+
- [Pieces Framework Reference](https://www.activepieces.com/docs/developers/piece-reference/properties)
|
|
146
|
+
- [Piece Development Guide](https://www.activepieces.com/docs/developers/building-pieces/create-action)
|
package/package.json
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coasy/piece-coasy",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
|
|
5
|
-
"@sinclair/typebox": "0.26.8",
|
|
6
|
-
"axios": "1.6.7",
|
|
7
|
-
"dayjs": "1.11.9",
|
|
8
|
-
"is-base64": "1.1.0",
|
|
9
|
-
"lodash": "4.17.21",
|
|
10
|
-
"nanoid": "3.3.6",
|
|
11
|
-
"semver": "7.6.0",
|
|
12
|
-
"@activepieces/pieces-common": "0.2.12",
|
|
13
|
-
"@activepieces/pieces-framework": "0.7.29",
|
|
14
|
-
"@activepieces/shared": "0.10.104",
|
|
15
|
-
"tslib": "1.14.1"
|
|
16
|
-
},
|
|
17
|
-
"main": "./src/index.js",
|
|
18
|
-
"type": "commonjs"
|
|
19
|
-
}
|
|
3
|
+
"version": "0.0.12"
|
|
4
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pieces-coasy",
|
|
3
|
+
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/pieces/community/coasy/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"build": {
|
|
8
|
+
"executor": "@nx/js:tsc",
|
|
9
|
+
"outputs": [
|
|
10
|
+
"{options.outputPath}"
|
|
11
|
+
],
|
|
12
|
+
"options": {
|
|
13
|
+
"outputPath": "dist/packages/pieces/community/coasy",
|
|
14
|
+
"tsConfig": "packages/pieces/community/coasy/tsconfig.lib.json",
|
|
15
|
+
"packageJson": "packages/pieces/community/coasy/package.json",
|
|
16
|
+
"main": "packages/pieces/community/coasy/src/index.ts",
|
|
17
|
+
"assets": [
|
|
18
|
+
"packages/pieces/community/coasy/*.md"
|
|
19
|
+
],
|
|
20
|
+
"buildableProjectDepsInPackageJsonType": "dependencies",
|
|
21
|
+
"updateBuildableProjectDepsInPackageJson": true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"publish": {
|
|
25
|
+
"command": "node tools/scripts/publish.mjs pieces-coasy {args.ver} {args.tag}",
|
|
26
|
+
"dependsOn": [
|
|
27
|
+
"build"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"lint": {
|
|
31
|
+
"executor": "@nx/eslint:lint",
|
|
32
|
+
"outputs": [
|
|
33
|
+
"{options.outputFile}"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"tags": []
|
|
38
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createPiece, PieceAuth, Property } from '@activepieces/pieces-framework';
|
|
2
|
+
import { createFunnelParticipant } from './lib/actions/create-funnel-participant';
|
|
3
|
+
import { newFunnelParticipant } from './lib/triggers/new-funnel-participant';
|
|
4
|
+
import { newWebinarParticipant } from './lib/triggers/new-webinar-participant';
|
|
5
|
+
import { newAuthEvent } from './lib/triggers/new-auth-event';
|
|
6
|
+
|
|
7
|
+
export const coasyAuth = PieceAuth.CustomAuth({
|
|
8
|
+
required: true,
|
|
9
|
+
description: 'Enter coasy authentication details',
|
|
10
|
+
props: {
|
|
11
|
+
baseUrl: Property.ShortText({
|
|
12
|
+
displayName: 'Base URL',
|
|
13
|
+
description: 'Enter the base URL',
|
|
14
|
+
required: false,
|
|
15
|
+
defaultValue: 'https://backend.api.prod.coasy.io',
|
|
16
|
+
}),
|
|
17
|
+
apiKey: PieceAuth.SecretText({
|
|
18
|
+
displayName: 'API Key',
|
|
19
|
+
description: 'Enter the api key',
|
|
20
|
+
required: true
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const coasy = createPiece({
|
|
26
|
+
displayName: 'Coasy',
|
|
27
|
+
auth: coasyAuth,
|
|
28
|
+
description: 'Communicate with Coasy!',
|
|
29
|
+
minimumSupportedRelease: '0.20.0',
|
|
30
|
+
logoUrl: 'https://console.achtsamkeitsakademie.de/favicon/apple-icon.png',
|
|
31
|
+
authors: ["christian-schab"],
|
|
32
|
+
actions: [createFunnelParticipant],
|
|
33
|
+
triggers: [newFunnelParticipant, newWebinarParticipant, newAuthEvent]
|
|
34
|
+
});
|
|
35
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createAction, Property } from '@activepieces/pieces-framework';
|
|
2
|
+
import { coasyAuth } from '../../index';
|
|
3
|
+
import { CoasyClient } from '../common/coasyClient';
|
|
4
|
+
|
|
5
|
+
export const createFunnelParticipant = createAction({
|
|
6
|
+
auth: coasyAuth,
|
|
7
|
+
name: 'createFunnelParticipant',
|
|
8
|
+
displayName: 'Create Funnel Participant',
|
|
9
|
+
description: 'Create a new funnel participant',
|
|
10
|
+
props: {
|
|
11
|
+
funnelId: Property.ShortText({
|
|
12
|
+
displayName: 'Funnel ID',
|
|
13
|
+
description: 'ID of funnel',
|
|
14
|
+
required: true
|
|
15
|
+
}),
|
|
16
|
+
firstName: Property.ShortText({
|
|
17
|
+
displayName: 'First name',
|
|
18
|
+
description: 'first name of participant',
|
|
19
|
+
required: true
|
|
20
|
+
}),
|
|
21
|
+
lastName: Property.ShortText({
|
|
22
|
+
displayName: 'Last name',
|
|
23
|
+
description: 'last name of participant',
|
|
24
|
+
required: false
|
|
25
|
+
}),
|
|
26
|
+
email: Property.ShortText({
|
|
27
|
+
displayName: 'Email',
|
|
28
|
+
description: 'email address of partipant',
|
|
29
|
+
required: true
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
async run(configValue) {
|
|
33
|
+
const { propsValue, auth } = configValue;
|
|
34
|
+
const client = new CoasyClient(auth.baseUrl || 'https://backend.api.prod.coasy.io', auth.apiKey);
|
|
35
|
+
const request = {
|
|
36
|
+
email: propsValue.email,
|
|
37
|
+
firstName: propsValue.firstName,
|
|
38
|
+
funnelId: propsValue.funnelId
|
|
39
|
+
};
|
|
40
|
+
return client.action('createFunnelParticipant', request);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AuthenticationType, httpClient, HttpMethod, HttpRequest } from '@activepieces/pieces-common';
|
|
2
|
+
|
|
3
|
+
export class CoasyClient {
|
|
4
|
+
private baseUrl: string;
|
|
5
|
+
private apiKey: string;
|
|
6
|
+
|
|
7
|
+
constructor(baseUrl: string, apiKey: string) {
|
|
8
|
+
this.baseUrl = baseUrl;
|
|
9
|
+
this.apiKey = apiKey;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
async action(actionName: string, request: any) {
|
|
14
|
+
return this.request(`/apps/actions/${actionName}`, request);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async createTrigger(trigger: string, hookUrl: string, filter: any) {
|
|
18
|
+
return this.request(`/apps/triggers/create`, {
|
|
19
|
+
hookUrl,
|
|
20
|
+
trigger,
|
|
21
|
+
filter
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async destroyTrigger(webhookId: string) {
|
|
26
|
+
return this.request(`/apps/triggers/destroy`, { webhookId})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async listTriggerEvents(trigger: string) {
|
|
30
|
+
return this.request(`/apps/list`, {
|
|
31
|
+
trigger
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async request(path: string, requestBody: any) {
|
|
37
|
+
const request: HttpRequest<string> = {
|
|
38
|
+
method: HttpMethod.POST,
|
|
39
|
+
url: `${this.baseUrl}${path}`,
|
|
40
|
+
body: JSON.stringify(requestBody),
|
|
41
|
+
authentication: {
|
|
42
|
+
type: AuthenticationType.BEARER_TOKEN,
|
|
43
|
+
token: this.apiKey
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const response = await httpClient.sendRequest(request);
|
|
48
|
+
|
|
49
|
+
if (response.status !== 200) {
|
|
50
|
+
throw new Error(`Failed to communicate with Mailjet`);
|
|
51
|
+
} else {
|
|
52
|
+
return response.body;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
import { CoasyClient } from './coasyClient';
|
|
3
|
+
|
|
4
|
+
import { SecretTextProperty, ShortTextProperty, StaticPropsValue, Store } from '@activepieces/pieces-framework';
|
|
5
|
+
|
|
6
|
+
export interface CreateTriggerRequest {
|
|
7
|
+
triggerName: string;
|
|
8
|
+
webhookUrl: string;
|
|
9
|
+
auth: StaticPropsValue<{
|
|
10
|
+
baseUrl: ShortTextProperty<false>,
|
|
11
|
+
apiKey: SecretTextProperty<true>
|
|
12
|
+
}>
|
|
13
|
+
filter: any;
|
|
14
|
+
store: Store;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface DestroyTriggerRequest {
|
|
18
|
+
triggerName: string;
|
|
19
|
+
auth: StaticPropsValue<{
|
|
20
|
+
baseUrl: ShortTextProperty<false>,
|
|
21
|
+
apiKey: SecretTextProperty<true>
|
|
22
|
+
}>
|
|
23
|
+
store: Store;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TestTriggerRequest {
|
|
27
|
+
triggerName: string;
|
|
28
|
+
auth: StaticPropsValue<{
|
|
29
|
+
baseUrl: ShortTextProperty<false>,
|
|
30
|
+
apiKey: SecretTextProperty<true>
|
|
31
|
+
}>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const createCoasyTrigger = async (request: CreateTriggerRequest) => {
|
|
35
|
+
const { triggerName, webhookUrl, filter, auth, store} = request;
|
|
36
|
+
const client = new CoasyClient(auth.baseUrl || 'https://backend.api.prod.coasy.io', auth.apiKey);
|
|
37
|
+
const response = await client.createTrigger(triggerName, webhookUrl, filter);
|
|
38
|
+
if (!response.id) throw new Error(`Failed to create Trigger!`);
|
|
39
|
+
await store.put<string>(`${triggerName}__WEBHOOK_ID`, response.id);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const destroyCoasyTrigger = async (request: DestroyTriggerRequest) => {
|
|
43
|
+
const { triggerName, auth, store} = request;
|
|
44
|
+
const webhookId = await store.get<string>(`${triggerName}__WEBHOOK_ID`);
|
|
45
|
+
if (!webhookId) throw new Error(`Webhook Id not found!`);
|
|
46
|
+
|
|
47
|
+
const client = new CoasyClient(auth.baseUrl || 'https://backend.api.prod.coasy.io', auth.apiKey);
|
|
48
|
+
await client.destroyTrigger(webhookId);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const testCoasyTrigger = async (request: TestTriggerRequest): Promise<any[]> => {
|
|
52
|
+
const { triggerName, auth} = request;
|
|
53
|
+
|
|
54
|
+
const client = new CoasyClient(auth.baseUrl || 'https://backend.api.prod.coasy.io', auth.apiKey);
|
|
55
|
+
const response = await client.listTriggerEvents(triggerName);
|
|
56
|
+
|
|
57
|
+
return [{ test: true}];
|
|
58
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
import { coasyAuth } from '../..';
|
|
3
|
+
import { createCoasyTrigger, destroyCoasyTrigger } from '../common/triggers';
|
|
4
|
+
|
|
5
|
+
const triggerName = "NEW_AUTH_EVENT";
|
|
6
|
+
|
|
7
|
+
export const newAuthEvent = createTrigger({
|
|
8
|
+
auth: coasyAuth,
|
|
9
|
+
name: 'newAuthEvent',
|
|
10
|
+
displayName: 'New Auth event',
|
|
11
|
+
description: 'Triggers when an authentication (signUp, password forgotten etc.) event happens',
|
|
12
|
+
props: {
|
|
13
|
+
triggerCategories: Property.StaticMultiSelectDropdown({
|
|
14
|
+
displayName: 'Trigger Categories',
|
|
15
|
+
description: 'categories of trigger',
|
|
16
|
+
required: true,
|
|
17
|
+
options: {
|
|
18
|
+
options: [{
|
|
19
|
+
value: "CustomEmailSender",
|
|
20
|
+
label: "Custom Email Sender"
|
|
21
|
+
}, {
|
|
22
|
+
value: "UserMigration",
|
|
23
|
+
label: "User Migration"
|
|
24
|
+
}, {
|
|
25
|
+
value: "DefineAuthChallenge",
|
|
26
|
+
label: "Define Auth Challenge"
|
|
27
|
+
}, {
|
|
28
|
+
value: "CreateAuthChallenge",
|
|
29
|
+
label: "Create Auth Challenge"
|
|
30
|
+
}, {
|
|
31
|
+
value: "VerifyAuthChallengeResponse",
|
|
32
|
+
label: "Verify Auth Challenge Response"
|
|
33
|
+
}]
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
triggerNames: Property.StaticMultiSelectDropdown({
|
|
37
|
+
displayName: 'Triggers',
|
|
38
|
+
description: 'Select triggers to react on',
|
|
39
|
+
required: true,
|
|
40
|
+
options: {
|
|
41
|
+
options: [{
|
|
42
|
+
value: "SignUp",
|
|
43
|
+
label: "Sign Up"
|
|
44
|
+
}, {
|
|
45
|
+
value: "ResendCode",
|
|
46
|
+
label: "Resend Code"
|
|
47
|
+
}, {
|
|
48
|
+
value: "ForgotPassword",
|
|
49
|
+
label: "Forgot Password"
|
|
50
|
+
}, {
|
|
51
|
+
value: "Authentication",
|
|
52
|
+
label: "Authentication"
|
|
53
|
+
}, {
|
|
54
|
+
value: "ELSE",
|
|
55
|
+
label: "Else"
|
|
56
|
+
}]
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
sampleData: {},
|
|
61
|
+
type: TriggerStrategy.WEBHOOK,
|
|
62
|
+
onEnable : (context) => createCoasyTrigger({
|
|
63
|
+
triggerName,
|
|
64
|
+
webhookUrl: context.webhookUrl,
|
|
65
|
+
auth: context.auth,
|
|
66
|
+
filter: context.propsValue,
|
|
67
|
+
store: context.store
|
|
68
|
+
}),
|
|
69
|
+
onDisable : (context) => destroyCoasyTrigger({
|
|
70
|
+
triggerName,
|
|
71
|
+
auth: context.auth,
|
|
72
|
+
store: context.store
|
|
73
|
+
}),
|
|
74
|
+
async run(context) {
|
|
75
|
+
return [context.payload.body];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
import { coasyAuth } from '../..';
|
|
3
|
+
import { createCoasyTrigger, destroyCoasyTrigger } from '../common/triggers';
|
|
4
|
+
|
|
5
|
+
const triggerName = "NEW_FUNNEL_PARTICIPANT";
|
|
6
|
+
|
|
7
|
+
export const newFunnelParticipant = createTrigger({
|
|
8
|
+
auth: coasyAuth,
|
|
9
|
+
name: 'newFunnelParticipant',
|
|
10
|
+
displayName: 'New Funnel Participant',
|
|
11
|
+
description: 'Triggers when a new funnel particpant is created',
|
|
12
|
+
props: {
|
|
13
|
+
funnelIds: Property.Array({
|
|
14
|
+
displayName: 'Funnel IDs',
|
|
15
|
+
description: 'IDs of funnel to react to',
|
|
16
|
+
required: false
|
|
17
|
+
})
|
|
18
|
+
},
|
|
19
|
+
sampleData: {},
|
|
20
|
+
type: TriggerStrategy.WEBHOOK,
|
|
21
|
+
onEnable : (context) => createCoasyTrigger({
|
|
22
|
+
triggerName,
|
|
23
|
+
webhookUrl: context.webhookUrl,
|
|
24
|
+
auth: context.auth,
|
|
25
|
+
filter: context.propsValue,
|
|
26
|
+
store: context.store
|
|
27
|
+
}),
|
|
28
|
+
onDisable : (context) => destroyCoasyTrigger({
|
|
29
|
+
triggerName,
|
|
30
|
+
auth: context.auth,
|
|
31
|
+
store: context.store
|
|
32
|
+
}),
|
|
33
|
+
async run(context) {
|
|
34
|
+
return [context.payload.body];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
import { coasyAuth } from '../..';
|
|
3
|
+
import { createCoasyTrigger, destroyCoasyTrigger } from '../common/triggers';
|
|
4
|
+
|
|
5
|
+
const triggerName = "NEW_WEBINAR_PARTICIPANT";
|
|
6
|
+
|
|
7
|
+
export const newWebinarParticipant = createTrigger({
|
|
8
|
+
auth: coasyAuth,
|
|
9
|
+
name: 'newWebinarParticipant',
|
|
10
|
+
displayName: 'New Webinar Participant',
|
|
11
|
+
description: 'Triggers when a new webinar particpant is created',
|
|
12
|
+
props: {
|
|
13
|
+
webinarIds: Property.Array({
|
|
14
|
+
displayName: 'Webinar IDs',
|
|
15
|
+
description: 'IDs of webinar to react to',
|
|
16
|
+
required: false
|
|
17
|
+
}),
|
|
18
|
+
selectedStartType: Property.StaticDropdown({
|
|
19
|
+
displayName: 'Selected start type',
|
|
20
|
+
description: 'filter only those participants',
|
|
21
|
+
required: false,
|
|
22
|
+
options: {
|
|
23
|
+
options: [{
|
|
24
|
+
label: "Instantly",
|
|
25
|
+
value: "INSTANTLY"
|
|
26
|
+
}, {
|
|
27
|
+
label: "Later",
|
|
28
|
+
value: "LATER"
|
|
29
|
+
}]
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
sampleData: {},
|
|
34
|
+
type: TriggerStrategy.WEBHOOK,
|
|
35
|
+
onEnable : (context) => createCoasyTrigger({
|
|
36
|
+
triggerName,
|
|
37
|
+
webhookUrl: context.webhookUrl,
|
|
38
|
+
auth: context.auth,
|
|
39
|
+
filter: context.propsValue,
|
|
40
|
+
store: context.store
|
|
41
|
+
}),
|
|
42
|
+
onDisable : (context) => destroyCoasyTrigger({
|
|
43
|
+
triggerName,
|
|
44
|
+
auth: context.auth,
|
|
45
|
+
store: context.store
|
|
46
|
+
}),
|
|
47
|
+
async run(context) {
|
|
48
|
+
return [context.payload.body];
|
|
49
|
+
}
|
|
50
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"forceConsistentCasingInFileNames": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noImplicitOverride": true,
|
|
8
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
+
"noImplicitReturns": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true
|
|
11
|
+
},
|
|
12
|
+
"files": [],
|
|
13
|
+
"include": [],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "./tsconfig.lib.json"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"outDir": "../../../../dist/out-tsc",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"types": ["node"]
|
|
8
|
+
},
|
|
9
|
+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
|
|
10
|
+
"include": ["src/**/*.ts"]
|
|
11
|
+
}
|
package/src/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const coasyAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const coasy: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
package/src/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.coasy = exports.coasyAuth = void 0;
|
|
4
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
-
const create_funnel_participant_1 = require("./lib/actions/create-funnel-participant");
|
|
6
|
-
const new_funnel_participant_1 = require("./lib/triggers/new-funnel-participant");
|
|
7
|
-
const new_webinar_participant_1 = require("./lib/triggers/new-webinar-participant");
|
|
8
|
-
const new_auth_event_1 = require("./lib/triggers/new-auth-event");
|
|
9
|
-
exports.coasyAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
10
|
-
required: true,
|
|
11
|
-
description: 'Enter coasy authentication details',
|
|
12
|
-
props: {
|
|
13
|
-
baseUrl: pieces_framework_1.Property.ShortText({
|
|
14
|
-
displayName: 'Base URL',
|
|
15
|
-
description: 'Enter the base URL',
|
|
16
|
-
required: true,
|
|
17
|
-
}),
|
|
18
|
-
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
19
|
-
displayName: 'API Key',
|
|
20
|
-
description: 'Enter the api key',
|
|
21
|
-
required: true
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
exports.coasy = (0, pieces_framework_1.createPiece)({
|
|
26
|
-
displayName: 'Coasy',
|
|
27
|
-
auth: exports.coasyAuth,
|
|
28
|
-
description: 'Communicate with Coasy!',
|
|
29
|
-
minimumSupportedRelease: '0.20.0',
|
|
30
|
-
logoUrl: 'https://console.achtsamkeitsakademie.de/favicon/apple-icon.png',
|
|
31
|
-
authors: ["christian-schab"],
|
|
32
|
-
actions: [create_funnel_participant_1.createFunnelParticipant],
|
|
33
|
-
triggers: [new_funnel_participant_1.newFunnelParticipant, new_webinar_participant_1.newWebinarParticipant, new_auth_event_1.newAuthEvent]
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/coasy/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAkF;AAClF,uFAAkF;AAClF,kFAA6E;AAC7E,oFAA+E;AAC/E,kEAA6D;AAEhD,QAAA,SAAS,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC5C,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;CACF,CAAC,CAAC;AAEU,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,iBAAS;IACf,WAAW,EAAE,yBAAyB;IACtC,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gEAAgE;IACzE,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE,CAAC,mDAAuB,CAAC;IAClC,QAAQ,EAAE,CAAC,6CAAoB,EAAE,+CAAqB,EAAE,6BAAY,CAAC;CACtE,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const createFunnelParticipant: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
funnelId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
firstName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFunnelParticipant = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const index_1 = require("../../index");
|
|
7
|
-
const coasyClient_1 = require("../common/coasyClient");
|
|
8
|
-
exports.createFunnelParticipant = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: index_1.coasyAuth,
|
|
10
|
-
name: 'createFunnelParticipant',
|
|
11
|
-
displayName: 'Create Funnel Participant',
|
|
12
|
-
description: 'Create a new funnel participant',
|
|
13
|
-
props: {
|
|
14
|
-
funnelId: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Funnel ID',
|
|
16
|
-
description: 'ID of funnel',
|
|
17
|
-
required: true
|
|
18
|
-
}),
|
|
19
|
-
firstName: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'First name',
|
|
21
|
-
description: 'first name of participant',
|
|
22
|
-
required: true
|
|
23
|
-
}),
|
|
24
|
-
lastName: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Last name',
|
|
26
|
-
description: 'last name of participant',
|
|
27
|
-
required: false
|
|
28
|
-
}),
|
|
29
|
-
email: pieces_framework_1.Property.ShortText({
|
|
30
|
-
displayName: 'Email',
|
|
31
|
-
description: 'email address of partipant',
|
|
32
|
-
required: true
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
run(configValue) {
|
|
36
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const { propsValue, auth } = configValue;
|
|
38
|
-
const client = new coasyClient_1.CoasyClient(auth.baseUrl, auth.apiKey);
|
|
39
|
-
const request = {
|
|
40
|
-
email: propsValue.email,
|
|
41
|
-
firstName: propsValue.firstName,
|
|
42
|
-
funnelId: propsValue.funnelId
|
|
43
|
-
};
|
|
44
|
-
return client.action('createFunnelParticipant', request);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=create-funnel-participant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-funnel-participant.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/actions/create-funnel-participant.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAAwC;AACxC,uDAAoD;AAEvC,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,iBAAS;IACf,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,WAAW;;YACnB,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1D,MAAM,OAAO,GAAG;gBACd,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,QAAQ,EAAE,UAAU,CAAC,QAAQ;aAC9B,CAAC;YACF,OAAO,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAC3D,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class CoasyClient {
|
|
2
|
-
private baseUrl;
|
|
3
|
-
private apiKey;
|
|
4
|
-
constructor(baseUrl: string, apiKey: string);
|
|
5
|
-
action(actionName: string, request: any): Promise<any>;
|
|
6
|
-
createTrigger(trigger: string, hookUrl: string, filter: any): Promise<any>;
|
|
7
|
-
destroyTrigger(webhookId: string): Promise<any>;
|
|
8
|
-
listTriggerEvents(trigger: string): Promise<any>;
|
|
9
|
-
request(path: string, requestBody: any): Promise<any>;
|
|
10
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoasyClient = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
class CoasyClient {
|
|
7
|
-
constructor(baseUrl, apiKey) {
|
|
8
|
-
this.baseUrl = baseUrl;
|
|
9
|
-
this.apiKey = apiKey;
|
|
10
|
-
}
|
|
11
|
-
action(actionName, request) {
|
|
12
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
return this.request(`/apps/actions/${actionName}`, request);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
createTrigger(trigger, hookUrl, filter) {
|
|
17
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
return this.request(`/apps/triggers/create`, {
|
|
19
|
-
hookUrl,
|
|
20
|
-
trigger,
|
|
21
|
-
filter
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
destroyTrigger(webhookId) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
return this.request(`/apps/triggers/destroy`, { webhookId });
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
listTriggerEvents(trigger) {
|
|
31
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
return this.request(`/apps/list`, {
|
|
33
|
-
trigger
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
request(path, requestBody) {
|
|
38
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const request = {
|
|
40
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
41
|
-
url: `${this.baseUrl}${path}`,
|
|
42
|
-
body: JSON.stringify(requestBody),
|
|
43
|
-
authentication: {
|
|
44
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
45
|
-
token: this.apiKey
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
49
|
-
if (response.status !== 200) {
|
|
50
|
-
throw new Error(`Failed to communicate with Mailjet`);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return response.body;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.CoasyClient = CoasyClient;
|
|
59
|
-
//# sourceMappingURL=coasyClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coasyClient.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/common/coasyClient.ts"],"names":[],"mappings":";;;;AAAA,+DAAsG;AAEtG,MAAa,WAAW;IAItB,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAGK,MAAM,CAAC,UAAkB,EAAE,OAAY;;YAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC;KAAA;IAEK,aAAa,CAAC,OAAe,EAAE,OAAe,EAAE,MAAW;;YAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE;gBAC3C,OAAO;gBACP,OAAO;gBACP,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,cAAc,CAAC,SAAiB;;YACpC,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,SAAS,EAAC,CAAC,CAAA;QAC7D,CAAC;KAAA;IAEK,iBAAiB,CAAC,OAAe;;YACrC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;gBAChC,OAAO;aACR,CAAC,CAAA;QACJ,CAAC;KAAA;IAGK,OAAO,CAAC,IAAY,EAAE,WAAgB;;YAC1C,MAAM,OAAO,GAAwB;gBACnC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE;gBAC7B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;gBACjC,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI,CAAC,MAAM;iBACnB;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEvD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;QACH,CAAC;KAAA;CAEF;AArDD,kCAqDC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { SecretTextProperty, ShortTextProperty, StaticPropsValue, Store } from '@activepieces/pieces-framework';
|
|
2
|
-
export interface CreateTriggerRequest {
|
|
3
|
-
triggerName: string;
|
|
4
|
-
webhookUrl: string;
|
|
5
|
-
auth: StaticPropsValue<{
|
|
6
|
-
baseUrl: ShortTextProperty<true>;
|
|
7
|
-
apiKey: SecretTextProperty<true>;
|
|
8
|
-
}>;
|
|
9
|
-
filter: any;
|
|
10
|
-
store: Store;
|
|
11
|
-
}
|
|
12
|
-
export interface DestroyTriggerRequest {
|
|
13
|
-
triggerName: string;
|
|
14
|
-
auth: StaticPropsValue<{
|
|
15
|
-
baseUrl: ShortTextProperty<true>;
|
|
16
|
-
apiKey: SecretTextProperty<true>;
|
|
17
|
-
}>;
|
|
18
|
-
store: Store;
|
|
19
|
-
}
|
|
20
|
-
export interface TestTriggerRequest {
|
|
21
|
-
triggerName: string;
|
|
22
|
-
auth: StaticPropsValue<{
|
|
23
|
-
baseUrl: ShortTextProperty<true>;
|
|
24
|
-
apiKey: SecretTextProperty<true>;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
export declare const createCoasyTrigger: (request: CreateTriggerRequest) => Promise<void>;
|
|
28
|
-
export declare const destroyCoasyTrigger: (request: DestroyTriggerRequest) => Promise<void>;
|
|
29
|
-
export declare const testCoasyTrigger: (request: TestTriggerRequest) => Promise<any[]>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.testCoasyTrigger = exports.destroyCoasyTrigger = exports.createCoasyTrigger = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const coasyClient_1 = require("./coasyClient");
|
|
6
|
-
const createCoasyTrigger = (request) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
7
|
-
const { triggerName, webhookUrl, filter, auth, store } = request;
|
|
8
|
-
const client = new coasyClient_1.CoasyClient(auth.baseUrl, auth.apiKey);
|
|
9
|
-
const response = yield client.createTrigger(triggerName, webhookUrl, filter);
|
|
10
|
-
if (!response.id)
|
|
11
|
-
throw new Error(`Failed to create Trigger!`);
|
|
12
|
-
yield store.put(`${triggerName}__WEBHOOK_ID`, response.id);
|
|
13
|
-
});
|
|
14
|
-
exports.createCoasyTrigger = createCoasyTrigger;
|
|
15
|
-
const destroyCoasyTrigger = (request) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
const { triggerName, auth, store } = request;
|
|
17
|
-
const webhookId = yield store.get(`${triggerName}__WEBHOOK_ID`);
|
|
18
|
-
if (!webhookId)
|
|
19
|
-
throw new Error(`Webhook Id not found!`);
|
|
20
|
-
const client = new coasyClient_1.CoasyClient(auth.baseUrl, auth.apiKey);
|
|
21
|
-
yield client.destroyTrigger(webhookId);
|
|
22
|
-
});
|
|
23
|
-
exports.destroyCoasyTrigger = destroyCoasyTrigger;
|
|
24
|
-
const testCoasyTrigger = (request) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
const { triggerName, auth } = request;
|
|
26
|
-
const client = new coasyClient_1.CoasyClient(auth.baseUrl, auth.apiKey);
|
|
27
|
-
const response = yield client.listTriggerEvents(triggerName);
|
|
28
|
-
return [{ test: true }];
|
|
29
|
-
});
|
|
30
|
-
exports.testCoasyTrigger = testCoasyTrigger;
|
|
31
|
-
//# sourceMappingURL=triggers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/common/triggers.ts"],"names":[],"mappings":";;;;AACA,+CAA4C;AAgCrC,MAAM,kBAAkB,GAAG,CAAO,OAA6B,EAAE,EAAE;IACxE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC;IAChE,MAAM,MAAM,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7E,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/D,MAAM,KAAK,CAAC,GAAG,CAAS,GAAG,WAAW,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACrE,CAAC,CAAA,CAAC;AANW,QAAA,kBAAkB,sBAM7B;AAEK,MAAM,mBAAmB,GAAG,CAAO,OAA8B,EAAE,EAAE;IAC1E,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,GAAG,CAAS,GAAG,WAAW,cAAc,CAAC,CAAC;IACxE,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC,CAAA,CAAA;AAPY,QAAA,mBAAmB,uBAO/B;AAEM,MAAM,gBAAgB,GAAG,CAAO,OAA2B,EAAkB,EAAE;IACpF,MAAM,EAAE,WAAW,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAErC,MAAM,MAAM,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAE7D,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AACzB,CAAC,CAAA,CAAA;AAPY,QAAA,gBAAgB,oBAO5B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newAuthEvent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
triggerCategories: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
7
|
-
triggerNames: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
8
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {
|
|
12
|
-
triggerCategories: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
13
|
-
triggerNames: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
14
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
15
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
17
|
-
}>, {
|
|
18
|
-
triggerCategories: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
19
|
-
triggerNames: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
20
|
-
}>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newAuthEvent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const triggers_1 = require("../common/triggers");
|
|
8
|
-
const triggerName = "NEW_AUTH_EVENT";
|
|
9
|
-
exports.newAuthEvent = (0, pieces_framework_1.createTrigger)({
|
|
10
|
-
auth: __1.coasyAuth,
|
|
11
|
-
name: 'newAuthEvent',
|
|
12
|
-
displayName: 'New Auth event',
|
|
13
|
-
description: 'Triggers when an authentication (signUp, password forgotten etc.) event happens',
|
|
14
|
-
props: {
|
|
15
|
-
triggerCategories: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
16
|
-
displayName: 'Trigger Categories',
|
|
17
|
-
description: 'categories of trigger',
|
|
18
|
-
required: true,
|
|
19
|
-
options: {
|
|
20
|
-
options: [{
|
|
21
|
-
value: "CustomEmailSender",
|
|
22
|
-
label: "Custom Email Sender"
|
|
23
|
-
}, {
|
|
24
|
-
value: "UserMigration",
|
|
25
|
-
label: "User Migration"
|
|
26
|
-
}, {
|
|
27
|
-
value: "DefineAuthChallenge",
|
|
28
|
-
label: "Define Auth Challenge"
|
|
29
|
-
}, {
|
|
30
|
-
value: "CreateAuthChallenge",
|
|
31
|
-
label: "Create Auth Challenge"
|
|
32
|
-
}, {
|
|
33
|
-
value: "VerifyAuthChallengeResponse",
|
|
34
|
-
label: "Verify Auth Challenge Response"
|
|
35
|
-
}]
|
|
36
|
-
}
|
|
37
|
-
}),
|
|
38
|
-
triggerNames: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
39
|
-
displayName: 'Triggers',
|
|
40
|
-
description: 'Select triggers to react on',
|
|
41
|
-
required: true,
|
|
42
|
-
options: {
|
|
43
|
-
options: [{
|
|
44
|
-
value: "SignUp",
|
|
45
|
-
label: "Sign Up"
|
|
46
|
-
}, {
|
|
47
|
-
value: "ResendCode",
|
|
48
|
-
label: "Resend Code"
|
|
49
|
-
}, {
|
|
50
|
-
value: "ForgotPassword",
|
|
51
|
-
label: "Forgot Password"
|
|
52
|
-
}, {
|
|
53
|
-
value: "Authentication",
|
|
54
|
-
label: "Authentication"
|
|
55
|
-
}, {
|
|
56
|
-
value: "ELSE",
|
|
57
|
-
label: "Else"
|
|
58
|
-
}]
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
},
|
|
62
|
-
sampleData: {},
|
|
63
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
64
|
-
onEnable: (context) => (0, triggers_1.createCoasyTrigger)({
|
|
65
|
-
triggerName,
|
|
66
|
-
webhookUrl: context.webhookUrl,
|
|
67
|
-
auth: context.auth,
|
|
68
|
-
filter: context.propsValue,
|
|
69
|
-
store: context.store
|
|
70
|
-
}),
|
|
71
|
-
onDisable: (context) => (0, triggers_1.destroyCoasyTrigger)({
|
|
72
|
-
triggerName,
|
|
73
|
-
auth: context.auth,
|
|
74
|
-
store: context.store
|
|
75
|
-
}),
|
|
76
|
-
run(context) {
|
|
77
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
return [context.payload.body];
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=new-auth-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-auth-event.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/triggers/new-auth-event.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,6BAAkC;AAClC,iDAA6E;AAE7E,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAExB,QAAA,YAAY,GAAG,IAAA,gCAAa,EAAC;IACxC,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,iFAAiF;IAC9F,KAAK,EAAE;QACL,iBAAiB,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YACpD,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,CAAC;wBACR,KAAK,EAAE,mBAAmB;wBAC1B,KAAK,EAAE,qBAAqB;qBAC7B,EAAE;wBACD,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,gBAAgB;qBACxB,EAAE;wBACD,KAAK,EAAE,qBAAqB;wBAC5B,KAAK,EAAE,uBAAuB;qBAC/B,EAAE;wBACD,KAAK,EAAE,qBAAqB;wBAC5B,KAAK,EAAE,uBAAuB;qBAC/B,EAAE;wBACD,KAAK,EAAE,6BAA6B;wBACpC,KAAK,EAAE,gCAAgC;qBACxC,CAAC;aACH;SACF,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YAC/C,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,CAAC;wBACR,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,SAAS;qBACjB,EAAE;wBACD,KAAK,EAAE,YAAY;wBACnB,KAAK,EAAE,aAAa;qBACrB,EAAE;wBACD,KAAK,EAAE,gBAAgB;wBACvB,KAAK,EAAE,iBAAiB;qBACzB,EAAE;wBACD,KAAK,EAAE,gBAAgB;wBACvB,KAAK,EAAE,gBAAgB;qBACxB,EAAE;wBACD,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACd,CAAC;aACH;SACF,CAAC;KACH;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,QAAQ,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,6BAAkB,EAAC;QACzC,WAAW;QACX,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,UAAU;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACF,SAAS,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,8BAAmB,EAAC;QAC3C,WAAW;QACX,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACI,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newFunnelParticipant: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
funnelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
8
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
-
}>, {
|
|
11
|
-
funnelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
12
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
13
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
15
|
-
}>, {
|
|
16
|
-
funnelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
17
|
-
}>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newFunnelParticipant = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const triggers_1 = require("../common/triggers");
|
|
8
|
-
const triggerName = "NEW_FUNNEL_PARTICIPANT";
|
|
9
|
-
exports.newFunnelParticipant = (0, pieces_framework_1.createTrigger)({
|
|
10
|
-
auth: __1.coasyAuth,
|
|
11
|
-
name: 'newFunnelParticipant',
|
|
12
|
-
displayName: 'New Funnel Participant',
|
|
13
|
-
description: 'Triggers when a new funnel particpant is created',
|
|
14
|
-
props: {
|
|
15
|
-
funnelIds: pieces_framework_1.Property.Array({
|
|
16
|
-
displayName: 'Funnel IDs',
|
|
17
|
-
description: 'IDs of funnel to react to',
|
|
18
|
-
required: false
|
|
19
|
-
})
|
|
20
|
-
},
|
|
21
|
-
sampleData: {},
|
|
22
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
23
|
-
onEnable: (context) => (0, triggers_1.createCoasyTrigger)({
|
|
24
|
-
triggerName,
|
|
25
|
-
webhookUrl: context.webhookUrl,
|
|
26
|
-
auth: context.auth,
|
|
27
|
-
filter: context.propsValue,
|
|
28
|
-
store: context.store
|
|
29
|
-
}),
|
|
30
|
-
onDisable: (context) => (0, triggers_1.destroyCoasyTrigger)({
|
|
31
|
-
triggerName,
|
|
32
|
-
auth: context.auth,
|
|
33
|
-
store: context.store
|
|
34
|
-
}),
|
|
35
|
-
run(context) {
|
|
36
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
return [context.payload.body];
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=new-funnel-participant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-funnel-participant.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/triggers/new-funnel-participant.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,6BAAkC;AAClC,iDAA6E;AAE7E,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAEhC,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,kDAAkD;IAC/D,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,QAAQ,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,6BAAkB,EAAC;QACzC,WAAW;QACX,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,UAAU;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACF,SAAS,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,8BAAmB,EAAC;QAC3C,WAAW;QACX,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACI,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newWebinarParticipant: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
webinarIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
-
selectedStartType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
8
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>, {
|
|
12
|
-
webinarIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
13
|
-
selectedStartType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
14
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
15
|
-
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
17
|
-
}>, {
|
|
18
|
-
webinarIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
19
|
-
selectedStartType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
20
|
-
}>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newWebinarParticipant = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
const triggers_1 = require("../common/triggers");
|
|
8
|
-
const triggerName = "NEW_WEBINAR_PARTICIPANT";
|
|
9
|
-
exports.newWebinarParticipant = (0, pieces_framework_1.createTrigger)({
|
|
10
|
-
auth: __1.coasyAuth,
|
|
11
|
-
name: 'newWebinarParticipant',
|
|
12
|
-
displayName: 'New Webinar Participant',
|
|
13
|
-
description: 'Triggers when a new webinar particpant is created',
|
|
14
|
-
props: {
|
|
15
|
-
webinarIds: pieces_framework_1.Property.Array({
|
|
16
|
-
displayName: 'Webinar IDs',
|
|
17
|
-
description: 'IDs of webinar to react to',
|
|
18
|
-
required: false
|
|
19
|
-
}),
|
|
20
|
-
selectedStartType: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
-
displayName: 'Selected start type',
|
|
22
|
-
description: 'filter only those participants',
|
|
23
|
-
required: false,
|
|
24
|
-
options: {
|
|
25
|
-
options: [{
|
|
26
|
-
label: "Instantly",
|
|
27
|
-
value: "INSTANTLY"
|
|
28
|
-
}, {
|
|
29
|
-
label: "Later",
|
|
30
|
-
value: "LATER"
|
|
31
|
-
}]
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
sampleData: {},
|
|
36
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
37
|
-
onEnable: (context) => (0, triggers_1.createCoasyTrigger)({
|
|
38
|
-
triggerName,
|
|
39
|
-
webhookUrl: context.webhookUrl,
|
|
40
|
-
auth: context.auth,
|
|
41
|
-
filter: context.propsValue,
|
|
42
|
-
store: context.store
|
|
43
|
-
}),
|
|
44
|
-
onDisable: (context) => (0, triggers_1.destroyCoasyTrigger)({
|
|
45
|
-
triggerName,
|
|
46
|
-
auth: context.auth,
|
|
47
|
-
store: context.store
|
|
48
|
-
}),
|
|
49
|
-
run(context) {
|
|
50
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
return [context.payload.body];
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=new-webinar-participant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-webinar-participant.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/coasy/src/lib/triggers/new-webinar-participant.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,6BAAkC;AAClC,iDAA6E;AAE7E,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAEjC,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACzB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACzC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,CAAC;wBACR,KAAK,EAAE,WAAW;wBAClB,KAAK,EAAE,WAAW;qBACnB,EAAE;wBACD,KAAK,EAAE,OAAO;wBACd,KAAK,EAAE,OAAO;qBACf,CAAC;aACH;SACF,CAAC;KACH;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,QAAQ,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,6BAAkB,EAAC;QACzC,WAAW;QACX,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,UAAU;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACF,SAAS,EAAG,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,8BAAmB,EAAC;QAC3C,WAAW;QACX,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACI,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|