@qawolf/api-contracts 0.42.0 → 0.48.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.
Files changed (93) hide show
  1. package/dist/v1/auth/config.d.ts +14 -6
  2. package/dist/v1/auth/config.d.ts.map +1 -1
  3. package/dist/v1/auth/config.js +15 -6
  4. package/dist/v1/auth/config.js.map +1 -1
  5. package/dist/v1/email/find.d.ts +42 -0
  6. package/dist/v1/email/find.d.ts.map +1 -0
  7. package/dist/v1/email/find.js +44 -0
  8. package/dist/v1/email/find.js.map +1 -0
  9. package/dist/v1/email/get.d.ts +52 -0
  10. package/dist/v1/email/get.d.ts.map +1 -0
  11. package/dist/v1/email/get.js +19 -0
  12. package/dist/v1/email/get.js.map +1 -0
  13. package/dist/v1/email/getAttachment.d.ts +23 -0
  14. package/dist/v1/email/getAttachment.d.ts.map +1 -0
  15. package/dist/v1/email/getAttachment.js +46 -0
  16. package/dist/v1/email/getAttachment.js.map +1 -0
  17. package/dist/v1/email/listAddresses.d.ts +23 -0
  18. package/dist/v1/email/listAddresses.d.ts.map +1 -0
  19. package/dist/v1/email/listAddresses.js +33 -0
  20. package/dist/v1/email/listAddresses.js.map +1 -0
  21. package/dist/v1/email/resource.d.ts +67 -0
  22. package/dist/v1/email/resource.d.ts.map +1 -0
  23. package/dist/v1/email/resource.js +56 -0
  24. package/dist/v1/email/resource.js.map +1 -0
  25. package/dist/v1/email/send.d.ts +46 -0
  26. package/dist/v1/email/send.d.ts.map +1 -0
  27. package/dist/v1/email/send.js +62 -0
  28. package/dist/v1/email/send.js.map +1 -0
  29. package/dist/v1/index.d.ts +387 -0
  30. package/dist/v1/index.d.ts.map +1 -1
  31. package/dist/v1/index.js +28 -13
  32. package/dist/v1/index.js.map +1 -1
  33. package/dist/v1/runner/evaluateSnippet.d.ts +5 -1
  34. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -1
  35. package/dist/v1/runner/evaluateSnippet.js +5 -2
  36. package/dist/v1/runner/evaluateSnippet.js.map +1 -1
  37. package/dist/v1/runner/get.d.ts +5 -1
  38. package/dist/v1/runner/get.d.ts.map +1 -1
  39. package/dist/v1/runner/get.js +5 -2
  40. package/dist/v1/runner/get.js.map +1 -1
  41. package/dist/v1/runner/highlightSelector.d.ts +5 -1
  42. package/dist/v1/runner/highlightSelector.d.ts.map +1 -1
  43. package/dist/v1/runner/highlightSelector.js +5 -2
  44. package/dist/v1/runner/highlightSelector.js.map +1 -1
  45. package/dist/v1/runner/identity.d.ts +2 -0
  46. package/dist/v1/runner/identity.d.ts.map +1 -1
  47. package/dist/v1/runner/identity.js +2 -0
  48. package/dist/v1/runner/identity.js.map +1 -1
  49. package/dist/v1/runner/importPackage.d.ts +5 -1
  50. package/dist/v1/runner/importPackage.d.ts.map +1 -1
  51. package/dist/v1/runner/importPackage.js +5 -2
  52. package/dist/v1/runner/importPackage.js.map +1 -1
  53. package/dist/v1/runner/index.d.ts +9 -2
  54. package/dist/v1/runner/index.d.ts.map +1 -1
  55. package/dist/v1/runner/index.js +9 -3
  56. package/dist/v1/runner/index.js.map +1 -1
  57. package/dist/v1/runner/inspect.d.ts +5 -1
  58. package/dist/v1/runner/inspect.d.ts.map +1 -1
  59. package/dist/v1/runner/inspect.js +5 -2
  60. package/dist/v1/runner/inspect.js.map +1 -1
  61. package/dist/v1/runner/inspectMobile.d.ts +5 -1
  62. package/dist/v1/runner/inspectMobile.d.ts.map +1 -1
  63. package/dist/v1/runner/inspectMobile.js +5 -2
  64. package/dist/v1/runner/inspectMobile.js.map +1 -1
  65. package/dist/v1/runner/list.d.ts +26 -0
  66. package/dist/v1/runner/list.d.ts.map +1 -0
  67. package/dist/v1/runner/list.js +23 -0
  68. package/dist/v1/runner/list.js.map +1 -0
  69. package/dist/v1/runner/performAction.d.ts +5 -1
  70. package/dist/v1/runner/performAction.d.ts.map +1 -1
  71. package/dist/v1/runner/performAction.js +5 -2
  72. package/dist/v1/runner/performAction.js.map +1 -1
  73. package/dist/v1/runner/promoteSnapshot.d.ts +5 -1
  74. package/dist/v1/runner/promoteSnapshot.d.ts.map +1 -1
  75. package/dist/v1/runner/promoteSnapshot.js +5 -2
  76. package/dist/v1/runner/promoteSnapshot.js.map +1 -1
  77. package/dist/v1/runner/readJournal.d.ts +5 -1
  78. package/dist/v1/runner/readJournal.d.ts.map +1 -1
  79. package/dist/v1/runner/readJournal.js +5 -2
  80. package/dist/v1/runner/readJournal.js.map +1 -1
  81. package/dist/v1/runner/runFlow.d.ts +3 -1
  82. package/dist/v1/runner/runFlow.d.ts.map +1 -1
  83. package/dist/v1/runner/runFlow.js +4 -1
  84. package/dist/v1/runner/runFlow.js.map +1 -1
  85. package/dist/v1/runner/stopRun.d.ts +5 -1
  86. package/dist/v1/runner/stopRun.d.ts.map +1 -1
  87. package/dist/v1/runner/stopRun.js +5 -2
  88. package/dist/v1/runner/stopRun.js.map +1 -1
  89. package/dist/v1/runner/takeScreenshot.d.ts +5 -1
  90. package/dist/v1/runner/takeScreenshot.d.ts.map +1 -1
  91. package/dist/v1/runner/takeScreenshot.js +5 -2
  92. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  93. package/package.json +1 -1
