attio 0.0.1-experimental.20251031.1 → 0.0.1-experimental.20251104.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/README.md +0 -6
- package/lib/attio.js +417840 -22
- package/lib/build/client/generate-client-entry.js +1 -1
- package/lib/build/server/generate-server-entry.js +1 -1
- package/lib/build.js +1 -1
- package/lib/client/workflow/outcome-data-schema/array-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/array-node.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/attio-list.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/attio-list.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/attio-object.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/attio-object.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/attio-record.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/attio-record.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/attio-select.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/attio-select.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/boolean-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/boolean-node.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/number-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/number-node.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/string-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/string-node.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/struct-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/struct-node.d.ts.map +1 -1
- package/lib/client/workflow/outcome-data-schema/timestamp-node.d.ts +1 -3
- package/lib/client/workflow/outcome-data-schema/timestamp-node.d.ts.map +1 -1
- package/lib/commands/build.js +1 -2
- package/lib/commands/dev/boot.js +1 -2
- package/lib/commands/dev/graphql-code-gen.js +1 -1
- package/lib/commands/dev/graphql-server.js +5 -6
- package/lib/commands/dev/onboarding.js +1 -2
- package/lib/commands/dev/upload.js +1 -2
- package/lib/commands/dev.js +5 -4
- package/lib/commands/init.js +9 -41
- package/lib/commands/login.js +1 -2
- package/lib/commands/logout.js +1 -2
- package/lib/commands/logs.js +1 -3
- package/lib/commands/version/create.js +1 -4
- package/lib/commands/version/list.js +1 -2
- package/lib/commands/whoami.js +1 -3
- package/lib/server/workflow/block-config/config-schema/attio-attribute.d.ts +1 -3
- package/lib/server/workflow/block-config/config-schema/attio-attribute.d.ts.map +1 -1
- package/lib/server/workflow/block-config/config-schema/attio-list.d.ts +1 -3
- package/lib/server/workflow/block-config/config-schema/attio-list.d.ts.map +1 -1
- package/lib/server/workflow/block-config/config-schema/attio-object.d.ts +1 -3
- package/lib/server/workflow/block-config/config-schema/attio-object.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/array-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/array-node.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/attio-attribute.d.ts +1 -3
- package/lib/server/workflow/config-schema/attio-attribute.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/attio-list.d.ts +1 -3
- package/lib/server/workflow/config-schema/attio-list.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/attio-object.d.ts +1 -3
- package/lib/server/workflow/config-schema/attio-object.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/attio-record.d.ts +1 -3
- package/lib/server/workflow/config-schema/attio-record.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/attio-select.d.ts +1 -3
- package/lib/server/workflow/config-schema/attio-select.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/boolean-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/boolean-node.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/number-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/number-node.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/string-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/string-node.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/struct-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/struct-node.d.ts.map +1 -1
- package/lib/server/workflow/config-schema/timestamp-node.d.ts +1 -3
- package/lib/server/workflow/config-schema/timestamp-node.d.ts.map +1 -1
- package/lib/shared/schema-utils/array-node.d.ts +3 -9
- package/lib/shared/schema-utils/array-node.d.ts.map +1 -1
- package/lib/shared/schema-utils/base-node.d.ts +1 -3
- package/lib/shared/schema-utils/base-node.d.ts.map +1 -1
- package/lib/shared/schema-utils/index.d.ts +3 -0
- package/lib/shared/schema-utils/index.d.ts.map +1 -1
- package/lib/shared/schema-utils/normalize.d.ts +1 -3
- package/lib/shared/schema-utils/normalize.d.ts.map +1 -1
- package/lib/shared/schema-utils/optional.d.ts +5 -0
- package/lib/shared/schema-utils/optional.d.ts.map +1 -0
- package/lib/shared/schema-utils/{attio-list.js → optional.js} +1 -1
- package/lib/shared/schema-utils/optional.js.map +1 -0
- package/lib/shared/schema-utils/path.d.ts +7 -5
- package/lib/shared/schema-utils/path.d.ts.map +1 -1
- package/lib/shared/schema-utils/resolved-path.d.ts +3 -5
- package/lib/shared/schema-utils/resolved-path.d.ts.map +1 -1
- package/lib/shared/schema-utils/struct-node.d.ts +3 -9
- package/lib/shared/schema-utils/struct-node.d.ts.map +1 -1
- package/lib/shared/schema-utils/undefined-node.d.ts +5 -0
- package/lib/shared/schema-utils/undefined-node.d.ts.map +1 -0
- package/lib/shared/schema-utils/{attio-attribute.js → undefined-node.js} +1 -1
- package/lib/shared/schema-utils/undefined-node.js.map +1 -0
- package/lib/shared/schema-utils/union-node.d.ts +8 -0
- package/lib/shared/schema-utils/union-node.d.ts.map +1 -0
- package/lib/shared/schema-utils/{attio-object.js → union-node.js} +1 -1
- package/lib/shared/schema-utils/union-node.js.map +1 -0
- package/lib/shared/workflow/activator.d.ts +10 -4
- package/lib/shared/workflow/activator.d.ts.map +1 -1
- package/lib/shared/workflow/config/attio-attribute.d.ts +3 -10
- package/lib/shared/workflow/config/attio-attribute.d.ts.map +1 -1
- package/lib/shared/workflow/config/attio-list.d.ts +3 -10
- package/lib/shared/workflow/config/attio-list.d.ts.map +1 -1
- package/lib/shared/workflow/config/attio-object.d.ts +3 -10
- package/lib/shared/workflow/config/attio-object.d.ts.map +1 -1
- package/lib/shared/workflow/config/attio-record.d.ts +3 -10
- package/lib/shared/workflow/config/attio-record.d.ts.map +1 -1
- package/lib/shared/workflow/config/attio-select.d.ts +3 -10
- package/lib/shared/workflow/config/attio-select.d.ts.map +1 -1
- package/lib/shared/workflow/config/boolean-node.d.ts +3 -10
- package/lib/shared/workflow/config/boolean-node.d.ts.map +1 -1
- package/lib/shared/workflow/config/friendly-value-of.d.ts +3 -5
- package/lib/shared/workflow/config/friendly-value-of.d.ts.map +1 -1
- package/lib/shared/workflow/config/initial-values-of.d.ts +1 -1
- package/lib/shared/workflow/config/initial-values-of.d.ts.map +1 -1
- package/lib/shared/workflow/config/node.d.ts +2 -10
- package/lib/shared/workflow/config/node.d.ts.map +1 -1
- package/lib/shared/workflow/config/number-node.d.ts +3 -10
- package/lib/shared/workflow/config/number-node.d.ts.map +1 -1
- package/lib/shared/workflow/config/rich-text-node.d.ts +3 -10
- package/lib/shared/workflow/config/rich-text-node.d.ts.map +1 -1
- package/lib/shared/workflow/config/string-node.d.ts +3 -10
- package/lib/shared/workflow/config/string-node.d.ts.map +1 -1
- package/lib/shared/workflow/config/timestamp-node.d.ts +3 -10
- package/lib/shared/workflow/config/timestamp-node.d.ts.map +1 -1
- package/lib/shared/workflow/deactivator.d.ts +10 -4
- package/lib/shared/workflow/deactivator.d.ts.map +1 -1
- package/lib/shared/workflow/executor.d.ts +12 -4
- package/lib/shared/workflow/executor.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/attio-attribute.d.ts +4 -10
- package/lib/shared/workflow/outcome-data/attio-attribute.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/attio-entity-reference.d.ts +3 -7
- package/lib/shared/workflow/outcome-data/attio-entity-reference.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/attio-list.d.ts +4 -10
- package/lib/shared/workflow/outcome-data/attio-list.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/attio-object.d.ts +4 -10
- package/lib/shared/workflow/outcome-data/attio-object.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/attio-select.d.ts +4 -10
- package/lib/shared/workflow/outcome-data/attio-select.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/boolean-node.d.ts +3 -10
- package/lib/shared/workflow/outcome-data/boolean-node.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/node.d.ts +2 -10
- package/lib/shared/workflow/outcome-data/node.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/number-node.d.ts +3 -10
- package/lib/shared/workflow/outcome-data/number-node.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/rich-text-node.d.ts +3 -10
- package/lib/shared/workflow/outcome-data/rich-text-node.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/runtime-value-of.d.ts +1 -3
- package/lib/shared/workflow/outcome-data/runtime-value-of.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/string-node.d.ts +3 -10
- package/lib/shared/workflow/outcome-data/string-node.d.ts.map +1 -1
- package/lib/shared/workflow/outcome-data/timestamp-node.d.ts +3 -10
- package/lib/shared/workflow/outcome-data/timestamp-node.d.ts.map +1 -1
- package/lib/spinners/determine-workspace.spinner.js +1 -2
- package/lib/spinners/get-app-info.spinner.js +1 -2
- package/lib/spinners/get-versions.spinner.js +1 -2
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/lib/util/assert-app-settings.js +1 -1
- package/lib/util/exit-with-missing-app-settings.js +1 -1
- package/lib/util/exit-with-missing-entry-point.js +1 -1
- package/lib/util/generate-settings-files.js +1 -1
- package/lib/util/realtime.js +1 -1
- package/package.json +3 -3
- package/lib/api/api.js +0 -183
- package/lib/api/fetcher.js +0 -69
- package/lib/api/schemas.js +0 -89
- package/lib/attio-logo.js +0 -24
- package/lib/auth/auth.js +0 -174
- package/lib/auth/keychain.js +0 -108
- package/lib/build/workflow-block-modules.js +0 -1
- package/lib/commands/init/create-project.js +0 -36
- package/lib/constants/settings-files.js +0 -2
- package/lib/env.js +0 -5
- package/lib/errors.js +0 -1
- package/lib/print-errors.js +0 -177
- package/lib/sdk-version.js +0 -1
- package/lib/shared/schema-utils/attio-attribute.d.ts +0 -12
- package/lib/shared/schema-utils/attio-attribute.d.ts.map +0 -1
- package/lib/shared/schema-utils/attio-attribute.js.map +0 -1
- package/lib/shared/schema-utils/attio-list.d.ts +0 -12
- package/lib/shared/schema-utils/attio-list.d.ts.map +0 -1
- package/lib/shared/schema-utils/attio-list.js.map +0 -1
- package/lib/shared/schema-utils/attio-object.d.ts +0 -12
- package/lib/shared/schema-utils/attio-object.d.ts.map +0 -1
- package/lib/shared/schema-utils/attio-object.js.map +0 -1
- package/lib/template/README.md +0 -21
- package/lib/template/biome.jsonc +0 -59
- package/lib/template/eslint.attio.config.js +0 -41
- package/lib/template/graphql.config.json +0 -9
- package/lib/template/package.json +0 -35
- package/lib/template/src/app.settings.ts +0 -8
- package/lib/template/src/app.ts +0 -10
- package/lib/template/src/assets/icon.png +0 -0
- package/lib/template/src/get-stoic-quote.server.ts +0 -14
- package/lib/template/src/hello-world-action.tsx +0 -18
- package/lib/template/src/hello-world-dialog.tsx +0 -27
- package/lib/template/src/stoic-quote.tsx +0 -21
- package/lib/template/tsconfig.json +0 -42
- package/lib/util/can-write.js +0 -11
- package/lib/util/copy-with-replace.js +0 -56
- package/lib/util/create-directory.js +0 -27
- package/lib/util/find-available-port.js +0 -37
- package/lib/util/hard-exit.js +0 -6
- package/lib/util/print-logo.js +0 -5
- package/lib/util/spinner.js +0 -61
- package/lib/util/text-gradient.js +0 -28
package/lib/print-errors.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { APP } from "./env.js";
|
|
3
|
-
export function printFetcherError(message, { error }) {
|
|
4
|
-
process.stderr.write(`${chalk.red("✖ ")}${message}\n`);
|
|
5
|
-
switch (error.code) {
|
|
6
|
-
case "HTTP_ERROR":
|
|
7
|
-
process.stderr.write(`HTTP Error (${error.status}): ${error.message}\n`);
|
|
8
|
-
break;
|
|
9
|
-
case "INVALID_RESPONSE":
|
|
10
|
-
process.stderr.write(`Invalid response: ${error.message}\n`);
|
|
11
|
-
break;
|
|
12
|
-
case "NETWORK_ERROR":
|
|
13
|
-
process.stderr.write(`Network error: ${error.message}\n`);
|
|
14
|
-
break;
|
|
15
|
-
case "UNAUTHORIZED":
|
|
16
|
-
process.stderr.write(`Unauthorized. You must log in with "attio login"\n`);
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export function printUploadError(error) {
|
|
21
|
-
switch (error.code) {
|
|
22
|
-
case "BUNDLE_UPLOAD_ERROR":
|
|
23
|
-
process.stderr.write(chalk.red(`Error uploading bundle: ${error.upload_url}\n`));
|
|
24
|
-
break;
|
|
25
|
-
case "START_UPLOAD_ERROR":
|
|
26
|
-
printFetcherError("Error starting upload", error);
|
|
27
|
-
break;
|
|
28
|
-
case "COMPLETE_BUNDLE_UPLOAD_ERROR":
|
|
29
|
-
printFetcherError("Error completing bundle upload", error);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
return error;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export function printCreateProjectError(error) {
|
|
36
|
-
switch (error.code) {
|
|
37
|
-
case "DIRECTORY_ALREADY_EXISTS":
|
|
38
|
-
process.stderr.write(chalk.red(`Directory ${error.path} already exists`));
|
|
39
|
-
break;
|
|
40
|
-
case "WRITE_ACCESS_DENIED":
|
|
41
|
-
process.stderr.write(chalk.red(`Write access denied to ${error.path}`));
|
|
42
|
-
break;
|
|
43
|
-
case "FAILED_TO_CREATE_DIRECTORY":
|
|
44
|
-
process.stderr.write(chalk.red(`Failed to create directory ${error.path}`));
|
|
45
|
-
break;
|
|
46
|
-
case "FAILED_TO_COPY_FILE":
|
|
47
|
-
process.stderr.write(chalk.red(`Failed to copy file ${error.src} to ${error.dest}`));
|
|
48
|
-
break;
|
|
49
|
-
case "FAILED_TO_LIST_FILES":
|
|
50
|
-
process.stderr.write(chalk.red(`Failed to list files in ${error.path}`));
|
|
51
|
-
break;
|
|
52
|
-
case "FAILED_TO_READ_FILE":
|
|
53
|
-
process.stderr.write(chalk.red(`Failed to read file ${error.path}`));
|
|
54
|
-
break;
|
|
55
|
-
case "FAILED_TO_WRITE_FILE":
|
|
56
|
-
process.stderr.write(chalk.red(`Failed to write file ${error.path}`));
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
return error;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export function printPackageJsonError({ code, error }) {
|
|
63
|
-
switch (code) {
|
|
64
|
-
case "MALFORMED_PACKAGE_JSON":
|
|
65
|
-
if (error.issues.length > 0) {
|
|
66
|
-
process.stderr.write(`${chalk.red("✖ ")}Malformed package.json: ${error.issues[0].message}\n`);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
process.stderr.write(`${chalk.red("✖ ")}Malformed package.json: ${error.message}\n`);
|
|
70
|
-
}
|
|
71
|
-
break;
|
|
72
|
-
case "FILE_SYSTEM_ERROR":
|
|
73
|
-
process.stderr.write(`${chalk.red("✖ ")}Failed to read package.json\n`);
|
|
74
|
-
break;
|
|
75
|
-
case "INVALID_JSON":
|
|
76
|
-
process.stderr.write(`${chalk.red("✖ ")}Invalid JSON in package.json: ${error}\n`);
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
export function printCliVersionError({ error }) {
|
|
81
|
-
switch (error.code) {
|
|
82
|
-
case "UNABLE_TO_FIND_PACKAGE_JSON":
|
|
83
|
-
process.stderr.write(`${chalk.red("✖ ")}Failed to find package.json in ${error.path}\n`);
|
|
84
|
-
break;
|
|
85
|
-
case "UNABLE_TO_READ_PACKAGE_JSON":
|
|
86
|
-
process.stderr.write(`${chalk.red("✖ ")}Failed to read package.json: ${error.error}\n`);
|
|
87
|
-
break;
|
|
88
|
-
case "UNABLE_TO_PARSE_PACKAGE_JSON":
|
|
89
|
-
process.stderr.write(`${chalk.red("✖ ")}Failed to parse package.json: ${error.error}\n`);
|
|
90
|
-
break;
|
|
91
|
-
case "INVALID_PACKAGE_JSON":
|
|
92
|
-
process.stderr.write(`${chalk.red("✖ ")}Invalid package.json: ${error.error}\n`);
|
|
93
|
-
break;
|
|
94
|
-
case "ERROR_LOADING_PACKAGE_JSON":
|
|
95
|
-
process.stderr.write(`${chalk.red("✖ ")}Error loading package.json: ${error.error}\n`);
|
|
96
|
-
break;
|
|
97
|
-
case "NO_CLI_VERSION_FOUND":
|
|
98
|
-
process.stderr.write(`${chalk.red("✖ ")}No CLI version found in attio's package.json\n`);
|
|
99
|
-
break;
|
|
100
|
-
default:
|
|
101
|
-
return error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
export function printDetermineWorkspaceError(error) {
|
|
105
|
-
switch (error.code) {
|
|
106
|
-
case "FETCH_WORKSPACES_ERROR":
|
|
107
|
-
process.stderr.write(`Error fetching workspaces: ${error.error}
|
|
108
|
-
|
|
109
|
-
${APP}/welcome/workspace-details
|
|
110
|
-
`);
|
|
111
|
-
break;
|
|
112
|
-
case "NO_WORKSPACE_FOUND":
|
|
113
|
-
process.stderr.write(`You are not the admin any workspace with the slug "${error.workspace_slug}". Either request permission from "${error.workspace_slug}" or create your own.
|
|
114
|
-
|
|
115
|
-
${APP}/welcome/workspace-details
|
|
116
|
-
`);
|
|
117
|
-
break;
|
|
118
|
-
case "NO_WORKSPACES_FOUND":
|
|
119
|
-
process.stderr.write(`You are not the admin of any workspaces. Either request permission from an existing workspace or create your own.
|
|
120
|
-
|
|
121
|
-
${APP}/welcome/workspace-details
|
|
122
|
-
`);
|
|
123
|
-
break;
|
|
124
|
-
default:
|
|
125
|
-
return error;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
export function printKeychainError(error) {
|
|
129
|
-
switch (error.code) {
|
|
130
|
-
case "SAVE_KEYCHAIN_ERROR":
|
|
131
|
-
process.stderr.write(chalk.red(`Error saving token to keychain: ${error.error}`));
|
|
132
|
-
break;
|
|
133
|
-
case "LOAD_KEYCHAIN_ERROR":
|
|
134
|
-
process.stderr.write(chalk.red(`Error loading token from keychain: ${error.error}`));
|
|
135
|
-
break;
|
|
136
|
-
case "DELETE_KEYCHAIN_ERROR":
|
|
137
|
-
process.stderr.write(chalk.red(`Error deleting token from keychain: ${error.error}`));
|
|
138
|
-
break;
|
|
139
|
-
default:
|
|
140
|
-
return error;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
export function printAuthenticationError(error) {
|
|
144
|
-
switch (error.code) {
|
|
145
|
-
case "GET_TOKEN_ERROR":
|
|
146
|
-
printFetcherError("Error getting token", error);
|
|
147
|
-
break;
|
|
148
|
-
case "REFRESH_TOKEN_ERROR":
|
|
149
|
-
printFetcherError("Error refreshing token", error);
|
|
150
|
-
break;
|
|
151
|
-
case "NO_AUTHORIZATION_CODE":
|
|
152
|
-
process.stderr.write(chalk.red(`No authorization code received`));
|
|
153
|
-
break;
|
|
154
|
-
case "OAUTH_STATE_MISMATCH":
|
|
155
|
-
process.stderr.write(chalk.red(`OAuth state mismatch, possible CSRF attack`));
|
|
156
|
-
break;
|
|
157
|
-
case "SAVE_KEYCHAIN_ERROR":
|
|
158
|
-
case "LOAD_KEYCHAIN_ERROR":
|
|
159
|
-
case "DELETE_KEYCHAIN_ERROR":
|
|
160
|
-
printKeychainError(error);
|
|
161
|
-
break;
|
|
162
|
-
default:
|
|
163
|
-
return error;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
export function printLogSubscriptionError(error) {
|
|
167
|
-
switch (error.code) {
|
|
168
|
-
case "FAILED_TO_CONNECT_TO_LOGS_SERVER":
|
|
169
|
-
process.stderr.write(chalk.red("Failed to connect to logs server\n"));
|
|
170
|
-
if (error.error instanceof Error) {
|
|
171
|
-
process.stderr.write(chalk.red(error.error.message));
|
|
172
|
-
}
|
|
173
|
-
break;
|
|
174
|
-
default:
|
|
175
|
-
return error.code;
|
|
176
|
-
}
|
|
177
|
-
}
|
package/lib/sdk-version.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const SDK_VERSION = "2025-10-30";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseNode } from "./base-node";
|
|
2
|
-
export interface AttioAttribute<TOptions extends {
|
|
3
|
-
is_optional: boolean;
|
|
4
|
-
} = {
|
|
5
|
-
is_optional: boolean;
|
|
6
|
-
}> extends BaseNode<"attio-attribute", TOptions> {
|
|
7
|
-
type: "attio-attribute";
|
|
8
|
-
optional(): AttioAttribute<Omit<TOptions, "is_optional"> & {
|
|
9
|
-
is_optional: true;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=attio-attribute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-attribute.d.ts","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,GAAG;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,CAC5F,SAAQ,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7C,IAAI,EAAE,iBAAiB,CAAA;IACvB,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG;QAAC,WAAW,EAAE,IAAI,CAAA;KAAC,CAAC,CAAA;CAClF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-attribute.js","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-attribute.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseNode } from "./base-node";
|
|
2
|
-
export interface AttioList<TOptions extends {
|
|
3
|
-
is_optional: boolean;
|
|
4
|
-
} = {
|
|
5
|
-
is_optional: boolean;
|
|
6
|
-
}> extends BaseNode<"attio-list", TOptions> {
|
|
7
|
-
type: "attio-list";
|
|
8
|
-
optional(): AttioList<Omit<TOptions, "is_optional"> & {
|
|
9
|
-
is_optional: true;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=attio-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-list.d.ts","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,SAAS,CAAC,QAAQ,SAAS;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,GAAG;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,CACvF,SAAQ,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxC,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG;QAAC,WAAW,EAAE,IAAI,CAAA;KAAC,CAAC,CAAA;CAC7E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-list.js","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-list.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseNode } from "./base-node";
|
|
2
|
-
export interface AttioObject<TOptions extends {
|
|
3
|
-
is_optional: boolean;
|
|
4
|
-
} = {
|
|
5
|
-
is_optional: boolean;
|
|
6
|
-
}> extends BaseNode<"attio-object", TOptions> {
|
|
7
|
-
type: "attio-object";
|
|
8
|
-
optional(): AttioObject<Omit<TOptions, "is_optional"> & {
|
|
9
|
-
is_optional: true;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=attio-object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-object.d.ts","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,WAAW,CAAC,QAAQ,SAAS;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,GAAG;IAAC,WAAW,EAAE,OAAO,CAAA;CAAC,CACzF,SAAQ,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC1C,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG;QAAC,WAAW,EAAE,IAAI,CAAA;KAAC,CAAC,CAAA;CAC/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attio-object.js","sourceRoot":"","sources":["../../../src/shared/schema-utils/attio-object.ts"],"names":[],"mappings":""}
|
package/lib/template/README.md
DELETED
package/lib/template/biome.jsonc
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
-
"vcs": {
|
|
4
|
-
"enabled": true,
|
|
5
|
-
"clientKind": "git",
|
|
6
|
-
"useIgnoreFile": true
|
|
7
|
-
},
|
|
8
|
-
"files": {
|
|
9
|
-
"ignoreUnknown": false,
|
|
10
|
-
"includes": ["**", "!**/node_modules/", "!**/dist/"]
|
|
11
|
-
},
|
|
12
|
-
"formatter": {
|
|
13
|
-
"enabled": true,
|
|
14
|
-
"attributePosition": "auto",
|
|
15
|
-
"bracketSpacing": false,
|
|
16
|
-
"formatWithErrors": false,
|
|
17
|
-
"indentStyle": "space",
|
|
18
|
-
"indentWidth": 2,
|
|
19
|
-
"lineEnding": "lf",
|
|
20
|
-
"lineWidth": 100,
|
|
21
|
-
"useEditorconfig": true
|
|
22
|
-
},
|
|
23
|
-
"linter": {
|
|
24
|
-
"enabled": true,
|
|
25
|
-
"rules": {
|
|
26
|
-
"recommended": true
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"json": {
|
|
30
|
-
"formatter": {
|
|
31
|
-
"enabled": true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"javascript": {
|
|
35
|
-
"linter": {
|
|
36
|
-
"enabled": true
|
|
37
|
-
},
|
|
38
|
-
"formatter": {
|
|
39
|
-
"arrowParentheses": "always",
|
|
40
|
-
"bracketSameLine": false,
|
|
41
|
-
"jsxQuoteStyle": "double",
|
|
42
|
-
"quoteProperties": "asNeeded",
|
|
43
|
-
"quoteStyle": "double",
|
|
44
|
-
"semicolons": "asNeeded",
|
|
45
|
-
"trailingCommas": "es5",
|
|
46
|
-
"indentWidth": 4
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"assist": {
|
|
50
|
-
"enabled": true,
|
|
51
|
-
"actions": {
|
|
52
|
-
"source": {
|
|
53
|
-
"organizeImports": {
|
|
54
|
-
"level": "on"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// ESLint v9 flat config for Attio-specific rules only
|
|
2
|
-
// Biome handles all other linting and formatting
|
|
3
|
-
|
|
4
|
-
const typescriptParser = require("@typescript-eslint/parser")
|
|
5
|
-
const attioRules = require("attio/lint")
|
|
6
|
-
|
|
7
|
-
module.exports = [
|
|
8
|
-
{
|
|
9
|
-
files: ["src/**/*.{ts,tsx}"],
|
|
10
|
-
languageOptions: {
|
|
11
|
-
parser: typescriptParser,
|
|
12
|
-
parserOptions: {
|
|
13
|
-
ecmaFeatures: {
|
|
14
|
-
jsx: true,
|
|
15
|
-
},
|
|
16
|
-
ecmaVersion: 2020,
|
|
17
|
-
sourceType: "module",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
plugins: {
|
|
21
|
-
attio: {
|
|
22
|
-
rules: attioRules.rules,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
rules: {
|
|
26
|
-
// Only Attio-specific rules - these are critical for the platform
|
|
27
|
-
"attio/attio-client-import": "error",
|
|
28
|
-
"attio/server-default-export": "error",
|
|
29
|
-
"attio/form-submit-button": "error",
|
|
30
|
-
"attio/widget-text-children": "error",
|
|
31
|
-
},
|
|
32
|
-
settings: {
|
|
33
|
-
react: {
|
|
34
|
-
version: "detect",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
ignores: ["package.json", "dist/", "node_modules/"],
|
|
40
|
-
},
|
|
41
|
-
]
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slug-to-be-replaced",
|
|
3
|
-
"description": "title-to-be-replaced",
|
|
4
|
-
"private": true,
|
|
5
|
-
"version": "0.0.1",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"attio": "attio",
|
|
8
|
-
"dev": "attio dev",
|
|
9
|
-
"build": "attio build",
|
|
10
|
-
"format": "biome format --write src/",
|
|
11
|
-
"format:check": "biome format src/",
|
|
12
|
-
"clean": "rm -rf lib && rm -rf dist",
|
|
13
|
-
"lint": "npm run lint:biome && npm run lint:attio",
|
|
14
|
-
"lint:biome": "ATTIO_LINT_MODE='exhaustive' biome lint src/",
|
|
15
|
-
"lint:biome:fix": "ATTIO_LINT_MODE='exhaustive' biome lint --write src/",
|
|
16
|
-
"lint:attio": "ATTIO_LINT_MODE='exhaustive' eslint \"src/**/*.{ts,tsx}\" --config eslint.attio.config.js",
|
|
17
|
-
"lint:attio:fix": "ATTIO_LINT_MODE='exhaustive' eslint \"src/**/*.{ts,tsx}\" --config eslint.attio.config.js --fix",
|
|
18
|
-
"lint:fix": "npm run lint:biome:fix && npm run lint:attio:fix",
|
|
19
|
-
"check": "biome check src/",
|
|
20
|
-
"check:fix": "biome check --write src/",
|
|
21
|
-
"test": ""
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@biomejs/biome": "^2.0.0",
|
|
25
|
-
"@types/react": "19.1.8",
|
|
26
|
-
"node-fetch": "3.3.2",
|
|
27
|
-
"eslint": "^9.29.0",
|
|
28
|
-
"@typescript-eslint/parser": "^8.34.1"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"attio": "latest",
|
|
32
|
-
"react": "19.1.0",
|
|
33
|
-
"zod": "3.25.67"
|
|
34
|
-
}
|
|
35
|
-
}
|
package/lib/template/src/app.ts
DELETED
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {z} from "zod"
|
|
2
|
-
|
|
3
|
-
const quoteSchema = z.object({
|
|
4
|
-
text: z.string(),
|
|
5
|
-
author: z.string(),
|
|
6
|
-
})
|
|
7
|
-
export type Quote = z.infer<typeof quoteSchema>
|
|
8
|
-
|
|
9
|
-
export default async function getStoicQuote(recordId: string): Promise<Quote> {
|
|
10
|
-
// We don't really need the recordId for this API, but this is how we could use a parameter
|
|
11
|
-
const response = await fetch(`https://stoic-quotes.com/api/quote?${recordId}`)
|
|
12
|
-
const data = await response.json()
|
|
13
|
-
return quoteSchema.parse(data)
|
|
14
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type {App} from "attio"
|
|
2
|
-
import {showDialog} from "attio/client"
|
|
3
|
-
|
|
4
|
-
import {HelloWorldDialog} from "./hello-world-dialog"
|
|
5
|
-
|
|
6
|
-
export const helloWorldAction: App.Record.Action = {
|
|
7
|
-
id: "slug-to-be-replaced",
|
|
8
|
-
label: "title-to-be-replaced",
|
|
9
|
-
onTrigger: async ({recordId}) => {
|
|
10
|
-
showDialog({
|
|
11
|
-
title: "title-to-be-replaced",
|
|
12
|
-
Dialog: () => {
|
|
13
|
-
// This is a React component. It can use hooks and render other components.
|
|
14
|
-
return <HelloWorldDialog recordId={recordId} />
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
},
|
|
18
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {TextBlock} from "attio/client"
|
|
2
|
-
import React from "react"
|
|
3
|
-
|
|
4
|
-
import {StoicQuote} from "./stoic-quote"
|
|
5
|
-
|
|
6
|
-
const Loading = () => <TextBlock>Loading stoic quote...</TextBlock>
|
|
7
|
-
|
|
8
|
-
export function HelloWorldDialog({recordId}: {recordId: string}) {
|
|
9
|
-
// A simple counter to demonstrate that this is just regular React code.
|
|
10
|
-
const [seconds, setSeconds] = React.useState(0)
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
const timeout = setTimeout(() => setSeconds(seconds + 1), 1000)
|
|
13
|
-
return () => clearTimeout(timeout)
|
|
14
|
-
}, [seconds])
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<TextBlock align="left">
|
|
19
|
-
I am a dialog. I have been open for: {seconds} second{seconds === 1 ? "" : "s"}
|
|
20
|
-
</TextBlock>
|
|
21
|
-
{/* The hook in StoicQuote will suspend until the stoic quote is loaded. */}
|
|
22
|
-
<React.Suspense fallback={<Loading />}>
|
|
23
|
-
<StoicQuote recordId={recordId} />
|
|
24
|
-
</React.Suspense>
|
|
25
|
-
</>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {TextBlock, useAsyncCache} from "attio/client"
|
|
2
|
-
|
|
3
|
-
import getStoicQuote from "./get-stoic-quote.server"
|
|
4
|
-
|
|
5
|
-
export function StoicQuote({recordId}: {recordId: string}) {
|
|
6
|
-
// By passing in the recordId, the result will be cached for each recordId
|
|
7
|
-
const {
|
|
8
|
-
values: {quote},
|
|
9
|
-
// ^^^^^– this key matches
|
|
10
|
-
// vvvvv– this key
|
|
11
|
-
} = useAsyncCache({quote: [getStoicQuote, recordId]})
|
|
12
|
-
// ^^^^^^^^^^^^^ ^^^^^^^^
|
|
13
|
-
// async fn parameter(s)
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<TextBlock align="center">{quote.text}</TextBlock>
|
|
18
|
-
<TextBlock align="right">– {quote.author}</TextBlock>
|
|
19
|
-
</>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowJs": false,
|
|
4
|
-
"allowSyntheticDefaultImports": true,
|
|
5
|
-
"allowUmdGlobalAccess": false,
|
|
6
|
-
"allowUnreachableCode": false,
|
|
7
|
-
"allowUnusedLabels": false,
|
|
8
|
-
"alwaysStrict": true,
|
|
9
|
-
"composite": true,
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"declarationMap": true,
|
|
12
|
-
"emitDecoratorMetadata": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"experimentalDecorators": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
18
|
-
"module": "ES6",
|
|
19
|
-
"moduleResolution": "bundler",
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noImplicitAny": true,
|
|
22
|
-
"noImplicitReturns": true,
|
|
23
|
-
"noImplicitThis": true,
|
|
24
|
-
"noUnusedLocals": true,
|
|
25
|
-
"noUnusedParameters": false,
|
|
26
|
-
"outDir": "lib",
|
|
27
|
-
"removeComments": true,
|
|
28
|
-
"resolveJsonModule": true,
|
|
29
|
-
"rootDir": "src",
|
|
30
|
-
"skipLibCheck": true,
|
|
31
|
-
"sourceMap": true,
|
|
32
|
-
"strict": true,
|
|
33
|
-
"strictBindCallApply": true,
|
|
34
|
-
"strictFunctionTypes": true,
|
|
35
|
-
"strictNullChecks": true,
|
|
36
|
-
"strictPropertyInitialization": true,
|
|
37
|
-
"target": "ES2019",
|
|
38
|
-
"types": ["attio/client"]
|
|
39
|
-
},
|
|
40
|
-
"exclude": ["node_modules"],
|
|
41
|
-
"include": ["src", ".attio"]
|
|
42
|
-
}
|
package/lib/util/can-write.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { combineAsync, complete, errored, isErrored } from "@attio/fetchable-npm";
|
|
4
|
-
export async function copyWithTransform(srcDir, destDir, transform) {
|
|
5
|
-
try {
|
|
6
|
-
await fs.mkdir(destDir, { recursive: true });
|
|
7
|
-
}
|
|
8
|
-
catch {
|
|
9
|
-
return errored({ code: "FAILED_TO_CREATE_DIRECTORY", path: destDir });
|
|
10
|
-
}
|
|
11
|
-
let entries;
|
|
12
|
-
try {
|
|
13
|
-
entries = await fs.readdir(srcDir, { withFileTypes: true });
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return errored({ code: "FAILED_TO_LIST_FILES", path: srcDir });
|
|
17
|
-
}
|
|
18
|
-
const results = await combineAsync(entries.map(async (entry) => {
|
|
19
|
-
const srcPath = path.join(srcDir, entry.name);
|
|
20
|
-
const destPath = path.join(destDir, entry.name);
|
|
21
|
-
if (entry.isDirectory()) {
|
|
22
|
-
return await copyWithTransform(srcPath, destPath, transform);
|
|
23
|
-
}
|
|
24
|
-
else if (entry.isFile()) {
|
|
25
|
-
if (/\.(jpg|jpeg|png|gif|svg|webp|ico)$/i.test(entry.name)) {
|
|
26
|
-
try {
|
|
27
|
-
await fs.copyFile(srcPath, destPath);
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return errored({ code: "FAILED_TO_COPY_FILE", src: srcPath, dest: destPath });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
let content;
|
|
35
|
-
try {
|
|
36
|
-
content = await fs.readFile(srcPath, "utf8");
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return errored({ code: "FAILED_TO_READ_FILE", path: srcPath });
|
|
40
|
-
}
|
|
41
|
-
content = transform(content);
|
|
42
|
-
try {
|
|
43
|
-
await fs.writeFile(destPath, content, "utf8");
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return errored({ code: "FAILED_TO_WRITE_FILE", path: destPath });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return complete(undefined);
|
|
51
|
-
}));
|
|
52
|
-
if (isErrored(results)) {
|
|
53
|
-
return results;
|
|
54
|
-
}
|
|
55
|
-
return complete(undefined);
|
|
56
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { constants, promises as fs } from "fs";
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import { complete, errored } from "@attio/fetchable-npm";
|
|
4
|
-
export const createDirectory = async (name) => {
|
|
5
|
-
const currentDir = process.cwd();
|
|
6
|
-
const newPath = join(currentDir, name);
|
|
7
|
-
try {
|
|
8
|
-
if (await fs
|
|
9
|
-
.access(newPath)
|
|
10
|
-
.then(() => true)
|
|
11
|
-
.catch(() => false)) {
|
|
12
|
-
return errored({
|
|
13
|
-
code: "DIRECTORY_ALREADY_EXISTS",
|
|
14
|
-
path: newPath,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
await fs.access(currentDir, constants.W_OK);
|
|
18
|
-
await fs.mkdir(newPath);
|
|
19
|
-
return complete(newPath);
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return errored({
|
|
23
|
-
code: "WRITE_ACCESS_DENIED",
|
|
24
|
-
path: name,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|