attio 0.0.1-experimental.20240821 → 0.0.1-experimental.20240821.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ export declare function completeProdBundleUpload({ token, developerSlug, appId, bundleId, major, minor, }: {
2
+ token: string;
3
+ developerSlug: string;
4
+ appId: string;
5
+ bundleId: string;
6
+ major: number;
7
+ minor: number;
8
+ }): Promise<true>;
9
+ //# sourceMappingURL=complete-prod-bundle-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complete-prod-bundle-upload.d.ts","sourceRoot":"","sources":["../../src/api/complete-prod-bundle-upload.ts"],"names":[],"mappings":"AAUA,wBAAsB,wBAAwB,CAAC,EAC3C,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,GACR,EAAE;IACC,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB,iBAgBA"}
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { API } from "../env.js";
3
+ import { handleError } from "./handle-error.js";
4
+ import { makeHeaders } from "./make-headers.js";
5
+ const completeBundleUploadSchema = z.object({
6
+ success: z.literal(true),
7
+ });
8
+ export async function completeProdBundleUpload({ token, developerSlug, appId, bundleId, major, minor, }) {
9
+ const response = await fetch(`${API}/developer-portal/accounts/${developerSlug}/apps/${appId}/prod-versions/${major}/${minor}/bundles/${bundleId}/complete`, {
10
+ method: "POST",
11
+ headers: makeHeaders(token),
12
+ });
13
+ await handleError(response);
14
+ const json = await response.json();
15
+ try {
16
+ return completeBundleUploadSchema.parse(json).success;
17
+ }
18
+ catch {
19
+ throw new Error(JSON.stringify(json));
20
+ }
21
+ }
22
+ //# sourceMappingURL=complete-prod-bundle-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complete-prod-bundle-upload.js","sourceRoot":"","sources":["../../src/api/complete-prod-bundle-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAE7C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAC3B,CAAC,CAAA;AAEF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAC3C,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,GAQR;IACG,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,GAAG,8BAA8B,aAAa,SAAS,KAAK,kBAAkB,KAAK,IAAI,KAAK,YAAY,QAAQ,WAAW,EAC9H;QACI,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC;KAC9B,CACJ,CAAA;IACD,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAA;IAE3B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAClC,IAAI,CAAC;QACD,OAAO,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAA;IACzD,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IACzC,CAAC;AACL,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import { Config } from "../schema.js";
3
+ declare const createVersionSchema: z.ZodObject<{
4
+ app_id: z.ZodString;
5
+ major: z.ZodNumber;
6
+ minor: z.ZodNumber;
7
+ app_prod_version_bundle_id: z.ZodString;
8
+ client_bundle_upload_url: z.ZodString;
9
+ server_bundle_upload_url: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ major: number;
12
+ minor: number;
13
+ app_id: string;
14
+ app_prod_version_bundle_id: string;
15
+ client_bundle_upload_url: string;
16
+ server_bundle_upload_url: string;
17
+ }, {
18
+ major: number;
19
+ minor: number;
20
+ app_id: string;
21
+ app_prod_version_bundle_id: string;
22
+ client_bundle_upload_url: string;
23
+ server_bundle_upload_url: string;
24
+ }>;
25
+ export type AppVersion = z.infer<typeof createVersionSchema>;
26
+ export declare function createVersion({ token, devSlug, appId, connection, }: {
27
+ token: string;
28
+ devSlug: string;
29
+ appId: string;
30
+ connection: Config["connection"];
31
+ }): Promise<AppVersion>;
32
+ export {};
33
+ //# sourceMappingURL=create-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-version.d.ts","sourceRoot":"","sources":["../../src/api/create-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAGrB,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AAInC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE5D,wBAAsB,aAAa,CAAC,EAChC,KAAK,EACL,OAAO,EACP,KAAK,EACL,UAAU,GACb,EAAE;IACC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;CACnC,GAAG,OAAO,CAAC,UAAU,CAAC,CAgBtB"}
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import { API } from "../env.js";
3
+ import { handleError } from "./handle-error.js";
4
+ import { makeHeaders } from "./make-headers.js";
5
+ const createVersionSchema = z.object({
6
+ app_id: z.string(),
7
+ major: z.number(),
8
+ minor: z.number(),
9
+ app_prod_version_bundle_id: z.string(),
10
+ client_bundle_upload_url: z.string(),
11
+ server_bundle_upload_url: z.string(),
12
+ });
13
+ export async function createVersion({ token, devSlug, appId, connection, }) {
14
+ const response = await fetch(`${API}/developer-portal/accounts/${devSlug}/apps/${appId}/create-version`, {
15
+ method: "PUT",
16
+ headers: makeHeaders(token),
17
+ body: JSON.stringify({
18
+ connection_type: connection?.connection_type,
19
+ audience: connection?.audience,
20
+ major: 1,
21
+ }),
22
+ });
23
+ await handleError(response);
24
+ return createVersionSchema.parse(await response.json());
25
+ }
26
+ //# sourceMappingURL=create-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-version.js","sourceRoot":"","sources":["../../src/api/create-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAE7B,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAE7C,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE;IACtC,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE;IACpC,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE;CACvC,CAAC,CAAA;AAIF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAChC,KAAK,EACL,OAAO,EACP,KAAK,EACL,UAAU,GAMb;IACG,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,GAAG,8BAA8B,OAAO,SAAS,KAAK,iBAAiB,EAC1E;QACI,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC;QAC3B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACjB,eAAe,EAAE,UAAU,EAAE,eAAe;YAC5C,QAAQ,EAAE,UAAU,EAAE,QAAQ;YAC9B,KAAK,EAAE,CAAC;SACX,CAAC;KACL,CACJ,CAAA;IACD,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAA;IAE3B,OAAO,mBAAmB,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;AAC3D,CAAC"}
@@ -5,8 +5,8 @@ export declare function startUpload({ token, developerSlug, appId, devVersionId,
5
5
  devVersionId: string;
6
6
  }): Promise<{
7
7
  app_dev_version_id: string;
8
- app_dev_version_bundle_id: string;
9
8
  client_bundle_upload_url: string;
10
9
  server_bundle_upload_url: string;
10
+ app_dev_version_bundle_id: string;
11
11
  }>;
