@keystrokehq/typeform 0.0.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.
Files changed (46) hide show
  1. package/README.md +159 -0
  2. package/dist/_official/index.d.mts +3 -0
  3. package/dist/_official/index.mjs +3 -0
  4. package/dist/_runtime/index.d.mts +1 -0
  5. package/dist/_runtime/index.mjs +1 -0
  6. package/dist/accounts.d.mts +17 -0
  7. package/dist/accounts.mjs +20 -0
  8. package/dist/client.d.mts +104 -0
  9. package/dist/client.mjs +308 -0
  10. package/dist/connection.d.mts +2 -0
  11. package/dist/connection.mjs +3 -0
  12. package/dist/events.d.mts +160 -0
  13. package/dist/events.mjs +38 -0
  14. package/dist/factory-B_dyn39A.mjs +8 -0
  15. package/dist/forms.d.mts +390 -0
  16. package/dist/forms.mjs +147 -0
  17. package/dist/images.d.mts +112 -0
  18. package/dist/images.mjs +104 -0
  19. package/dist/index.d.mts +1 -0
  20. package/dist/index.mjs +1 -0
  21. package/dist/insights.d.mts +26 -0
  22. package/dist/insights.mjs +37 -0
  23. package/dist/integration-BCzgn7Dm.mjs +76 -0
  24. package/dist/integration-d_VqlGvZ.d.mts +38 -0
  25. package/dist/messaging.d.mts +1 -0
  26. package/dist/messaging.mjs +1 -0
  27. package/dist/provider-app-BnLMYj3B.d.mts +35 -0
  28. package/dist/responses.d.mts +118 -0
  29. package/dist/responses.mjs +107 -0
  30. package/dist/schemas/index.d.mts +564 -0
  31. package/dist/schemas/index.mjs +3 -0
  32. package/dist/shared-D0ONnQL8.mjs +49 -0
  33. package/dist/themes.d.mts +225 -0
  34. package/dist/themes.mjs +132 -0
  35. package/dist/triggers.d.mts +21 -0
  36. package/dist/triggers.mjs +45 -0
  37. package/dist/verification.d.mts +19 -0
  38. package/dist/verification.mjs +33 -0
  39. package/dist/videos.d.mts +20 -0
  40. package/dist/videos.mjs +29 -0
  41. package/dist/webhooks.d.mts +73 -0
  42. package/dist/webhooks.mjs +79 -0
  43. package/dist/workspace-C1CCnvgv.mjs +271 -0
  44. package/dist/workspaces.d.mts +145 -0
  45. package/dist/workspaces.mjs +119 -0
  46. package/package.json +131 -0