@@ -2,16 +2,24 @@ import { z } from "zod";
2
2
  /**
3
3
  * The configuration a client needs before it can authenticate.
4
4
  *
5
- * A client must send a WorkOS client id to start the device authorization
6
- * grant, and the token it receives verifies only against the client the backend
7
- * checks. The id differs per environment, so a client reads it from the host it
8
- * points at.
5
+ * `workOsClientId` identifies the deployment's WorkOS environment for legacy
6
+ * sign-in. `workOsConnectClientId` identifies the public OAuth application for
7
+ * Connect sign-in. Clients read these deployment-specific identifiers from
8
+ * the host they use.
9
9
  *
10
- * This carries no secret. A WorkOS client id is a public identifier, and the
11
- * device grant is designed for public clients that hold no secret.
10
+ * `authorizationServer` is the OAuth 2.1 authorization server, the AuthKit
11
+ * domain that serves WorkOS Connect. A client discovers the grant endpoints
12
+ * from its `/.well-known/oauth-authorization-server` document. It is absent
13
+ * when the environment does not trust Connect tokens yet.
14
+ *
15
+ * This carries no secret. A WorkOS client id and an issuer URL are public
16
+ * identifiers, and the device grant is designed for public clients that hold
17
+ * no secret.
12
18
  */
