@frogbotai/piece-hubspot 0.0.0-stage → 0.41.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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -2
  3. package/dist/actions/associations.d.ts +161 -0
  4. package/dist/actions/associations.d.ts.map +1 -0
  5. package/dist/actions/associations.js +192 -0
  6. package/dist/actions/associations.js.map +1 -0
  7. package/dist/actions/createOrUpdateContact.d.ts +36 -0
  8. package/dist/actions/createOrUpdateContact.d.ts.map +1 -0
  9. package/dist/actions/createOrUpdateContact.js +65 -0
  10. package/dist/actions/createOrUpdateContact.js.map +1 -0
  11. package/dist/actions/crm.d.ts +1042 -0
  12. package/dist/actions/crm.d.ts.map +1 -0
  13. package/dist/actions/crm.js +266 -0
  14. package/dist/actions/crm.js.map +1 -0
  15. package/dist/actions/crud.d.ts +180 -0
  16. package/dist/actions/crud.d.ts.map +1 -0
  17. package/dist/actions/crud.js +203 -0
  18. package/dist/actions/crud.js.map +1 -0
  19. package/dist/actions/customApiCall.d.ts +6 -0
  20. package/dist/actions/customApiCall.d.ts.map +1 -0
  21. package/dist/actions/customApiCall.js +10 -0
  22. package/dist/actions/customApiCall.js.map +1 -0
  23. package/dist/actions/lists.d.ts +42 -0
  24. package/dist/actions/lists.d.ts.map +1 -0
  25. package/dist/actions/lists.js +108 -0
  26. package/dist/actions/lists.js.map +1 -0
  27. package/dist/actions/lookups.d.ts +110 -0
  28. package/dist/actions/lookups.d.ts.map +1 -0
  29. package/dist/actions/lookups.js +71 -0
  30. package/dist/actions/lookups.js.map +1 -0
  31. package/dist/actions/marketing.d.ts +45 -0
  32. package/dist/actions/marketing.d.ts.map +1 -0
  33. package/dist/actions/marketing.js +75 -0
  34. package/dist/actions/marketing.js.map +1 -0
  35. package/dist/actions/options.d.ts +38 -0
  36. package/dist/actions/options.d.ts.map +1 -0
  37. package/dist/actions/options.js +229 -0
  38. package/dist/actions/options.js.map +1 -0
  39. package/dist/actions/reads.d.ts +351 -0
  40. package/dist/actions/reads.d.ts.map +1 -0
  41. package/dist/actions/reads.js +253 -0
  42. package/dist/actions/reads.js.map +1 -0
  43. package/dist/actions/uploadFile.d.ts +47 -0
  44. package/dist/actions/uploadFile.d.ts.map +1 -0
  45. package/dist/actions/uploadFile.js +66 -0
  46. package/dist/actions/uploadFile.js.map +1 -0
  47. package/dist/client.d.ts +31 -0
  48. package/dist/client.d.ts.map +1 -0
  49. package/dist/client.js +115 -0
  50. package/dist/client.js.map +1 -0
  51. package/dist/config.d.ts +24 -0
  52. package/dist/config.d.ts.map +1 -0
  53. package/dist/config.js +35 -0
  54. package/dist/config.js.map +1 -0
  55. package/dist/define.d.ts +76 -0
  56. package/dist/define.d.ts.map +1 -0
  57. package/dist/define.js +4 -0
  58. package/dist/define.js.map +1 -0
  59. package/dist/files.d.ts +13 -0
  60. package/dist/files.d.ts.map +1 -0
  61. package/dist/files.js +55 -0
  62. package/dist/files.js.map +1 -0
  63. package/dist/index.d.ts +3463 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +173 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/objects.d.ts +57 -0
  68. package/dist/objects.d.ts.map +1 -0
  69. package/dist/objects.js +194 -0
  70. package/dist/objects.js.map +1 -0
  71. package/dist/pagination.d.ts +41 -0
  72. package/dist/pagination.d.ts.map +1 -0
  73. package/dist/pagination.js +29 -0
  74. package/dist/pagination.js.map +1 -0
  75. package/dist/records.d.ts +99 -0
  76. package/dist/records.d.ts.map +1 -0
  77. package/dist/records.js +106 -0
  78. package/dist/records.js.map +1 -0
  79. package/dist/triggers/marketing.d.ts +167 -0
  80. package/dist/triggers/marketing.d.ts.map +1 -0
  81. package/dist/triggers/marketing.js +227 -0
  82. package/dist/triggers/marketing.js.map +1 -0
  83. package/dist/triggers/newContactInList.d.ts +75 -0
  84. package/dist/triggers/newContactInList.d.ts.map +1 -0
  85. package/dist/triggers/newContactInList.js +78 -0
  86. package/dist/triggers/newContactInList.js.map +1 -0
  87. package/dist/triggers/newEngagement.d.ts +91 -0
  88. package/dist/triggers/newEngagement.d.ts.map +1 -0
  89. package/dist/triggers/newEngagement.js +125 -0
  90. package/dist/triggers/newEngagement.js.map +1 -0
  91. package/dist/triggers/poll.d.ts +94 -0
  92. package/dist/triggers/poll.d.ts.map +1 -0
  93. package/dist/triggers/poll.js +141 -0
  94. package/dist/triggers/poll.js.map +1 -0
  95. package/dist/triggers/records.d.ts +1234 -0
  96. package/dist/triggers/records.d.ts.map +1 -0
  97. package/dist/triggers/records.js +249 -0
  98. package/dist/triggers/records.js.map +1 -0
  99. package/package.json +41 -3