12
12
  //# sourceMappingURL=start-upload.d.ts.map
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { z } from "zod";
3
+ export declare const description = "Create a new production unpublished version of your Attio app";
4
+ export declare const options: z.ZodObject<{
5
+ dev: z.ZodDefault<z.ZodBoolean>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ dev: boolean;
8
+ }, {
9
+ dev?: boolean | undefined;
10
+ }>;
11
+ interface Props {
12
+ options: z.infer<typeof options>;
13
+ }
14
+ export default function CreateVersion({ options: { dev } }: Props): React.JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/version/create.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAOrB,eAAO,MAAM,WAAW,kEAAkE,CAAA;AAC1F,eAAO,MAAM,OAAO;;;;;;EAKlB,CAAA;AAEF,UAAU,KAAK;IACX,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;CACnC;AAID,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAC,OAAO,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,KAAK,qBA8F5D"}
@@ -0,0 +1,72 @@
1
+ import { useMachine } from "@xstate/react";
2
+ import { Box, Text, useApp } from "ink";
3
+ import Spinner from "ink-spinner";
4
+ import { option } from "pastel";
5
+ import React from "react";
6
+ import { z } from "zod";
7
+ import { renderBuildErrors } from "../../components/BuildError.js";
8
+ import { InitialInstructions } from "../../components/InitialInstructions.js";
9
+ import { Logo } from "../../components/Logo.js";
10
+ import { createVersionMachine } from "../../machines/create-version-machine.js";
11
+ export const description = "Create a new production unpublished version of your Attio app";
12
+ export const options = z.object({
13
+ dev: z
14
+ .boolean()
15
+ .default(false)
16
+ .describe(option({ description: "Run in development mode (additional debugging info)" })),
17
+ });
18
+ export default function CreateVersion({ options: { dev } }) {
19
+ const [snapshot] = useMachine(createVersionMachine);
20
+ const { exit } = useApp();
21
+ const jsError = snapshot.children.javascript?.getSnapshot().context.error;
22
+ const version = snapshot.context.version;
23
+ const isBuildError = snapshot.matches({ JavaScript: "Build Error" });
24
+ React.useEffect(() => {
25
+ if (isBuildError) {
26
+ exit();
27
+ }
28
+ }, [isBuildError, exit]);
29
+ return (React.createElement(Box, { flexDirection: "column" },
30
+ dev && (React.createElement(Box, null,
31
+ React.createElement(Text, null, JSON.stringify(snapshot.value, null, 2)))),
32
+ React.createElement(Logo, null),
33
+ React.createElement(Box, { flexDirection: "column" },
34
+ snapshot.matches("Show config instructions") && (React.createElement(InitialInstructions, { reason: snapshot.context.configError })),
35
+ snapshot.matches({ JavaScript: "Building" }) && (React.createElement(Box, null,
36
+ React.createElement(Text, null,
37
+ "\uD83D\uDD28 Building...",
38
+ " ",
39
+ React.createElement(Text, { color: "green" },
40
+ React.createElement(Spinner, { type: "dots" }))))),
41
+ isBuildError && (React.createElement(Box, { flexDirection: "column", gap: 1 },
42
+ jsError && renderBuildErrors(jsError),
43
+ !jsError && (React.createElement(Box, null,
44
+ React.createElement(Text, null, "Unknown error"))))),
45
+ snapshot.matches("Creating version") && (React.createElement(Box, null,
46
+ React.createElement(Text, null,
47
+ "\u231B\uFE0F Creating new version...",
48
+ " ",
49
+ React.createElement(Text, { color: "green" },
50
+ React.createElement(Spinner, { type: "dots" }))))),
51
+ snapshot.matches("Uploading") && (React.createElement(Box, null,
52
+ React.createElement(Text, null,
53
+ "\u231B\uFE0F Uploading...",
54
+ " ",
55
+ React.createElement(Text, { color: "green" },
56
+ React.createElement(Spinner, { type: "dots" }))))),
57
+ snapshot.matches("Success") && (React.createElement(React.Fragment, null,
58
+ React.createElement(Box, null,
59
+ React.createElement(Text, { color: "green" },
60
+ "SUCCESS!! \uD83C\uDF89 Version ",
61
+ version?.major,
62
+ ".",
63
+ version?.minor,
64
+ " successfully created.")),
65
+ React.createElement(Box, null,
66
+ React.createElement(Text, null, "When you're ready, you can publish it with:")),
67
+ React.createElement(Box, { flexDirection: "column", borderStyle: "round", width: 27, paddingX: 1, marginBottom: 1 },
68
+ React.createElement(Text, null, "attio version publish")))),
69
+ snapshot.context.error && (React.createElement(Box, { marginTop: 1 },
70
+ React.createElement(Text, { color: "red" }, snapshot.context.error))))));
71
+ }
72
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/version/create.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,KAAK,CAAA;AACrC,OAAO,OAAO,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,MAAM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AM,GAAG,CACpB,CACJ,CACL,CACT;YACA,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAC5B;gBACI,oBAAC,GAAG;oBACA,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO;;wBACO,OAAO,EAAE,KAAK;;wBAAG,OAAO,EAAE,KAAK;iDAElD,CACL;gBACN,oBAAC,GAAG;oBACA,oBAAC,IAAI,sDAAmD,CACtD;gBACN,oBAAC,GAAG,IACA,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,EACX,YAAY,EAAE,CAAC;oBAEf,oBAAC,IAAI,gCAA6B,CAChC,CACP,CACN;YACA,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,CACvB,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;gBACb,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAQ,CAC/C,CACT,CACC,CACJ,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const description = "Manage app versions";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/version/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,wBAAwB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export const description = "Manage app versions";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/version/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAA"}