13
19
  export declare const authConfigResponse: z.ZodObject<{
20
+ authorizationServer: z.ZodOptional<z.ZodString>;
14
21
  workOsClientId: z.ZodString;
22
+ workOsConnectClientId: z.ZodOptional<z.ZodString>;
15
23
  }, z.core.$strip>;
16
24
  export type AuthConfigResponse = z.infer<typeof authConfigResponse>;
17
25
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/v1/auth/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB;;iBAE7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/v1/auth/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB;;;;iBAK7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -2,15 +2,24 @@ import { z } from "zod";
2
2
  /**
3
3
  * The configuration a client needs before it can authenticate.
4
4
  *
5
- * A client must send a WorkOS client id to start the device authorization
6
- * grant, and the token it receives verifies only against the client the backend
7
- * checks. The id differs per environment, so a client reads it from the host it
8
- * points at.
5
+ * `workOsClientId` identifies the deployment's WorkOS environment for legacy
6
+ * sign-in. `workOsConnectClientId` identifies the public OAuth application for
7
+ * Connect sign-in. Clients read these deployment-specific identifiers from
8
+ * the host they use.
9
9
  *
10
- * This carries no secret. A WorkOS client id is a public identifier, and the
11
- * device grant is designed for public clients that hold no secret.
10
+ * `authorizationServer` is the OAuth 2.1 authorization server, the AuthKit
11
+ * domain that serves WorkOS Connect. A client discovers the grant endpoints
12
+ * from its `/.well-known/oauth-authorization-server` document. It is absent
13
+ * when the environment does not trust Connect tokens yet.
14
+ *
15
+ * This carries no secret. A WorkOS client id and an issuer URL are public
16
+ * identifiers, and the device grant is designed for public clients that hold
17
+ * no secret.
12
18
  */
13
19
  export const authConfigResponse = z.object({
20
+ authorizationServer: z.string().optional(),
14
21
  workOsClientId: z.string(),
22
+ /** Public Connect application client ID used with authorizationServer. */
23
+ workOsConnectClientId: z.string().optional(),
15
24
  });
