@superpanel-sdk/runtime 0.0.1-internal.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 (169) hide show
  1. package/README.md +35 -0
  2. package/bin/superpanel-sdk-runtime.mjs +22 -0
  3. package/dist/builder/codegen/emit.d.ts +17 -0
  4. package/dist/builder/codegen/emit.js +143 -0
  5. package/dist/builder/codegen/generate.d.ts +21 -0
  6. package/dist/builder/codegen/generate.js +90 -0
  7. package/dist/builder/compile/compile-agenda.d.ts +15 -0
  8. package/dist/builder/compile/compile-agenda.js +59 -0
  9. package/dist/builder/compile/compile-sequence.d.ts +24 -0
  10. package/dist/builder/compile/compile-sequence.js +121 -0
  11. package/dist/builder/compile/function-code.d.ts +6 -0
  12. package/dist/builder/compile/function-code.js +30 -0
  13. package/dist/builder/compile/registry.d.ts +13 -0
  14. package/dist/builder/compile/registry.js +42 -0
  15. package/dist/builder/load.d.ts +22 -0
  16. package/dist/builder/load.js +169 -0
  17. package/dist/builder/merge.d.ts +4 -0
  18. package/dist/builder/merge.js +19 -0
  19. package/dist/builder/paths.d.ts +10 -0
  20. package/dist/builder/paths.js +22 -0
  21. package/dist/builder/types.d.ts +31 -0
  22. package/dist/builder/types.js +2 -0
  23. package/dist/cli/compile/index.d.ts +4 -0
  24. package/dist/cli/compile/index.js +11 -0
  25. package/dist/cli/index.d.ts +3 -0
  26. package/dist/cli/index.js +64 -0
  27. package/dist/cli/serve/index.d.ts +9 -0
  28. package/dist/cli/serve/index.js +340 -0
  29. package/dist/cli/type-gen/index.d.ts +5 -0
  30. package/dist/cli/type-gen/index.js +90 -0
  31. package/dist/compute-host/compute-host.d.ts +38 -0
  32. package/dist/compute-host/compute-host.js +45 -0
  33. package/dist/compute-host/index.d.ts +5 -0
  34. package/dist/compute-host/index.js +3 -0
  35. package/dist/compute-host/source-compute-host.d.ts +29 -0
  36. package/dist/compute-host/source-compute-host.js +72 -0
  37. package/dist/core/context/account-fields.d.ts +12 -0
  38. package/dist/core/context/account-fields.js +2 -0
  39. package/dist/core/context/contact.d.ts +60 -0
  40. package/dist/core/context/contact.js +34 -0
  41. package/dist/core/context/db.d.ts +69 -0
  42. package/dist/core/context/db.js +44 -0
  43. package/dist/core/context/docusign.d.ts +134 -0
  44. package/dist/core/context/docusign.js +108 -0
  45. package/dist/core/context/env.d.ts +9 -0
  46. package/dist/core/context/env.js +19 -0
  47. package/dist/core/context/filevine.d.ts +323 -0
  48. package/dist/core/context/filevine.js +254 -0
  49. package/dist/core/context/http.d.ts +9 -0
  50. package/dist/core/context/http.js +4 -0
  51. package/dist/core/context/hubspot.d.ts +250 -0
  52. package/dist/core/context/hubspot.js +191 -0
  53. package/dist/core/context/platform-registry.d.ts +67 -0
  54. package/dist/core/context/platform-registry.js +11 -0
  55. package/dist/core/context/platform.d.ts +33 -0
  56. package/dist/core/context/platform.js +2 -0
  57. package/dist/core/context/twilio.d.ts +50 -0
  58. package/dist/core/context/twilio.js +42 -0
  59. package/dist/core/context/types.d.ts +87 -0
  60. package/dist/core/context/types.js +9 -0
  61. package/dist/core/functions/define/case-context.d.ts +14 -0
  62. package/dist/core/functions/define/case-context.js +15 -0
  63. package/dist/core/functions/define/compute.d.ts +7 -0
  64. package/dist/core/functions/define/compute.js +17 -0
  65. package/dist/core/functions/define/custom.d.ts +4 -0
  66. package/dist/core/functions/define/custom.js +8 -0
  67. package/dist/core/functions/define/system.d.ts +7 -0
  68. package/dist/core/functions/define/system.js +12 -0
  69. package/dist/core/functions/func-ref.d.ts +16 -0
  70. package/dist/core/functions/func-ref.js +20 -0
  71. package/dist/core/functions/types.d.ts +78 -0
  72. package/dist/core/functions/types.js +5 -0
  73. package/dist/core/slot/compile-schema.d.ts +24 -0
  74. package/dist/core/slot/compile-schema.js +336 -0
  75. package/dist/core/slot/deps.d.ts +15 -0
  76. package/dist/core/slot/deps.js +88 -0
  77. package/dist/core/slot/derived.d.ts +32 -0
  78. package/dist/core/slot/derived.js +115 -0
  79. package/dist/core/slot/field.d.ts +36 -0
  80. package/dist/core/slot/field.js +97 -0
  81. package/dist/core/slot/id-ref.d.ts +4 -0
  82. package/dist/core/slot/id-ref.js +15 -0
  83. package/dist/core/slot/index.d.ts +15 -0
  84. package/dist/core/slot/index.js +14 -0
  85. package/dist/core/slot/path.d.ts +18 -0
  86. package/dist/core/slot/path.js +22 -0
  87. package/dist/core/slot/row.d.ts +22 -0
  88. package/dist/core/slot/row.js +54 -0
  89. package/dist/core/slot/schema.d.ts +102 -0
  90. package/dist/core/slot/schema.js +17 -0
  91. package/dist/core/slot/sf-schema.d.ts +23 -0
  92. package/dist/core/slot/sf-schema.js +125 -0
  93. package/dist/core/slot/sf-validate.d.ts +14 -0
  94. package/dist/core/slot/sf-validate.js +132 -0
  95. package/dist/core/slot/snapshot.d.ts +18 -0
  96. package/dist/core/slot/snapshot.js +138 -0
  97. package/dist/core/slot/types.d.ts +144 -0
  98. package/dist/core/slot/types.js +2 -0
  99. package/dist/core/slot/value.d.ts +9 -0
  100. package/dist/core/slot/value.js +97 -0
  101. package/dist/core/slot/write.d.ts +41 -0
  102. package/dist/core/slot/write.js +319 -0
  103. package/dist/core/stage/builders.d.ts +36 -0
  104. package/dist/core/stage/builders.js +28 -0
  105. package/dist/core/stage/condition.d.ts +17 -0
  106. package/dist/core/stage/condition.js +198 -0
  107. package/dist/core/stage/drive.d.ts +43 -0
  108. package/dist/core/stage/drive.js +77 -0
  109. package/dist/core/stage/finish-when.d.ts +20 -0
  110. package/dist/core/stage/finish-when.js +82 -0
  111. package/dist/core/stage/flatten.d.ts +27 -0
  112. package/dist/core/stage/flatten.js +464 -0
  113. package/dist/core/stage/index.d.ts +11 -0
  114. package/dist/core/stage/index.js +10 -0
  115. package/dist/core/stage/simulate.d.ts +24 -0
  116. package/dist/core/stage/simulate.js +33 -0
  117. package/dist/core/stage/transfer-fields.d.ts +14 -0
  118. package/dist/core/stage/transfer-fields.js +88 -0
  119. package/dist/core/stage/types.d.ts +177 -0
  120. package/dist/core/stage/types.js +2 -0
  121. package/dist/core/stage/validate.d.ts +11 -0
  122. package/dist/core/stage/validate.js +226 -0
  123. package/dist/core/stage/walk.d.ts +34 -0
  124. package/dist/core/stage/walk.js +96 -0
  125. package/dist/dev-overlay/protocol.d.ts +53 -0
  126. package/dist/dev-overlay/protocol.js +21 -0
  127. package/dist/fn-context/build-context.d.ts +11 -0
  128. package/dist/fn-context/build-context.js +21 -0
  129. package/dist/fn-context/fake/empty-api.d.ts +9 -0
  130. package/dist/fn-context/fake/empty-api.js +50 -0
  131. package/dist/fn-context/fake/index.d.ts +12 -0
  132. package/dist/fn-context/fake/index.js +22 -0
  133. package/dist/fn-context/index.d.ts +9 -0
  134. package/dist/fn-context/index.js +8 -0
  135. package/dist/fn-context/log.d.ts +8 -0
  136. package/dist/fn-context/log.js +29 -0
  137. package/dist/fn-context/make-ctx.d.ts +9 -0
  138. package/dist/fn-context/make-ctx.js +51 -0
  139. package/dist/fn-context/rpc/errors.d.ts +25 -0
  140. package/dist/fn-context/rpc/errors.js +23 -0
  141. package/dist/fn-context/rpc/index.d.ts +10 -0
  142. package/dist/fn-context/rpc/index.js +9 -0
  143. package/dist/fn-context/rpc/integration/index.d.ts +51 -0
  144. package/dist/fn-context/rpc/integration/index.js +19 -0
  145. package/dist/fn-context/rpc/integration/list-bindings.d.ts +21 -0
  146. package/dist/fn-context/rpc/integration/list-bindings.js +18 -0
  147. package/dist/fn-context/rpc/log.d.ts +36 -0
  148. package/dist/fn-context/rpc/log.js +16 -0
  149. package/dist/fn-context/rpc/platform.d.ts +28 -0
  150. package/dist/fn-context/rpc/platform.js +15 -0
  151. package/dist/fn-context/rpc/request-id.d.ts +5 -0
  152. package/dist/fn-context/rpc/request-id.js +13 -0
  153. package/dist/fn-context/rpc/trpc-client.d.ts +7 -0
  154. package/dist/fn-context/rpc/trpc-client.js +109 -0
  155. package/dist/fn-context/rpc/trpc-init.d.ts +17 -0
  156. package/dist/fn-context/rpc/trpc-init.js +17 -0
  157. package/dist/fn-context/rpc/trpc-router-factory.d.ts +84 -0
  158. package/dist/fn-context/rpc/trpc-router-factory.js +9 -0
  159. package/dist/fn-context/types.d.ts +17 -0
  160. package/dist/fn-context/types.js +2 -0
  161. package/dist/index.d.ts +47 -0
  162. package/dist/index.js +34 -0
  163. package/dist/voice-service/actions.d.ts +20 -0
  164. package/dist/voice-service/actions.js +2 -0
  165. package/dist/voice-service/index.d.ts +3 -0
  166. package/dist/voice-service/index.js +3 -0
  167. package/dist/voice-service/types.d.ts +1010 -0
  168. package/dist/voice-service/types.js +16 -0
  169. package/package.json +55 -0
