picked 0.0.102 → 0.0.103-next.2
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/docs/reference/dashboard/external-apis.md +4 -0
- package/docs/reference/dashboard/labels.md +6 -6
- package/docs/reference/dashboard/workflow-tools.md +55 -0
- package/docs/reference/management-api/schema/external-api.md +35 -0
- package/docs/reference/management-api/schema/index.md +1 -0
- package/docs/reference/management-api/schema/workflow.md +18 -0
- package/package.json +4 -4
|
@@ -59,6 +59,9 @@ OAuth2 credential.
|
|
|
59
59
|
|
|
60
60
|
- Picked sends the token request as a `POST` with a form body, so no secret is in a URL.
|
|
61
61
|
- Picked uses an access token until 60 seconds before it expires.
|
|
62
|
+
- **Refresh credentials** on the page of the external API gets a new access token
|
|
63
|
+
immediately. The page then shows the time of the last refresh, or the reason for the
|
|
64
|
+
failure.
|
|
62
65
|
- Picked reads the lifetime from `expires_in_sec`, or else from `expires_in`. Picked keeps
|
|
63
66
|
a token with no lifetime for one hour.
|
|
64
67
|
- Picked counts an answer as a success when its JSON body has an `access_token`, for all
|
|
@@ -176,6 +179,7 @@ You can also do this task with the [Management API](/reference/management-api/sc
|
|
|
176
179
|
| --- | --- | --- | --- |
|
|
177
180
|
| Register an external API | [`externalApiCreate`](/reference/management-api/schema/external-api#externalapicreate) | None | None |
|
|
178
181
|
| Set or replace the authorization header | [`externalApiAuthHeaderSet`](/reference/management-api/schema/external-api#externalapiauthheaderset) | None | None |
|
|
182
|
+
| Get a new OAuth2 access token | [`externalApiOAuth2Refresh`](/reference/management-api/schema/external-api#externalapioauth2refresh) | None | None |
|
|
179
183
|
| Delete a registration | [`externalApiDelete`](/reference/management-api/schema/external-api#externalapidelete) | None | None |
|
|
180
184
|
| Set the arguments of an External API node | [`workflowGraphUpdate`](/reference/management-api/schema/workflow#workflowgraphupdate) | [`update_workflow_graph`](/reference/tools/mcp#update_workflow_graph) | `tools.update_workflow_graph({ workflow_id, update_nodes })` |
|
|
181
185
|
|
|
@@ -35,13 +35,13 @@ A run reads, sets and removes its own labels without a scope.
|
|
|
35
35
|
|
|
36
36
|
The **Labels** card shows the labels of one owner, in one section for each namespace.
|
|
37
37
|
|
|
38
|
-
| Page | Where the card shows
|
|
39
|
-
| -------------- |
|
|
40
|
-
| Lead | Next to the responses, or below them on a medium screen. On a narrow screen, it is on the **Labels** tab.
|
|
41
|
-
| Project labels | At `…/<project>/labels`.
|
|
42
|
-
| Run | Below the details of the run. On a narrow screen, the card is on the **Labels** tab.
|
|
38
|
+
| Page | Where the card shows | Scope to change the labels |
|
|
39
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
40
|
+
| Lead | Next to the responses, or below them on a medium screen. On a narrow screen, it is on the **Labels** tab. | `ORGANIZATION_LEADS_UPDATE` |
|
|
41
|
+
| Project labels | At `…/<project>/settings/labels`. The page opens for `ORGANIZATION_PROJECTS_READ`. | `ORGANIZATION_PROJECTS_UPDATE` |
|
|
42
|
+
| Run | Below the details of the run. On a narrow screen, the card is on the **Labels** tab. | `ORGANIZATION_PROJECTS_UPDATE` |
|
|
43
43
|
|
|
44
|
-
The project settings
|
|
44
|
+
The project settings have a **Labels** link to the Project labels page. To open the project
|
|
45
45
|
settings, you must have `ORGANIZATION_PROJECTS_UPDATE`.
|
|
46
46
|
|
|
47
47
|
Without the scope, the card shows the labels, and you cannot change them.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow tools
|
|
7
|
+
|
|
8
|
+
A tool node runs one tool. The inspector of the node shows the name of the tool and a short
|
|
9
|
+
description. This page gives the full reference for each tool.
|
|
10
|
+
|
|
11
|
+
The header of a tool node shows the name of the tool. To show a different name on the node,
|
|
12
|
+
type it in the **Title** field of the inspector. A title can have 80 characters or fewer. A
|
|
13
|
+
condition node also has a **Title** field. Without a title, a condition node shows its rules
|
|
14
|
+
in short form.
|
|
15
|
+
|
|
16
|
+
## Tools
|
|
17
|
+
|
|
18
|
+
| Tool | Name in the editor | What it does | Output |
|
|
19
|
+
| ----------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
20
|
+
| `workflow_noop` | **Log a message** | Records the text in its `message` argument on the node. | `message` |
|
|
21
|
+
| `search_leads` | **Search leads** | Finds the leads that match a query in the leads query language, the newest lead first. It finds 20 or fewer. | `leads` |
|
|
22
|
+
| `get_lead` | **Get lead** | Reads the lead of the visitor whose action started the run. `exists` is `false` when the visitor has no lead. | `lead` and `exists` |
|
|
23
|
+
| `create_lead` | **Create lead** | Creates a lead for the visitor, and sets the labels in its `labels` argument on it. | `lead`, `created` and `labelCount` |
|
|
24
|
+
| `set_lead_labels` | **Set lead labels** | Adds labels to the lead in its `lead` argument, or changes them. | `lead` and `count` |
|
|
25
|
+
| `remove_lead_labels` | **Remove lead labels** | Removes labels from the lead in its `lead` argument. | `lead` and `removed` |
|
|
26
|
+
| `set_project_labels` | **Set project labels** | Adds labels to the project of the run, or changes them. | `project` and `count` |
|
|
27
|
+
| `remove_project_labels` | **Remove project labels** | Removes labels from the project of the run. | `project` and `removed` |
|
|
28
|
+
| `get_project` | **Get project** | Reads the project of the run and its labels. | `project` |
|
|
29
|
+
| `set_run_labels` | **Set run labels** | Adds labels to the run, or changes them. | `run` and `count` |
|
|
30
|
+
| `remove_run_labels` | **Remove run labels** | Removes labels from the run. | `run` and `removed` |
|
|
31
|
+
| `get_run` | **Get run** | Reads the run and its labels. | `run` |
|
|
32
|
+
| `http` | **External API** | Sends a request to an external API that the project registered. The registration holds the credential. | `status`, `ok`, `body`, `bodyTruncated` and `durationMs` |
|
|
33
|
+
| `action_response` | **Action response** | Sends the payload in its `payload` argument to the visitor who started the action in its `actionId` argument. | `actionId` and `recorded` |
|
|
34
|
+
|
|
35
|
+
## Labels
|
|
36
|
+
|
|
37
|
+
A row of a label tool can expire. It can set a label only when the owner does not have it. It
|
|
38
|
+
can add to a `number` label. A row of a remove tool can remove a label only when the label
|
|
39
|
+
has a given value. For the arguments, the outputs and the scopes of the label tools, refer to
|
|
40
|
+
the [labels reference](/reference/dashboard/labels#tools).
|
|
41
|
+
|
|
42
|
+
## External APIs
|
|
43
|
+
|
|
44
|
+
For the arguments of **External API** and how to register an API, refer to
|
|
45
|
+
[Call an external API from a workflow](/how-to/call-an-external-api-from-a-workflow).
|
|
46
|
+
|
|
47
|
+
## Action responses
|
|
48
|
+
|
|
49
|
+
For **Action response**, refer to
|
|
50
|
+
[Wait for an action response](/how-to/wait-for-an-action-response).
|
|
51
|
+
|
|
52
|
+
## Failures
|
|
53
|
+
|
|
54
|
+
When a tool fails, the node fails. An edge on the error exit of the node can continue the
|
|
55
|
+
run. Refer to the [workflow runs reference](/reference/dashboard/workflow-runs#run-status).
|
|
@@ -78,6 +78,16 @@ Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`.
|
|
|
78
78
|
externalApiOAuth2Clear(input: ExternalApiOAuth2ClearInput!): ExternalApiOAuth2ClearPayload! @auth(only: USER)
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
### `externalApiOAuth2Refresh`
|
|
82
|
+
|
|
83
|
+
Fetches a new access token for the OAuth2 credential of an external API now, in place of any
|
|
84
|
+
cached one. An external API with no OAuth2 credential is refused.
|
|
85
|
+
Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`.
|
|
86
|
+
|
|
87
|
+
```graphql
|
|
88
|
+
externalApiOAuth2Refresh(input: ExternalApiOAuth2RefreshInput!): ExternalApiOAuth2RefreshPayload! @auth(only: USER)
|
|
89
|
+
```
|
|
90
|
+
|
|
81
91
|
### `externalApiDelete`
|
|
82
92
|
|
|
83
93
|
Deletes an external API and its credential. Workflows then cannot call its origin.
|
|
@@ -521,6 +531,16 @@ input ExternalApiOAuth2ClearInput {
|
|
|
521
531
|
}
|
|
522
532
|
```
|
|
523
533
|
|
|
534
|
+
### `ExternalApiOAuth2RefreshInput`
|
|
535
|
+
|
|
536
|
+
```graphql
|
|
537
|
+
"""The input of `externalApiOAuth2Refresh`."""
|
|
538
|
+
input ExternalApiOAuth2RefreshInput {
|
|
539
|
+
"""The ID of the external API."""
|
|
540
|
+
id: ID!
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
524
544
|
### `ExternalApiDeleteInput`
|
|
525
545
|
|
|
526
546
|
```graphql
|
|
@@ -606,6 +626,21 @@ type ExternalApiOAuth2ClearPayload {
|
|
|
606
626
|
}
|
|
607
627
|
```
|
|
608
628
|
|
|
629
|
+
### `ExternalApiOAuth2RefreshPayload`
|
|
630
|
+
|
|
631
|
+
```graphql
|
|
632
|
+
"""The result of `externalApiOAuth2Refresh`."""
|
|
633
|
+
type ExternalApiOAuth2RefreshPayload {
|
|
634
|
+
"""
|
|
635
|
+
The external API after the refresh. `oauth2.lastRefreshedAt` moves on a new token, and
|
|
636
|
+
`oauth2.lastRefreshFailure` says why there is none.
|
|
637
|
+
"""
|
|
638
|
+
externalApi: ExternalApi
|
|
639
|
+
"""The errors. Always empty."""
|
|
640
|
+
errors: [UserError!]!
|
|
641
|
+
}
|
|
642
|
+
```
|
|
643
|
+
|
|
609
644
|
### `ExternalApiDeletePayload`
|
|
610
645
|
|
|
611
646
|
```graphql
|
|
@@ -79,6 +79,7 @@ An operation with `@auth` needs a caller that has authenticated. `@auth(only: US
|
|
|
79
79
|
| [`externalApiCreate`](/reference/management-api/schema/external-api#externalapicreate) | Mutation | Creates an external API in a project, with an optional credential. Scope: `ORGANIZATION_INTEGRATIONS_CREATE`. |
|
|
80
80
|
| [`externalApiDelete`](/reference/management-api/schema/external-api#externalapidelete) | Mutation | Deletes an external API and its credential. Workflows then cannot call its origin. Scope: `ORGANIZATION_INTEGRATIONS_DELETE`. |
|
|
81
81
|
| [`externalApiOAuth2Clear`](/reference/management-api/schema/external-api#externalapioauth2clear) | Mutation | Removes the OAuth2 credential of an external API, with its secrets and cached access token. An external API with no OAuth2 credential is unchanged. Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`. |
|
|
82
|
+
| [`externalApiOAuth2Refresh`](/reference/management-api/schema/external-api#externalapioauth2refresh) | Mutation | Fetches a new access token for the OAuth2 credential of an external API now, in place of any cached one. An external API with no OAuth2 credential is refused. Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`. |
|
|
82
83
|
| [`externalApiOAuth2Set`](/reference/management-api/schema/external-api#externalapioauth2set) | Mutation | Sets the OAuth2 credential of an external API, and removes any static auth header. The next call fetches a new access token. Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`. |
|
|
83
84
|
| [`externalApiUpdate`](/reference/management-api/schema/external-api#externalapiupdate) | Mutation | Updates the name of an external API. To change the origin, delete it and create another. Scope: `ORGANIZATION_INTEGRATIONS_UPDATE`. |
|
|
84
85
|
| [`feature`](/reference/management-api/schema/feature#feature) | Query | Reads a feature flag by its ID and workspace. Scope: `ORGANIZATION_WORKSPACE_READ`. |
|
|
@@ -175,6 +175,12 @@ enum WorkflowEventName {
|
|
|
175
175
|
CONDITION_DELETED
|
|
176
176
|
"""An action was deleted."""
|
|
177
177
|
ACTION_DELETED
|
|
178
|
+
"""A lead was created."""
|
|
179
|
+
LEAD_CREATED
|
|
180
|
+
"""
|
|
181
|
+
A person or an API key changed a lead. A change a workflow run makes starts no workflow.
|
|
182
|
+
"""
|
|
183
|
+
LEAD_UPDATED
|
|
178
184
|
}
|
|
179
185
|
```
|
|
180
186
|
|
|
@@ -305,6 +311,10 @@ type WorkflowToolNode implements WorkflowNode {
|
|
|
305
311
|
tool: String!
|
|
306
312
|
"""The values of the arguments of the tool."""
|
|
307
313
|
configuration: JSON!
|
|
314
|
+
"""
|
|
315
|
+
The title the author gave the node. Null when the canvas shows the name of the tool.
|
|
316
|
+
"""
|
|
317
|
+
title: String
|
|
308
318
|
}
|
|
309
319
|
```
|
|
310
320
|
|
|
@@ -323,6 +333,10 @@ type WorkflowConditionNode implements WorkflowNode {
|
|
|
323
333
|
position: Position!
|
|
324
334
|
"""The rule the node evaluates."""
|
|
325
335
|
logic: JSON!
|
|
336
|
+
"""
|
|
337
|
+
The title the author gave the node. Null when the canvas shows a summary of the rule.
|
|
338
|
+
"""
|
|
339
|
+
title: String
|
|
326
340
|
}
|
|
327
341
|
```
|
|
328
342
|
|
|
@@ -373,6 +387,8 @@ input WorkflowToolNodeInput {
|
|
|
373
387
|
The values of the arguments of the tool. Omit for a tool with no arguments.
|
|
374
388
|
"""
|
|
375
389
|
configuration: JSON
|
|
390
|
+
"""A title for the node, at most 80 characters. Omit for none."""
|
|
391
|
+
title: String
|
|
376
392
|
}
|
|
377
393
|
```
|
|
378
394
|
|
|
@@ -383,6 +399,8 @@ input WorkflowToolNodeInput {
|
|
|
383
399
|
input WorkflowConditionNodeInput {
|
|
384
400
|
"""The rule the node evaluates."""
|
|
385
401
|
logic: JSON!
|
|
402
|
+
"""A title for the node, at most 80 characters. Omit for none."""
|
|
403
|
+
title: String
|
|
386
404
|
}
|
|
387
405
|
```
|
|
388
406
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "picked",
|
|
3
3
|
"description": "The Picked SDK front door: the client, the picked.config helpers, and the picked CLI in one install",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.103-next.2",
|
|
5
5
|
"bin": {
|
|
6
6
|
"picked": "dist/esm/bin.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@picked/cli": "0.0.
|
|
10
|
-
"@picked/config": "0.0.
|
|
9
|
+
"@picked/cli": "0.0.103-next.2",
|
|
10
|
+
"@picked/config": "0.0.103-next.2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@picked/client": "workspace:*",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"main": "./dist/cjs/index.js",
|
|
65
65
|
"module": "./dist/esm/index.js",
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@picked/client": "0.0.
|
|
67
|
+
"@picked/client": "0.0.103-next.2"
|
|
68
68
|
},
|
|
69
69
|
"private": false,
|
|
70
70
|
"publishConfig": {
|