attio 0.0.1-experimental.20240823.1 → 0.0.1-experimental.20240827

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.
@@ -14,7 +14,7 @@ export async function addConnectionDefinition({ token, devSlug, appId, connectio
14
14
  audience: connection.audience,
15
15
  major: 1,
16
16
  };
17
- if (connection.connection_type === "oauth2_code") {
17
+ if (connection.connection_type === "oauth2-code") {
18
18
  body.authorize_url = authorizeUrl;
19
19
  body.access_token_url = accessTokenUrl;
20
20
  body.client_id = clientId;
@@ -17,7 +17,7 @@ export declare function createDevVersion({ token, devSlug, appId, targetWorkspac
17
17
  targetWorkspaceId: string;
18
18
  environmentVariables: Record<string, string>;
19
19
  connection: {
20
- connection_type: "secret" | "oauth2_code";
20
+ connection_type: "secret" | "oauth2-code";
21
21
  audience: "workspace" | "workspace-member";
22
22
  } | null;
23
23
  }): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"generate-server-entry.d.ts","sourceRoot":"","sources":["../../../src/build/server/generate-server-entry.ts"],"names":[],"mappings":"AAKA,wBAAsB,mBAAmB,CAAC,EACtC,MAAM,EACN,GAAG,GACN,EAAE;IACC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC,mBA2DA"}
1
+ {"version":3,"file":"generate-server-entry.d.ts","sourceRoot":"","sources":["../../../src/build/server/generate-server-entry.ts"],"names":[],"mappings":"AAKA,wBAAsB,mBAAmB,CAAC,EACtC,MAAM,EACN,GAAG,GACN,EAAE;IACC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC,mBA6DA"}
@@ -14,25 +14,28 @@ export async function generateServerEntry({ appDir, log, }) {
14
14
  log?.(`🔎 Found server module "${module.path}"`);
15
15
  }
16
16
  return `
17
- ${modules
18
- .map((module, index) => `import * as C${index} from ${JSON.stringify(`.${path.sep}${path.join(appDir, module.path)}`)}`)
19
- .join("\n")}
17
+
18
+ const modules = new Map()
20
19
 
21
- const modules = new Map()
22
20
 
23
- ${modules.map((module, index) => `modules.set("${module.hash}", C${index})`).join("\n")}
21
+
22
+ ${modules
23
+ .map((module) => `modules.set("${module.hash}", () => import(${JSON.stringify(`.${path.sep}${path.join(appDir, module.path)}`)}))`)
24
+ .join("\n")}
24
25
 
25
26
 
26
27
  var stdin_default;
27
28
  function main() {
28
- stdin_default = function(moduleHash, args) {
29
+ stdin_default = async function(moduleHash, args) {
30
+
31
+
29
32
  const module = modules.get(moduleHash)
30
33
 
31
34
  if (!module) {
32
35
  throw new Error(\`Module \${moduleHash} not found\`)
33
36
  }
34
37
 
35
- const func = module.default
38
+ const func = (await module()).default
36
39
 
37
40
  if (!func) {
38
41
  throw new Error(\`Default export not found in module \${moduleHash}\`)
@@ -1 +1 @@
1
- {"version":3,"file":"generate-server-entry.js","sourceRoot":"","sources":["../../../src/build/server/generate-server-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAA;AACzB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACtC,MAAM,EACN,GAAG,GAIN;IACG,MAAM,aAAa,GAAG,CAClB,MAAM,OAAO,CAAC,GAAG,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,CAAC;QAClD,IAAI,CAAC,gBAAgB,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,CAAC;KACrD,CAAC,CACL,CAAC,IAAI,EAAE,CAAA;IAER,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI;QACJ,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;KACtD,CAAC,CAAC,CAAA;IAEH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,GAAG,EAAE,CAAC,2BAA2B,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA;IACpD,CAAC;IAED,OAAO;MACL,OAAO;SACJ,GAAG,CACA,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAEd,gBAAgB,KAAK,SAAS,IAAI,CAAC,SAAS,CACxC,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAClD,EAAE,CACV;SACA,IAAI,CAAC,IAAI,CAAC;;;;UAIT,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,gBAAgB,MAAM,CAAC,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B9F,CAAA;AACD,CAAC"}
1
+ {"version":3,"file":"generate-server-entry.js","sourceRoot":"","sources":["../../../src/build/server/generate-server-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAA;AACzB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACtC,MAAM,EACN,GAAG,GAIN;IACG,MAAM,aAAa,GAAG,CAClB,MAAM,OAAO,CAAC,GAAG,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,CAAC;QAClD,IAAI,CAAC,gBAAgB,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,CAAC;KACrD,CAAC,CACL,CAAC,IAAI,EAAE,CAAA;IAER,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI;QACJ,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;KACtD,CAAC,CAAC,CAAA;IAEH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,GAAG,EAAE,CAAC,2BAA2B,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA;IACpD,CAAC;IAED,OAAO;;;;;;UAMD,OAAO;SACJ,GAAG,CACA,CAAC,MAAM,EAAE,EAAE,CACP,gBAAgB,MAAM,CAAC,IAAI,mBAAmB,IAAI,CAAC,SAAS,CACxD,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAClD,IAAI,CACZ;SACA,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BtB,CAAA;AACD,CAAC"}
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { z } from "zod";
3
3
  export declare const description = "Create a new connection for your Attio app";
4
4
  export declare const options: z.ZodObject<{
5
- type: z.ZodOptional<z.ZodEnum<["secret", "oauth2_code"]>>;
5
+ type: z.ZodOptional<z.ZodEnum<["secret", "oauth2-code"]>>;
6
6
  audience: z.ZodOptional<z.ZodEnum<["workspace", "workspace-member"]>>;
7
7
  authorizeUrl: z.ZodOptional<z.ZodString>;
8
8
  accessTokenUrl: z.ZodOptional<z.ZodString>;
@@ -12,7 +12,7 @@ export declare const options: z.ZodObject<{
12
12
  dev: z.ZodDefault<z.ZodBoolean>;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  dev: boolean;
15
- type?: "secret" | "oauth2_code" | undefined;
15
+ type?: "secret" | "oauth2-code" | undefined;
16
16
  audience?: "workspace" | "workspace-member" | undefined;
17
17
  authorizeUrl?: string | undefined;
18
18
  accessTokenUrl?: string | undefined;
@@ -20,7 +20,7 @@ export declare const options: z.ZodObject<{
20
20
  clientId?: string | undefined;
21
21
  clientSecret?: string | undefined;
22
22
  }, {
23
- type?: "secret" | "oauth2_code" | undefined;
23
+ type?: "secret" | "oauth2-code" | undefined;
24
24
  audience?: "workspace" | "workspace-member" | undefined;
25
25
  authorizeUrl?: string | undefined;
26
26
  accessTokenUrl?: string | undefined;
@@ -12,7 +12,7 @@ import { addConnectionMachine, audiences, connectionTypes, } from "../../machine
12
12
  export const description = "Create a new connection for your Attio app";
13
13
  export const options = z.object({
14
14
  type: z
15
- .enum(["secret", "oauth2_code"])
15
+ .enum(["secret", "oauth2-code"])
16
16
  .optional()
17
17
  .describe(option({ description: "The type of connection to create" })),
18
18
  audience: z
@@ -4,7 +4,7 @@ export declare const connectionTypes: readonly [{
4
4
  readonly value: "secret";
5
5
  readonly label: "Secret";
6
6
  }, {
7
- readonly value: "oauth2_code";
7
+ readonly value: "oauth2-code";
8
8
  readonly label: "OAuth2";
9
9
  }];
10
10
  export declare const audiences: readonly [{
@@ -247,42 +247,42 @@ export declare const addConnectionMachine: import("xstate").StateMachine<Context
247
247
  "have connection type": {
248
248
  type: "have connection type";
249
249
  params: {
250
- connectionType?: "secret" | "oauth2_code" | undefined;
250
+ connectionType?: "secret" | "oauth2-code" | undefined;
251
251
  };
252
252
  };
253
253
  "have authorize url": {
254
254
  type: "have authorize url";
255
255
  params: {
256
256
  authorizeUrl?: string | undefined;
257
- connectionType?: "secret" | "oauth2_code" | undefined;
257
+ connectionType?: "secret" | "oauth2-code" | undefined;
258
258
  };
259
259
  };
260
260
  "have access token url": {
261
261
  type: "have access token url";
262
262
  params: {
263
263
  accessTokenUrl?: string | undefined;
264
- connectionType?: "secret" | "oauth2_code" | undefined;
264
+ connectionType?: "secret" | "oauth2-code" | undefined;
265
265
  };
266
266
  };
267
267
  "have scopes": {
268
268
  type: "have scopes";
269
269
  params: {
270
270
  scopes?: string | undefined;
271
- connectionType?: "secret" | "oauth2_code" | undefined;
271
+ connectionType?: "secret" | "oauth2-code" | undefined;
272
272
  };
273
273
  };
274
274
  "have client id": {
275
275
  type: "have client id";
276
276
  params: {
277
277
  clientId?: string | undefined;
278
- connectionType?: "secret" | "oauth2_code" | undefined;
278
+ connectionType?: "secret" | "oauth2-code" | undefined;
279
279
  };
280
280
  };
281
281
  "have client secret": {
282
282
  type: "have client secret";
283
283
  params: {
284
284
  clientSecret?: string | undefined;
285
- connectionType?: "secret" | "oauth2_code" | undefined;
285
+ connectionType?: "secret" | "oauth2-code" | undefined;
286
286
  };
287
287
  };
288
288
  }>, never, "Success" | "Error" | "Show config instructions" | "Loading Developer Config" | "Loading App Config" | "Do we already have a connection?" | "Ask for connection type" | "Do we have an audience?" | "Ask for audience" | "Do we have an authorize url?" | "Creating connection definition" | "Already have a connection" | "Do we have a connection type?" | "Ask for Authorize URL" | "Do we have an access token url?" | "Ask for Access Token URL" | "Do we have scopes?" | "Ask for Scopes" | "Do we have a client id?" | "Ask for Client ID" | "Do we have a client secret?" | "Ask for Client Secret", string, Pick<Context, "audience" | "clientId" | "clientSecret" | "authorizeUrl" | "accessTokenUrl" | "scopes" | "connectionType">, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject>;
@@ -5,7 +5,7 @@ import { updateAppConfig } from "../util/app-config.js";
5
5
  import { loadAppConfig, loadDeveloperConfig } from "./actors.js";
6
6
  export const connectionTypes = [
7
7
  { value: "secret", label: "Secret" },
8
- { value: "oauth2_code", label: "OAuth2" },
8
+ { value: "oauth2-code", label: "OAuth2" },
9
9
  ];
10
10
  export const audiences = [
11
11
  { value: "workspace", label: "Workspace" },
@@ -5,7 +5,7 @@ export declare const connectionTypes: readonly [{
5
5
  readonly value: "secret";
6
6
  readonly label: "Secret";
7
7
  }, {
8
- readonly value: "oauth2_code";
8
+ readonly value: "oauth2-code";
9
9
  readonly label: "OAuth2";
10
10
  }];
11
11
  export declare const audiences: readonly [{
@@ -7,7 +7,7 @@ import { loadAppConfig, loadDeveloperConfig } from "./actors.js";
7
7
  import { jsMachine } from "./js-machine.js";
8
8
  export const connectionTypes = [
9
9
  { value: "secret", label: "Secret" },
10
- { value: "oauth2_code", label: "OAuth2" },
10
+ { value: "oauth2-code", label: "OAuth2" },
11
11
  ];
12
12
  export const audiences = [
13
13
  { value: "workspace", label: "Workspace" },
@@ -5,7 +5,7 @@ export declare const connectionTypes: readonly [{
5
5
  readonly value: "secret";
6
6
  readonly label: "Secret";
7
7
  }, {
8
- readonly value: "oauth2_code";
8
+ readonly value: "oauth2-code";
9
9
  readonly label: "OAuth2";
10
10
  }];
11
11
  export declare const audiences: readonly [{
@@ -5,7 +5,7 @@ import { emptyConfig } from "../schema.js";
5
5
  import { loadAppConfig, loadDeveloperConfig } from "./actors.js";
6
6
  export const connectionTypes = [
7
7
  { value: "secret", label: "Secret" },
8
- { value: "oauth2_code", label: "OAuth2" },
8
+ { value: "oauth2-code", label: "OAuth2" },
9
9
  ];
10
10
  export const audiences = [
11
11
  { value: "workspace", label: "Workspace" },
package/lib/schema.d.ts CHANGED
@@ -5,13 +5,13 @@ declare const configSchema: z.ZodObject<{
5
5
  major: z.ZodDefault<z.ZodNumber>;
6
6
  minor: z.ZodDefault<z.ZodNumber>;
7
7
  connection: z.ZodDefault<z.ZodNullable<z.ZodObject<{
8
- connection_type: z.ZodEnum<["secret", "oauth2_code"]>;
8
+ connection_type: z.ZodEnum<["secret", "oauth2-code"]>;
9
9
  audience: z.ZodEnum<["workspace", "workspace-member"]>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- connection_type: "secret" | "oauth2_code";
11
+ connection_type: "secret" | "oauth2-code";
12
12
  audience: "workspace" | "workspace-member";
13
13
  }, {
14
- connection_type: "secret" | "oauth2_code";
14
+ connection_type: "secret" | "oauth2-code";
15
15
  audience: "workspace" | "workspace-member";
16
16
  }>>>;
17
17
  }, "strip", z.ZodTypeAny, {
@@ -20,7 +20,7 @@ declare const configSchema: z.ZodObject<{
20
20
  major: number;
21
21
  minor: number;
22
22
  connection: {
23
- connection_type: "secret" | "oauth2_code";
23
+ connection_type: "secret" | "oauth2-code";
24
24
  audience: "workspace" | "workspace-member";
25
25
  } | null;
26
26
  }, {
@@ -29,7 +29,7 @@ declare const configSchema: z.ZodObject<{
29
29
  major?: number | undefined;
30
30
  minor?: number | undefined;
31
31
  connection?: {
32
- connection_type: "secret" | "oauth2_code";
32
+ connection_type: "secret" | "oauth2-code";
33
33
  audience: "workspace" | "workspace-member";
34
34
  } | null | undefined;
35
35
  }>;
package/lib/schema.js CHANGED
@@ -8,7 +8,7 @@ const configSchema = z.object({
8
8
  minor: z.number().int().min(0).default(0).describe("The minor version of the app"),
9
9
  connection: z
10
10
  .object({
11
- connection_type: z.enum(["secret", "oauth2_code"]).describe("The type of connection"),
11
+ connection_type: z.enum(["secret", "oauth2-code"]).describe("The type of connection"),
12
12
  audience: z
13
13
  .enum(["workspace", "workspace-member"])
14
14
  .describe("The connection's audience"),
package/lib/schema.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "type": "string",
32
32
  "enum": [
33
33
  "secret",
34
- "oauth2_code"
34
+ "oauth2-code"
35
35
  ],
36
36
  "description": "The type of connection"
37
37
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attio",
3
- "version": "0.0.1-experimental.20240823.1",
3
+ "version": "0.0.1-experimental.20240827",
4
4
  "bin": "lib/attio.js",
5
5
  "type": "module",
6
6
  "files": [