orangeslice 2.1.4-beta.2 → 2.1.4
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/dist/cli.js +3 -5
- package/dist/ctx.d.ts +12 -7
- package/dist/ctx.js +6 -46
- package/dist/index.d.ts +1 -20
- package/dist/index.js +0 -2
- package/docs/integrations/attio/assertEntry.md +44 -0
- package/docs/integrations/attio/assertRecord.md +51 -0
- package/docs/integrations/attio/createAttribute.md +59 -0
- package/docs/integrations/attio/createComment.md +60 -0
- package/docs/integrations/attio/createEntry.md +44 -0
- package/docs/integrations/attio/createFolder.md +58 -0
- package/docs/integrations/attio/createList.md +51 -0
- package/docs/integrations/attio/createNote.md +47 -0
- package/docs/integrations/attio/createObject.md +39 -0
- package/docs/integrations/attio/createRecord.md +49 -0
- package/docs/integrations/attio/createSelectOption.md +37 -0
- package/docs/integrations/attio/createStatus.md +45 -0
- package/docs/integrations/attio/createTask.md +58 -0
- package/docs/integrations/attio/createWebhook.md +43 -0
- package/docs/integrations/attio/deleteComment.md +21 -0
- package/docs/integrations/attio/deleteEntry.md +23 -0
- package/docs/integrations/attio/deleteFile.md +21 -0
- package/docs/integrations/attio/deleteNote.md +21 -0
- package/docs/integrations/attio/deleteRecord.md +23 -0
- package/docs/integrations/attio/deleteTask.md +21 -0
- package/docs/integrations/attio/deleteWebhook.md +19 -0
- package/docs/integrations/attio/getAttribute.md +39 -0
- package/docs/integrations/attio/getCallRecording.md +33 -0
- package/docs/integrations/attio/getCallTranscript.md +38 -0
- package/docs/integrations/attio/getComment.md +31 -0
- package/docs/integrations/attio/getEntry.md +33 -0
- package/docs/integrations/attio/getFile.md +36 -0
- package/docs/integrations/attio/getList.md +33 -0
- package/docs/integrations/attio/getMeeting.md +39 -0
- package/docs/integrations/attio/getNote.md +33 -0
- package/docs/integrations/attio/getObject.md +31 -0
- package/docs/integrations/attio/getRecord.md +32 -0
- package/docs/integrations/attio/getSelf.md +27 -0
- package/docs/integrations/attio/getTask.md +34 -0
- package/docs/integrations/attio/getThread.md +36 -0
- package/docs/integrations/attio/getWebhook.md +31 -0
- package/docs/integrations/attio/getWorkspaceMember.md +32 -0
- package/docs/integrations/attio/index.md +122 -0
- package/docs/integrations/attio/listAttributes.md +38 -0
- package/docs/integrations/attio/listCallRecordings.md +35 -0
- package/docs/integrations/attio/listEntries.md +44 -0
- package/docs/integrations/attio/listEntryAttributeValues.md +36 -0
- package/docs/integrations/attio/listFiles.md +51 -0
- package/docs/integrations/attio/listLists.md +28 -0
- package/docs/integrations/attio/listMeetings.md +63 -0
- package/docs/integrations/attio/listNotes.md +39 -0
- package/docs/integrations/attio/listObjects.md +26 -0
- package/docs/integrations/attio/listRecordAttributeValues.md +35 -0
- package/docs/integrations/attio/listRecordEntries.md +37 -0
- package/docs/integrations/attio/listRecords.md +55 -0
- package/docs/integrations/attio/listSelectOptions.md +35 -0
- package/docs/integrations/attio/listStatuses.md +37 -0
- package/docs/integrations/attio/listTasks.md +45 -0
- package/docs/integrations/attio/listThreads.md +51 -0
- package/docs/integrations/attio/listWebhooks.md +31 -0
- package/docs/integrations/attio/listWorkspaceMembers.md +27 -0
- package/docs/integrations/attio/overwriteEntry.md +42 -0
- package/docs/integrations/attio/overwriteRecord.md +41 -0
- package/docs/integrations/attio/searchRecords.md +40 -0
- package/docs/integrations/attio/updateAttribute.md +53 -0
- package/docs/integrations/attio/updateEntry.md +42 -0
- package/docs/integrations/attio/updateList.md +49 -0
- package/docs/integrations/attio/updateObject.md +40 -0
- package/docs/integrations/attio/updateRecord.md +41 -0
- package/docs/integrations/attio/updateSelectOption.md +40 -0
- package/docs/integrations/attio/updateStatus.md +47 -0
- package/docs/integrations/attio/updateTask.md +57 -0
- package/docs/integrations/attio/updateWebhook.md +41 -0
- package/docs/integrations/index.md +42 -0
- package/docs/services/ctx/index.md +10 -9
- package/docs/services/index.md +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# updateObject
|
|
2
|
+
|
|
3
|
+
Update an object's metadata.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateObject({
|
|
7
|
+
object: "projects",
|
|
8
|
+
data: {
|
|
9
|
+
singular_noun: "Initiative",
|
|
10
|
+
plural_noun: "Initiatives",
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Input
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
{
|
|
19
|
+
object: string;
|
|
20
|
+
data: {
|
|
21
|
+
api_slug?: string;
|
|
22
|
+
singular_noun?: string;
|
|
23
|
+
plural_noun?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
{
|
|
32
|
+
data: {
|
|
33
|
+
id: { object_id: string };
|
|
34
|
+
api_slug: string;
|
|
35
|
+
singular_noun: string;
|
|
36
|
+
plural_noun: string;
|
|
37
|
+
created_at: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# updateRecord
|
|
2
|
+
|
|
3
|
+
Update a record. For multiselect attributes, new values are appended (existing values kept).
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateRecord({
|
|
7
|
+
object: "people",
|
|
8
|
+
record_id: "rec_01abc123def456",
|
|
9
|
+
data: {
|
|
10
|
+
values: {
|
|
11
|
+
job_title: "Senior Engineer",
|
|
12
|
+
tags: ["vip"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
{
|
|
22
|
+
object: string;
|
|
23
|
+
record_id: string;
|
|
24
|
+
data: {
|
|
25
|
+
values: Record<string, any>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
{
|
|
34
|
+
data: {
|
|
35
|
+
id: { workspace_id: string; object_id: string; record_id: string };
|
|
36
|
+
created_at: string;
|
|
37
|
+
web_url: string;
|
|
38
|
+
values: Record<string, Array<{ active_from?: string; active_until?: string | null; attribute_type?: string; [key: string]: any }>>;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# updateSelectOption
|
|
2
|
+
|
|
3
|
+
Update a select option.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateSelectOption({
|
|
7
|
+
target: "objects",
|
|
8
|
+
target_identifier: "companies",
|
|
9
|
+
attribute: "industry",
|
|
10
|
+
option: "fin-services-opt-id",
|
|
11
|
+
data: { title: "Finance & Banking" },
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Input
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
{
|
|
19
|
+
target: "objects" | "lists";
|
|
20
|
+
target_identifier: string;
|
|
21
|
+
attribute: string;
|
|
22
|
+
option: string;
|
|
23
|
+
data: {
|
|
24
|
+
title?: string;
|
|
25
|
+
is_archived?: boolean;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
{
|
|
34
|
+
data: {
|
|
35
|
+
id: { option_id: string };
|
|
36
|
+
title: string;
|
|
37
|
+
is_archived: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# updateStatus
|
|
2
|
+
|
|
3
|
+
Update a status.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateStatus({
|
|
7
|
+
target: "objects",
|
|
8
|
+
target_identifier: "deals",
|
|
9
|
+
attribute: "stage",
|
|
10
|
+
status: "negotiation-status-id",
|
|
11
|
+
data: {
|
|
12
|
+
title: "In Negotiation",
|
|
13
|
+
celebration_enabled: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
{
|
|
22
|
+
target: "objects" | "lists";
|
|
23
|
+
target_identifier: string;
|
|
24
|
+
attribute: string;
|
|
25
|
+
status: string;
|
|
26
|
+
data: {
|
|
27
|
+
title?: string;
|
|
28
|
+
is_archived?: boolean;
|
|
29
|
+
celebration_enabled?: boolean;
|
|
30
|
+
target_time_in_status?: string | null;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
{
|
|
39
|
+
data: {
|
|
40
|
+
id: { status_id: string };
|
|
41
|
+
title: string;
|
|
42
|
+
is_archived: boolean;
|
|
43
|
+
celebration_enabled: boolean;
|
|
44
|
+
target_time_in_status: string | null;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# updateTask
|
|
2
|
+
|
|
3
|
+
Update a task.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateTask({
|
|
7
|
+
task_id: "task_01abc123def456",
|
|
8
|
+
data: {
|
|
9
|
+
is_completed: true,
|
|
10
|
+
deadline_at: "2026-03-28T17:00:00.000Z",
|
|
11
|
+
assignees: [
|
|
12
|
+
{ workspace_member_email_address: "manager@example.com" },
|
|
13
|
+
],
|
|
14
|
+
linked_records: [
|
|
15
|
+
{ target_object: "companies", target_record_id: "rec_01abc123def456" },
|
|
16
|
+
{ target_object: "people", target_record_id: "rec_02xyz789ghi012" },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Input
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
{
|
|
26
|
+
task_id: string;
|
|
27
|
+
data: {
|
|
28
|
+
deadline_at?: string | null;
|
|
29
|
+
is_completed?: boolean;
|
|
30
|
+
assignees?: Array<
|
|
31
|
+
| { referenced_actor_type: string; referenced_actor_id: string }
|
|
32
|
+
| { workspace_member_email_address: string }
|
|
33
|
+
>;
|
|
34
|
+
linked_records?: Array<{
|
|
35
|
+
target_object: string;
|
|
36
|
+
target_record_id: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Output
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
{
|
|
46
|
+
data: {
|
|
47
|
+
id: { task_id: string };
|
|
48
|
+
content_plaintext: string;
|
|
49
|
+
is_completed: boolean;
|
|
50
|
+
deadline_at: string | null;
|
|
51
|
+
created_at: string;
|
|
52
|
+
created_by_actor: { type: string; id: string | null };
|
|
53
|
+
assignees: Array<{ type: string; id: string | null }>;
|
|
54
|
+
linked_records: Array<{ target_object: string; target_record_id: string }>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# updateWebhook
|
|
2
|
+
|
|
3
|
+
Update a webhook.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
const result = await integrations.attio.updateWebhook({
|
|
7
|
+
webhook_id: "wh_01abc234def567",
|
|
8
|
+
data: {
|
|
9
|
+
target_url: "https://example.com/webhooks/attio/v2",
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Input
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
{
|
|
18
|
+
webhook_id: string;
|
|
19
|
+
data: {
|
|
20
|
+
target_url?: string;
|
|
21
|
+
subscriptions?: Array<{
|
|
22
|
+
event_type: string;
|
|
23
|
+
filter: Record<string, any> | null;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
{
|
|
33
|
+
data: {
|
|
34
|
+
id: { webhook_id: string };
|
|
35
|
+
target_url: string;
|
|
36
|
+
subscriptions: Array<{ event_type: string; filter: Record<string, any> | null }>;
|
|
37
|
+
status: string;
|
|
38
|
+
created_at: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -149,6 +149,48 @@ const invite = await integrations.slack.conversationsInviteShared({
|
|
|
149
149
|
|
|
150
150
|
See [slack/](./slack/) for all available functions.
|
|
151
151
|
|
|
152
|
+
### Attio
|
|
153
|
+
|
|
154
|
+
CRM operations for records, lists, notes, tasks, and more.
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// List people with a filter
|
|
158
|
+
const people = await integrations.attio.listRecords({
|
|
159
|
+
object: "people",
|
|
160
|
+
filter: { email_addresses: { email_address: "jane@acme.com" } }
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Upsert a company by domain
|
|
164
|
+
const company = await integrations.attio.assertRecord({
|
|
165
|
+
object: "companies",
|
|
166
|
+
matching_attribute: "domains",
|
|
167
|
+
data: { values: { name: [{ value: "Acme Inc" }], domains: [{ domain: "acme.com" }] } }
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Add a record to a list
|
|
171
|
+
await integrations.attio.createEntry({
|
|
172
|
+
list_id: "sales_pipeline",
|
|
173
|
+
data: {
|
|
174
|
+
parent_record_id: company.data.id.record_id,
|
|
175
|
+
parent_object: "companies",
|
|
176
|
+
entry_values: { stage: "New Lead" }
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// Create a note on a record
|
|
181
|
+
await integrations.attio.createNote({
|
|
182
|
+
data: {
|
|
183
|
+
parent_object: "people",
|
|
184
|
+
parent_record_id: "rec_abc123",
|
|
185
|
+
title: "Call notes",
|
|
186
|
+
format: "plaintext",
|
|
187
|
+
content: "Discussed Q3 roadmap."
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
See [attio/](./attio/) for all available functions.
|
|
193
|
+
|
|
152
194
|
### Gmail
|
|
153
195
|
|
|
154
196
|
Send emails from connected Google Gmail accounts.
|
|
@@ -9,8 +9,7 @@ Manage Orange Slice spreadsheets programmatically. Create spreadsheets, add shee
|
|
|
9
9
|
## Quick start
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
import {
|
|
13
|
-
const { ctx } = services;
|
|
12
|
+
import { ctx } from "orangeslice";
|
|
14
13
|
|
|
15
14
|
// Create a spreadsheet
|
|
16
15
|
const ss = await ctx.createSpreadsheet({ name: "Leads" });
|
|
@@ -18,8 +17,12 @@ const ss = await ctx.createSpreadsheet({ name: "Leads" });
|
|
|
18
17
|
// Create a sheet with columns
|
|
19
18
|
await ctx.sql(ss.id, "CREATE TABLE contacts (name, email, website)");
|
|
20
19
|
|
|
21
|
-
// Insert data
|
|
22
|
-
|
|
20
|
+
// Insert data via addRows (not SQL)
|
|
21
|
+
const bound = ctx.spreadsheet(ss.id);
|
|
22
|
+
await bound.sheet("contacts").addRows([
|
|
23
|
+
{ name: "Acme", email: "hi@acme.com" },
|
|
24
|
+
{ name: "Globex", email: "hello@globex.com" }
|
|
25
|
+
]);
|
|
23
26
|
|
|
24
27
|
// Query data
|
|
25
28
|
const result = await ctx.sql(ss.id, "SELECT * FROM contacts WHERE name = 'Acme'");
|
|
@@ -40,19 +43,17 @@ console.log(result.rows);
|
|
|
40
43
|
Call `ctx.spreadsheet(id)` to get a handle bound to a specific spreadsheet:
|
|
41
44
|
|
|
42
45
|
```typescript
|
|
43
|
-
const { ctx } = services;
|
|
44
46
|
const ss = ctx.spreadsheet("uuid-here");
|
|
45
47
|
await ss.sql("SELECT * FROM contacts");
|
|
46
|
-
await ss.sheet("contacts").addRow({ name: "Corp", email: "corp@example.com" });
|
|
47
48
|
await ss.sheet("contacts").addRows([
|
|
49
|
+
{ name: "Corp", email: "corp@example.com" },
|
|
48
50
|
{ name: "Foo", email: "foo@example.com" },
|
|
49
51
|
{ name: "Bar", email: "bar@example.com" }
|
|
50
52
|
]);
|
|
51
53
|
```
|
|
52
54
|
|
|
53
55
|
- **`ss.sql(sql)`** — Execute EAV-SQL (same as `ctx.sql` but without needing to pass spreadsheetId).
|
|
54
|
-
- **`ss.sheet(name).
|
|
55
|
-
- **`ss.sheet(name).addRows(rows)`** — Insert multiple rows.
|
|
56
|
+
- **`ss.sheet(name).addRows(rows)`** — Insert one or more rows into the named sheet. Accepts a single row object or an array. Missing columns are auto-created.
|
|
56
57
|
|
|
57
58
|
## EAV-SQL Reference
|
|
58
59
|
|
|
@@ -62,7 +63,7 @@ The `sql` method supports a subset of SQL mapped to Orange Slice's EAV storage:
|
|
|
62
63
|
| -------------- | ---------------------------------------------------------- | -------------------------------- |
|
|
63
64
|
| `CREATE TABLE` | `CREATE TABLE leads (name, email, website)` | Creates a new sheet with columns |
|
|
64
65
|
| `SELECT` | `SELECT name, email FROM leads WHERE email LIKE '%@acme%'` | Query rows |
|
|
65
|
-
| `INSERT INTO` | `
|
|
66
|
+
| `INSERT INTO` | Use `ss.sheet(name).addRows([...])` instead | Add rows (not via SQL) |
|
|
66
67
|
| `ALTER TABLE` | `ALTER TABLE leads ADD COLUMN phone` | Add/rename/drop columns |
|
|
67
68
|
| `DELETE FROM` | `DELETE FROM leads WHERE email IS NULL` | Delete rows |
|
|
68
69
|
| `DROP TABLE` | `DROP TABLE leads` | Delete a sheet |
|
package/docs/services/index.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
- **ctx**: Spreadsheet management — create spreadsheets, run SQL, add sheets/columns/rows programmatically.
|
|
2
1
|
- **ai**: AI helpers (summaries, classifications, scoring).
|
|
3
2
|
- **apify**: Run any of 10,000+ Apify actors for web scraping, social media, e-commerce, and more.
|
|
4
3
|
- **browser**: Kernel browser automation - spin up cloud browsers, execute Playwright code, take screenshots. **Use this for scraping structured lists of repeated data** (e.g., product listings, search results, table rows) where you know the DOM structure. Also ideal for **intercepting network requests** to discover underlying APIs, then paginate those APIs directly in your code (faster & cheaper than clicking through pages). Perfect for JS-heavy sites that don't work with simple HTTP scraping.
|