attio 0.0.1-experimental.20241112 → 0.0.1-experimental.20241209
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/lib/attio.js +1 -1
- package/lib/build/client/generate-client-entry.js +34 -22
- package/lib/build.js +1 -0
- package/lib/client/bulk-record-action.d.ts +54 -0
- package/lib/client/components/index.d.ts +0 -2
- package/lib/client/hooks/index.d.ts +1 -1
- package/lib/client/hooks/use-workspace.d.ts +13 -0
- package/lib/client/index.d.ts +3 -2
- package/lib/client/record-action.d.ts +53 -0
- package/lib/client/show-dialog.d.ts +33 -0
- package/lib/client/show-toast.d.ts +1 -1
- package/lib/commands/dev.js +2 -0
- package/lib/components/BuildError.js +7 -1
- package/lib/components/CodeGenErrors.js +2 -2
- package/lib/components/Log.js +69 -0
- package/lib/machines/dev-machine.js +6 -3
- package/lib/machines/js-machine.js +0 -8
- package/lib/server/attio-fetch.d.ts +57 -0
- package/lib/server/index.d.ts +1 -0
- package/lib/templates/common/src/assets/icon.png +0 -0
- package/lib/templates/javascript/package.json +5 -3
- package/lib/templates/javascript/src/advice.jsx +16 -0
- package/lib/templates/javascript/src/get-advice.server.js +6 -0
- package/lib/templates/javascript/src/hello-world-action.jsx +17 -0
- package/lib/templates/javascript/src/hello-world-dialog.jsx +25 -0
- package/lib/templates/typescript/package.json +8 -6
- package/lib/templates/typescript/src/advice.tsx +16 -0
- package/lib/templates/typescript/src/get-advice.server.ts +6 -0
- package/lib/templates/typescript/src/hello-world-action.tsx +17 -0
- package/lib/templates/typescript/src/hello-world-dialog.tsx +25 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util/copy-with-replace.js +8 -3
- package/lib/util/find-surface-exports/find-surface-exports.js +45 -0
- package/lib/util/find-surface-exports/generate-random-file-name.js +13 -0
- package/lib/util/find-surface-exports/parse-file-exports.js +98 -0
- package/lib/util/find-surface-exports/surface-types.js +24 -0
- package/lib/util/find-surface-exports/walk-dir.js +25 -0
- package/lib/util/surfaces.js +4 -0
- package/package.json +3 -3
- package/schema.graphql +14 -0
- package/lib/client/components/action.d.ts +0 -31
- package/lib/client/components/multistep.d.ts +0 -24
- package/lib/client/hooks/use-dialog.d.ts +0 -71
- package/lib/client/register-bulk-record-action.d.ts +0 -36
- package/lib/client/register-record-action.d.ts +0 -36
- package/lib/templates/javascript/src/app.jsx +0 -6
- package/lib/templates/typescript/src/app.tsx +0 -6
package/schema.graphql
CHANGED
|
@@ -13,6 +13,8 @@ interface IObject {
|
|
|
13
13
|
|
|
14
14
|
"""A record in the workspace."""
|
|
15
15
|
interface Record {
|
|
16
|
+
"""The id of the record."""
|
|
17
|
+
id: ID!
|
|
16
18
|
attribute(
|
|
17
19
|
"""Slug of the attribute"""
|
|
18
20
|
slug: String!
|
|
@@ -192,6 +194,8 @@ type Object implements IObject {
|
|
|
192
194
|
|
|
193
195
|
"""A record for a custom object."""
|
|
194
196
|
type CustomRecord implements Record {
|
|
197
|
+
"""The id of the record."""
|
|
198
|
+
id: ID!
|
|
195
199
|
attribute(
|
|
196
200
|
"""Slug of the attribute"""
|
|
197
201
|
slug: String!
|
|
@@ -260,6 +264,8 @@ type people implements IObject {
|
|
|
260
264
|
|
|
261
265
|
"""A person record."""
|
|
262
266
|
type Person implements Record {
|
|
267
|
+
"""The id of the record."""
|
|
268
|
+
id: ID!
|
|
263
269
|
attribute(
|
|
264
270
|
"""Slug of the attribute"""
|
|
265
271
|
slug: String!
|
|
@@ -300,6 +306,8 @@ type Person implements Record {
|
|
|
300
306
|
|
|
301
307
|
"""A company record."""
|
|
302
308
|
type Company implements Record {
|
|
309
|
+
"""The id of the record."""
|
|
310
|
+
id: ID!
|
|
303
311
|
attribute(
|
|
304
312
|
"""Slug of the attribute"""
|
|
305
313
|
slug: String!
|
|
@@ -343,6 +351,8 @@ type Company implements Record {
|
|
|
343
351
|
|
|
344
352
|
"""A deal record."""
|
|
345
353
|
type Deal implements Record {
|
|
354
|
+
"""The id of the record."""
|
|
355
|
+
id: ID!
|
|
346
356
|
attribute(
|
|
347
357
|
"""Slug of the attribute"""
|
|
348
358
|
slug: String!
|
|
@@ -366,6 +376,8 @@ type Deal implements Record {
|
|
|
366
376
|
|
|
367
377
|
"""A workspace record."""
|
|
368
378
|
type WorkspaceRecord implements Record {
|
|
379
|
+
"""The id of the record."""
|
|
380
|
+
id: ID!
|
|
369
381
|
attribute(
|
|
370
382
|
"""Slug of the attribute"""
|
|
371
383
|
slug: String!
|
|
@@ -388,6 +400,8 @@ type WorkspaceRecord implements Record {
|
|
|
388
400
|
|
|
389
401
|
"""A user record."""
|
|
390
402
|
type UserRecord implements Record {
|
|
403
|
+
"""The id of the record."""
|
|
404
|
+
id: ID!
|
|
391
405
|
attribute(
|
|
392
406
|
"""Slug of the attribute"""
|
|
393
407
|
slug: String!
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Icon } from "../icon";
|
|
3
|
-
/**
|
|
4
|
-
* An “action button” is a button that can appear in the Attio UI,
|
|
5
|
-
* typically on a record page.
|
|
6
|
-
*
|
|
7
|
-
* You must “register” the component that renders this component
|
|
8
|
-
* using `registerRecordAction()`.
|
|
9
|
-
*/
|
|
10
|
-
export declare function Action(props: {
|
|
11
|
-
/**
|
|
12
|
-
* A function to execute when the button is clicked (or tapped)
|
|
13
|
-
*/
|
|
14
|
-
onTrigger: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* An icon to display in the button, either an `AttioIcon` or
|
|
17
|
-
* a string `.png` referencing a file in your app’s `assets`
|
|
18
|
-
* directory.
|
|
19
|
-
*
|
|
20
|
-
* If no `icon` prop is provided, it will default to your app’s icon.
|
|
21
|
-
*/
|
|
22
|
-
icon?: Icon;
|
|
23
|
-
/**
|
|
24
|
-
* Whether or not the button is disabled. Defaults to `false`.
|
|
25
|
-
*/
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The text content of the button.
|
|
29
|
-
*/
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
}): React.JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A step in a multi-step component.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated This is not ready for use yet.
|
|
6
|
-
*/
|
|
7
|
-
export interface Step {
|
|
8
|
-
title: string;
|
|
9
|
-
content: React.ReactNode;
|
|
10
|
-
isValid?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* A multi-step component
|
|
14
|
-
*
|
|
15
|
-
* @deprecated This is not ready for use yet.
|
|
16
|
-
*/
|
|
17
|
-
export declare function Multistep(props: {
|
|
18
|
-
initialStep?: number;
|
|
19
|
-
steps: ReadonlyArray<Step>;
|
|
20
|
-
onDone: () => void;
|
|
21
|
-
nextLabel?: string;
|
|
22
|
-
previousLabel?: string;
|
|
23
|
-
doneLabel?: string;
|
|
24
|
-
}): React.JSX.Element;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Dialog component
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT: The <Dialog/> component should _always_ be rendered in your app.
|
|
6
|
-
* Do not render it conditionally.
|
|
7
|
-
*/
|
|
8
|
-
interface Dialog extends React.FC<{
|
|
9
|
-
/**
|
|
10
|
-
* A required title for the dialog.
|
|
11
|
-
*/
|
|
12
|
-
title: string;
|
|
13
|
-
/**
|
|
14
|
-
* An optional callback that will be called when the dialog is closed.
|
|
15
|
-
*/
|
|
16
|
-
onClose?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
* The content of the dialog.
|
|
19
|
-
*/
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
}> {
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* This hook allows you to create a modal dialog.
|
|
25
|
-
*
|
|
26
|
-
* ## EXAMPLE USAGE
|
|
27
|
-
*
|
|
28
|
-
* ----
|
|
29
|
-
* ```tsx
|
|
30
|
-
* import { useDialog } from "attio/client"
|
|
31
|
-
*
|
|
32
|
-
* ...
|
|
33
|
-
*
|
|
34
|
-
* // inside component:
|
|
35
|
-
* const dialog = useDialog()
|
|
36
|
-
*
|
|
37
|
-
* return (
|
|
38
|
-
* <>
|
|
39
|
-
* <Action onTrigger={() => dialog.open()}>Do Stuff</Action>
|
|
40
|
-
* <dialog.Dialog>
|
|
41
|
-
* Here is my useful UI
|
|
42
|
-
* </dialog.Dialog>
|
|
43
|
-
* </>
|
|
44
|
-
* )
|
|
45
|
-
* ```
|
|
46
|
-
* ----
|
|
47
|
-
*
|
|
48
|
-
* @returns An object with the following properties:
|
|
49
|
-
* - `Dialog`: A React component that you should render with the dialog contents as its children.
|
|
50
|
-
* - `open`: Opens the rendered dialog.
|
|
51
|
-
* - `close`: Closes the rendered dialog.
|
|
52
|
-
*/
|
|
53
|
-
export declare function useDialog(): {
|
|
54
|
-
/**
|
|
55
|
-
* The dialog component to render.
|
|
56
|
-
*
|
|
57
|
-
* IMPORTANT: The <Dialog/> component should _always_ be rendered in your app.
|
|
58
|
-
* Do not render it conditionally.
|
|
59
|
-
*/
|
|
60
|
-
Dialog: Dialog;
|
|
61
|
-
/**
|
|
62
|
-
* A function to imperatively open the dialog. Often called via an
|
|
63
|
-
* `onTrigger` prop on an `<Action/>` button.
|
|
64
|
-
*/
|
|
65
|
-
open: () => void;
|
|
66
|
-
/**
|
|
67
|
-
* A function to imperatively close the dialog.
|
|
68
|
-
*/
|
|
69
|
-
close: () => void;
|
|
70
|
-
};
|
|
71
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ObjectSlug } from "./object-slug";
|
|
2
|
-
/**
|
|
3
|
-
* Registers a component that renders an <Action/> button for a set of records in Attio.
|
|
4
|
-
*
|
|
5
|
-
* You should use this in your `app.tsx` file to register where you want your
|
|
6
|
-
* app to surface inside the Attio UI.
|
|
7
|
-
*
|
|
8
|
-
* ## EXAMPLE USAGE
|
|
9
|
-
*
|
|
10
|
-
* ----
|
|
11
|
-
* ```tsx
|
|
12
|
-
* // app.tsx
|
|
13
|
-
* import { registerBulkRecordAction } from "attio/client";
|
|
14
|
-
* import { SendBulkInvoiceButton } from "./send-invoice-button";
|
|
15
|
-
* import React from "react";
|
|
16
|
-
*
|
|
17
|
-
* registerBulkRecordAction("send-bulk-invoice", <SendBulkInvoiceButton />);
|
|
18
|
-
* ```
|
|
19
|
-
* ----
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerBulkRecordAction(
|
|
22
|
-
/**
|
|
23
|
-
* The unique identifier for the action.
|
|
24
|
-
*
|
|
25
|
-
* It is only used internally; never shown to the user.
|
|
26
|
-
*/
|
|
27
|
-
id: string,
|
|
28
|
-
/**
|
|
29
|
-
* The React element to render for the action.
|
|
30
|
-
*/
|
|
31
|
-
action: React.ReactElement, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* If provided then the action will only be shown on records of the specified object(s).
|
|
34
|
-
*/
|
|
35
|
-
objects: ObjectSlug | Array<ObjectSlug>;
|
|
36
|
-
}): void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ObjectSlug } from "./object-slug";
|
|
2
|
-
/**
|
|
3
|
-
* Registers a component that renders an <Action/> button for a record in Attio.
|
|
4
|
-
*
|
|
5
|
-
* You should use this in your `app.tsx` file to register where you want your
|
|
6
|
-
* app to surface inside the Attio UI.
|
|
7
|
-
*
|
|
8
|
-
* ## EXAMPLE USAGE
|
|
9
|
-
*
|
|
10
|
-
* ----
|
|
11
|
-
* ```tsx
|
|
12
|
-
* // app.tsx
|
|
13
|
-
* import { registerRecordAction } from "attio/client";
|
|
14
|
-
* import { SendInvoiceButton } from "./send-invoice-button";
|
|
15
|
-
* import React from "react";
|
|
16
|
-
*
|
|
17
|
-
* registerRecordAction("send-invoice", <SendInvoiceButton />);
|
|
18
|
-
* ```
|
|
19
|
-
* ----
|
|
20
|
-
*/
|
|
21
|
-
export declare function registerRecordAction(
|
|
22
|
-
/**
|
|
23
|
-
* The unique identifier for the action.
|
|
24
|
-
*
|
|
25
|
-
* It is only used internally; never shown to the user.
|
|
26
|
-
*/
|
|
27
|
-
id: string,
|
|
28
|
-
/**
|
|
29
|
-
* The React element to render for the action.
|
|
30
|
-
*/
|
|
31
|
-
action: React.ReactElement, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* If provided then the action will only be shown on records of the specified object(s).
|
|
34
|
-
*/
|
|
35
|
-
objects: ObjectSlug | Array<ObjectSlug>;
|
|
36
|
-
}): void;
|