@@ -0,0 +1,250 @@
1
+ import { z } from 'zod';
2
+ import type { IntegrationAccountFields } from './account-fields.js';
3
+ export declare const hubspotPropertyValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
4
+ export declare const hubspotPropertiesInput: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
5
+ export declare const hubspotPropertiesOutput: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
6
+ export declare const hubspotRecord: z.ZodObject<{
7
+ id: z.ZodString;
8
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
9
+ }, z.core.$strip>;
10
+ export type HubspotRecord = z.infer<typeof hubspotRecord>;
11
+ export declare const hubspotCreateContactInput: z.ZodObject<{
12
+ properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
13
+ }, z.core.$strip>;
14
+ export type HubspotCreateContactInput = z.infer<typeof hubspotCreateContactInput>;
15
+ export declare const hubspotCreateContactOutput: z.ZodObject<{
16
+ id: z.ZodString;
17
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
18
+ }, z.core.$strip>;
19
+ export type HubspotCreateContactOutput = HubspotRecord;
20
+ export declare const hubspotUpdateContactInput: z.ZodObject<{
21
+ id: z.ZodString;
22
+ properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
23
+ }, z.core.$strip>;
24
+ export type HubspotUpdateContactInput = z.infer<typeof hubspotUpdateContactInput>;
25
+ export declare const hubspotUpdateContactOutput: z.ZodObject<{
26
+ id: z.ZodString;
27
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
28
+ }, z.core.$strip>;
29
+ export type HubspotUpdateContactOutput = HubspotRecord;
30
+ export declare const hubspotGetContactInput: z.ZodObject<{
31
+ id: z.ZodString;
32
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ }, z.core.$strip>;
34
+ export type HubspotGetContactInput = z.infer<typeof hubspotGetContactInput>;
35
+ export declare const hubspotGetContactOutput: z.ZodObject<{
36
+ id: z.ZodString;
37
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
38
+ }, z.core.$strip>;
39
+ export type HubspotGetContactOutput = HubspotRecord;
40
+ export declare const hubspotSearchContactsInput: z.ZodObject<{
41
+ query: z.ZodString;
42
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ after: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>;
45
+ export type HubspotSearchContactsInput = z.infer<typeof hubspotSearchContactsInput>;
46
+ export declare const hubspotSearchContactsOutput: z.ZodObject<{
47
+ total: z.ZodNumber;
48
+ results: z.ZodArray<z.ZodObject<{
49
+ id: z.ZodString;
50
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
51
+ }, z.core.$strip>>;
52
+ after: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>;
54
+ export type HubspotSearchContactsOutput = z.infer<typeof hubspotSearchContactsOutput>;
55
+ export declare const hubspotUpsertContactInput: z.ZodObject<{
56
+ email: z.ZodString;
57
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
58
+ }, z.core.$strip>;
59
+ export type HubspotUpsertContactInput = z.infer<typeof hubspotUpsertContactInput>;
60
+ export declare const hubspotUpsertContactOutput: z.ZodObject<{
61
+ ok: z.ZodLiteral<true>;
62
+ id: z.ZodString;
63
+ created: z.ZodBoolean;
64
+ }, z.core.$strip>;
65
+ export type HubspotUpsertContactOutput = z.infer<typeof hubspotUpsertContactOutput>;
66
+ export declare const hubspotCreateDealInput: z.ZodObject<{
67
+ properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
68
+ contactId: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>;
70
+ export type HubspotCreateDealInput = z.infer<typeof hubspotCreateDealInput>;
71
+ export declare const hubspotCreateDealOutput: z.ZodObject<{
72
+ id: z.ZodString;
73
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
74
+ }, z.core.$strip>;
75
+ export type HubspotCreateDealOutput = HubspotRecord;
76
+ export declare const hubspotUpdateDealInput: z.ZodObject<{
77
+ id: z.ZodString;
78
+ properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
79
+ }, z.core.$strip>;
80
+ export type HubspotUpdateDealInput = z.infer<typeof hubspotUpdateDealInput>;
81
+ export declare const hubspotUpdateDealOutput: z.ZodObject<{
82
+ id: z.ZodString;
83
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
84
+ }, z.core.$strip>;
85
+ export type HubspotUpdateDealOutput = HubspotRecord;
86
+ export declare const hubspotGetDealInput: z.ZodObject<{
87
+ id: z.ZodString;
88
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ }, z.core.$strip>;
90
+ export type HubspotGetDealInput = z.infer<typeof hubspotGetDealInput>;
91
+ export declare const hubspotGetDealOutput: z.ZodObject<{
92
+ id: z.ZodString;
93
+ properties: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
94
+ }, z.core.$strip>;
95
+ export type HubspotGetDealOutput = HubspotRecord;
96
+ export declare const hubspotGetAssociatedDealsInput: z.ZodObject<{
97
+ contactId: z.ZodString;
98
+ }, z.core.$strip>;
99
+ export type HubspotGetAssociatedDealsInput = z.infer<typeof hubspotGetAssociatedDealsInput>;
100
+ export declare const hubspotAssociationListOutput: z.ZodObject<{
101
+ results: z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>;
105
+ export type HubspotAssociationListOutput = z.infer<typeof hubspotAssociationListOutput>;
106
+ export declare const hubspotGetAssociatedContactsInput: z.ZodObject<{
107
+ dealId: z.ZodString;
108
+ }, z.core.$strip>;
109
+ export type HubspotGetAssociatedContactsInput = z.infer<typeof hubspotGetAssociatedContactsInput>;
110
+ export declare const hubspotGetOwnerInput: z.ZodObject<{
111
+ id: z.ZodString;
112
+ }, z.core.$strip>;
113
+ export type HubspotGetOwnerInput = z.infer<typeof hubspotGetOwnerInput>;
114
+ export declare const hubspotGetOwnerOutput: z.ZodObject<{
115
+ id: z.ZodString;
116
+ email: z.ZodNullable<z.ZodString>;
117
+ firstName: z.ZodNullable<z.ZodString>;
118
+ lastName: z.ZodNullable<z.ZodString>;
119
+ }, z.core.$strip>;
120
+ export type HubspotGetOwnerOutput = z.infer<typeof hubspotGetOwnerOutput>;
121
+ export declare const hubspotCreateNoteInput: z.ZodObject<{
122
+ contactId: z.ZodString;
123
+ body: z.ZodString;
124
+ }, z.core.$strip>;
125
+ export type HubspotCreateNoteInput = z.infer<typeof hubspotCreateNoteInput>;
126
+ export declare const hubspotEngagementOutput: z.ZodObject<{
127
+ id: z.ZodString;
128
+ }, z.core.$strip>;
129
+ export type HubspotEngagementOutput = z.infer<typeof hubspotEngagementOutput>;
130
+ export declare const hubspotLogCallInput: z.ZodObject<{
131
+ to: z.ZodObject<{
132
+ kind: z.ZodEnum<{
133
+ contact: "contact";
134
+ deal: "deal";
135
+ }>;
136
+ id: z.ZodString;
137
+ }, z.core.$strip>;
138
+ direction: z.ZodEnum<{
139
+ INBOUND: "INBOUND";
140
+ OUTBOUND: "OUTBOUND";
141
+ }>;
142
+ timestamp: z.ZodNumber;
143
+ title: z.ZodOptional<z.ZodString>;
144
+ body: z.ZodOptional<z.ZodString>;
145
+ recordingUrl: z.ZodOptional<z.ZodString>;
146
+ status: z.ZodOptional<z.ZodEnum<{
147
+ BUSY: "BUSY";
148
+ CALLING_CRM_USER: "CALLING_CRM_USER";
149
+ CANCELED: "CANCELED";
150
+ COMPLETED: "COMPLETED";
151
+ CONNECTING: "CONNECTING";
152
+ FAILED: "FAILED";
153
+ IN_PROGRESS: "IN_PROGRESS";
154
+ NO_ANSWER: "NO_ANSWER";
155
+ QUEUED: "QUEUED";
156
+ RINGING: "RINGING";
157
+ }>>;
158
+ }, z.core.$strip>;
159
+ export type HubspotLogCallInput = z.infer<typeof hubspotLogCallInput>;
160
+ export declare const hubspotLogEmailInput: z.ZodObject<{
161
+ to: z.ZodObject<{
162
+ kind: z.ZodEnum<{
163
+ contact: "contact";
164
+ deal: "deal";
165
+ }>;
166
+ id: z.ZodString;
167
+ }, z.core.$strip>;
168
+ direction: z.ZodEnum<{
169
+ EMAIL: "EMAIL";
170
+ FORWARDED_EMAIL: "FORWARDED_EMAIL";
171
+ INCOMING_EMAIL: "INCOMING_EMAIL";
172
+ }>;
173
+ subject: z.ZodString;
174
+ body: z.ZodString;
175
+ timestamp: z.ZodNumber;
176
+ }, z.core.$strip>;
177
+ export type HubspotLogEmailInput = z.infer<typeof hubspotLogEmailInput>;
178
+ export declare const hubspotLogSmsInput: z.ZodObject<{
179
+ to: z.ZodObject<{
180
+ kind: z.ZodEnum<{
181
+ contact: "contact";
182
+ deal: "deal";
183
+ }>;
184
+ id: z.ZodString;
185
+ }, z.core.$strip>;
186
+ message: z.ZodString;
187
+ timestamp: z.ZodNumber;
188
+ prefix: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ export type HubspotLogSmsInput = z.infer<typeof hubspotLogSmsInput>;
191
+ export declare const hubspotCreateTaskInput: z.ZodObject<{
192
+ to: z.ZodObject<{
193
+ kind: z.ZodEnum<{
194
+ contact: "contact";
195
+ deal: "deal";
196
+ }>;
197
+ id: z.ZodString;
198
+ }, z.core.$strip>;
199
+ title: z.ZodString;
200
+ description: z.ZodString;
201
+ dueAt: z.ZodNumber;
202
+ ownerId: z.ZodString;
203
+ priority: z.ZodEnum<{
204
+ HIGH: "HIGH";
205
+ LOW: "LOW";
206
+ MEDIUM: "MEDIUM";
207
+ }>;
208
+ status: z.ZodEnum<{
209
+ COMPLETED: "COMPLETED";
210
+ DEFERRED: "DEFERRED";
211
+ IN_PROGRESS: "IN_PROGRESS";
212
+ NOT_STARTED: "NOT_STARTED";
213
+ WAITING: "WAITING";
214
+ }>;
215
+ }, z.core.$strip>;
216
+ export type HubspotCreateTaskInput = z.infer<typeof hubspotCreateTaskInput>;
217
+ export declare const hubspotGetCrmUrlInput: z.ZodObject<{
218
+ type: z.ZodEnum<{
219
+ call: "call";
220
+ contact: "contact";
221
+ }>;
222
+ id: z.ZodString;
223
+ }, z.core.$strip>;
224
+ export type HubspotGetCrmUrlInput = z.infer<typeof hubspotGetCrmUrlInput>;
225
+ export declare const hubspotGetCrmUrlOutput: z.ZodObject<{
226
+ url: z.ZodString;
227
+ }, z.core.$strip>;
228
+ export type HubspotGetCrmUrlOutput = z.infer<typeof hubspotGetCrmUrlOutput>;
229
+ export type HubspotService = {
230
+ createContact(input: HubspotCreateContactInput): Promise<HubspotCreateContactOutput>;
231
+ updateContact(input: HubspotUpdateContactInput): Promise<HubspotUpdateContactOutput>;
232
+ getContact(input: HubspotGetContactInput): Promise<HubspotGetContactOutput>;
233
+ searchContacts(input: HubspotSearchContactsInput): Promise<HubspotSearchContactsOutput>;
234
+ upsertContact(input: HubspotUpsertContactInput): Promise<HubspotUpsertContactOutput>;
235
+ createDeal(input: HubspotCreateDealInput): Promise<HubspotCreateDealOutput>;
236
+ updateDeal(input: HubspotUpdateDealInput): Promise<HubspotUpdateDealOutput>;
237
+ getDeal(input: HubspotGetDealInput): Promise<HubspotGetDealOutput>;
238
+ getAssociatedDeals(input: HubspotGetAssociatedDealsInput): Promise<HubspotAssociationListOutput>;
239
+ getAssociatedContacts(input: HubspotGetAssociatedContactsInput): Promise<HubspotAssociationListOutput>;
240
+ getOwner(input: HubspotGetOwnerInput): Promise<HubspotGetOwnerOutput>;
241
+ createNote(input: HubspotCreateNoteInput): Promise<HubspotEngagementOutput>;
242
+ logCall(input: HubspotLogCallInput): Promise<HubspotEngagementOutput>;
243
+ logEmail(input: HubspotLogEmailInput): Promise<HubspotEngagementOutput>;
244
+ logSms(input: HubspotLogSmsInput): Promise<HubspotEngagementOutput>;
245
+ createTask(input: HubspotCreateTaskInput): Promise<HubspotEngagementOutput>;
246
+ getCrmUrl(input: HubspotGetCrmUrlInput): Promise<HubspotGetCrmUrlOutput>;
247
+ };
248
+ export declare const hubspotMockService: HubspotService;
249
+ export type HubspotApi = IntegrationAccountFields & HubspotService;
250
+ //# sourceMappingURL=hubspot.d.ts.map
@@ -0,0 +1,191 @@
1
+ import { z } from 'zod';
2
+ export const hubspotPropertyValue = z.union([z.string(), z.number(), z.boolean()]);
3
+ export const hubspotPropertiesInput = z.record(z.string(), hubspotPropertyValue);
4
+ export const hubspotPropertiesOutput = z.record(z.string(), z.string().nullable());
5
+ export const hubspotRecord = z.object({
6
+ id: z.string(),
7
+ properties: hubspotPropertiesOutput,
8
+ });
9
+ export const hubspotCreateContactInput = z.object({
10
+ properties: hubspotPropertiesInput,
11
+ });
12
+ export const hubspotCreateContactOutput = hubspotRecord;
13
+ export const hubspotUpdateContactInput = z.object({
14
+ id: z.string(),
15
+ properties: hubspotPropertiesInput,
16
+ });
17
+ export const hubspotUpdateContactOutput = hubspotRecord;
18
+ export const hubspotGetContactInput = z.object({
19
+ id: z.string(),
20
+ properties: z.array(z.string()).optional(),
21
+ });
22
+ export const hubspotGetContactOutput = hubspotRecord;
23
+ export const hubspotSearchContactsInput = z.object({
24
+ query: z.string(),
25
+ properties: z.array(z.string()).optional(),
26
+ after: z.string().optional(),
27
+ });
28
+ export const hubspotSearchContactsOutput = z.object({
29
+ total: z.number(),
30
+ results: z.array(hubspotRecord),
31
+ after: z.string().optional(),
32
+ });
33
+ export const hubspotUpsertContactInput = z.object({
34
+ email: z.string(),
35
+ properties: hubspotPropertiesInput.optional(),
36
+ });
37
+ export const hubspotUpsertContactOutput = z.object({
38
+ ok: z.literal(true),
39
+ id: z.string(),
40
+ created: z.boolean(),
41
+ });
42
+ export const hubspotCreateDealInput = z.object({
43
+ properties: hubspotPropertiesInput,
44
+ contactId: z.string().optional(),
45
+ });
46
+ export const hubspotCreateDealOutput = hubspotRecord;
47
+ export const hubspotUpdateDealInput = z.object({
48
+ id: z.string(),
49
+ properties: hubspotPropertiesInput,
50
+ });
51
+ export const hubspotUpdateDealOutput = hubspotRecord;
52
+ export const hubspotGetDealInput = z.object({
53
+ id: z.string(),
54
+ properties: z.array(z.string()).optional(),
55
+ });
56
+ export const hubspotGetDealOutput = hubspotRecord;
57
+ export const hubspotGetAssociatedDealsInput = z.object({
58
+ contactId: z.string(),
59
+ });
60
+ export const hubspotAssociationListOutput = z.object({
61
+ results: z.array(z.object({ id: z.string() })),
62
+ });
63
+ export const hubspotGetAssociatedContactsInput = z.object({
64
+ dealId: z.string(),
65
+ });
66
+ export const hubspotGetOwnerInput = z.object({
67
+ id: z.string(),
68
+ });
69
+ export const hubspotGetOwnerOutput = z.object({
70
+ id: z.string(),
71
+ email: z.string().nullable(),
72
+ firstName: z.string().nullable(),
73
+ lastName: z.string().nullable(),
74
+ });
75
+ export const hubspotCreateNoteInput = z.object({
76
+ contactId: z.string(),
77
+ body: z.string(),
78
+ });
79
+ export const hubspotEngagementOutput = z.object({
80
+ id: z.string(),
81
+ });
82
+ const hubspotAssociateTo = z.object({
83
+ kind: z.enum(['contact', 'deal']),
84
+ id: z.string(),
85
+ });
86
+ export const hubspotLogCallInput = z.object({
87
+ to: hubspotAssociateTo,
88
+ direction: z.enum(['INBOUND', 'OUTBOUND']),
89
+ timestamp: z.number(),
90
+ title: z.string().optional(),
91
+ body: z.string().optional(),
92
+ recordingUrl: z.string().optional(),
93
+ status: z
94
+ .enum([
95
+ 'BUSY',
96
+ 'CALLING_CRM_USER',
97
+ 'CANCELED',
98
+ 'COMPLETED',
99
+ 'CONNECTING',
100
+ 'FAILED',
101
+ 'IN_PROGRESS',
102
+ 'NO_ANSWER',
103
+ 'QUEUED',
104
+ 'RINGING',
105
+ ])
106
+ .optional(),
107
+ });
108
+ export const hubspotLogEmailInput = z.object({
109
+ to: hubspotAssociateTo,
110
+ direction: z.enum(['EMAIL', 'INCOMING_EMAIL', 'FORWARDED_EMAIL']),
111
+ subject: z.string(),
112
+ body: z.string(),
113
+ timestamp: z.number(),
114
+ });
115
+ export const hubspotLogSmsInput = z.object({
116
+ to: hubspotAssociateTo,
117
+ message: z.string(),
118
+ timestamp: z.number(),
119
+ prefix: z.string().optional(),
120
+ });
121
+ export const hubspotCreateTaskInput = z.object({
122
+ to: hubspotAssociateTo,
123
+ title: z.string(),
124
+ description: z.string(),
125
+ dueAt: z.number(),
126
+ ownerId: z.string(),
127
+ priority: z.enum(['HIGH', 'MEDIUM', 'LOW']),
128
+ status: z.enum(['NOT_STARTED', 'IN_PROGRESS', 'WAITING', 'COMPLETED', 'DEFERRED']),
129
+ });
130
+ export const hubspotGetCrmUrlInput = z.object({
131
+ type: z.enum(['contact', 'call']),
132
+ id: z.string(),
133
+ });
134
+ export const hubspotGetCrmUrlOutput = z.object({
135
+ url: z.string(),
136
+ });
137
+ const mockRecord = { id: 'mock-hs-1', properties: {} };
138
+ export const hubspotMockService = {
139
+ async createContact() {
140
+ return mockRecord;
141
+ },
142
+ async updateContact() {
143
+ return mockRecord;
144
+ },
145
+ async getContact() {
146
+ return mockRecord;
147
+ },
148
+ async searchContacts() {
149
+ return { total: 0, results: [] };
150
+ },
151
+ async upsertContact() {
152
+ return { ok: true, id: 'mock-hs-1', created: true };
153
+ },
154
+ async createDeal() {
155
+ return mockRecord;
156
+ },
157
+ async updateDeal() {
158
+ return mockRecord;
159
+ },
160
+ async getDeal() {
161
+ return mockRecord;
162
+ },
163
+ async getAssociatedDeals() {
164
+ return { results: [] };
165
+ },
166
+ async getAssociatedContacts() {
167
+ return { results: [] };
168
+ },
169
+ async getOwner() {
170
+ return { id: 'mock-owner', email: null, firstName: null, lastName: null };
171
+ },
172
+ async createNote() {
173
+ return { id: 'mock-note' };
174
+ },
175
+ async logCall() {
176
+ return { id: 'mock-call' };
177
+ },
178
+ async logEmail() {
179
+ return { id: 'mock-email' };
180
+ },
181
+ async logSms() {
182
+ return { id: 'mock-sms' };
183
+ },
184
+ async createTask() {
185
+ return { id: 'mock-task' };
186
+ },
187
+ async getCrmUrl() {
188
+ return { url: 'https://app.hubspot.com/contacts/0/record/0-1/mock-hs-1' };
189
+ },
190
+ };
191
+ //# sourceMappingURL=hubspot.js.map
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Every platform API surface. Registering one here is what makes it appear on `ctx.api`,
3
+ * routable over RPC, and present in fake contexts — there is no second place to update.
4
+ */
5
+ export declare const platformSurfaces: {
6
+ contact: {
7
+ methods: {
8
+ list: {
9
+ input: import("zod").ZodObject<{
10
+ offset: import("zod").ZodNumber;
11
+ limit: import("zod").ZodNumber;
12
+ phone: import("zod").ZodOptional<import("zod").ZodString>;
13
+ email: import("zod").ZodOptional<import("zod").ZodString>;
14
+ }, import("zod/v4/core").$strip>;
15
+ output: import("zod").ZodObject<{
16
+ contacts: import("zod").ZodArray<import("zod").ZodObject<{
17
+ id: import("zod").ZodString;
18
+ kind: import("zod").ZodString;
19
+ externalIdentifier: import("zod").ZodNullable<import("zod").ZodString>;
20
+ phone: import("zod").ZodNullable<import("zod").ZodString>;
21
+ createdAt: import("zod").ZodString;
22
+ }, import("zod/v4/core").$strip>>;
23
+ offset: import("zod").ZodNumber;
24
+ limit: import("zod").ZodNumber;
25
+ }, import("zod/v4/core").$strip>;
26
+ };
27
+ };
28
+ mock: import("./contact.js").ContactApi;
29
+ };
30
+ db: {
31
+ methods: {
32
+ get: {
33
+ input: import("zod").ZodObject<{
34
+ key: import("zod").ZodString;
35
+ }, import("zod/v4/core").$strip>;
36
+ output: import("zod").ZodObject<{
37
+ value: import("zod").ZodNullable<import("zod").ZodString>;
38
+ }, import("zod/v4/core").$strip>;
39
+ };
40
+ set: {
41
+ input: import("zod").ZodObject<{
42
+ key: import("zod").ZodString;
43
+ value: import("zod").ZodString;
44
+ ttlSeconds: import("zod").ZodOptional<import("zod").ZodNumber>;
45
+ }, import("zod/v4/core").$strip>;
46
+ output: import("zod").ZodObject<{
47
+ ok: import("zod").ZodLiteral<true>;
48
+ }, import("zod/v4/core").$strip>;
49
+ };
50
+ del: {
51
+ input: import("zod").ZodObject<{
52
+ key: import("zod").ZodString;
53
+ }, import("zod/v4/core").$strip>;
54
+ output: import("zod").ZodObject<{
55
+ deleted: import("zod").ZodBoolean;
56
+ }, import("zod/v4/core").$strip>;
57
+ };
58
+ };
59
+ mock: import("./db.js").DbApi;
60
+ };
61
+ };
62
+ export type PlatformSurfaceKey = keyof typeof platformSurfaces;
63
+ /** The platform half of `ctx.api`, derived so the registry stays the only source of truth. */
64
+ export type PlatformApis = {
65
+ [K in PlatformSurfaceKey]: (typeof platformSurfaces)[K]['mock'];
66
+ };
67
+ //# sourceMappingURL=platform-registry.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { contactSurface } from './contact.js';
2
+ import { dbSurface } from './db.js';
3
+ /**
4
+ * Every platform API surface. Registering one here is what makes it appear on `ctx.api`,
5
+ * routable over RPC, and present in fake contexts — there is no second place to update.
6
+ */
7
+ export const platformSurfaces = {
8
+ contact: contactSurface,
9
+ db: dbSurface,
10
+ };
11
+ //# sourceMappingURL=platform-registry.js.map
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Platform APIs (contact, company, case, ...) differ from integration APIs: their method set is
4
+ * fixed by this codebase rather than by whichever provider a sequence happens to be bound to.
5
+ * That makes them describable by a compile-time table, which drives RPC dispatch, server-side
6
+ * validation, the client stub and the fake context — so a new method is declared exactly once.
7
+ *
8
+ * Methods take a single params object; use `z.object({})` for the ones that need no input.
9
+ */
10
+ export type PlatformApiShape = Record<string, (input: never) => Promise<unknown>>;
11
+ export type PlatformSurface<TApi extends PlatformApiShape> = {
12
+ methods: {
13
+ [K in keyof TApi]: {
14
+ input: z.ZodType<Parameters<TApi[K]>[0]>;
15
+ output: z.ZodType<Awaited<ReturnType<TApi[K]>>>;
16
+ };
17
+ };
18
+ /** Stand-in used by fake contexts; its key set is also the surface's method list. */
19
+ mock: TApi;
20
+ };
21
+ /** Type-erased view used by registries and generic plumbing. */
22
+ export type AnyPlatformSurface = {
23
+ methods: Record<string, {
24
+ input: z.ZodType;
25
+ output: z.ZodType;
26
+ }>;
27
+ mock: Record<string, (...args: never[]) => Promise<unknown>>;
28
+ };
29
+ /** Server-side implementation of one surface, checked against the surface's declared types. */
30
+ export type PlatformImpl<TApi extends PlatformApiShape, TCtx> = {
31
+ [K in keyof TApi]: (ctx: TCtx, input: Parameters<TApi[K]>[0]) => ReturnType<TApi[K]>;
32
+ };
33
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ import type { IntegrationAccountFields } from './account-fields.js';
3
+ export declare const twilioSendSmsInput: z.ZodObject<{
4
+ to: z.ZodString;
5
+ body: z.ZodString;
6
+ from: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type TwilioSendSmsInput = z.infer<typeof twilioSendSmsInput>;
9
+ export declare const twilioSendSmsOutput: z.ZodObject<{
10
+ ok: z.ZodLiteral<true>;
11
+ sid: z.ZodString;
12
+ status: z.ZodNullable<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export type TwilioSendSmsOutput = z.infer<typeof twilioSendSmsOutput>;
15
+ export declare const twilioCreateCallInput: z.ZodObject<{
16
+ to: z.ZodString;
17
+ from: z.ZodString;
18
+ url: z.ZodOptional<z.ZodString>;
19
+ twiml: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type TwilioCreateCallInput = z.infer<typeof twilioCreateCallInput>;
22
+ export declare const twilioCreateCallOutput: z.ZodObject<{
23
+ ok: z.ZodLiteral<true>;
24
+ sid: z.ZodString;
25
+ status: z.ZodNullable<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ export type TwilioCreateCallOutput = z.infer<typeof twilioCreateCallOutput>;
28
+ export declare const twilioIncomingNumber: z.ZodObject<{
29
+ sid: z.ZodString;
30
+ phoneNumber: z.ZodString;
31
+ friendlyName: z.ZodString;
32
+ status: z.ZodString;
33
+ }, z.core.$strip>;
34
+ export type TwilioIncomingNumber = z.infer<typeof twilioIncomingNumber>;
35
+ export declare const twilioListIncomingNumbersOutput: z.ZodArray<z.ZodObject<{
36
+ sid: z.ZodString;
37
+ phoneNumber: z.ZodString;
38
+ friendlyName: z.ZodString;
39
+ status: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ export type TwilioListIncomingNumbersOutput = z.infer<typeof twilioListIncomingNumbersOutput>;
42
+ export type TwilioService = {
43
+ sendSms(input: TwilioSendSmsInput): Promise<TwilioSendSmsOutput>;
44
+ createCall(input: TwilioCreateCallInput): Promise<TwilioCreateCallOutput>;
45
+ listIncomingNumbers(): Promise<TwilioListIncomingNumbersOutput>;
46
+ };
47
+ /** Stand-in surface for fake contexts and local runs; never reaches Twilio. */
48
+ export declare const twilioMockService: TwilioService;
49
+ export type TwilioApi = IntegrationAccountFields & TwilioService;
50
+ //# sourceMappingURL=twilio.d.ts.map
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ export const twilioSendSmsInput = z.object({
3
+ to: z.string(),
4
+ body: z.string(),
5
+ from: z.string().optional(),
6
+ });
7
+ export const twilioSendSmsOutput = z.object({
8
+ ok: z.literal(true),
9
+ sid: z.string(),
10
+ status: z.string().nullable(),
11
+ });
12
+ export const twilioCreateCallInput = z.object({
13
+ to: z.string(),
14
+ from: z.string(),
15
+ url: z.string().optional(),
16
+ twiml: z.string().optional(),
17
+ });
18
+ export const twilioCreateCallOutput = z.object({
19
+ ok: z.literal(true),
20
+ sid: z.string(),
21
+ status: z.string().nullable(),
22
+ });
23
+ export const twilioIncomingNumber = z.object({
24
+ sid: z.string(),
25
+ phoneNumber: z.string(),
26
+ friendlyName: z.string(),
27
+ status: z.string(),
28
+ });
29
+ export const twilioListIncomingNumbersOutput = z.array(twilioIncomingNumber);
30
+ /** Stand-in surface for fake contexts and local runs; never reaches Twilio. */
31
+ export const twilioMockService = {
32
+ async sendSms() {
33
+ return { ok: true, sid: 'SM-mock', status: 'queued' };
34
+ },
35
+ async createCall() {
36
+ return { ok: true, sid: 'CA-mock', status: 'queued' };
37
+ },
38
+ async listIncomingNumbers() {
39
+ return [];
40
+ },
41
+ };
42
+ //# sourceMappingURL=twilio.js.map