16
25
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/v1/auth/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/v1/auth/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeFindEmailsContract: <WorkspaceId extends PublicIdSchema>(ids: {
4
+ workspace: WorkspaceId;
5
+ }) => {
6
+ readonly description: "List the workspace's inbox, or its sent mail, newest first. Read a message body with email.get.";
7
+ readonly input: z.ZodObject<{
8
+ cursor: z.ZodOptional<z.ZodString>;
9
+ limit: z.ZodDefault<z.ZodNumber>;
10
+ address: z.ZodOptional<z.ZodEmail>;
11
+ createdAfter: z.ZodOptional<z.ZodISODateTime>;
12
+ direction: z.ZodDefault<z.ZodEnum<{
13
+ inbound: "inbound";
14
+ outbound: "outbound";
15
+ }>>;
16
+ workspaceId: z.ZodOptional<WorkspaceId>;
17
+ }, z.core.$strip>;
18
+ readonly kind: "read";
19
+ readonly name: "email.find";
20
+ readonly output: z.ZodObject<{
21
+ emails: z.ZodArray<z.ZodObject<{
22
+ createdAt: z.ZodISODateTime;
23
+ direction: z.ZodEnum<{
24
+ inbound: "inbound";
25
+ outbound: "outbound";
26
+ }>;
27
+ from: z.ZodObject<{
28
+ address: z.ZodString;
29
+ name: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strip>;
31
+ id: z.ZodString;
32
+ subject: z.ZodOptional<z.ZodString>;
33
+ to: z.ZodArray<z.ZodObject<{
34
+ address: z.ZodString;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>>;
37
+ url: z.ZodURL;
38
+ }, z.core.$strip>>;
39
+ nextCursor: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ };
42
+ //# sourceMappingURL=find.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/v1/email/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAUhD,eAAO,MAAM,sBAAsB,GACjC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDA,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
3
+ import { resource } from "../resource.js";
4
+ import { emailDirectionSchema, emailUrlFieldDescription, makeEmailSummaryFields, } from "./resource.js";
5
+ export const makeFindEmailsContract = (ids) => {
6
+ const input = z.object({
7
+ address: z
8
+ .email()
9
+ .optional()
10
+ .describe("Only emails delivered to this exact address (inbound) or sent from it (outbound). Mail to a plus-suffixed address such as inbox+abc@example.com is found by that full address, not by inbox@example.com."),
11
+ // `offset: true` accepts all ISO 8601 datetimes, with `Z` or with a
12
+ // timezone offset. Without it, zod rejects valid inputs such as
13
+ // `2026-07-01T00:00:00+02:00`.
14
+ createdAfter: z.iso
15
+ .datetime({ offset: true })
16
+ .optional()
17
+ .describe("Only include emails received or sent after this instant, e.g. since a flow submitted a sign-up form."),
18
+ direction: emailDirectionSchema
19
+ .default("inbound")
20
+ .describe("inbound lists the mail the workspace received: its inbox. outbound lists the mail it sent."),
21
+ workspaceId: ids.workspace
22
+ .optional()
23
+ .describe("The workspace whose emails to list. Required when authenticating with an organization or user API key."),
24
+ // Every row the emailer returns carries its full bodies and attachments,
25
+ // even though the listing drops them. The cap stays below the usual 100.
26
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 50 }),
27
+ });
28
+ const output = z.object({
29
+ emails: z
30
+ .array(resource(makeEmailSummaryFields(), {
31
+ urlFieldDescription: emailUrlFieldDescription,
32
+ }))
33
+ .describe("The workspace's emails, newest first. Bodies are available via email.get."),
34
+ nextCursor: nextCursorSchema,
35
+ });
36
+ return {
37
+ description: "List the workspace's inbox, or its sent mail, newest first. Read a message body with email.get.",
38
+ input,
39
+ kind: "read",
40
+ name: "email.find",
41
+ output,
42
+ };
43
+ };
44
+ //# sourceMappingURL=find.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find.js","sourceRoot":"","sources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,OAAO;QACL,WAAW,EACT,iGAAiG;QACnG,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,YAAY;QAClB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeGetEmailContract: <WorkspaceId extends PublicIdSchema>(ids: {
4
+ workspace: WorkspaceId;
5
+ }) => {
6
+ readonly description: "Read one email of the workspace, with its plain text and HTML bodies. Use it to pull a sign-in code or a verification link out of a message.";
7
+ readonly input: z.ZodObject<{
8
+ id: z.ZodString;
9
+ workspaceId: z.ZodOptional<WorkspaceId>;
10
+ }, z.core.$strip>;
11
+ readonly kind: "read";
12
+ readonly name: "email.get";
13
+ readonly output: z.ZodObject<{
14
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ fileName: z.ZodString;
16
+ index: z.ZodNumber;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>>;
19
+ bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ address: z.ZodString;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>>;
23
+ cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ address: z.ZodString;
25
+ name: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>>>;
27
+ html: z.ZodOptional<z.ZodString>;
28
+ links: z.ZodArray<z.ZodString>;
29
+ replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ address: z.ZodString;
31
+ name: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>>;
33
+ text: z.ZodOptional<z.ZodString>;
34
+ createdAt: z.ZodISODateTime;
35
+ direction: z.ZodEnum<{
36
+ inbound: "inbound";
37
+ outbound: "outbound";
38
+ }>;
39
+ from: z.ZodObject<{
40
+ address: z.ZodString;
41
+ name: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ id: z.ZodString;
44
+ subject: z.ZodOptional<z.ZodString>;
45
+ to: z.ZodArray<z.ZodObject<{
46
+ address: z.ZodString;
47
+ name: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>;
49
+ url: z.ZodURL;
50
+ }, z.core.$strip>;
51
+ };
52
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/email/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,oBAAoB,GAAI,WAAW,SAAS,cAAc,EAAE,KAAK;IAC5E,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBA,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { makeEmailResourceSchema } from "./resource.js";
3
+ export const makeGetEmailContract = (ids) => {
4
+ const input = z.object({
5
+ id: z.string().min(1).describe("The id of the email, from email.find."),
6
+ workspaceId: ids.workspace
7
+ .optional()
8
+ .describe("The workspace the email belongs to. Required when authenticating with an organization or user API key."),
9
+ });
10
+ const output = makeEmailResourceSchema();
11
+ return {
12
+ description: "Read one email of the workspace, with its plain text and HTML bodies. Use it to pull a sign-in code or a verification link out of a message.",
13
+ input,
14
+ kind: "read",
15
+ name: "email.get",
16
+ output,
17
+ };
18
+ };
19
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/email/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAqC,GAExE,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACvE,WAAW,EAAE,GAAG,CAAC,SAAS;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,wGAAwG,CACzG;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IAEzC,OAAO;QACL,WAAW,EACT,8IAA8I;QAChJ,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeGetEmailAttachmentContract: <WorkspaceId extends PublicIdSchema>(ids: {
4
+ workspace: WorkspaceId;
5
+ }) => {
6
+ readonly description: "Read one attachment of a workspace email as base64 content, by file name or by position. email.get lists both.";
7
+ readonly input: z.ZodObject<{
8
+ fileName: z.ZodOptional<z.ZodString>;
9
+ id: z.ZodString;
10
+ index: z.ZodOptional<z.ZodNumber>;
11
+ workspaceId: z.ZodOptional<WorkspaceId>;
12
+ }, z.core.$strip>;
13
+ readonly kind: "read";
14
+ readonly name: "email.getAttachment";
15
+ readonly output: z.ZodObject<{
16
+ contentBase64: z.ZodString;
17
+ fileName: z.ZodString;
18
+ index: z.ZodNumber;
19
+ type: z.ZodOptional<z.ZodString>;
20
+ url: z.ZodURL;
21
+ }, z.core.$strip>;
22
+ };
23
+ //# sourceMappingURL=getAttachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAttachment.d.ts","sourceRoot":"","sources":["../../../src/v1/email/getAttachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,8BAA8B,GACzC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;CA4DA,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import { resource } from "../resource.js";
3
+ import { emailUrlFieldDescription } from "./resource.js";
4
+ export const makeGetEmailAttachmentContract = (ids) => {
5
+ const input = z
6
+ .object({
7
+ fileName: z
8
+ .string()
9
+ .min(1)
10
+ .optional()
11
+ .describe("The attachment's file name, as email.get lists it. The first attachment with that name is returned."),
12
+ id: z.string().min(1).describe("The id of the email, from email.find."),
13
+ index: z
14
+ .number()
15
+ .int()
16
+ .min(0)
17
+ .optional()
18
+ .describe("The attachment's position in the email, from 0, as email.get lists it. Use it when file names repeat."),
19
+ workspaceId: ids.workspace
20
+ .optional()
21
+ .describe("The workspace the email belongs to. Required when authenticating with an organization or user API key."),
22
+ })
23
+ .refine((input) => (input.fileName === undefined) !== (input.index === undefined), { message: "Provide fileName or index, not both." });
24
+ const output = resource({
25
+ // Not `z.base64()`: every response is parsed with this schema, on the
26
+ // server and in each client, and the content comes from the emailer's
27
+ // own encoder, so a scan of the whole file buys nothing. The same
28
+ // choice as runner/takeScreenshot.ts.
29
+ contentBase64: z.string().describe("The file content, base64 encoded."),
30
+ fileName: z.string(),
31
+ index: z
32
+ .number()
33
+ .int()
34
+ .min(0)
35
+ .describe("The position of the attachment in the email, from 0."),
36
+ type: z.string().optional().describe("The MIME type."),
37
+ }, { urlFieldDescription: emailUrlFieldDescription });
38
+ return {
39
+ description: "Read one attachment of a workspace email as base64 content, by file name or by position. email.get lists both.",
40
+ input,
41
+ kind: "read",
42
+ name: "email.getAttachment",
43
+ output,
44
+ };
45
+ };
46
+ //# sourceMappingURL=getAttachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAttachment.js","sourceRoot":"","sources":["../../../src/v1/email/getAttachment.ts"],"names":[],"mappings":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sD,CAAC;QACnE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KACvD,EACD,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,CAClD,CAAC;IAEF,OAAO;QACL,WAAW,EACT,gHAAgH;QAClH,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeListEmailAddressesContract: <WorkspaceId extends PublicIdSchema>(ids: {
4
+ workspace: WorkspaceId;
5
+ }) => {
6
+ readonly description: "List the workspace's inbox addresses, alphabetical. A flow can sign up with a plus-suffixed form of any of them, and email.find reads what arrives.";
7
+ readonly input: z.ZodObject<{
8
+ cursor: z.ZodOptional<z.ZodString>;
9
+ limit: z.ZodDefault<z.ZodNumber>;
10
+ workspaceId: z.ZodOptional<WorkspaceId>;
11
+ }, z.core.$strip>;
12
+ readonly kind: "read";
13
+ readonly name: "email.listAddresses";
14
+ readonly output: z.ZodObject<{
15
+ addresses: z.ZodArray<z.ZodObject<{
16
+ address: z.ZodString;
17
+ isDefault: z.ZodBoolean;
18
+ url: z.ZodURL;
19
+ }, z.core.$strip>>;
20
+ nextCursor: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ };
23
+ //# sourceMappingURL=listAddresses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listAddresses.d.ts","sourceRoot":"","sources":["../../../src/v1/email/listAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,8BAA8B,GACzC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;CA6CA,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
3
+ import { resource } from "../resource.js";
4
+ import { emailUrlFieldDescription } from "./resource.js";
5
+ export const makeListEmailAddressesContract = (ids) => {
6
+ const input = z.object({
7
+ workspaceId: ids.workspace
8
+ .optional()
9
+ .describe("The workspace whose inbox addresses to list. Required when authenticating with an organization or user API key."),
10
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 50 }),
11
+ });
12
+ const output = z.object({
13
+ addresses: z
14
+ .array(resource({
15
+ address: z
16
+ .string()
17
+ .describe("The inbox address. Mail sent to any plus-suffixed form, such as inbox+abc@example.com, lands in the same inbox."),
18
+ isDefault: z
19
+ .boolean()
20
+ .describe("Whether this is the workspace's default inbox address."),
21
+ }, { urlFieldDescription: emailUrlFieldDescription }))
22
+ .describe("The workspace's permanent inbox addresses, alphabetical."),
23
+ nextCursor: nextCursorSchema,
24
+ });
25
+ return {
26
+ description: "List the workspace's inbox addresses, alphabetical. A flow can sign up with a plus-suffixed form of any of them, and email.find reads what arrives.",
27
+ input,
28
+ kind: "read",
29
+ name: "email.listAddresses",
30
+ output,
31
+ };
32
+ };
33
+ //# sourceMappingURL=listAddresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listAddresses.js","sourceRoot":"","sources":["../../../src/v1/email/listAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAE5C,GAED,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,GAAG,CAAC,SAAS;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,iHAAiH,CAClH;QACH,GAAG,yBAAyB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;KACjE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE,CAAC;aACT,KAAK,CACJ,QAAQ,CACN;YACE,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CACP,iHAAiH,CAClH;YACH,SAAS,EAAE,CAAC;iBACT,OAAO,EAAE;iBACT,QAAQ,CACP,wDAAwD,CACzD;SACJ,EACD,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,CAClD,CACF;aACA,QAAQ,CAAC,0DAA0D,CAAC;QACvE,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,qJAAqJ;QACvJ,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ export declare const emailDirectionSchema: z.ZodEnum<{
3
+ inbound: "inbound";
4
+ outbound: "outbound";
5
+ }>;
6
+ export type EmailDirection = z.infer<typeof emailDirectionSchema>;
7
+ export declare const namedAddressSchema: z.ZodObject<{
8
+ address: z.ZodString;
9
+ name: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export declare const emailUrlFieldDescription = "Absolute URL of the workspace. The inbox opens from the app header.";
12
+ export declare const makeEmailSummaryFields: () => {
13
+ createdAt: z.ZodISODateTime;
14
+ direction: z.ZodEnum<{
15
+ inbound: "inbound";
16
+ outbound: "outbound";
17
+ }>;
18
+ from: z.ZodObject<{
19
+ address: z.ZodString;
20
+ name: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ id: z.ZodString;
23
+ subject: z.ZodOptional<z.ZodString>;
24
+ to: z.ZodArray<z.ZodObject<{
25
+ address: z.ZodString;
26
+ name: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>;
28
+ };
29
+ export declare const makeEmailResourceSchema: () => z.ZodObject<{
30
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ fileName: z.ZodString;
32
+ index: z.ZodNumber;
33
+ type: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>>;
35
+ bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
36
+ address: z.ZodString;
37
+ name: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>>>;
39
+ cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ address: z.ZodString;
41
+ name: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>>>;
43
+ html: z.ZodOptional<z.ZodString>;
44
+ links: z.ZodArray<z.ZodString>;
45
+ replyTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ address: z.ZodString;
47
+ name: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>>;
49
+ text: z.ZodOptional<z.ZodString>;
50
+ createdAt: z.ZodISODateTime;
51
+ direction: z.ZodEnum<{
52
+ inbound: "inbound";
53
+ outbound: "outbound";
54
+ }>;
55
+ from: z.ZodObject<{
56
+ address: z.ZodString;
57
+ name: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ id: z.ZodString;
60
+ subject: z.ZodOptional<z.ZodString>;
61
+ to: z.ZodArray<z.ZodObject<{
62
+ address: z.ZodString;
63
+ name: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>>;
65
+ url: z.ZodURL;
66
+ }, z.core.$strip>;
67
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/v1/email/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;EAAkC,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAIlE,eAAO,MAAM,kBAAkB;;;iBAM7B,CAAC;AAIH,eAAO,MAAM,wBAAwB,wEACkC,CAAC;AAIxE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;CAgBjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCjC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { resource } from "../resource.js";
3
+ export const emailDirectionSchema = z.enum(["inbound", "outbound"]);
4
+ // Output addresses are loose strings, not `z.email()`. Inbound mail arrives
5
+ // from the wild, and one odd sender address must not fail a whole page.
6
+ export const namedAddressSchema = z.object({
7
+ address: z.string().describe("The email address."),
8
+ name: z
9
+ .string()
10
+ .optional()
11
+ .describe("The display name, when the message carried one."),
12
+ });
13
+ // Every email resource shares the workspace URL: the inbox is a drawer in the
14
+ // app header, and there is no per-email page.
15
+ export const emailUrlFieldDescription = "Absolute URL of the workspace. The inbox opens from the app header.";
16
+ // email.find returns these fields as rows. email.get adds the bodies to them.
17
+ // Both shapes come from this one factory, so the shapes cannot drift.
18
+ export const makeEmailSummaryFields = () => ({
19
+ // `offset: true` keeps the output valid for any ISO 8601 form the emailer
20
+ // may serialize, so one timestamp format cannot fail a page.
21
+ createdAt: z.iso
22
+ .datetime({ offset: true })
23
+ .describe("When QA Wolf received or sent the email."),
24
+ direction: emailDirectionSchema.describe("inbound for mail the workspace received, outbound for mail it sent."),
25
+ from: namedAddressSchema,
26
+ id: z
27
+ .string()
28
+ .min(1)
29
+ .describe("The id of the email. Pass it to email.get to read the body."),
30
+ subject: z.string().optional(),
31
+ to: z.array(namedAddressSchema),
32
+ });
33
+ export const makeEmailResourceSchema = () => resource({
34
+ ...makeEmailSummaryFields(),
35
+ attachments: z
36
+ .array(z.object({
37
+ fileName: z.string(),
38
+ index: z
39
+ .number()
40
+ .int()
41
+ .min(0)
42
+ .describe("The position of the attachment in the email, from 0. Pass it to email.getAttachment when file names repeat."),
43
+ type: z.string().optional().describe("The MIME type."),
44
+ }))
45
+ .optional()
46
+ .describe("Attachment names, positions, and types. Read the content with email.getAttachment."),
47
+ bcc: z.array(namedAddressSchema).optional(),
48
+ cc: z.array(namedAddressSchema).optional(),
49
+ html: z.string().optional().describe("The HTML body."),
50
+ links: z
51
+ .array(z.string())
52
+ .describe("The links of the email, in order: HTML anchors, then images, then bare URLs of the plain text body. Follow one to confirm a sign-up or reset a password."),
53
+ replyTo: z.array(namedAddressSchema).optional(),
54
+ text: z.string().optional().describe("The plain text body."),
55
+ }, { urlFieldDescription: emailUrlFieldDescription });
56
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/v1/email/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAIpE,4EAA4E;AAC5E,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAClD,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;CAC/D,CAAC,CAAC;AAEH,8EAA8E;AAC9E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GACnC,qEAAqE,CAAC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AAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACtD,KAAK,EAAE,CAAC;SACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CACP,0JAA0J,CAC3J;IACH,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CAC7D,EACD,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,CAClD,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ /**
4
+ * The most base64 content the attachments of one email may carry together.
5
+ * SendGrid refuses a message over 30 MB, and base64 is the form on the wire.
6
+ */
7
+ export declare const maxEmailAttachmentsBase64Length: number;
8
+ export declare const makeSendEmailContract: <WorkspaceId extends PublicIdSchema>(ids: {
9
+ workspace: WorkspaceId;
10
+ }) => {
11
+ readonly description: "Send an email from one of the workspace's inbox addresses, for example to exercise a flow that reacts to incoming mail. Returns the sent email; read it back with email.get.";
12
+ readonly input: z.ZodObject<{
13
+ attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBase64>>;
14
+ bcc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
15
+ cc: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
16
+ from: z.ZodOptional<z.ZodEmail>;
17
+ html: z.ZodOptional<z.ZodString>;
18
+ inReplyTo: z.ZodOptional<z.ZodString>;
19
+ replyTo: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
20
+ subject: z.ZodString;
21
+ text: z.ZodOptional<z.ZodString>;
22
+ to: z.ZodArray<z.ZodEmail>;
23
+ workspaceId: z.ZodOptional<WorkspaceId>;
24
+ }, z.core.$strip>;
25
+ readonly kind: "write";
26
+ readonly name: "email.send";
27
+ readonly output: z.ZodObject<{
28
+ createdAt: z.ZodISODateTime;
29
+ direction: z.ZodEnum<{
30
+ inbound: "inbound";
31
+ outbound: "outbound";
32
+ }>;
33
+ from: z.ZodObject<{
34
+ address: z.ZodString;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ id: z.ZodString;
38
+ subject: z.ZodOptional<z.ZodString>;
39
+ to: z.ZodArray<z.ZodObject<{
40
+ address: z.ZodString;
41
+ name: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>>;
43
+ url: z.ZodURL;
44
+ }, z.core.$strip>;
45
+ };
46
+ //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/v1/email/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAYhD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,QAAmB,CAAC;AAQhE,eAAO,MAAM,qBAAqB,GAAI,WAAW,SAAS,cAAc,EAAE,KAAK;IAC7E,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEA,CAAC"}