@@ -0,0 +1,118 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/responses.d.ts
6
+ declare const getFormResponses: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ formId: z.ZodString;
8
+ pageSize: z.ZodOptional<z.ZodNumber>;
9
+ since: z.ZodOptional<z.ZodString>;
10
+ until: z.ZodOptional<z.ZodString>;
11
+ after: z.ZodOptional<z.ZodString>;
12
+ before: z.ZodOptional<z.ZodString>;
13
+ includedResponseIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ completed: z.ZodOptional<z.ZodBoolean>;
15
+ sort: z.ZodOptional<z.ZodEnum<{
16
+ "submitted_at,asc": "submitted_at,asc";
17
+ "submitted_at,desc": "submitted_at,desc";
18
+ }>>;
19
+ query: z.ZodOptional<z.ZodString>;
20
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ items: z.ZodArray<z.ZodObject<{
23
+ response_id: z.ZodOptional<z.ZodString>;
24
+ token: z.ZodOptional<z.ZodString>;
25
+ landed_at: z.ZodOptional<z.ZodString>;
26
+ submitted_at: z.ZodOptional<z.ZodString>;
27
+ metadata: z.ZodOptional<z.ZodObject<{
28
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
29
+ }, z.core.$catchall<z.ZodUnknown>>>;
30
+ hidden: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
31
+ calculated: z.ZodOptional<z.ZodObject<{
32
+ score: z.ZodOptional<z.ZodNumber>;
33
+ }, z.core.$catchall<z.ZodUnknown>>>;
34
+ variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ key: z.ZodString;
36
+ type: z.ZodOptional<z.ZodString>;
37
+ number: z.ZodOptional<z.ZodNumber>;
38
+ text: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$catchall<z.ZodUnknown>>>>;
40
+ answers: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ field: z.ZodObject<{
42
+ id: z.ZodString;
43
+ ref: z.ZodOptional<z.ZodString>;
44
+ type: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$catchall<z.ZodUnknown>>;
46
+ type: z.ZodOptional<z.ZodString>;
47
+ text: z.ZodOptional<z.ZodString>;
48
+ email: z.ZodOptional<z.ZodString>;
49
+ url: z.ZodOptional<z.ZodString>;
50
+ phone_number: z.ZodOptional<z.ZodString>;
51
+ number: z.ZodOptional<z.ZodNumber>;
52
+ boolean: z.ZodOptional<z.ZodBoolean>;
53
+ date: z.ZodOptional<z.ZodString>;
54
+ choice: z.ZodOptional<z.ZodObject<{
55
+ label: z.ZodOptional<z.ZodString>;
56
+ other: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$catchall<z.ZodUnknown>>>;
58
+ choices: z.ZodOptional<z.ZodObject<{
59
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ other: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$catchall<z.ZodUnknown>>>;
62
+ file_url: z.ZodOptional<z.ZodString>;
63
+ payment: z.ZodOptional<z.ZodObject<{
64
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
65
+ }, z.core.$catchall<z.ZodUnknown>>>;
66
+ }, z.core.$catchall<z.ZodUnknown>>>>;
67
+ definition: z.ZodOptional<z.ZodObject<{
68
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
69
+ }, z.core.$catchall<z.ZodUnknown>>>;
70
+ ending: z.ZodOptional<z.ZodObject<{
71
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
72
+ }, z.core.$catchall<z.ZodUnknown>>>;
73
+ }, z.core.$catchall<z.ZodUnknown>>>;
74
+ totalItems: z.ZodOptional<z.ZodNumber>;
75
+ pageCount: z.ZodOptional<z.ZodNumber>;
76
+ pagination: z.ZodOptional<z.ZodObject<{
77
+ pageSize: z.ZodOptional<z.ZodNumber>;
78
+ totalItems: z.ZodOptional<z.ZodNumber>;
79
+ pageCount: z.ZodOptional<z.ZodNumber>;
80
+ before: z.ZodOptional<z.ZodString>;
81
+ after: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
84
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
85
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
86
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
87
+ }, z.core.$strip>>[] | undefined>], undefined>;
88
+ declare const deleteResponses: _keystrokehq_core0.Operation<z.ZodObject<{
89
+ formId: z.ZodString;
90
+ includedTokens: z.ZodArray<z.ZodString>;
91
+ confirm: z.ZodLiteral<true>;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ success: z.ZodBoolean;
94
+ deleted: z.ZodNumber;
95
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
96
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
97
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
98
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
99
+ }, z.core.$strip>>[] | undefined>], undefined>;
100
+ declare const getAllResponseFiles: _keystrokehq_core0.Operation<z.ZodObject<{
101
+ formId: z.ZodString;
102
+ responseId: z.ZodString;
103
+ fieldId: z.ZodString;
104
+ filename: z.ZodString;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ formId: z.ZodString;
107
+ responseId: z.ZodString;
108
+ fieldId: z.ZodString;
109
+ filename: z.ZodString;
110
+ downloadUrl: z.ZodString;
111
+ note: z.ZodString;
112
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
113
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
114
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
115
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
116
+ }, z.core.$strip>>[] | undefined>], undefined>;
117
+ //#endregion
118
+ export { deleteResponses, getAllResponseFiles, getFormResponses };
@@ -0,0 +1,107 @@
1
+ import { i as mapCursorPagination, o as omitUndefined, r as asRecord } from "./shared-D0ONnQL8.mjs";
2
+ import { createTypeformClient } from "./client.mjs";
3
+ import { h as typeformResponseSchema, k as typeformIdentifierSchema, m as typeformResponseListSchema } from "./workspace-C1CCnvgv.mjs";
4
+ import { t as typeformOperation } from "./factory-B_dyn39A.mjs";
5
+ import { z } from "zod";
6
+
7
+ //#region src/responses.ts
8
+ const listResponsesInputSchema = z.object({
9
+ formId: typeformIdentifierSchema,
10
+ pageSize: z.number().int().positive().max(1e3).optional(),
11
+ since: z.string().trim().min(1).optional(),
12
+ until: z.string().trim().min(1).optional(),
13
+ after: z.string().trim().min(1).optional(),
14
+ before: z.string().trim().min(1).optional(),
15
+ includedResponseIds: z.array(z.string().trim().min(1)).optional(),
16
+ completed: z.boolean().optional(),
17
+ sort: z.enum(["submitted_at,asc", "submitted_at,desc"]).optional(),
18
+ query: z.string().trim().min(1).optional(),
19
+ fields: z.array(z.string().trim().min(1)).optional()
20
+ });
21
+ const deleteResponsesInputSchema = z.object({
22
+ formId: typeformIdentifierSchema,
23
+ includedTokens: z.array(z.string().trim().min(1)).min(1),
24
+ confirm: z.literal(true)
25
+ });
26
+ const getAllResponseFilesInputSchema = z.object({
27
+ formId: typeformIdentifierSchema,
28
+ responseId: z.string().trim().min(1),
29
+ fieldId: z.string().trim().min(1),
30
+ filename: z.string().trim().min(1)
31
+ });
32
+ const responseFileOutputSchema = z.object({
33
+ formId: typeformIdentifierSchema,
34
+ responseId: z.string().trim().min(1),
35
+ fieldId: z.string().trim().min(1),
36
+ filename: z.string().trim().min(1),
37
+ downloadUrl: z.string(),
38
+ note: z.string()
39
+ });
40
+ const getFormResponses = typeformOperation({
41
+ id: "get_form_responses",
42
+ name: "List Form Responses",
43
+ description: "List responses for a Typeform form using cursor pagination.",
44
+ input: listResponsesInputSchema,
45
+ output: typeformResponseListSchema,
46
+ run: async (input, credentials) => {
47
+ const record = asRecord(await createTypeformClient(credentials).responses.list(input.formId, omitUndefined({
48
+ page_size: input.pageSize,
49
+ since: input.since,
50
+ until: input.until,
51
+ after: input.after,
52
+ before: input.before,
53
+ completed: input.completed,
54
+ sort: input.sort,
55
+ query: input.query,
56
+ fields: input.fields,
57
+ included_response_ids: input.includedResponseIds
58
+ })));
59
+ const items = Array.isArray(record.items) ? record.items : [];
60
+ return typeformResponseListSchema.parse({
61
+ items: items.map((item) => typeformResponseSchema.parse(item)),
62
+ totalItems: typeof record.total_items === "number" ? record.total_items : void 0,
63
+ pageCount: typeof record.page_count === "number" ? record.page_count : void 0,
64
+ pagination: mapCursorPagination(record, items)
65
+ });
66
+ }
67
+ });
68
+ const deleteResponses = typeformOperation({
69
+ id: "delete_responses",
70
+ name: "Delete Responses",
71
+ description: "Delete form responses by token. Deletion is irreversible.",
72
+ input: deleteResponsesInputSchema,
73
+ output: z.object({
74
+ success: z.boolean(),
75
+ deleted: z.number().int().nonnegative()
76
+ }),
77
+ needsApproval: true,
78
+ run: async (input, credentials) => {
79
+ await createTypeformClient(credentials).responses.delete(input.formId, input.includedTokens);
80
+ return {
81
+ success: true,
82
+ deleted: input.includedTokens.length
83
+ };
84
+ }
85
+ });
86
+ const getAllResponseFiles = typeformOperation({
87
+ id: "get_all_response_files",
88
+ name: "Get Response File Download URL",
89
+ description: "Resolve the signed download URL for a file-upload answer in a Typeform response. Signed URLs expire quickly; fetch the content immediately.",
90
+ input: getAllResponseFilesInputSchema,
91
+ output: responseFileOutputSchema,
92
+ run: async (input, credentials) => {
93
+ createTypeformClient(credentials);
94
+ const path = `/forms/${encodeURIComponent(input.formId)}/responses/${encodeURIComponent(input.responseId)}/fields/${encodeURIComponent(input.fieldId)}/files/${encodeURIComponent(input.filename)}`;
95
+ return {
96
+ formId: input.formId,
97
+ responseId: input.responseId,
98
+ fieldId: input.fieldId,
99
+ filename: input.filename,
100
+ downloadUrl: `https://api.typeform.com${path}`,
101
+ note: "Typeform response-file endpoints redirect to signed S3 URLs. Follow redirects with credentials stripped when crossing hosts."
102
+ };
103
+ }
104
+ });
105
+
106
+ //#endregion
107
+ export { deleteResponses, getAllResponseFiles, getFormResponses };