@@ -0,0 +1,229 @@
1
+ import { z } from 'zod';
2
+ import { standardObjectTypes } from '../config.js';
3
+ import { cursorPage } from '../pagination.js';
4
+ const maxPages = 10;
5
+ function text(value) {
6
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
7
+ }
8
+ function safe(value) {
9
+ const found = text(value);
10
+ return found && /^[\w-]+$/.test(found) ? found : undefined;
11
+ }
12
+ async function allResults(client, item, request) {
13
+ const results = [];
14
+ let after;
15
+ for(let page = 0; page < maxPages; page++){
16
+ const result = await client.request(cursorPage(item), {
17
+ ...request,
18
+ query: {
19
+ ...request.query,
20
+ limit: 100,
21
+ after
22
+ }
23
+ });
24
+ results.push(...result.results);
25
+ if (result.nextCursor === null) break;
26
+ after = result.nextCursor;
27
+ }
28
+ return results;
29
+ }
30
+ const propertyItem = z.object({
31
+ name: z.string(),
32
+ label: z.string(),
33
+ hidden: z.boolean().optional()
34
+ });
35
+ async function properties(client, objectType) {
36
+ if (!objectType) return [];
37
+ const result = await client.request(z.object({
38
+ results: z.array(propertyItem)
39
+ }), {
40
+ path: `/crm/v3/properties/${objectType}`
41
+ });
42
+ return result.results.filter((property)=>!property.hidden).map((property)=>({
43
+ label: property.label,
44
+ value: property.name
45
+ }));
46
+ }
47
+ /** A standard object's properties, by label. */ export const propertyOptions = (objectType)=>({ client })=>properties(client, objectType);
48
+ /** The chosen custom object's properties. */ export const customPropertyOptions = ({ client, input })=>properties(client, safe(input.customObjectType));
49
+ const schemas = z.object({
50
+ results: z.array(z.object({
51
+ objectTypeId: z.string(),
52
+ name: z.string(),
53
+ labels: z.object({
54
+ plural: z.string().optional()
55
+ }).optional()
56
+ }))
57
+ });
58
+ export async function customObjectTypeOptions({ client }) {
59
+ const result = await client.request(schemas, {
60
+ path: '/crm/v3/schemas'
61
+ });
62
+ return result.results.map((schema)=>({
63
+ label: schema.labels?.plural ?? schema.name,
64
+ value: schema.objectTypeId
65
+ }));
66
+ }
67
+ const standardLabels = {
68
+ contacts: 'Contacts',
69
+ companies: 'Companies',
70
+ deals: 'Deals',
71
+ tickets: 'Tickets',
72
+ notes: 'Notes',
73
+ emails: 'Emails',
74
+ calls: 'Calls',
75
+ meetings: 'Meetings',
76
+ tasks: 'Tasks',
77
+ line_items: 'Line items',
78
+ products: 'Products'
79
+ };
80
+ /** Standard objects, then the account's custom objects. */ export async function objectTypeOptions(args) {
81
+ return [
82
+ ...standardObjectTypes.map((value)=>({
83
+ label: standardLabels[value],
84
+ value
85
+ })),
86
+ ...await customObjectTypeOptions(args)
87
+ ];
88
+ }
89
+ const pipelines = z.object({
90
+ results: z.array(z.object({
91
+ id: z.string(),
92
+ label: z.string()
93
+ }))
94
+ });
95
+ export const pipelineOptions = (objectType)=>async ({ client })=>{
96
+ const result = await client.request(pipelines, {
97
+ path: `/crm/v3/pipelines/${objectType}`
98
+ });
99
+ return result.results.map((pipeline)=>({
100
+ label: pipeline.label,
101
+ value: pipeline.id
102
+ }));
103
+ };
104
+ export const stageOptions = (objectType)=>async ({ client, input })=>{
105
+ const pipelineId = safe(input.pipelineId);
106
+ if (!pipelineId) return [];
107
+ const result = await client.request(pipelines, {
108
+ path: `/crm/v3/pipelines/${objectType}/${pipelineId}/stages`
109
+ });
110
+ return result.results.map((stage)=>({
111
+ label: stage.label,
112
+ value: stage.id
113
+ }));
114
+ };
115
+ const named = z.object({
116
+ id: z.string(),
117
+ properties: z.record(z.string(), z.string().nullable())
118
+ });
119
+ const labelProperty = {
120
+ contacts: 'email',
121
+ companies: 'name',
122
+ deals: 'dealname',
123
+ tickets: 'subject',
124
+ line_items: 'name',
125
+ products: 'name'
126
+ };
127
+ async function records(client, objectType) {
128
+ if (!objectType) return [];
129
+ const property = labelProperty[objectType];
130
+ const found = await allResults(client, named, {
131
+ path: `/crm/v3/objects/${objectType}`,
132
+ query: {
133
+ properties: property ? [
134
+ property
135
+ ] : undefined
136
+ }
137
+ });
138
+ return found.map((record)=>({
139
+ label: property && record.properties[property] || record.id,
140
+ value: record.id
141
+ }));
142
+ }
143
+ export const productOptions = ({ client })=>records(client, 'products');
144
+ /** Records of the chosen `toObjectType`. */ export const toRecordOptions = ({ client, input })=>records(client, safe(input.toObjectType));
145
+ const labels = z.object({
146
+ results: z.array(z.object({
147
+ typeId: z.number(),
148
+ label: z.string().nullable().optional()
149
+ }))
150
+ });
151
+ export async function associationTypeOptions({ client, input }) {
152
+ const from = safe(input.fromObjectType);
153
+ const to = safe(input.toObjectType);
154
+ if (!from || !to) return [];
155
+ const result = await client.request(labels, {
156
+ path: `/crm/associations/v4/${from}/${to}/labels`
157
+ });
158
+ return result.results.map((type)=>({
159
+ label: type.label ?? `${from} to ${to}`,
160
+ value: String(type.typeId)
161
+ }));
162
+ }
163
+ const listsPage = z.object({
164
+ lists: z.array(z.object({
165
+ listId: z.string(),
166
+ name: z.string()
167
+ })),
168
+ hasMore: z.boolean(),
169
+ offset: z.number()
170
+ });
171
+ /** Contact lists whose members can be added and removed by hand. */ export async function contactListOptions({ client }) {
172
+ const options = [];
173
+ let offset = 0;
174
+ for(let page = 0; page < maxPages; page++){
175
+ const result = await client.request(listsPage, {
176
+ method: 'POST',
177
+ path: '/crm/v3/lists/search',
178
+ body: {
179
+ query: '',
180
+ count: 100,
181
+ offset,
182
+ objectTypeId: '0-1',
183
+ processingTypes: [
184
+ 'MANUAL',
185
+ 'SNAPSHOT'
186
+ ],
187
+ additionalProperties: []
188
+ }
189
+ });
190
+ options.push(...result.lists.map((list)=>({
191
+ label: list.name,
192
+ value: list.listId
193
+ })));
194
+ if (!result.hasMore) break;
195
+ offset = result.offset;
196
+ }
197
+ return options;
198
+ }
199
+ const workflows = z.object({
200
+ workflows: z.array(z.object({
201
+ id: z.number(),
202
+ name: z.string(),
203
+ enabled: z.boolean()
204
+ }))
205
+ });
206
+ /** Enabled contact workflows, by their legacy ID. */ export async function workflowOptions({ client }) {
207
+ const result = await client.request(workflows, {
208
+ path: '/automation/v3/workflows'
209
+ });
210
+ return result.workflows.filter((workflow)=>workflow.enabled).map((workflow)=>({
211
+ label: workflow.name,
212
+ value: String(workflow.id)
213
+ }));
214
+ }
215
+ const folder = z.object({
216
+ id: z.string(),
217
+ name: z.string().optional()
218
+ });
219
+ export async function folderOptions({ client }) {
220
+ const folders = await allResults(client, folder, {
221
+ path: '/files/v3/folders/search'
222
+ });
223
+ return folders.map((found)=>({
224
+ label: found.name ?? found.id,
225
+ value: found.id
226
+ }));
227
+ }
228
+
229
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/actions/options.ts"],"names":["z","standardObjectTypes","cursorPage","maxPages","text","value","trim","undefined","safe","found","test","allResults","client","item","request","results","after","page","result","query","limit","push","nextCursor","propertyItem","object","name","string","label","hidden","boolean","optional","properties","objectType","array","path","filter","property","map","propertyOptions","customPropertyOptions","input","customObjectType","schemas","objectTypeId","labels","plural","customObjectTypeOptions","schema","standardLabels","contacts","companies","deals","tickets","notes","emails","calls","meetings","tasks","line_items","products","objectTypeOptions","args","pipelines","id","pipelineOptions","pipeline","stageOptions","pipelineId","stage","named","record","nullable","labelProperty","records","productOptions","toRecordOptions","toObjectType","typeId","number","associationTypeOptions","from","fromObjectType","to","type","String","listsPage","lists","listId","hasMore","offset","contactListOptions","options","method","body","count","processingTypes","additionalProperties","list","workflows","enabled","workflowOptions","workflow","folder","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IACzB0E,WAAWlG,EAAEiC,KAAK,CAACjC,EAAEwB,MAAM,CAAC;QAAEuC,IAAI/D,EAAE8E,MAAM;QAAIrD,MAAMzB,EAAE0B,MAAM;QAAIyE,SAASnG,EAAE6B,OAAO;IAAG;AACvF;AAEA,mDAAmD,GACnD,OAAO,eAAeuE,gBAAgB,EAAExF,MAAM,EAAQ;IACpD,MAAMM,SAAS,MAAMN,OAAOE,OAAO,CAACoF,WAAW;QAAEhE,MAAM;IAA2B;IAElF,OAAOhB,OAAOgF,SAAS,CACpB/D,MAAM,CAAC,CAACkE,WAAaA,SAASF,OAAO,EACrC9D,GAAG,CAAC,CAACgE,WAAc,CAAA;YAAE1E,OAAO0E,SAAS5E,IAAI;YAAEpB,OAAO+E,OAAOiB,SAAStC,EAAE;QAAE,CAAA;AAC3E;AAEA,MAAMuC,SAAStG,EAAEwB,MAAM,CAAC;IAAEuC,IAAI/D,EAAE0B,MAAM;IAAID,MAAMzB,EAAE0B,MAAM,GAAGI,QAAQ;AAAG;AAEtE,OAAO,eAAeyE,cAAc,EAAE3F,MAAM,EAAQ;IAClD,MAAM4F,UAAU,MAAM7F,WAAWC,QAAQ0F,QAAQ;QAAEpE,MAAM;IAA2B;IAEpF,OAAOsE,QAAQnE,GAAG,CAAC,CAAC5B,QAAW,CAAA;YAAEkB,OAAOlB,MAAMgB,IAAI,IAAIhB,MAAMsD,EAAE;YAAE1D,OAAOI,MAAMsD,EAAE;QAAC,CAAA;AAClF","file":"options.js"}
@@ -0,0 +1,351 @@
1
+ import { z } from 'zod';
2
+ export declare const listRecords: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
3
+ limit: z.ZodDefault<z.ZodNumber>;
4
+ cursor: z.ZodOptional<z.ZodString>;
5
+ objectType: z.ZodUnion<readonly [z.ZodEnum<{
6
+ contacts: "contacts";
7
+ companies: "companies";
8
+ deals: "deals";
9
+ tickets: "tickets";
10
+ notes: "notes";
11
+ emails: "emails";
12
+ calls: "calls";
13
+ meetings: "meetings";
14
+ tasks: "tasks";
15
+ line_items: "line_items";
16
+ products: "products";
17
+ }>, z.ZodTemplateLiteral<`2-${number}`>]>;
18
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ associations: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ results: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodString;
23
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
24
+ createdAt: z.ZodOptional<z.ZodString>;
25
+ updatedAt: z.ZodOptional<z.ZodString>;
26
+ archived: z.ZodOptional<z.ZodBoolean>;
27
+ associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
28
+ results: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ type: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>>>;
33
+ }, z.core.$strip>>;
34
+ nextCursor: z.ZodNullable<z.ZodString>;
35
+ }, z.core.$strip>, Record<string, never>, {
36
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
37
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
38
+ authorize(headers: Headers): void;
39
+ }, {
40
+ results: {
41
+ id: string;
42
+ properties: Record<string, string | null>;
43
+ createdAt?: string | undefined;
44
+ updatedAt?: string | undefined;
45
+ archived?: boolean | undefined;
46
+ associations?: Record<string, {
47
+ results: {
48
+ id: string;
49
+ type: string;
50
+ }[];
51
+ }> | undefined;
52
+ }[];
53
+ nextCursor: string | null;
54
+ }> & {
55
+ slug: "listRecords";
56
+ };
57
+ export declare const listAssociations: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
58
+ fromType: z.ZodUnion<readonly [z.ZodEnum<{
59
+ contacts: "contacts";
60
+ companies: "companies";
61
+ deals: "deals";
62
+ tickets: "tickets";
63
+ notes: "notes";
64
+ emails: "emails";
65
+ calls: "calls";
66
+ meetings: "meetings";
67
+ tasks: "tasks";
68
+ line_items: "line_items";
69
+ products: "products";
70
+ }>, z.ZodTemplateLiteral<`2-${number}`>]>;
71
+ toType: z.ZodUnion<readonly [z.ZodEnum<{
72
+ contacts: "contacts";
73
+ companies: "companies";
74
+ deals: "deals";
75
+ tickets: "tickets";
76
+ notes: "notes";
77
+ emails: "emails";
78
+ calls: "calls";
79
+ meetings: "meetings";
80
+ tasks: "tasks";
81
+ line_items: "line_items";
82
+ products: "products";
83
+ }>, z.ZodTemplateLiteral<`2-${number}`>]>;
84
+ ids: z.ZodArray<z.ZodString>;
85
+ cursors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ results: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ associations: z.ZodArray<z.ZodObject<{
90
+ id: z.ZodString;
91
+ labels: z.ZodArray<z.ZodObject<{
92
+ category: z.ZodString;
93
+ typeId: z.ZodNumber;
94
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
+ }, z.core.$strip>>;
96
+ }, z.core.$strip>>;
97
+ nextCursor: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strip>>;
99
+ errors: z.ZodArray<z.ZodObject<{
100
+ message: z.ZodString;
101
+ category: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>, Record<string, never>, {
104
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
105
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
106
+ authorize(headers: Headers): void;
107
+ }, {
108
+ results: {
109
+ id: string;
110
+ associations: {
111
+ id: string;
112
+ labels: {
113
+ category: string;
114
+ typeId: number;
115
+ label?: string | null | undefined;
116
+ }[];
117
+ }[];
118
+ nextCursor: string | null;
119
+ }[];
120
+ errors: {
121
+ message: string;
122
+ category?: string | undefined;
123
+ }[];
124
+ }> & {
125
+ slug: "listAssociations";
126
+ };
127
+ export declare const listLists: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
128
+ query: z.ZodOptional<z.ZodString>;
129
+ objectTypeId: z.ZodOptional<z.ZodString>;
130
+ limit: z.ZodDefault<z.ZodNumber>;
131
+ cursor: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ results: z.ZodArray<z.ZodObject<{
134
+ listId: z.ZodString;
135
+ name: z.ZodString;
136
+ objectTypeId: z.ZodString;
137
+ processingType: z.ZodString;
138
+ processingStatus: z.ZodOptional<z.ZodString>;
139
+ createdAt: z.ZodOptional<z.ZodString>;
140
+ updatedAt: z.ZodOptional<z.ZodString>;
141
+ additionalProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>>;
142
+ }, z.core.$strip>>;
143
+ nextCursor: z.ZodNullable<z.ZodString>;
144
+ }, z.core.$strip>, Record<string, never>, {
145
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
146
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
147
+ authorize(headers: Headers): void;
148
+ }, {
149
+ results: {
150
+ listId: string;
151
+ name: string;
152
+ objectTypeId: string;
153
+ processingType: string;
154
+ processingStatus?: string | undefined;
155
+ createdAt?: string | undefined;
156
+ updatedAt?: string | undefined;
157
+ additionalProperties?: Record<string, string> | undefined;
158
+ }[];
159
+ nextCursor: string | null;
160
+ }> & {
161
+ slug: "listLists";
162
+ };
163
+ export declare const listListMembers: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
164
+ limit: z.ZodDefault<z.ZodNumber>;
165
+ cursor: z.ZodOptional<z.ZodString>;
166
+ listId: z.ZodString;
167
+ }, z.core.$strip>, z.ZodObject<{
168
+ results: z.ZodArray<z.ZodObject<{
169
+ recordId: z.ZodString;
170
+ membershipTimestamp: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strip>>;
172
+ nextCursor: z.ZodNullable<z.ZodString>;
173
+ }, z.core.$strip>, Record<string, never>, {
174
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
175
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
176
+ authorize(headers: Headers): void;
177
+ }, {
178
+ results: {
179
+ recordId: string;
180
+ membershipTimestamp?: string | undefined;
181
+ }[];
182
+ nextCursor: string | null;
183
+ }> & {
184
+ slug: "listListMembers";
185
+ };
186
+ export declare const listOwners: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
187
+ limit: z.ZodDefault<z.ZodNumber>;
188
+ cursor: z.ZodOptional<z.ZodString>;
189
+ archived: z.ZodOptional<z.ZodBoolean>;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ results: z.ZodArray<z.ZodObject<{
192
+ id: z.ZodString;
193
+ email: z.ZodOptional<z.ZodString>;
194
+ firstName: z.ZodOptional<z.ZodString>;
195
+ lastName: z.ZodOptional<z.ZodString>;
196
+ userId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
197
+ type: z.ZodOptional<z.ZodString>;
198
+ archived: z.ZodOptional<z.ZodBoolean>;
199
+ createdAt: z.ZodOptional<z.ZodString>;
200
+ updatedAt: z.ZodOptional<z.ZodString>;
201
+ teams: z.ZodOptional<z.ZodArray<z.ZodObject<{
202
+ id: z.ZodString;
203
+ name: z.ZodString;
204
+ primary: z.ZodOptional<z.ZodBoolean>;
205
+ }, z.core.$strip>>>;
206
+ }, z.core.$strip>>;
207
+ nextCursor: z.ZodNullable<z.ZodString>;
208
+ }, z.core.$strip>, Record<string, never>, {
209
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
210
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
211
+ authorize(headers: Headers): void;
212
+ }, {
213
+ results: {
214
+ id: string;
215
+ email?: string | undefined;
216
+ firstName?: string | undefined;
217
+ lastName?: string | undefined;
218
+ userId?: number | null | undefined;
219
+ type?: string | undefined;
220
+ archived?: boolean | undefined;
221
+ createdAt?: string | undefined;
222
+ updatedAt?: string | undefined;
223
+ teams?: {
224
+ id: string;
225
+ name: string;
226
+ primary?: boolean | undefined;
227
+ }[] | undefined;
228
+ }[];
229
+ nextCursor: string | null;
230
+ }> & {
231
+ slug: "listOwners";
232
+ };
233
+ export declare const listPipelines: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
234
+ objectType: z.ZodEnum<{
235
+ deals: "deals";
236
+ tickets: "tickets";
237
+ }>;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ results: z.ZodArray<z.ZodObject<{
240
+ id: z.ZodString;
241
+ label: z.ZodString;
242
+ displayOrder: z.ZodNumber;
243
+ archived: z.ZodOptional<z.ZodBoolean>;
244
+ stages: z.ZodArray<z.ZodObject<{
245
+ id: z.ZodString;
246
+ label: z.ZodString;
247
+ displayOrder: z.ZodNumber;
248
+ archived: z.ZodOptional<z.ZodBoolean>;
249
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
250
+ createdAt: z.ZodOptional<z.ZodString>;
251
+ updatedAt: z.ZodOptional<z.ZodString>;
252
+ }, z.core.$strip>>;
253
+ createdAt: z.ZodOptional<z.ZodString>;
254
+ updatedAt: z.ZodOptional<z.ZodString>;
255
+ }, z.core.$strip>>;
256
+ }, z.core.$strip>, Record<string, never>, {
257
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
258
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
259
+ authorize(headers: Headers): void;
260
+ }, {
261
+ results: {
262
+ id: string;
263
+ label: string;
264
+ displayOrder: number;
265
+ stages: {
266
+ id: string;
267
+ label: string;
268
+ displayOrder: number;
269
+ archived?: boolean | undefined;
270
+ metadata?: Record<string, string> | undefined;
271
+ createdAt?: string | undefined;
272
+ updatedAt?: string | undefined;
273
+ }[];
274
+ archived?: boolean | undefined;
275
+ createdAt?: string | undefined;
276
+ updatedAt?: string | undefined;
277
+ }[];
278
+ }> & {
279
+ slug: "listPipelines";
280
+ };
281
+ export declare const listProperties: import("frogbot/pieces").PieceActionDefinition<z.ZodObject<{
282
+ objectType: z.ZodUnion<readonly [z.ZodEnum<{
283
+ contacts: "contacts";
284
+ companies: "companies";
285
+ deals: "deals";
286
+ tickets: "tickets";
287
+ notes: "notes";
288
+ emails: "emails";
289
+ calls: "calls";
290
+ meetings: "meetings";
291
+ tasks: "tasks";
292
+ line_items: "line_items";
293
+ products: "products";
294
+ }>, z.ZodTemplateLiteral<`2-${number}`>]>;
295
+ archived: z.ZodOptional<z.ZodBoolean>;
296
+ }, z.core.$strip>, z.ZodObject<{
297
+ results: z.ZodArray<z.ZodObject<{
298
+ name: z.ZodString;
299
+ label: z.ZodString;
300
+ type: z.ZodString;
301
+ fieldType: z.ZodString;
302
+ description: z.ZodOptional<z.ZodString>;
303
+ groupName: z.ZodOptional<z.ZodString>;
304
+ hidden: z.ZodOptional<z.ZodBoolean>;
305
+ calculated: z.ZodOptional<z.ZodBoolean>;
306
+ hubspotDefined: z.ZodOptional<z.ZodBoolean>;
307
+ referencedObjectType: z.ZodOptional<z.ZodString>;
308
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
309
+ label: z.ZodString;
310
+ value: z.ZodString;
311
+ displayOrder: z.ZodOptional<z.ZodNumber>;
312
+ hidden: z.ZodOptional<z.ZodBoolean>;
313
+ }, z.core.$strip>>>;
314
+ modificationMetadata: z.ZodOptional<z.ZodObject<{
315
+ archivable: z.ZodOptional<z.ZodBoolean>;
316
+ readOnlyDefinition: z.ZodOptional<z.ZodBoolean>;
317
+ readOnlyValue: z.ZodOptional<z.ZodBoolean>;
318
+ }, z.core.$strip>>;
319
+ }, z.core.$strip>>;
320
+ }, z.core.$strip>, Record<string, never>, {
321
+ json: (request: import("../client.js").HubSpotRequest) => Promise<unknown>;
322
+ request: <T>(schema: z.ZodType<T>, options: import("../client.js").HubSpotRequest) => Promise<T>;
323
+ authorize(headers: Headers): void;
324
+ }, {
325
+ results: {
326
+ name: string;
327
+ label: string;
328
+ type: string;
329
+ fieldType: string;
330
+ description?: string | undefined;
331
+ groupName?: string | undefined;
332
+ hidden?: boolean | undefined;
333
+ calculated?: boolean | undefined;
334
+ hubspotDefined?: boolean | undefined;
335
+ referencedObjectType?: string | undefined;
336
+ options?: {
337
+ label: string;
338
+ value: string;
339
+ displayOrder?: number | undefined;
340
+ hidden?: boolean | undefined;
341
+ }[] | undefined;
342
+ modificationMetadata?: {
343
+ archivable?: boolean | undefined;
344
+ readOnlyDefinition?: boolean | undefined;
345
+ readOnlyValue?: boolean | undefined;
346
+ } | undefined;
347
+ }[];
348
+ }> & {
349
+ slug: "listProperties";
350
+ };
351
+ //# sourceMappingURL=reads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../src/actions/reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BtB,CAAC;AAqBH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C3B,CAAC;AAQH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCpB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAa1B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBrB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYxB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzB,CAAC"}