picked 0.0.105 → 0.0.106-next.1

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.
@@ -15,22 +15,57 @@ in short form.
15
15
 
16
16
  ## Tools
17
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` |
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
+ | `upsert_lead` | **Create or update lead** | Updates the lead of the visitor with the responses of the action. If the lead is too old, it creates a lead. | `lead`, `created`, `updated`, `changedKeys` and `labelCount` |
25
+ | `set_lead_labels` | **Set lead labels** | Adds labels to the lead in its `lead` argument, or changes them. | `lead` and `count` |
26
+ | `remove_lead_labels` | **Remove lead labels** | Removes labels from the lead in its `lead` argument. | `lead` and `removed` |
27
+ | `set_project_labels` | **Set project labels** | Adds labels to the project of the run, or changes them. | `project` and `count` |
28
+ | `remove_project_labels` | **Remove project labels** | Removes labels from the project of the run. | `project` and `removed` |
29
+ | `get_project` | **Get project** | Reads the project of the run and its labels. | `project` |
30
+ | `set_run_labels` | **Set run labels** | Adds labels to the run, or changes them. | `run` and `count` |
31
+ | `remove_run_labels` | **Remove run labels** | Removes labels from the run. | `run` and `removed` |
32
+ | `get_run` | **Get run** | Reads the run and its labels. | `run` |
33
+ | `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` |
34
+ | `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` |
35
+
36
+ ## Create or update lead
37
+
38
+ **Create or update lead** (`upsert_lead`) records the responses of the action that started the
39
+ run. A run that an event started records no lead.
40
+
41
+ | Argument | Required | Value |
42
+ | ---------------- | -------- | ------------------------------------------------------------------------------------------- |
43
+ | `sameLeadWithin` | Yes | A number of seconds from 1 to 31536000. |
44
+ | `prefer` | Yes | `newer` or `older`. |
45
+ | `labels` | No | Labels to set on the lead. The value has the same shape as the `labels` of **Create lead**. |
46
+
47
+ The tool finds the newest lead of the visitor. If the last change to that lead is in the
48
+ `sameLeadWithin` seconds before the action, the tool updates that lead. Otherwise, the tool
49
+ creates a lead, the same as **Create lead**.
50
+
51
+ An update keeps each key of the lead. It adds each key that only the action has. For a key
52
+ that the action and the lead both have, `newer` keeps the value from the action. `older`
53
+ keeps the value from the lead. If the value in the lead is empty, `older` also uses the value
54
+ from the action.
55
+
56
+ An empty value from the action does not change the lead. An empty value is `null`, an empty
57
+ list, an empty object or a text with only spaces. `false` and `0` are
58
+ not empty.
59
+
60
+ | Output | Value |
61
+ | ------------- | ------------------------------------------------------------------------------ |
62
+ | `lead` | The lead that the tool created or updated. |
63
+ | `created` | `true` if the tool created a lead. |
64
+ | `updated` | `true` if the tool changed the responses of a lead that existed. |
65
+ | `changedKeys` | The response keys with a changed value. After a create, all the response keys. |
66
+ | `labelCount` | The number of labels that the tool set. |
67
+
68
+ The output does not show the response values.
34
69
 
35
70
  ## Labels
36
71
 
@@ -129,6 +129,7 @@ For a Shopify store, the `session` context also holds `shopify_client_id`,
129
129
  | `identify` | The SDK connects the session to a known person or store client. | `app`, `session` | `experience`, `feature_list`, `step` |
130
130
  | `lead_capture` | The visitor gives contact details. | `feature_list`, `session` | `experience`, `step` |
131
131
  | `lead_created` | The Picked API records the lead from a capture. | `app`, `session` | None. |
132
+ | `lead_updated` | The Picked API changes the responses of a lead from a later capture. | `app`, `session` | None. |
132
133
  | `modal_open` | A modal opens. | `feature_list`, `modal`, `session` | `experience`, `step` |
133
134
  | `modal_close` | A modal closes. | `feature_list`, `modal`, `session` | `experience`, `step` |
134
135
 
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.105",
4
+ "version": "0.0.106-next.1",
5
5
  "bin": {
6
6
  "picked": "dist/esm/bin.js"
7
7
  },
8
8
  "dependencies": {
9
- "@picked/cli": "0.0.105",
10
- "@picked/config": "0.0.105"
9
+ "@picked/cli": "0.0.106-next.1",
10
+ "@picked/config": "0.0.106-next.1"
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.105"
67
+ "@picked/client": "0.0.106-next.1"
68
68
  },
69
69
  "private": false,
70
70
  "publishConfig": {