@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
package/dist/forms.mjs ADDED
@@ -0,0 +1,147 @@
1
+ import { a as mapPagePagination, o as omitUndefined, r as asRecord } from "./shared-D0ONnQL8.mjs";
2
+ import { createTypeformClient } from "./client.mjs";
3
+ import { C as typeformFormSchema, N as typeformLooseObjectSchema, S as typeformFormRefSchema, k as typeformIdentifierSchema, x as typeformFormListSchema } from "./workspace-C1CCnvgv.mjs";
4
+ import { t as typeformOperation } from "./factory-B_dyn39A.mjs";
5
+ import { z } from "zod";
6
+
7
+ //#region src/forms.ts
8
+ const listFormsInputSchema = z.object({
9
+ page: z.number().int().positive().optional(),
10
+ pageSize: z.number().int().positive().max(200).optional(),
11
+ search: z.string().trim().min(1).optional(),
12
+ workspaceId: z.string().trim().min(1).optional()
13
+ });
14
+ const getFormInputSchema = z.object({ formId: typeformIdentifierSchema });
15
+ const createFormInputSchema = z.object({
16
+ title: z.string().trim().min(1),
17
+ workspaceHref: z.string().trim().min(1).optional(),
18
+ themeHref: z.string().trim().min(1).optional(),
19
+ language: z.string().trim().min(1).optional(),
20
+ settings: typeformLooseObjectSchema().optional(),
21
+ welcomeScreens: z.array(typeformLooseObjectSchema()).optional(),
22
+ thankyouScreens: z.array(typeformLooseObjectSchema()).optional(),
23
+ fields: z.array(typeformLooseObjectSchema()).optional(),
24
+ hidden: z.array(z.string()).optional(),
25
+ variables: typeformLooseObjectSchema().optional(),
26
+ logic: z.array(typeformLooseObjectSchema()).optional()
27
+ });
28
+ const updateFormInputSchema = createFormInputSchema.extend({ formId: typeformIdentifierSchema });
29
+ const patchFormInputSchema = z.object({
30
+ formId: typeformIdentifierSchema,
31
+ operations: z.array(z.object({
32
+ op: z.enum([
33
+ "add",
34
+ "replace",
35
+ "remove",
36
+ "copy",
37
+ "move",
38
+ "test"
39
+ ]),
40
+ path: z.string().trim().min(1),
41
+ value: z.unknown().optional(),
42
+ from: z.string().trim().min(1).optional()
43
+ })).min(1)
44
+ });
45
+ const deleteFormInputSchema = z.object({ formId: typeformIdentifierSchema });
46
+ function buildFormBody(input) {
47
+ return omitUndefined({
48
+ title: input.title,
49
+ workspace: input.workspaceHref ? { href: input.workspaceHref } : void 0,
50
+ theme: input.themeHref ? { href: input.themeHref } : void 0,
51
+ language: input.language,
52
+ settings: input.settings,
53
+ welcome_screens: input.welcomeScreens,
54
+ thankyou_screens: input.thankyouScreens,
55
+ fields: input.fields,
56
+ hidden: input.hidden,
57
+ variables: input.variables,
58
+ logic: input.logic
59
+ });
60
+ }
61
+ function mapFormList(raw) {
62
+ const record = asRecord(raw);
63
+ const items = Array.isArray(record.items) ? record.items : [];
64
+ return typeformFormListSchema.parse({
65
+ items: items.map((item) => typeformFormRefSchema.parse(item)),
66
+ pagination: mapPagePagination(record)
67
+ });
68
+ }
69
+ const listForms = typeformOperation({
70
+ id: "list_forms",
71
+ name: "List Forms",
72
+ description: "List Typeform forms visible to the connected account.",
73
+ input: listFormsInputSchema,
74
+ output: typeformFormListSchema,
75
+ run: async (input, credentials) => {
76
+ return mapFormList(await createTypeformClient(credentials).forms.list(omitUndefined({
77
+ page: input.page,
78
+ page_size: input.pageSize,
79
+ search: input.search,
80
+ workspace_id: input.workspaceId
81
+ })));
82
+ }
83
+ });
84
+ const getForm = typeformOperation({
85
+ id: "get_form",
86
+ name: "Get Form",
87
+ description: "Fetch a single Typeform form by id.",
88
+ input: getFormInputSchema,
89
+ output: typeformFormSchema,
90
+ run: async (input, credentials) => {
91
+ const response = await createTypeformClient(credentials).forms.get(input.formId);
92
+ return typeformFormSchema.parse(response);
93
+ }
94
+ });
95
+ const createForm = typeformOperation({
96
+ id: "create_form",
97
+ name: "Create Form",
98
+ description: "Create a new Typeform form in the connected account.",
99
+ input: createFormInputSchema,
100
+ output: typeformFormSchema,
101
+ needsApproval: true,
102
+ run: async (input, credentials) => {
103
+ const response = await createTypeformClient(credentials).forms.create(buildFormBody(input));
104
+ return typeformFormSchema.parse(response);
105
+ }
106
+ });
107
+ const updateForm = typeformOperation({
108
+ id: "update_form",
109
+ name: "Update Form",
110
+ description: "Replace a Typeform form by id (full PUT).",
111
+ input: updateFormInputSchema,
112
+ output: typeformFormSchema,
113
+ needsApproval: true,
114
+ run: async (input, credentials) => {
115
+ const client = createTypeformClient(credentials);
116
+ const { formId, ...rest } = input;
117
+ const response = await client.forms.update(formId, buildFormBody(rest));
118
+ return typeformFormSchema.parse(response);
119
+ }
120
+ });
121
+ const patchForm = typeformOperation({
122
+ id: "patch_form",
123
+ name: "Patch Form",
124
+ description: "Apply a JSON Patch (RFC 6902) operation set to a Typeform form.",
125
+ input: patchFormInputSchema,
126
+ output: typeformFormSchema,
127
+ needsApproval: true,
128
+ run: async (input, credentials) => {
129
+ const response = await createTypeformClient(credentials).forms.patch(input.formId, input.operations);
130
+ return typeformFormSchema.parse(response);
131
+ }
132
+ });
133
+ const deleteForm = typeformOperation({
134
+ id: "delete_form",
135
+ name: "Delete Form",
136
+ description: "Delete a Typeform form by id. Deletion is irreversible.",
137
+ input: deleteFormInputSchema,
138
+ output: z.object({ success: z.boolean() }),
139
+ needsApproval: true,
140
+ run: async (input, credentials) => {
141
+ await createTypeformClient(credentials).forms.delete(input.formId);
142
+ return { success: true };
143
+ }
144
+ });
145
+
146
+ //#endregion
147
+ export { createForm, deleteForm, getForm, listForms, patchForm, updateForm };
@@ -0,0 +1,112 @@
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/images.d.ts
6
+ declare const listImages: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
7
+ items: z.ZodArray<z.ZodObject<{
8
+ id: z.ZodString;
9
+ file_name: z.ZodOptional<z.ZodString>;
10
+ url: z.ZodOptional<z.ZodString>;
11
+ width: z.ZodOptional<z.ZodNumber>;
12
+ height: z.ZodOptional<z.ZodNumber>;
13
+ media_type: z.ZodOptional<z.ZodString>;
14
+ has_alpha: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$catchall<z.ZodUnknown>>>;
16
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
17
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
18
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
19
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
20
+ }, z.core.$strip>>[] | undefined>], undefined>;
21
+ declare const createImage: _keystrokehq_core0.Operation<z.ZodObject<{
22
+ fileName: z.ZodString;
23
+ image: z.ZodOptional<z.ZodString>;
24
+ url: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ id: z.ZodString;
27
+ file_name: z.ZodOptional<z.ZodString>;
28
+ url: z.ZodOptional<z.ZodString>;
29
+ width: z.ZodOptional<z.ZodNumber>;
30
+ height: z.ZodOptional<z.ZodNumber>;
31
+ media_type: z.ZodOptional<z.ZodString>;
32
+ has_alpha: z.ZodOptional<z.ZodBoolean>;
33
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
34
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
35
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
36
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
37
+ }, z.core.$strip>>[] | undefined>], undefined>;
38
+ declare const getImageBySize: _keystrokehq_core0.Operation<z.ZodObject<{
39
+ imageId: z.ZodString;
40
+ size: z.ZodEnum<{
41
+ default: "default";
42
+ thumbnail: "thumbnail";
43
+ mobile: "mobile";
44
+ }>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ id: z.ZodString;
47
+ file_name: z.ZodOptional<z.ZodString>;
48
+ url: z.ZodOptional<z.ZodString>;
49
+ width: z.ZodOptional<z.ZodNumber>;
50
+ height: z.ZodOptional<z.ZodNumber>;
51
+ media_type: z.ZodOptional<z.ZodString>;
52
+ has_alpha: z.ZodOptional<z.ZodBoolean>;
53
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
54
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
55
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
56
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
57
+ }, z.core.$strip>>[] | undefined>], undefined>;
58
+ declare const getBackgroundBySize: _keystrokehq_core0.Operation<z.ZodObject<{
59
+ imageId: z.ZodString;
60
+ size: z.ZodEnum<{
61
+ default: "default";
62
+ thumbnail: "thumbnail";
63
+ mobile: "mobile";
64
+ tablet: "tablet";
65
+ }>;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ id: z.ZodString;
68
+ file_name: z.ZodOptional<z.ZodString>;
69
+ url: z.ZodOptional<z.ZodString>;
70
+ width: z.ZodOptional<z.ZodNumber>;
71
+ height: z.ZodOptional<z.ZodNumber>;
72
+ media_type: z.ZodOptional<z.ZodString>;
73
+ has_alpha: z.ZodOptional<z.ZodBoolean>;
74
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
75
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
76
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
77
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
78
+ }, z.core.$strip>>[] | undefined>], undefined>;
79
+ declare const getChoiceImageBySize: _keystrokehq_core0.Operation<z.ZodObject<{
80
+ imageId: z.ZodString;
81
+ size: z.ZodEnum<{
82
+ default: "default";
83
+ thumbnail: "thumbnail";
84
+ supersize: "supersize";
85
+ supermobile: "supermobile";
86
+ supersizefit: "supersizefit";
87
+ supermobilefit: "supermobilefit";
88
+ }>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ id: z.ZodString;
91
+ file_name: z.ZodOptional<z.ZodString>;
92
+ url: z.ZodOptional<z.ZodString>;
93
+ width: z.ZodOptional<z.ZodNumber>;
94
+ height: z.ZodOptional<z.ZodNumber>;
95
+ media_type: z.ZodOptional<z.ZodString>;
96
+ has_alpha: z.ZodOptional<z.ZodBoolean>;
97
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
98
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
99
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
100
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
101
+ }, z.core.$strip>>[] | undefined>], undefined>;
102
+ declare const deleteImage: _keystrokehq_core0.Operation<z.ZodObject<{
103
+ imageId: z.ZodString;
104
+ }, z.core.$strip>, z.ZodObject<{
105
+ success: z.ZodBoolean;
106
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
107
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
108
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
109
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
110
+ }, z.core.$strip>>[] | undefined>], undefined>;
111
+ //#endregion
112
+ export { createImage, deleteImage, getBackgroundBySize, getChoiceImageBySize, getImageBySize, listImages };
@@ -0,0 +1,104 @@
1
+ import { o as omitUndefined, r as asRecord } from "./shared-D0ONnQL8.mjs";
2
+ import { createTypeformClient } from "./client.mjs";
3
+ import { A as typeformImageBackgroundSizeSchema, M as typeformImageSizeSchema, j as typeformImageChoiceSizeSchema, k as typeformIdentifierSchema, v as typeformImageListSchema, y as typeformImageSchema } from "./workspace-C1CCnvgv.mjs";
4
+ import { t as typeformOperation } from "./factory-B_dyn39A.mjs";
5
+ import { z } from "zod";
6
+
7
+ //#region src/images.ts
8
+ const listImagesInputSchema = z.object({});
9
+ const createImageInputSchema = z.object({
10
+ fileName: z.string().trim().min(1),
11
+ image: z.string().trim().min(1).optional(),
12
+ url: z.string().trim().min(1).optional()
13
+ });
14
+ const getImageBySizeInputSchema = z.object({
15
+ imageId: typeformIdentifierSchema,
16
+ size: typeformImageSizeSchema
17
+ });
18
+ const getBackgroundBySizeInputSchema = z.object({
19
+ imageId: typeformIdentifierSchema,
20
+ size: typeformImageBackgroundSizeSchema
21
+ });
22
+ const getChoiceImageBySizeInputSchema = z.object({
23
+ imageId: typeformIdentifierSchema,
24
+ size: typeformImageChoiceSizeSchema
25
+ });
26
+ const deleteImageInputSchema = z.object({ imageId: typeformIdentifierSchema });
27
+ const listImages = typeformOperation({
28
+ id: "list_images",
29
+ name: "List Images",
30
+ description: "List image assets in the connected Typeform account.",
31
+ input: listImagesInputSchema,
32
+ output: typeformImageListSchema,
33
+ run: async (_input, credentials) => {
34
+ const response = await createTypeformClient(credentials).images.list();
35
+ const record = asRecord(response);
36
+ const items = Array.isArray(record.items) ? record.items : Array.isArray(response) ? response : [];
37
+ return typeformImageListSchema.parse({ items: items.map((item) => typeformImageSchema.parse(item)) });
38
+ }
39
+ });
40
+ const createImage = typeformOperation({
41
+ id: "create_image",
42
+ name: "Create Image",
43
+ description: "Upload a new image asset to the Typeform account (base64 or URL-sourced).",
44
+ input: createImageInputSchema,
45
+ output: typeformImageSchema,
46
+ needsApproval: true,
47
+ run: async (input, credentials) => {
48
+ if (!input.image && !input.url) throw new Error("createImage requires either `image` (base64) or `url`.");
49
+ const response = await createTypeformClient(credentials).images.create(omitUndefined({
50
+ file_name: input.fileName,
51
+ image: input.image,
52
+ url: input.url
53
+ }));
54
+ return typeformImageSchema.parse(response);
55
+ }
56
+ });
57
+ const getImageBySize = typeformOperation({
58
+ id: "get_image_by_size",
59
+ name: "Get Image by Size",
60
+ description: "Fetch a sized variant of an image asset.",
61
+ input: getImageBySizeInputSchema,
62
+ output: typeformImageSchema,
63
+ run: async (input, credentials) => {
64
+ const response = await createTypeformClient(credentials).images.getBySize(input.imageId, input.size);
65
+ return typeformImageSchema.parse(response);
66
+ }
67
+ });
68
+ const getBackgroundBySize = typeformOperation({
69
+ id: "get_background_by_size",
70
+ name: "Get Background Image by Size",
71
+ description: "Fetch a sized variant of a background image asset.",
72
+ input: getBackgroundBySizeInputSchema,
73
+ output: typeformImageSchema,
74
+ run: async (input, credentials) => {
75
+ const response = await createTypeformClient(credentials).images.getBackgroundBySize(input.imageId, input.size);
76
+ return typeformImageSchema.parse(response);
77
+ }
78
+ });
79
+ const getChoiceImageBySize = typeformOperation({
80
+ id: "get_choice_image_by_size",
81
+ name: "Get Choice Image by Size",
82
+ description: "Fetch a sized variant of a picture-choice image asset.",
83
+ input: getChoiceImageBySizeInputSchema,
84
+ output: typeformImageSchema,
85
+ run: async (input, credentials) => {
86
+ const response = await createTypeformClient(credentials).images.getChoiceBySize(input.imageId, input.size);
87
+ return typeformImageSchema.parse(response);
88
+ }
89
+ });
90
+ const deleteImage = typeformOperation({
91
+ id: "delete_image",
92
+ name: "Delete Image",
93
+ description: "Delete an image asset.",
94
+ input: deleteImageInputSchema,
95
+ output: z.object({ success: z.boolean() }),
96
+ needsApproval: true,
97
+ run: async (input, credentials) => {
98
+ await createTypeformClient(credentials).images.delete(input.imageId);
99
+ return { success: true };
100
+ }
101
+ });
102
+
103
+ //#endregion
104
+ export { createImage, deleteImage, getBackgroundBySize, getChoiceImageBySize, getImageBySize, listImages };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,26 @@
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/insights.d.ts
6
+ declare const getFormMessages: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ formId: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
10
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
11
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
12
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
13
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
14
+ }, z.core.$strip>>[] | undefined>], undefined>;
15
+ declare const updateFormMessages: _keystrokehq_core0.Operation<z.ZodObject<{
16
+ formId: z.ZodString;
17
+ messages: z.ZodRecord<z.ZodString, z.ZodString>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ success: z.ZodBoolean;
20
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
21
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
22
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
23
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
24
+ }, z.core.$strip>>[] | undefined>], undefined>;
25
+ //#endregion
26
+ export { getFormMessages, updateFormMessages };
@@ -0,0 +1,37 @@
1
+ import { createTypeformClient } from "./client.mjs";
2
+ import { _ as typeformFormMessagesSchema, k as typeformIdentifierSchema } from "./workspace-C1CCnvgv.mjs";
3
+ import { t as typeformOperation } from "./factory-B_dyn39A.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/insights.ts
7
+ const getFormMessagesInputSchema = z.object({ formId: typeformIdentifierSchema });
8
+ const updateFormMessagesInputSchema = z.object({
9
+ formId: typeformIdentifierSchema,
10
+ messages: z.record(z.string(), z.string())
11
+ });
12
+ const getFormMessages = typeformOperation({
13
+ id: "get_form_messages",
14
+ name: "Get Form Messages",
15
+ description: "Retrieve the customizable copy overrides (messages) for a Typeform form.",
16
+ input: getFormMessagesInputSchema,
17
+ output: typeformFormMessagesSchema,
18
+ run: async (input, credentials) => {
19
+ const response = await createTypeformClient(credentials).insights.getFormMessages(input.formId);
20
+ return typeformFormMessagesSchema.parse(response);
21
+ }
22
+ });
23
+ const updateFormMessages = typeformOperation({
24
+ id: "update_form_messages",
25
+ name: "Update Form Messages",
26
+ description: "Replace the customizable copy overrides (messages) for a Typeform form.",
27
+ input: updateFormMessagesInputSchema,
28
+ output: z.object({ success: z.boolean() }),
29
+ needsApproval: true,
30
+ run: async (input, credentials) => {
31
+ await createTypeformClient(credentials).insights.updateFormMessages(input.formId, input.messages);
32
+ return { success: true };
33
+ }
34
+ });
35
+
36
+ //#endregion
37
+ export { getFormMessages, updateFormMessages };
@@ -0,0 +1,76 @@
1
+ import { defineOfficialIntegration } from "@keystrokehq/integration-authoring/official";
2
+ import { z } from "zod";
3
+ import { CredentialSet } from "@keystrokehq/core";
4
+
5
+ //#region src/_official/provider-app.ts
6
+ const typeformAppCredentialSet = new CredentialSet({
7
+ id: "typeform-app",
8
+ exposure: "platform-only",
9
+ name: "Typeform App",
10
+ auth: z.object({
11
+ clientId: z.string().min(1),
12
+ clientSecret: z.string().min(1),
13
+ webhookSecret: z.string().min(1).optional()
14
+ })
15
+ });
16
+ const typeformPlatformProviderSeed = {
17
+ provider: "typeform",
18
+ appRef: "typeform-platform",
19
+ displayName: "Typeform Platform",
20
+ credentialSetName: "Keystroke Typeform Platform App",
21
+ envShape: {
22
+ KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID: z.string().optional(),
23
+ KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_SECRET: z.string().optional(),
24
+ KEYSTROKE_PLATFORM_TYPEFORM_WEBHOOK_SECRET: z.string().optional()
25
+ },
26
+ requiredEnvKeys: ["KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID", "KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_SECRET"],
27
+ externalAppIdEnvKey: "KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID",
28
+ buildCredentials: (env) => ({
29
+ clientId: env.KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID,
30
+ clientSecret: env.KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_SECRET,
31
+ ...env.KEYSTROKE_PLATFORM_TYPEFORM_WEBHOOK_SECRET ? { webhookSecret: env.KEYSTROKE_PLATFORM_TYPEFORM_WEBHOOK_SECRET } : {}
32
+ })
33
+ };
34
+
35
+ //#endregion
36
+ //#region src/integration.ts
37
+ const typeformAuthSchema = z.object({ TYPEFORM_ACCESS_TOKEN: z.string().min(1) });
38
+ const typeformOfficialIntegration = {
39
+ id: "typeform",
40
+ name: "Typeform",
41
+ description: "Typeform forms, responses, themes, images, workspaces, and form_response webhooks for Keystroke workflows",
42
+ auth: typeformAuthSchema,
43
+ connections: [{
44
+ id: "oauth",
45
+ kind: "oauth",
46
+ tokenType: "refreshable",
47
+ authUrl: "https://api.typeform.com/oauth/authorize",
48
+ tokenUrl: "https://api.typeform.com/oauth/token",
49
+ revokeUrl: "https://api.typeform.com/oauth/revoke",
50
+ scopes: [
51
+ "accounts:read",
52
+ "forms:read",
53
+ "forms:write",
54
+ "responses:read",
55
+ "responses:write",
56
+ "images:read",
57
+ "images:write",
58
+ "themes:read",
59
+ "themes:write",
60
+ "workspaces:read",
61
+ "workspaces:write",
62
+ "webhooks:read",
63
+ "webhooks:write",
64
+ "offline"
65
+ ],
66
+ vault: { accessToken: "TYPEFORM_ACCESS_TOKEN" }
67
+ }]
68
+ };
69
+ const typeformBundle = defineOfficialIntegration({
70
+ ...typeformOfficialIntegration,
71
+ internal: { providerApp: typeformAppCredentialSet }
72
+ });
73
+ const typeform = typeformBundle.credentialSet;
74
+
75
+ //#endregion
76
+ export { typeformPlatformProviderSeed as a, typeformAppCredentialSet as i, typeformBundle as n, typeformOfficialIntegration as r, typeform as t };
@@ -0,0 +1,38 @@
1
+ import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
2
+ import { z } from "zod";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
5
+ import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
6
+
7
+ //#region src/integration.d.ts
8
+ declare const typeformOfficialIntegration: {
9
+ id: "typeform";
10
+ name: string;
11
+ description: string;
12
+ auth: z.ZodObject<{
13
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
14
+ }, z.core.$strip>;
15
+ connections: {
16
+ id: string;
17
+ kind: "oauth";
18
+ tokenType: "refreshable";
19
+ authUrl: string;
20
+ tokenUrl: string;
21
+ revokeUrl: string;
22
+ scopes: string[];
23
+ vault: {
24
+ accessToken: "TYPEFORM_ACCESS_TOKEN";
25
+ };
26
+ }[];
27
+ };
28
+ declare const typeformBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"typeform", z.ZodObject<{
29
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
30
+ }, z.core.$strip>>;
31
+ declare const typeform: _keystrokehq_core0.CredentialSet<"typeform", z.ZodObject<{
32
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
33
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
34
+ TYPEFORM_ACCESS_TOKEN: z.ZodString;
35
+ }, z.core.$strip>>[] | undefined>;
36
+ type TypeformCredentials = InferCredentialSetAuth<typeof typeform>;
37
+ //#endregion
38
+ export { typeformOfficialIntegration as i, typeform as n, typeformBundle as r, TypeformCredentials as t };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { CredentialSet } from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/_official/provider-app.d.ts
6
+ declare const typeformAppCredentialSet: CredentialSet<"typeform-app", z.ZodObject<{
7
+ clientId: z.ZodString;
8
+ clientSecret: z.ZodString;
9
+ webhookSecret: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
11
+ clientId: z.ZodString;
12
+ clientSecret: z.ZodString;
13
+ webhookSecret: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>>[] | undefined>;
15
+ declare const typeformPlatformProviderSeed: {
16
+ readonly provider: "typeform";
17
+ readonly appRef: "typeform-platform";
18
+ readonly displayName: "Typeform Platform";
19
+ readonly credentialSetName: "Keystroke Typeform Platform App";
20
+ readonly envShape: {
21
+ readonly KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID: z.ZodOptional<z.ZodString>;
22
+ readonly KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
23
+ readonly KEYSTROKE_PLATFORM_TYPEFORM_WEBHOOK_SECRET: z.ZodOptional<z.ZodString>;
24
+ };
25
+ readonly requiredEnvKeys: readonly ["KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID", "KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_SECRET"];
26
+ readonly externalAppIdEnvKey: "KEYSTROKE_PLATFORM_TYPEFORM_CLIENT_ID";
27
+ readonly buildCredentials: (env: Record<string, string | undefined>) => {
28
+ webhookSecret?: string | undefined;
29
+ clientId: string | undefined;
30
+ clientSecret: string | undefined;
31
+ };
32
+ };
33
+ type TypeformAppCredentials = z.infer<typeof typeformAppCredentialSet.auth>;
34
+ //#endregion
35
+ export { typeformAppCredentialSet as n, typeformPlatformProviderSeed as r, TypeformAppCredentials as t };