@macro-inc/sdk 0.4.1 → 0.5.0
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/README.md +169 -7
- package/dist/{chunk-PTX2RV2N.js → chunk-3SW6QVDV.js} +33 -0
- package/dist/{chunk-XFA7NCJ5.js → chunk-GT5EUYOR.js} +13 -15
- package/dist/{chunk-ZLBDES7U.js → chunk-HIW6KU2I.js} +490 -4
- package/dist/{chunk-AZJUIUIV.js → chunk-J2VK3NOR.js} +56 -0
- package/dist/{chunk-PZPTJI6F.js → chunk-UVJLWLSJ.js} +41 -2
- package/dist/generated/agent-fold/index.d.ts +8 -6
- package/dist/generated/agent-harness/index.d.ts +1 -1
- package/dist/generated/agent-harness/index.js +1 -1
- package/dist/generated/agent-harness/sdk.gen.d.ts +17 -1
- package/dist/generated/agent-harness/types.gen.d.ts +188 -3
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +13 -15
- package/dist/generated/auth/types.gen.d.ts +36 -17
- package/dist/generated/cognition/index.d.ts +1 -1
- package/dist/generated/cognition/index.js +1 -1
- package/dist/generated/cognition/sdk.gen.d.ts +38 -1
- package/dist/generated/cognition/types.gen.d.ts +473 -4
- package/dist/generated/connection/types.gen.d.ts +1 -1
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/types.gen.d.ts +36 -1
- package/dist/generated/scheduled-action/index.d.ts +1 -1
- package/dist/generated/scheduled-action/index.js +1 -1
- package/dist/generated/scheduled-action/sdk.gen.d.ts +17 -2
- package/dist/generated/scheduled-action/types.gen.d.ts +642 -104
- package/dist/generated/storage/index.d.ts +1 -1
- package/dist/generated/storage/index.js +1 -1
- package/dist/generated/storage/sdk.gen.d.ts +204 -5
- package/dist/generated/storage/types.gen.d.ts +3969 -374
- package/dist/src/entities/account-managers/grant.d.ts +28 -5
- package/dist/src/entities/account-managers/namespace.d.ts +15 -3
- package/dist/src/entities/activity/entity.d.ts +7 -0
- package/dist/src/entities/activity/namespace.d.ts +58 -0
- package/dist/src/entities/activity/namespace.test.d.ts +1 -0
- package/dist/src/entities/agent-sessions/activity.d.ts +10 -2
- package/dist/src/entities/agent-sessions/agent-session.d.ts +193 -18
- package/dist/src/entities/agent-sessions/code-execution.d.ts +15 -3
- package/dist/src/entities/agent-sessions/conversation.d.ts +46 -9
- package/dist/src/entities/agent-sessions/namespace.d.ts +71 -16
- package/dist/src/entities/agent-sessions/origin.d.ts +1 -1
- package/dist/src/entities/agent-sessions/queued-action.d.ts +17 -3
- package/dist/src/entities/agent-sessions/review.d.ts +55 -4
- package/dist/src/entities/agent-sessions/tool-approval.d.ts +5 -1
- package/dist/src/entities/agents/agent.d.ts +98 -3
- package/dist/src/entities/agents/namespace.d.ts +52 -8
- package/dist/src/entities/ai/namespace.d.ts +9 -1
- package/dist/src/entities/api-keys/api-key.d.ts +6 -1
- package/dist/src/entities/api-keys/namespace.d.ts +15 -3
- package/dist/src/entities/bots/bot.d.ts +38 -6
- package/dist/src/entities/bots/namespace.d.ts +13 -1
- package/dist/src/entities/bots/token.d.ts +6 -1
- package/dist/src/entities/calendar/booking-link.d.ts +7 -1
- package/dist/src/entities/calendar/booking-namespace.d.ts +13 -0
- package/dist/src/entities/calendar/booking.d.ts +15 -0
- package/dist/src/entities/calendar/calendar.d.ts +7 -1
- package/dist/src/entities/calendar/event.d.ts +59 -9
- package/dist/src/entities/calendar/namespace.d.ts +88 -10
- package/dist/src/entities/calendar/replacement.d.ts +19 -3
- package/dist/src/entities/calls/call-record.d.ts +90 -14
- package/dist/src/entities/calls/connection.d.ts +7 -1
- package/dist/src/entities/calls/message.d.ts +27 -5
- package/dist/src/entities/calls/namespace.d.ts +15 -3
- package/dist/src/entities/canvases/canvas.d.ts +324 -0
- package/dist/src/entities/channels/access-request.d.ts +10 -2
- package/dist/src/entities/channels/activity.d.ts +20 -4
- package/dist/src/entities/channels/channel.d.ts +130 -23
- package/dist/src/entities/channels/labels.d.ts +41 -7
- package/dist/src/entities/channels/message.d.ts +41 -7
- package/dist/src/entities/channels/namespace.d.ts +28 -3
- package/dist/src/entities/channels/post.test.d.ts +1 -0
- package/dist/src/entities/channels/thread.d.ts +19 -3
- package/dist/src/entities/chats/chat.d.ts +56 -6
- package/dist/src/entities/chats/generation.d.ts +11 -2
- package/dist/src/entities/chats/namespace.d.ts +10 -2
- package/dist/src/entities/connected-apps/connected-app.d.ts +14 -1
- package/dist/src/entities/connected-apps/connector.d.ts +3 -0
- package/dist/src/entities/connected-apps/namespace.d.ts +16 -0
- package/dist/src/entities/crm/company.d.ts +63 -15
- package/dist/src/entities/crm/contact.d.ts +60 -13
- package/dist/src/entities/crm/namespace.d.ts +85 -11
- package/dist/src/entities/crm/pipeline-entry.d.ts +102 -0
- package/dist/src/entities/crm/pipeline.d.ts +271 -27
- package/dist/src/entities/crm/pipelines.d.ts +39 -2
- package/dist/src/entities/databases/column.d.ts +54 -7
- package/dist/src/entities/databases/database.d.ts +126 -12
- package/dist/src/entities/databases/namespace.d.ts +16 -4
- package/dist/src/entities/databases/row.d.ts +2 -0
- package/dist/src/entities/databases/saved-query.d.ts +145 -0
- package/dist/src/entities/databases/table.d.ts +64 -10
- package/dist/src/entities/databases/view.d.ts +27 -5
- package/dist/src/entities/databases/webhook.d.ts +8 -1
- package/dist/src/entities/documents/ai-edit.d.ts +2 -0
- package/dist/src/entities/documents/anchor.d.ts +12 -2
- package/dist/src/entities/documents/comment.d.ts +29 -5
- package/dist/src/entities/documents/document.d.ts +243 -20
- package/dist/src/entities/documents/markdown.d.ts +25 -0
- package/dist/src/entities/documents/namespace.d.ts +132 -13
- package/dist/src/entities/documents/skills.test.d.ts +1 -0
- package/dist/src/entities/documents/system-skill.d.ts +21 -1
- package/dist/src/entities/documents/text-comment.d.ts +41 -0
- package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
- package/dist/src/entities/documents/version.d.ts +5 -1
- package/dist/src/entities/email/attachment.d.ts +3 -0
- package/dist/src/entities/email/draft.d.ts +61 -9
- package/dist/src/entities/email/filter.d.ts +12 -2
- package/dist/src/entities/email/label.d.ts +7 -1
- package/dist/src/entities/email/link.d.ts +5 -1
- package/dist/src/entities/email/message.d.ts +55 -8
- package/dist/src/entities/email/namespace.d.ts +127 -21
- package/dist/src/entities/email/thread.d.ts +99 -16
- package/dist/src/entities/entity-mentions/mention.d.ts +6 -1
- package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
- package/dist/src/entities/entity.d.ts +56 -6
- package/dist/src/entities/external-chat/chat.d.ts +62 -11
- package/dist/src/entities/external-chat/message.d.ts +1 -1
- package/dist/src/entities/external-chat/namespace.d.ts +5 -1
- package/dist/src/entities/external-chat/send.d.ts +10 -2
- package/dist/src/entities/favorites/namespace.d.ts +20 -3
- package/dist/src/entities/foreign/foreign-entity.d.ts +5 -1
- package/dist/src/entities/foreign/namespace.d.ts +4 -0
- package/dist/src/entities/forms/form.d.ts +71 -13
- package/dist/src/entities/forms/namespace.d.ts +10 -2
- package/dist/src/entities/forms/question.d.ts +35 -7
- package/dist/src/entities/forms/response.d.ts +25 -5
- package/dist/src/entities/forms/section.d.ts +15 -3
- package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
- package/dist/src/entities/github-pull-requests/pull-request.d.ts +15 -3
- package/dist/src/entities/harnesses/harness.d.ts +51 -3
- package/dist/src/entities/harnesses/namespace.d.ts +53 -7
- package/dist/src/entities/harnesses/pairing.d.ts +12 -2
- package/dist/src/entities/images/image.d.ts +16 -5
- package/dist/src/entities/images/namespace.d.ts +8 -1
- package/dist/src/entities/initiatives/initiative.d.ts +117 -3
- package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
- package/dist/src/entities/initiatives/namespace.d.ts +69 -7
- package/dist/src/entities/me/namespace.d.ts +27 -2
- package/dist/src/entities/meetings/meeting.d.ts +45 -8
- package/dist/src/entities/meetings/namespace.d.ts +20 -4
- package/dist/src/entities/memory/namespace.d.ts +49 -0
- package/dist/src/entities/memory/namespace.test.d.ts +1 -0
- package/dist/src/entities/messages/discussion.d.ts +84 -0
- package/dist/src/entities/messages/thread.d.ts +19 -5
- package/dist/src/entities/notifications/namespace.d.ts +40 -7
- package/dist/src/entities/notifications/notification.d.ts +29 -5
- package/dist/src/entities/pins/namespace.d.ts +23 -4
- package/dist/src/entities/projects/namespace.d.ts +29 -0
- package/dist/src/entities/projects/project.d.ts +47 -6
- package/dist/src/entities/properties/namespace.d.ts +67 -11
- package/dist/src/entities/properties/namespace.test.d.ts +1 -0
- package/dist/src/entities/properties/property-definition.d.ts +30 -5
- package/dist/src/entities/properties/property-option.d.ts +14 -2
- package/dist/src/entities/referrals/namespace.d.ts +8 -1
- package/dist/src/entities/routines/namespace.d.ts +128 -7
- package/dist/src/entities/routines/routine.d.ts +111 -25
- package/dist/src/entities/saved-views/namespace.d.ts +57 -0
- package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
- package/dist/src/entities/search/namespace.d.ts +5 -1
- package/dist/src/entities/sharing/access.d.ts +50 -9
- package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
- package/dist/src/entities/tasks/namespace.d.ts +13 -1
- package/dist/src/entities/tasks/task.d.ts +7 -1
- package/dist/src/entities/teams/invite.d.ts +3 -0
- package/dist/src/entities/teams/namespace.d.ts +10 -2
- package/dist/src/entities/teams/team.d.ts +7 -0
- package/dist/src/entities/unfurls/namespace.d.ts +12 -2
- package/dist/src/entities/users/namespace.d.ts +19 -1
- package/dist/src/entities/users/profile-picture.d.ts +29 -0
- package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
- package/dist/src/entities/users/user.d.ts +52 -1
- package/dist/src/entities/web/namespace.d.ts +6 -0
- package/dist/src/entities/webhooks/namespace.d.ts +5 -0
- package/dist/src/entities/webhooks/webhook.d.ts +47 -7
- package/dist/src/entities/whatsapp/account.d.ts +5 -1
- package/dist/src/entities/whatsapp/chat.d.ts +9 -1
- package/dist/src/entities/whatsapp/namespace.d.ts +7 -1
- package/dist/src/entities/workspace/namespace.d.ts +7 -1
- package/dist/src/entities/workspace/query.d.ts +5 -1
- package/dist/src/events/hydrate/user.d.ts +14 -0
- package/dist/src/events/receiver.d.ts +2 -0
- package/dist/src/events/types.d.ts +2 -1
- package/dist/src/macro.d.ts +33 -5
- package/dist/src/macro.js +15635 -10132
- package/dist/src/utils/lazy.d.ts +7 -1
- package/package.json +1 -1
- package/dist/src/entities/crm/comment.d.ts +0 -64
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type { AccessiblePipeline, CardPosition, ColumnDetail, CreatePipeline, DatabaseOp, DatabaseView as DatabaseViewRecord, StorageRow, StorageRowsQuery, TableDetail } from '../../../generated/storage/types.gen';
|
|
1
|
+
import type { AccessiblePipeline, CardPosition, ColumnDetail, CreatePipeline, DatabaseOp, DatabaseView as DatabaseViewRecord, EditPipelineRequest, StorageRow, StorageRowsQuery, TableDetail } from '../../../generated/storage/types.gen';
|
|
2
2
|
import type { MacroClient } from '../../utils/client';
|
|
3
|
+
import { Document } from '../documents/document';
|
|
3
4
|
import { MacroEntity } from '../entity';
|
|
4
5
|
import { PropertyOption } from '../properties/property-option';
|
|
5
6
|
import { type SharePermissionOptions } from '../sharing/permissions';
|
|
6
7
|
import { Team } from '../teams/team';
|
|
7
8
|
import { User } from '../users/user';
|
|
9
|
+
import { Company } from './company';
|
|
10
|
+
import { Contact } from './contact';
|
|
11
|
+
import { PipelineEntry, type PipelineField, type PipelineFieldChange, type PipelineFieldInputs, type PipelineFieldTotal, type PipelineImport, type PipelineOptionCounts, type PipelineRecordInput } from './pipeline-entry';
|
|
8
12
|
/** Required fields for one option of a pipeline stage column. */
|
|
9
13
|
export type PipelineStageRequirement = {
|
|
10
14
|
stageColumn: PipelineColumn;
|
|
@@ -31,35 +35,221 @@ export declare class CrmPipeline extends MacroEntity<AccessiblePipeline> {
|
|
|
31
35
|
readonly owner: () => Promise<User>;
|
|
32
36
|
/** Owning team. */
|
|
33
37
|
readonly team: () => Promise<Team>;
|
|
34
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Rename this pipeline.
|
|
40
|
+
*
|
|
41
|
+
* @write
|
|
42
|
+
* @idempotent
|
|
43
|
+
*/
|
|
35
44
|
rename(name: string): Promise<void>;
|
|
36
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Change its sharing scope.
|
|
47
|
+
*
|
|
48
|
+
* @write
|
|
49
|
+
* @idempotent
|
|
50
|
+
*/
|
|
37
51
|
setSharing(sharing: CreatePipeline['sharing']): Promise<void>;
|
|
38
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Trash or restore the pipeline.
|
|
54
|
+
*
|
|
55
|
+
* @destructive
|
|
56
|
+
* @idempotent
|
|
57
|
+
*/
|
|
39
58
|
setTrashed(trashed: boolean): Promise<void>;
|
|
40
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Read sharing grants.
|
|
61
|
+
*
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
41
64
|
sharePermissions(): Promise<import("../../../generated/storage").SharePermissionV2>;
|
|
42
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Update sharing grants.
|
|
67
|
+
*
|
|
68
|
+
* @write
|
|
69
|
+
* @idempotent
|
|
70
|
+
*/
|
|
43
71
|
updateSharePermissions(options: SharePermissionOptions): Promise<import("../../../generated/storage").SharePermissionV2>;
|
|
44
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Read stage rules with column and option handles that survive renames.
|
|
74
|
+
*
|
|
75
|
+
* @readonly
|
|
76
|
+
*/
|
|
45
77
|
stageRequirements(): Promise<PipelineStageRequirement[]>;
|
|
46
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Require fields when entering a stage; an empty list removes that stage's rule.
|
|
80
|
+
*
|
|
81
|
+
* @write
|
|
82
|
+
* @idempotent
|
|
83
|
+
* @mcp-exclude Takes a handle built from a listing record, which an MCP call can't reference.
|
|
84
|
+
*/
|
|
47
85
|
setStageRequirements(stageColumn: PipelineColumn, stage: PropertyOption, requiredFields: PipelineColumn[]): Promise<void>;
|
|
48
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Read the backing table through the pipeline's authorization boundary.
|
|
88
|
+
*
|
|
89
|
+
* @readonly
|
|
90
|
+
*/
|
|
49
91
|
table(): Promise<PipelineTable>;
|
|
50
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Saved card order through this pipeline's authorization boundary.
|
|
94
|
+
*
|
|
95
|
+
* @readonly
|
|
96
|
+
* @mcp-exclude Takes a handle built from a listing record, which an MCP call can't reference.
|
|
97
|
+
*/
|
|
51
98
|
viewPositions(view: PipelineView): Promise<CardPosition[]>;
|
|
52
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* @internal Cached table snapshot shared by all pipeline table handles.
|
|
101
|
+
*
|
|
102
|
+
* @readonly
|
|
103
|
+
* @mcp-exclude Internal cache accessor shared by pipeline handles.
|
|
104
|
+
*/
|
|
53
105
|
tableRecord(): Promise<TableDetail>;
|
|
54
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Rows in pipeline order, automatically paginated.
|
|
108
|
+
*
|
|
109
|
+
* @readonly
|
|
110
|
+
*/
|
|
55
111
|
rows(): AsyncGenerator<PipelineRow>;
|
|
56
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Query pipeline rows, optionally restricting the query to typed row handles.
|
|
114
|
+
*
|
|
115
|
+
* @readonly
|
|
116
|
+
*/
|
|
57
117
|
queryRows(options?: {
|
|
58
118
|
query?: StorageRowsQuery['query'];
|
|
59
119
|
rows?: PipelineRow[];
|
|
60
120
|
}): AsyncGenerator<PipelineRow>;
|
|
121
|
+
/**
|
|
122
|
+
* Add companies or contacts as entries (deals), filling fields by name: a
|
|
123
|
+
* stage by its label, a person as `'me'` or an email. A generic pipeline's
|
|
124
|
+
* entries name no record, only fields. A record already in the pipeline is
|
|
125
|
+
* not added again unless `allowDuplicates` (a separate second deal); its
|
|
126
|
+
* entry comes back in `alreadyPresent`.
|
|
127
|
+
*
|
|
128
|
+
* @write
|
|
129
|
+
*/
|
|
130
|
+
addRecords(entries: {
|
|
131
|
+
record?: PipelineRecordInput;
|
|
132
|
+
set?: PipelineFieldInputs;
|
|
133
|
+
}[], options?: {
|
|
134
|
+
allowDuplicates?: boolean;
|
|
135
|
+
}): Promise<{
|
|
136
|
+
added: PipelineEntry[];
|
|
137
|
+
alreadyPresent: PipelineEntry[];
|
|
138
|
+
version: number | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Set fields of entries by name, all or nothing: a stage by its label, a
|
|
142
|
+
* person as `'me'` or an email, `null` to empty. Name an entry, or a company
|
|
143
|
+
* or contact with exactly one entry here. Pass `baseVersion` (from
|
|
144
|
+
* {@link CrmPipeline.find}) to refuse the change if the pipeline changed
|
|
145
|
+
* since. Each returned entry carries the fields the update set.
|
|
146
|
+
*
|
|
147
|
+
* @destructive
|
|
148
|
+
* @mcp-exclude Takes a pipeline entry built from a listing record, which an MCP call cannot reference.
|
|
149
|
+
*/
|
|
150
|
+
updateEntries(updates: {
|
|
151
|
+
entry: PipelineEntry | Company | Contact;
|
|
152
|
+
set: PipelineFieldInputs;
|
|
153
|
+
}[], options?: {
|
|
154
|
+
baseVersion?: number;
|
|
155
|
+
}): Promise<{
|
|
156
|
+
updated: {
|
|
157
|
+
entry: PipelineEntry;
|
|
158
|
+
changes: PipelineFieldChange[];
|
|
159
|
+
}[];
|
|
160
|
+
version: number | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Delete entries: each entry given, and every entry of each company or
|
|
164
|
+
* contact given. The companies and contacts stay in the CRM. Returns the
|
|
165
|
+
* deleted entries as they were.
|
|
166
|
+
*
|
|
167
|
+
* @destructive
|
|
168
|
+
* @mcp-exclude Takes a pipeline entry built from a listing record, which an MCP call cannot reference.
|
|
169
|
+
*/
|
|
170
|
+
removeRecords(targets: (PipelineEntry | Company | Contact)[]): Promise<{
|
|
171
|
+
removed: PipelineEntry[];
|
|
172
|
+
version: number | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
/**
|
|
175
|
+
* Read entries by field name and label: `where` filters (`{ Stage: 'Demo' }`,
|
|
176
|
+
* a list for any of several, `null` for empty), only some companies or
|
|
177
|
+
* contacts, or a search of their names, domains and emails; sorted by a
|
|
178
|
+
* field. Also answers per-stage counts and number totals (such as Revenue)
|
|
179
|
+
* over every match, and the pipeline's fields and version.
|
|
180
|
+
*
|
|
181
|
+
* @param query.limit Most entries to return, 1 to 5000 (default 50); counts and totals cover every match.
|
|
182
|
+
*
|
|
183
|
+
* @readonly
|
|
184
|
+
*/
|
|
185
|
+
find(query?: {
|
|
186
|
+
where?: PipelineFieldInputs;
|
|
187
|
+
records?: (Company | Contact)[];
|
|
188
|
+
search?: string;
|
|
189
|
+
sortBy?: string;
|
|
190
|
+
descending?: boolean;
|
|
191
|
+
limit?: number;
|
|
192
|
+
}): Promise<{
|
|
193
|
+
entries: PipelineEntry[];
|
|
194
|
+
matched: number;
|
|
195
|
+
complete: boolean;
|
|
196
|
+
counts: PipelineOptionCounts[];
|
|
197
|
+
totals: PipelineFieldTotal[];
|
|
198
|
+
fields: PipelineField[];
|
|
199
|
+
version: number;
|
|
200
|
+
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Rename or share the pipeline and change its fields and options by name,
|
|
203
|
+
* in one change: add fields (text, number, checkbox, date, link, select,
|
|
204
|
+
* multi_select, person or people), rename or delete fields, and add,
|
|
205
|
+
* relabel or delete options (new Stage options become the last stages).
|
|
206
|
+
* Returns the fields and version afterwards.
|
|
207
|
+
*
|
|
208
|
+
* @destructive
|
|
209
|
+
*/
|
|
210
|
+
edit(changes: EditPipelineRequest): Promise<{
|
|
211
|
+
fields: PipelineField[];
|
|
212
|
+
version: number;
|
|
213
|
+
}>;
|
|
214
|
+
/**
|
|
215
|
+
* Add a CSV's rows as entries: CSV text, or a CSV document. Columns match
|
|
216
|
+
* fields by name; Company and Domain (or Contact and Email) name each row's
|
|
217
|
+
* record, created when the team lacks it. Records already here are not
|
|
218
|
+
* added again, and select options the CSV needs are added.
|
|
219
|
+
*
|
|
220
|
+
* @write
|
|
221
|
+
*/
|
|
222
|
+
importCsv(source: string | Document): Promise<PipelineImport>;
|
|
223
|
+
/**
|
|
224
|
+
* Every entry as CSV text: Company and Domain (or Contact and Email), then
|
|
225
|
+
* one column per field, people as emails; {@link CrmPipeline.importCsv}
|
|
226
|
+
* reads the same layout. `complete` is false past 5000 entries.
|
|
227
|
+
*
|
|
228
|
+
* @readonly
|
|
229
|
+
*/
|
|
230
|
+
exportCsv(): Promise<{
|
|
231
|
+
csv: string;
|
|
232
|
+
name: string;
|
|
233
|
+
rows: number;
|
|
234
|
+
complete: boolean;
|
|
235
|
+
}>;
|
|
236
|
+
/** Save every entry as a CSV file in the caller's Macro files, laid out as {@link CrmPipeline.exportCsv} returns it.
|
|
237
|
+
*
|
|
238
|
+
* @write
|
|
239
|
+
*/
|
|
240
|
+
exportCsvFile(): Promise<{
|
|
241
|
+
document: Document;
|
|
242
|
+
rows: number;
|
|
243
|
+
complete: boolean;
|
|
244
|
+
}>;
|
|
245
|
+
/** @internal Whether entries track companies or contacts; `undefined` for a generic pipeline. */
|
|
246
|
+
private trackedRecordType;
|
|
61
247
|
/** Apply an atomic generated database operation batch through this pipeline.
|
|
62
|
-
* As with Database.applyOps, batch-local UUIDs may name resources minted earlier in the batch.
|
|
248
|
+
* As with Database.applyOps, batch-local UUIDs may name resources minted earlier in the batch.
|
|
249
|
+
*
|
|
250
|
+
* @destructive
|
|
251
|
+
* @mcp-exclude Takes a handle built from a listing record, which an MCP call can't reference.
|
|
252
|
+
*/
|
|
63
253
|
applyOps(ops: DatabaseOp[], options?: {
|
|
64
254
|
baseVersions?: {
|
|
65
255
|
table: PipelineTable;
|
|
@@ -67,7 +257,11 @@ export declare class CrmPipeline extends MacroEntity<AccessiblePipeline> {
|
|
|
67
257
|
}[];
|
|
68
258
|
}): Promise<import("../../../generated/storage").AppliedOps>;
|
|
69
259
|
}
|
|
70
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Backing table of a CRM pipeline.
|
|
262
|
+
*
|
|
263
|
+
* @mcp-exclude Built from a listing record; no id-only reference an MCP call can pass.
|
|
264
|
+
*/
|
|
71
265
|
export declare class PipelineTable extends MacroEntity<TableDetail> {
|
|
72
266
|
/** Parent pipeline. */
|
|
73
267
|
readonly pipeline: CrmPipeline;
|
|
@@ -81,18 +275,42 @@ export declare class PipelineTable extends MacroEntity<TableDetail> {
|
|
|
81
275
|
/** Seed a table from a pipeline table response. */
|
|
82
276
|
static from(client: MacroClient, pipeline: CrmPipeline, record: TableDetail): PipelineTable;
|
|
83
277
|
protected fetch(): Promise<TableDetail>;
|
|
84
|
-
/**
|
|
278
|
+
/**
|
|
279
|
+
* Columns in this table.
|
|
280
|
+
*
|
|
281
|
+
* @readonly
|
|
282
|
+
*/
|
|
85
283
|
columns(): Promise<PipelineColumn[]>;
|
|
86
|
-
/**
|
|
284
|
+
/**
|
|
285
|
+
* Stored views in display order.
|
|
286
|
+
*
|
|
287
|
+
* @readonly
|
|
288
|
+
*/
|
|
87
289
|
views(): Promise<PipelineView[]>;
|
|
88
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Table version for optimistic operation batches.
|
|
292
|
+
*
|
|
293
|
+
* @readonly
|
|
294
|
+
*/
|
|
89
295
|
version(): Promise<number>;
|
|
90
|
-
/**
|
|
296
|
+
/**
|
|
297
|
+
* A scoped row handle.
|
|
298
|
+
*
|
|
299
|
+
* @readonly
|
|
300
|
+
*/
|
|
91
301
|
rowById(id: string): PipelineRow;
|
|
92
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* Rows from the authorized pipeline surface.
|
|
304
|
+
*
|
|
305
|
+
* @readonly
|
|
306
|
+
*/
|
|
93
307
|
rows(): AsyncGenerator<PipelineRow>;
|
|
94
308
|
}
|
|
95
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* A view owned and authorized by its CRM pipeline.
|
|
311
|
+
*
|
|
312
|
+
* @mcp-exclude Its table is built from a listing record; no id-only reference an MCP call can pass.
|
|
313
|
+
*/
|
|
96
314
|
export declare class PipelineView {
|
|
97
315
|
/** The pipeline table this view shows. */
|
|
98
316
|
readonly table: PipelineTable;
|
|
@@ -101,12 +319,18 @@ export declare class PipelineView {
|
|
|
101
319
|
private constructor();
|
|
102
320
|
/** A handle to a stored view within a pipeline table. */
|
|
103
321
|
static byId(table: PipelineTable, id: string): PipelineView;
|
|
104
|
-
/**
|
|
322
|
+
/**
|
|
323
|
+
* The current view definition from the pipeline's shared schema cache.
|
|
324
|
+
*
|
|
325
|
+
* @readonly
|
|
326
|
+
*/
|
|
105
327
|
detail(): Promise<DatabaseViewRecord>;
|
|
106
328
|
/**
|
|
107
329
|
* Read only cards with saved positions; unplaced cards are omitted.
|
|
108
330
|
* A saved lane may be stale after a row's grouping value changes outside a
|
|
109
331
|
* card move. Compare each lane with the row's current grouping before using it.
|
|
332
|
+
*
|
|
333
|
+
* @readonly
|
|
110
334
|
*/
|
|
111
335
|
positions(): Promise<CardPosition[]>;
|
|
112
336
|
/** Serialize identity without an authenticated client. */
|
|
@@ -136,10 +360,18 @@ export declare class PipelineRow extends MacroEntity<StorageRow> {
|
|
|
136
360
|
readonly cells: () => Promise<{
|
|
137
361
|
[key: string]: import("../../../generated/storage").PropertyValue;
|
|
138
362
|
}>;
|
|
139
|
-
/**
|
|
363
|
+
/**
|
|
364
|
+
* Reload this row after an operation batch.
|
|
365
|
+
*
|
|
366
|
+
* @readonly
|
|
367
|
+
*/
|
|
140
368
|
refresh(): Promise<void>;
|
|
141
369
|
}
|
|
142
|
-
/**
|
|
370
|
+
/**
|
|
371
|
+
* A column belonging to a pipeline table.
|
|
372
|
+
*
|
|
373
|
+
* @mcp-exclude Built from a listing record; no id-only reference an MCP call can pass.
|
|
374
|
+
*/
|
|
143
375
|
export declare class PipelineColumn extends MacroEntity<ColumnDetail> {
|
|
144
376
|
/** Parent table. */
|
|
145
377
|
readonly table: PipelineTable;
|
|
@@ -154,10 +386,22 @@ export declare class PipelineColumn extends MacroEntity<ColumnDetail> {
|
|
|
154
386
|
/** Seed a column handle. */
|
|
155
387
|
static from(client: MacroClient, table: PipelineTable, record: ColumnDetail): PipelineColumn;
|
|
156
388
|
protected fetch(): Promise<ColumnDetail>;
|
|
157
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* Selectable options, including stable stage identities for requirement rules.
|
|
391
|
+
*
|
|
392
|
+
* @readonly
|
|
393
|
+
*/
|
|
158
394
|
options(): Promise<PropertyOption[]>;
|
|
159
|
-
/**
|
|
395
|
+
/**
|
|
396
|
+
* Whether the caller can write this column.
|
|
397
|
+
*
|
|
398
|
+
* @readonly
|
|
399
|
+
*/
|
|
160
400
|
writable(): Promise<boolean>;
|
|
161
|
-
/**
|
|
401
|
+
/**
|
|
402
|
+
* Current column label.
|
|
403
|
+
*
|
|
404
|
+
* @readonly
|
|
405
|
+
*/
|
|
162
406
|
name(): Promise<string>;
|
|
163
407
|
}
|
|
@@ -1,14 +1,51 @@
|
|
|
1
1
|
import type { CreatePipeline } from '../../../generated/storage/types.gen';
|
|
2
2
|
import type { MacroClient } from '../../utils/client';
|
|
3
|
+
import type { Company } from './company';
|
|
4
|
+
import type { Contact } from './contact';
|
|
3
5
|
import { CrmPipeline } from './pipeline';
|
|
6
|
+
import { PipelineEntry } from './pipeline-entry';
|
|
4
7
|
/** CRM pipelines in the caller's team. */
|
|
5
8
|
export declare class PipelineNamespace {
|
|
6
9
|
private readonly client;
|
|
7
10
|
constructor(client: MacroClient);
|
|
8
11
|
/** Construct a lazy pipeline handle. */
|
|
9
12
|
byId(id: string): CrmPipeline;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* List accessible pipelines.
|
|
15
|
+
*
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
11
18
|
list(): Promise<CrmPipeline[]>;
|
|
12
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Create a pipeline and its backing storage.
|
|
21
|
+
*
|
|
22
|
+
* @write
|
|
23
|
+
*/
|
|
13
24
|
create(options: CreatePipeline): Promise<CrmPipeline>;
|
|
25
|
+
/**
|
|
26
|
+
* Every entry (deal) tracking one of these companies or contacts, across
|
|
27
|
+
* the caller's pipelines; pipelines without one are left out.
|
|
28
|
+
*
|
|
29
|
+
* @readonly
|
|
30
|
+
*/
|
|
31
|
+
entriesFor(records: (Company | Contact)[]): Promise<{
|
|
32
|
+
pipeline: CrmPipeline;
|
|
33
|
+
entries: PipelineEntry[];
|
|
34
|
+
}[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Entries (deals) whose company or contact name, domain or email contains
|
|
37
|
+
* `search`, across the caller's pipelines; pipelines without a match are
|
|
38
|
+
* left out.
|
|
39
|
+
*
|
|
40
|
+
* @param opts.limit Most entries per pipeline, 1 to 5000 (default 50).
|
|
41
|
+
*
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
searchEntries(search: string, opts?: {
|
|
45
|
+
limit?: number;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
pipeline: CrmPipeline;
|
|
48
|
+
entries: PipelineEntry[];
|
|
49
|
+
}[]>;
|
|
50
|
+
private entries;
|
|
14
51
|
}
|
|
@@ -20,52 +20,99 @@ export declare class DatabaseColumn {
|
|
|
20
20
|
/**
|
|
21
21
|
* The column's record as the API returns it: the placement and the bound
|
|
22
22
|
* property definition.
|
|
23
|
+
*
|
|
24
|
+
* @readonly
|
|
23
25
|
*/
|
|
24
26
|
detail(): Promise<ColumnDetail>;
|
|
25
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The placement's display name, falling back to its property definition.
|
|
29
|
+
*
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
26
32
|
name(): Promise<string>;
|
|
27
33
|
/**
|
|
28
34
|
* Rename this placement, only if its last-read name is still current,
|
|
29
35
|
* without changing its shared property definition.
|
|
36
|
+
*
|
|
37
|
+
* @write
|
|
38
|
+
* @idempotent
|
|
30
39
|
*/
|
|
31
40
|
rename(name: string): Promise<DatabaseColumn>;
|
|
32
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Settle the type of an empty column created with inferType enabled.
|
|
43
|
+
*
|
|
44
|
+
* @write
|
|
45
|
+
* @idempotent
|
|
46
|
+
*/
|
|
33
47
|
inferType(options: InferColumnTypeOptions): Promise<DatabaseColumn>;
|
|
34
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Change this column's type. See {@link Database.changeColumnType}.
|
|
50
|
+
*
|
|
51
|
+
* @write
|
|
52
|
+
* @idempotent
|
|
53
|
+
*/
|
|
35
54
|
changeType(options: ChangeColumnTypeOptions): Promise<OpResultOf<'column', 'type_changed'>>;
|
|
36
55
|
/**
|
|
37
56
|
* Add a column of another type right after this one, filled with the
|
|
38
57
|
* values that convert, leaving this one as it is. See
|
|
39
58
|
* {@link Database.convertColumnIntoNewColumn}.
|
|
59
|
+
*
|
|
60
|
+
* @write
|
|
40
61
|
*/
|
|
41
62
|
convertIntoNewColumn(options: ConvertIntoNewColumnOptions): Promise<DatabaseColumn>;
|
|
42
63
|
/**
|
|
43
64
|
* What changing this column to each type would do to its values: `safe`,
|
|
44
65
|
* `checked` (with how many would not convert, and a few of them), or
|
|
45
66
|
* `never` (with why). Changes nothing.
|
|
67
|
+
*
|
|
68
|
+
* @readonly
|
|
46
69
|
*/
|
|
47
70
|
casts(): Promise<ColumnCast[]>;
|
|
48
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Delete this placement and its cells at the table version last read.
|
|
73
|
+
*
|
|
74
|
+
* @destructive
|
|
75
|
+
* @idempotent
|
|
76
|
+
*/
|
|
49
77
|
delete(): Promise<void>;
|
|
50
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* The value type the column holds.
|
|
80
|
+
*
|
|
81
|
+
* @readonly
|
|
82
|
+
*/
|
|
51
83
|
dataType(): Promise<DataType>;
|
|
52
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Whether the column holds multiple values.
|
|
86
|
+
*
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
53
89
|
isMultiSelect(): Promise<boolean>;
|
|
54
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* The column's fractional index within the table's column order.
|
|
92
|
+
*
|
|
93
|
+
* @readonly
|
|
94
|
+
*/
|
|
55
95
|
position(): Promise<string>;
|
|
56
96
|
/**
|
|
57
97
|
* The bound property definition together with its select options — the
|
|
58
98
|
* source of the column's name, type, and allowed values.
|
|
99
|
+
*
|
|
100
|
+
* @readonly
|
|
59
101
|
*/
|
|
60
102
|
definition(): Promise<PropertyDefinitionWithOptions>;
|
|
61
103
|
/**
|
|
62
104
|
* Column-kind configuration (a link), or `undefined` for a plain
|
|
63
105
|
* value column.
|
|
106
|
+
*
|
|
107
|
+
* @readonly
|
|
64
108
|
*/
|
|
65
109
|
config(): Promise<ColumnConfig | undefined>;
|
|
66
110
|
/**
|
|
67
111
|
* Add select options to the column. Labels it already has are skipped, so
|
|
68
112
|
* the call is safe to repeat. Only select and tag columns accept options.
|
|
113
|
+
*
|
|
114
|
+
* @write
|
|
115
|
+
* @idempotent
|
|
69
116
|
*/
|
|
70
117
|
addOptions(labels: string[]): Promise<DatabaseColumn>;
|
|
71
118
|
toJSON(): {
|