@useairfoil/producer-hubspot 0.0.2 → 0.0.3
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.
- package/LICENSE.txt +201 -0
- package/dist/index.mjs +1 -1
- package/dist/main.mjs +6 -4
- package/dist/main.mjs.map +1 -1
- package/dist/{src-NlJCpnba.mjs → src-DrpeP9_I.mjs} +83 -88
- package/dist/src-DrpeP9_I.mjs.map +1 -0
- package/package.json +17 -17
- package/src/create-table.ts +6 -1
- package/src/main.ts +8 -2
- package/src/schemas/crm.ts +34 -22
- package/src/schemas/lists.ts +23 -11
- package/src/schemas/owners.ts +27 -15
- package/src/schemas/pipelines.ts +38 -18
- package/src/schemas/properties.ts +53 -25
- package/src/schemas/shared.ts +7 -19
- package/src/schemas/teams.ts +18 -8
- package/src/start.ts +2 -2
- package/dist/src-NlJCpnba.mjs.map +0 -1
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 GNC Labs Limited
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
193
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
194
|
+
License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
199
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
200
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
201
|
+
specific language governing permissions and limitations under the License.
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { manifest } from "./manifest.mjs";
|
|
2
|
-
import { A as PostalMailSchema, C as GoalTargetSchema, D as MeetingSchema, E as LineItemSchema, F as TaxSchema, I as TicketSchema, L as UserSchema, M as QuoteSchema, N as SubscriptionSchema, O as NoteSchema, P as TaskSchema, R as client_exports, S as FeedbackSubmissionSchema, T as LeadSchema, _ as DealSchema, a as TeamSchema, b as EmailSchema, c as OwnerSchema, d as CartSchema, f as CommercePaymentSchema, g as CustomObjectSchema, h as ContactSchema, i as webhookPath, j as ProductSchema, k as OrderSchema, l as ListSchema, m as CompanySchema, n as connector_exports, o as PropertySchema, p as CommunicationSchema, s as PipelineSchema, u as CallSchema, v as DealSplitSchema, w as InvoiceSchema, x as FeeSchema, y as DiscountSchema } from "./src-
|
|
2
|
+
import { A as PostalMailSchema, C as GoalTargetSchema, D as MeetingSchema, E as LineItemSchema, F as TaxSchema, I as TicketSchema, L as UserSchema, M as QuoteSchema, N as SubscriptionSchema, O as NoteSchema, P as TaskSchema, R as client_exports, S as FeedbackSubmissionSchema, T as LeadSchema, _ as DealSchema, a as TeamSchema, b as EmailSchema, c as OwnerSchema, d as CartSchema, f as CommercePaymentSchema, g as CustomObjectSchema, h as ContactSchema, i as webhookPath, j as ProductSchema, k as OrderSchema, l as ListSchema, m as CompanySchema, n as connector_exports, o as PropertySchema, p as CommunicationSchema, s as PipelineSchema, u as CallSchema, v as DealSplitSchema, w as InvoiceSchema, x as FeeSchema, y as DiscountSchema } from "./src-DrpeP9_I.mjs";
|
|
3
3
|
export { CallSchema, CartSchema, CommercePaymentSchema, CommunicationSchema, CompanySchema, ContactSchema, CustomObjectSchema, DealSchema, DealSplitSchema, DiscountSchema, EmailSchema, FeeSchema, FeedbackSubmissionSchema, GoalTargetSchema, client_exports as HubSpotClient, connector_exports as HubSpotConnector, InvoiceSchema, LeadSchema, LineItemSchema, ListSchema, MeetingSchema, NoteSchema, OrderSchema, OwnerSchema, PipelineSchema, PostalMailSchema, ProductSchema, PropertySchema, QuoteSchema, SubscriptionSchema, TaskSchema, TaxSchema, TeamSchema, TicketSchema, UserSchema, manifest, webhookPath };
|
package/dist/main.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { HubSpotConfigDef } from "./manifest.mjs";
|
|
3
|
-
import { A as PostalMailSchema, C as GoalTargetSchema, D as MeetingSchema, E as LineItemSchema, F as TaxSchema, I as TicketSchema, L as UserSchema, M as QuoteSchema, N as SubscriptionSchema, O as NoteSchema, P as TaskSchema, S as FeedbackSubmissionSchema, T as LeadSchema, _ as DealSchema, a as TeamSchema, b as EmailSchema, c as OwnerSchema, d as CartSchema, f as CommercePaymentSchema, g as CustomObjectSchema, h as ContactSchema, j as ProductSchema, k as OrderSchema, l as ListSchema, m as CompanySchema, o as PropertySchema, p as CommunicationSchema, r as layerConfig, s as PipelineSchema, t as HubSpotConnector, u as CallSchema, v as DealSplitSchema, w as InvoiceSchema, x as FeeSchema, y as DiscountSchema } from "./src-
|
|
3
|
+
import { A as PostalMailSchema, C as GoalTargetSchema, D as MeetingSchema, E as LineItemSchema, F as TaxSchema, I as TicketSchema, L as UserSchema, M as QuoteSchema, N as SubscriptionSchema, O as NoteSchema, P as TaskSchema, S as FeedbackSubmissionSchema, T as LeadSchema, _ as DealSchema, a as TeamSchema, b as EmailSchema, c as OwnerSchema, d as CartSchema, f as CommercePaymentSchema, g as CustomObjectSchema, h as ContactSchema, j as ProductSchema, k as OrderSchema, l as ListSchema, m as CompanySchema, o as PropertySchema, p as CommunicationSchema, r as layerConfig, s as PipelineSchema, t as HubSpotConnector, u as CallSchema, v as DealSplitSchema, w as InvoiceSchema, x as FeeSchema, y as DiscountSchema } from "./src-DrpeP9_I.mjs";
|
|
4
4
|
import { ConnectorApp, Demo, Ingestor, RuntimeConfig, StateStore, Telemetry } from "@useairfoil/connector-kit";
|
|
5
5
|
import { Config, Duration, Effect, Layer, Logger, Schema } from "effect";
|
|
6
6
|
import { FetchHttpClient } from "effect/http";
|
|
@@ -8,7 +8,7 @@ import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
|
8
8
|
import { Command } from "effect/cli";
|
|
9
9
|
import { PgClient } from "@effect/sql-pg";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "0.0.
|
|
11
|
+
var version = "0.0.3";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/tables.ts
|
|
14
14
|
const tableSchemas = {
|
|
@@ -49,6 +49,7 @@ const tableSchemas = {
|
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/create-table.ts
|
|
51
51
|
const createTableCommand = ConnectorApp.makeCreateTableCommand(tableSchemas);
|
|
52
|
+
const setupCommand = ConnectorApp.makeSetupCommand(tableSchemas).pipe(Command.provide(RuntimeConfig.layerHosted()));
|
|
52
53
|
//#endregion
|
|
53
54
|
//#region src/demo/shared.ts
|
|
54
55
|
const hour = Duration.toMillis(Duration.hours(1));
|
|
@@ -1304,12 +1305,13 @@ const StateStoreLayer = StateStore.layerSql().pipe(Layer.provide(PostgresLayer))
|
|
|
1304
1305
|
const startCommand = Command.make("start", {}, () => Effect.gen(function* () {
|
|
1305
1306
|
const port = yield* RuntimeConfig.httpPort;
|
|
1306
1307
|
const entrypoint = yield* HubSpotConnector;
|
|
1307
|
-
return yield* ConnectorApp.start(entrypoint, { port }).pipe(Effect.provide(Ingestor.
|
|
1308
|
-
}).pipe(Effect.annotateLogs({ component: "hubspot" }), Effect.provide(Layer.mergeAll(StateStoreLayer, ConnectorLayer, Logger.layer([Logger.consolePretty()]), TelemetryLayer)), Effect.provide(RuntimeConfig.layerHosted()))).pipe(Command.withDescription("Run the
|
|
1308
|
+
return yield* ConnectorApp.start(entrypoint, { port }).pipe(Effect.provide(Ingestor.layerArrowFlightConfig(entrypoint)));
|
|
1309
|
+
}).pipe(Effect.annotateLogs({ component: "hubspot" }), Effect.provide(Layer.mergeAll(StateStoreLayer, ConnectorLayer, Logger.layer([Logger.consolePretty()]), TelemetryLayer)), Effect.provide(RuntimeConfig.layerHosted()))).pipe(Command.withDescription("Run the connector"));
|
|
1309
1310
|
//#endregion
|
|
1310
1311
|
//#region src/main.ts
|
|
1311
1312
|
const BootstrapLayer = Layer.mergeAll(FetchHttpClient.layer, NodeServices.layer);
|
|
1312
1313
|
const program = Command.make("producer-hubspot", {}, () => Effect.void).pipe(Command.withSubcommands([
|
|
1314
|
+
setupCommand,
|
|
1313
1315
|
startCommand,
|
|
1314
1316
|
sandboxCommand,
|
|
1315
1317
|
createTableCommand,
|
package/dist/main.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.mjs","names":["ConnectorLayer","HubSpotConnector.layerConfig","TelemetryLayer","HubSpotConnector.HubSpotConnector","HubSpotConnector.layerConfig","HubSpotConnector.HubSpotConnector","packageJson.version"],"sources":["../package.json","../src/tables.ts","../src/create-table.ts","../src/demo/shared.ts","../src/demo/activity.ts","../src/demo/deals.ts","../src/demo/companies.ts","../src/demo/setup.ts","../src/demo/index.ts","../src/sandbox.ts","../src/start.ts","../src/main.ts"],"sourcesContent":["","import type { Schema } from \"effect\";\n\nimport {\n CallSchema,\n CartSchema,\n CommercePaymentSchema,\n CommunicationSchema,\n CompanySchema,\n ContactSchema,\n CustomObjectSchema,\n DealSchema,\n DealSplitSchema,\n DiscountSchema,\n EmailSchema,\n FeeSchema,\n FeedbackSubmissionSchema,\n GoalTargetSchema,\n InvoiceSchema,\n LeadSchema,\n LineItemSchema,\n MeetingSchema,\n NoteSchema,\n OrderSchema,\n PostalMailSchema,\n ProductSchema,\n QuoteSchema,\n SubscriptionSchema,\n TaskSchema,\n TaxSchema,\n TicketSchema,\n UserSchema,\n} from \"./schemas/crm\";\nimport { ListSchema } from \"./schemas/lists\";\nimport { OwnerSchema } from \"./schemas/owners\";\nimport { PipelineSchema } from \"./schemas/pipelines\";\nimport { PropertySchema } from \"./schemas/properties\";\nimport { TeamSchema } from \"./schemas/teams\";\n\nexport const tableSchemas: Readonly<Record<string, Schema.Top>> = {\n contacts: ContactSchema,\n companies: CompanySchema,\n deals: DealSchema,\n tickets: TicketSchema,\n calls: CallSchema,\n emails: EmailSchema,\n meetings: MeetingSchema,\n notes: NoteSchema,\n tasks: TaskSchema,\n communications: CommunicationSchema,\n postal_mail: PostalMailSchema,\n feedback_submissions: FeedbackSubmissionSchema,\n line_items: LineItemSchema,\n products: ProductSchema,\n quotes: QuoteSchema,\n leads: LeadSchema,\n invoices: InvoiceSchema,\n orders: OrderSchema,\n carts: CartSchema,\n commerce_payments: CommercePaymentSchema,\n subscriptions: SubscriptionSchema,\n discounts: DiscountSchema,\n fees: FeeSchema,\n taxes: TaxSchema,\n goal_targets: GoalTargetSchema,\n users: UserSchema,\n deal_split: DealSplitSchema,\n custom_objects: CustomObjectSchema,\n owners: OwnerSchema,\n pipelines: PipelineSchema,\n properties: PropertySchema,\n teams: TeamSchema,\n lists: ListSchema,\n};\n","import { ConnectorApp } from \"@useairfoil/connector-kit\";\n\nimport { tableSchemas } from \"./tables\";\n\nexport const createTableCommand = ConnectorApp.makeCreateTableCommand(tableSchemas);\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { Duration } from \"effect\";\n\nimport type {\n Call,\n Cart,\n CommercePayment,\n Communication,\n Company,\n Contact,\n CustomObject,\n Deal,\n DealSplit,\n Email,\n FeedbackSubmission,\n Invoice,\n Lead,\n LineItem,\n Meeting,\n Note,\n Order,\n PostalMail,\n Quote,\n Subscription,\n Task,\n Ticket,\n} from \"../schemas/crm\";\n\nexport const hour = Duration.toMillis(Duration.hours(1));\nexport const day = Duration.toMillis(Duration.days(1));\nexport const ownerCount = 10;\n\n// HubSpot record IDs are numbers sent as text. Each object type gets its own range.\nexport const idOf = (base: number, index: number, n = 0) => String(base + index * 100 + n);\nexport const ownerId = (o: number) => String(70_000_000 + o);\nexport const userId = (o: number) => String(80_000_000 + o);\nexport const iso = (date: Date) => date.toISOString();\n\nexport const teams = [\"Sales East\", \"Sales West\", \"Customer Success\"] as const;\n\nexport const dealStages = [\n { id: \"appointmentscheduled\", label: \"Appointment scheduled\", probability: \"0.2\" },\n { id: \"qualifiedtobuy\", label: \"Qualified to buy\", probability: \"0.4\" },\n { id: \"presentationscheduled\", label: \"Presentation scheduled\", probability: \"0.6\" },\n { id: \"decisionmakerboughtin\", label: \"Decision maker bought in\", probability: \"0.8\" },\n { id: \"contractsent\", label: \"Contract sent\", probability: \"0.9\" },\n { id: \"closedwon\", label: \"Closed won\", probability: \"1.0\" },\n { id: \"closedlost\", label: \"Closed lost\", probability: \"0.0\" },\n] as const;\n\nexport const ticketStages = [\n { id: \"1\", label: \"New\", state: \"OPEN\" },\n { id: \"2\", label: \"Waiting on contact\", state: \"OPEN\" },\n { id: \"3\", label: \"Waiting on us\", state: \"OPEN\" },\n { id: \"4\", label: \"Closed\", state: \"CLOSED\" },\n] as const;\n\n// HubSpot's default lead pipeline uses these stage IDs.\nexport const leadStages = [\n { id: \"new-stage-id\", label: \"New\" },\n { id: \"attempting-stage-id\", label: \"Attempting\" },\n { id: \"connected-stage-id\", label: \"Connected\" },\n { id: \"qualified-stage-id\", label: \"Qualified\" },\n { id: \"unqualified-stage-id\", label: \"Disqualified\" },\n] as const;\n\n// Prices are yearly, in US dollars.\nexport const products = [\n { name: \"Starter plan\", sku: \"PLAN-STARTER\", price: 6000 },\n { name: \"Professional plan\", sku: \"PLAN-PRO\", price: 18000 },\n { name: \"Enterprise plan\", sku: \"PLAN-ENT\", price: 48000 },\n { name: \"Onboarding package\", sku: \"SVC-ONBOARD\", price: 5000 },\n { name: \"Premium support\", sku: \"SVC-SUPPORT\", price: 9000 },\n { name: \"Additional seats (10)\", sku: \"ADD-SEATS-10\", price: 3000 },\n] as const;\n\nexport const productId = (p: number) => String(3_000_000 + p);\n\nexport const customObjectTypeId = \"2-24512345\";\n\n/** One CRM record: the fields every table shares and its property map. */\nexport const record = (\n id: string,\n created: Date,\n updated: Date,\n now: Date,\n properties: Readonly<Record<string, string>>,\n) => ({\n id,\n // HubSpot rows use the fetch time as their version.\n version: now,\n created_at: created,\n updated_at: updated,\n _deleted: false,\n properties: new Map(\n Object.entries({\n hs_object_id: id,\n createdate: iso(created),\n hs_lastmodifieddate: iso(updated),\n ...properties,\n }),\n ),\n});\n\nexport type Rows = {\n readonly companies: Array<Company>;\n readonly contacts: Array<Contact>;\n readonly deals: Array<Deal>;\n readonly line_items: Array<LineItem>;\n readonly quotes: Array<Quote>;\n readonly deal_split: Array<DealSplit>;\n readonly tickets: Array<Ticket>;\n readonly calls: Array<Call>;\n readonly emails: Array<Email>;\n readonly meetings: Array<Meeting>;\n readonly notes: Array<Note>;\n readonly tasks: Array<Task>;\n readonly communications: Array<Communication>;\n readonly postal_mail: Array<PostalMail>;\n readonly feedback_submissions: Array<FeedbackSubmission>;\n readonly leads: Array<Lead>;\n readonly invoices: Array<Invoice>;\n readonly orders: Array<Order>;\n readonly carts: Array<Cart>;\n readonly commerce_payments: Array<CommercePayment>;\n readonly subscriptions: Array<Subscription>;\n readonly custom_objects: Array<CustomObject>;\n};\n\n/** Date helpers for one run. `at` keeps a time from going past now. */\nexport const clock = ({ faker, now }: Demo.DemoContext) => {\n const at = (time: number) => new Date(Math.min(time, now.getTime()));\n\n const between = (from: Date, to: Date) =>\n faker.date.between({ from, to: at(Math.max(from.getTime(), to.getTime())) });\n\n return { at, between };\n};\n\ntype CompanyContact = {\n readonly id: string;\n readonly first: string;\n readonly last: string;\n readonly email: string;\n readonly created: Date;\n};\n\nexport type DealPlan = {\n readonly id: string;\n readonly opened: Date;\n readonly stage: (typeof dealStages)[number];\n readonly closed: Date | null;\n readonly lines: ReadonlyArray<{ readonly p: number; readonly quantity: number }>;\n readonly amount: number;\n readonly won: boolean;\n};\n\n/** One company being built: the run's tools, its rows so far, and what its parts need to know. */\nexport type CompanyGroup = Demo.DemoContext &\n ReturnType<typeof clock> & {\n readonly rows: Rows;\n readonly index: number;\n readonly companyId: string;\n readonly name: string;\n readonly owner: number;\n readonly created: Date;\n readonly contacts: ReadonlyArray<CompanyContact>;\n readonly contactIds: ReadonlyArray<string>;\n readonly dealIds: ReadonlyArray<string>;\n readonly customer: boolean;\n readonly main: CompanyContact | undefined;\n };\n","import { type CompanyGroup, day, hour, idOf, iso, ownerId, record, ticketStages } from \"./shared\";\n\n/** Support tickets, for customers only. Returns their IDs. */\nexport const ticketRows = (company: CompanyGroup): Array<string> => {\n const { faker, now, at, between, rows, index, companyId, owner, created, customer, main } =\n company;\n\n return customer\n ? Array.from({ length: faker.number.int({ max: 3 }) }, (_, n) => {\n const opened = between(created, now);\n\n const stage = faker.helpers.weightedArrayElement([\n { weight: 70, value: ticketStages[3] },\n ...ticketStages.slice(0, 3).map((value) => ({ weight: 10, value })),\n ]);\n\n const closed =\n stage.state === \"CLOSED\"\n ? at(opened.getTime() + faker.number.int({ min: hour, max: 5 * day }))\n : null;\n\n const id = idOf(80_000_000_000, index, n);\n\n rows.tickets.push({\n ...record(id, opened, closed ?? opened, now, {\n subject: faker.helpers.arrayElement([\n \"Can't export report\",\n \"SSO login fails\",\n \"Question about invoice\",\n \"Feature request: bulk edit\",\n ]),\n content: \"Hi team, we ran into this today. Can you help?\",\n hs_pipeline: \"0\",\n hs_pipeline_stage: stage.id,\n hs_ticket_priority: faker.helpers.arrayElement([\"LOW\", \"MEDIUM\", \"HIGH\"]),\n hubspot_owner_id: ownerId(owner),\n ...(closed ? { closed_date: iso(closed) } : {}),\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [],\n });\n\n return id;\n })\n : [];\n};\n\n/** Calls, emails, meetings, notes, and other activity, tied to the company's records. */\nexport const activityRows = (company: CompanyGroup, tickets: ReadonlyArray<string>) => {\n const { faker, now, between, rows, index, companyId, name, owner, created, contacts, dealIds } =\n company;\n\n const activityCount = faker.number.int({ min: 2, max: 10 });\n\n for (let a = 0; a < activityCount; a++) {\n const when = between(created, now);\n const contact = faker.helpers.arrayElement(contacts);\n\n const links = {\n company_ids: [companyId],\n contact_ids: contact ? [contact.id] : [],\n deal_ids:\n dealIds.length > 0 && faker.datatype.boolean() ? [faker.helpers.arrayElement(dealIds)] : [],\n ticket_ids:\n tickets.length > 0 && faker.datatype.boolean({ probability: 0.3 })\n ? [faker.helpers.arrayElement(tickets)]\n : [],\n };\n\n const base = { hs_timestamp: iso(when), hubspot_owner_id: ownerId(owner) };\n const id = idOf(90_000_000_000, index, a);\n\n const kind = faker.helpers.weightedArrayElement([\n { weight: 30, value: \"email\" },\n { weight: 20, value: \"call\" },\n { weight: 15, value: \"meeting\" },\n { weight: 15, value: \"note\" },\n { weight: 15, value: \"task\" },\n { weight: 4, value: \"communication\" },\n { weight: 3, value: \"postal_mail\" },\n ] as const);\n\n switch (kind) {\n case \"email\":\n rows.emails.push({\n ...record(id, when, when, now, {\n ...base,\n hs_email_subject: faker.helpers.arrayElement([\n \"Following up\",\n \"Quick question\",\n \"Next steps\",\n \"Your trial\",\n ]),\n hs_email_direction: faker.helpers.arrayElement([\"EMAIL\", \"INCOMING_EMAIL\"]),\n hs_email_status: \"SENT\",\n hs_email_text: \"Thanks for your time today. Here is a summary of what we discussed.\",\n }),\n ...links,\n });\n\n break;\n case \"call\":\n rows.calls.push({\n ...record(id, when, when, now, {\n ...base,\n hs_call_title: `Call with ${contact?.first ?? name}`,\n hs_call_direction: faker.helpers.arrayElement([\"OUTBOUND\", \"INBOUND\"]),\n hs_call_duration: String(faker.number.int({ min: 60_000, max: 2_400_000 })),\n hs_call_status: \"COMPLETED\",\n hs_call_disposition: \"f240bbac-87c9-4f6e-bf70-924b57d47db7\",\n }),\n ...links,\n });\n\n break;\n case \"meeting\":\n rows.meetings.push({\n ...record(id, when, when, now, {\n ...base,\n hs_meeting_title: faker.helpers.arrayElement([\n \"Discovery call\",\n \"Product demo\",\n \"Quarterly review\",\n \"Onboarding kickoff\",\n ]),\n hs_meeting_start_time: iso(when),\n hs_meeting_end_time: iso(new Date(when.getTime() + hour / 2)),\n hs_meeting_outcome: when < now ? \"COMPLETED\" : \"SCHEDULED\",\n }),\n ...links,\n });\n\n break;\n case \"note\":\n rows.notes.push({\n ...record(id, when, when, now, {\n ...base,\n hs_note_body: faker.helpers.arrayElement([\n \"Budget approved for next quarter.\",\n \"They are comparing us with two other vendors.\",\n \"Champion moved teams, need a new contact.\",\n ]),\n }),\n ...links,\n });\n\n break;\n case \"task\":\n rows.tasks.push({\n ...record(id, when, when, now, {\n ...base,\n hs_task_subject: faker.helpers.arrayElement([\n \"Send proposal\",\n \"Follow up on pricing\",\n \"Book demo\",\n \"Check in after onboarding\",\n ]),\n hs_task_status: when < new Date(now.getTime() - 7 * day) ? \"COMPLETED\" : \"NOT_STARTED\",\n hs_task_priority: faker.helpers.arrayElement([\"LOW\", \"MEDIUM\", \"HIGH\"]),\n hs_task_type: faker.helpers.arrayElement([\"EMAIL\", \"CALL\", \"TODO\"]),\n }),\n ...links,\n });\n\n break;\n case \"communication\":\n rows.communications.push({\n ...record(id, when, when, now, {\n ...base,\n hs_communication_channel_type: faker.helpers.arrayElement([\n \"SMS\",\n \"WHATS_APP\",\n \"LINKEDIN_MESSAGE\",\n ]),\n hs_communication_logged_from: \"CRM\",\n hs_communication_body: \"Sounds good, talk on Thursday.\",\n }),\n ...links,\n });\n\n break;\n case \"postal_mail\":\n rows.postal_mail.push({\n ...record(id, when, when, now, {\n ...base,\n hs_postal_mail_body: \"Sent a thank-you card and swag box.\",\n }),\n ...links,\n });\n\n break;\n }\n }\n};\n","import {\n type CompanyGroup,\n day,\n type DealPlan,\n idOf,\n iso,\n ownerId,\n productId,\n products,\n record,\n} from \"./shared\";\n\n/** One deal with its line items, quote, and split. A won deal also brings billing records. */\nexport const dealRows = (company: CompanyGroup, deal: DealPlan, n: number) => {\n const { faker, now, between, rows, index, companyId, name, owner, contactIds, main } = company;\n\n const updated = deal.closed ?? deal.opened;\n\n rows.deals.push({\n ...record(deal.id, deal.opened, updated, now, {\n dealname: `${name} - ${products[deal.lines[0]?.p ?? 0]?.name ?? \"Plan\"}`,\n amount: String(deal.amount),\n dealstage: deal.stage.id,\n pipeline: \"default\",\n closedate: iso(deal.closed ?? new Date(deal.opened.getTime() + 45 * day)),\n hubspot_owner_id: ownerId(owner),\n hs_deal_stage_probability: deal.stage.probability,\n deal_currency_code: \"USD\",\n hs_is_closed_won: String(deal.won),\n }),\n company_ids: [companyId],\n contact_ids: contactIds,\n });\n\n deal.lines.forEach((line, k) => {\n const product = products[line.p] ?? products[0];\n\n rows.line_items.push({\n ...record(idOf(50_000_000_000, index, n * 10 + k), deal.opened, deal.opened, now, {\n name: product.name,\n hs_sku: product.sku,\n hs_product_id: productId(line.p),\n quantity: String(line.quantity),\n price: String(product.price),\n amount: String(product.price * line.quantity),\n hs_recurring_billing_period: \"P12M\",\n }),\n deal_ids: [deal.id],\n });\n });\n\n rows.deal_split.push({\n ...record(idOf(55_000_000_000, index, n), deal.opened, deal.opened, now, {\n hs_split_percentage: \"1\",\n hubspot_owner_id: ownerId(owner),\n }),\n deal_ids: [deal.id],\n });\n\n if (deal.stage.id === \"contractsent\" || deal.closed) {\n const sent = between(deal.opened, deal.closed ?? now);\n\n rows.quotes.push({\n ...record(idOf(60_000_000_000, index, n), sent, sent, now, {\n hs_title: `Quote for ${name}`,\n hs_quote_amount: String(deal.amount),\n hs_currency: \"USD\",\n hs_expiration_date: iso(new Date(sent.getTime() + 30 * day)),\n hs_status: deal.won ? \"APPROVED\" : deal.closed ? \"REJECTED\" : \"PENDING_APPROVAL\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n\n if (deal.won && deal.closed) {\n // A won deal becomes a subscription, an order, and yearly invoices with payments.\n const start = deal.closed;\n\n rows.subscriptions.push({\n ...record(idOf(70_000_000_000, index, n), start, start, now, {\n hs_name: `${name} subscription`,\n hs_status: \"active\",\n hs_recurring_billing_start_date: iso(start),\n hs_recurring_billing_period: \"P12M\",\n hs_last_payment_amount: String(deal.amount),\n hs_currency_code: \"USD\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n rows.orders.push({\n ...record(idOf(71_000_000_000, index, n), start, start, now, {\n hs_order_name: `Order ${index + 1}-${n + 1}`,\n hs_total_price: String(deal.amount),\n hs_currency_code: \"USD\",\n hs_fulfillment_status: \"fulfilled\",\n hs_payment_status: \"paid\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n for (\n let year = 0, billed = start;\n billed <= now;\n year++, billed = new Date(start.getTime() + year * 365 * day)\n ) {\n const paid = new Date(billed.getTime() + faker.number.int({ min: day, max: 20 * day }));\n const settled = paid <= now;\n\n rows.invoices.push({\n ...record(\n idOf(72_000_000_000, index, n * 10 + year),\n billed,\n settled ? paid : billed,\n now,\n {\n hs_number: `INV-${index + 1}${n}${year + 1}`,\n hs_amount_billed: String(deal.amount),\n hs_currency: \"USD\",\n hs_invoice_status: settled ? \"paid\" : \"open\",\n hs_due_date: iso(new Date(billed.getTime() + 30 * day)),\n },\n ),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n if (settled) {\n rows.commerce_payments.push({\n ...record(idOf(73_000_000_000, index, n * 10 + year), paid, paid, now, {\n hs_initial_amount: String(deal.amount),\n hs_currency_code: \"USD\",\n hs_payment_method_type: faker.helpers.arrayElement([\"card\", \"ach\"]),\n hs_latest_status: \"succeeded\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n }\n }\n\n if (!deal.closed && faker.datatype.boolean({ probability: 0.3 })) {\n const left = between(deal.opened, now);\n\n rows.carts.push({\n ...record(idOf(74_000_000_000, index, n), left, left, now, {\n hs_cart_name: `${name} checkout`,\n hs_total_price: String(deal.amount),\n hs_currency_code: \"USD\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { activityRows, ticketRows } from \"./activity\";\nimport { dealRows } from \"./deals\";\nimport {\n clock,\n type CompanyGroup,\n customObjectTypeId,\n day,\n dealStages,\n idOf,\n iso,\n ownerCount,\n ownerId,\n products,\n record,\n type Rows,\n} from \"./shared\";\n\n/** One group is one company with its contacts, deals, tickets, activity, and billing. */\nexport const companyRows = (index: number, context: Demo.DemoContext): Rows => {\n const { faker, now } = context;\n const { at, between } = clock(context);\n\n const rows: Rows = {\n companies: [],\n contacts: [],\n deals: [],\n line_items: [],\n quotes: [],\n deal_split: [],\n tickets: [],\n calls: [],\n emails: [],\n meetings: [],\n notes: [],\n tasks: [],\n communications: [],\n postal_mail: [],\n feedback_submissions: [],\n leads: [],\n invoices: [],\n orders: [],\n carts: [],\n commerce_payments: [],\n subscriptions: [],\n custom_objects: [],\n };\n\n const owner = faker.number.int({ max: ownerCount - 1 });\n const companyId = idOf(10_000_000_000, index);\n const name = faker.company.name();\n const domain = `${name.toLowerCase().replaceAll(/[^a-z]+/g, \"\")}.example.com`;\n const employees = faker.helpers.arrayElement([12, 45, 120, 380, 1_200, 5_000]);\n const created = at(now.getTime() - faker.number.int({ min: 20 * day, max: 700 * day }));\n\n // Contacts at the company. The first one is the main contact.\n const contacts = Array.from({ length: faker.number.int({ min: 1, max: 5 }) }, (_, n) => {\n const first = faker.person.firstName();\n const last = faker.person.lastName();\n\n return {\n id: idOf(20_000_000_000, index, n),\n first,\n last,\n email: `${first}.${last}@${domain}`.toLowerCase(),\n created: between(created, new Date(created.getTime() + 60 * day)),\n };\n });\n\n const contactIds = contacts.map((contact) => contact.id);\n\n // Deals: most companies have one, some two. Won deals bring billing records.\n const deals = Array.from(\n {\n length: faker.helpers.weightedArrayElement([\n { weight: 25, value: 0 },\n { weight: 55, value: 1 },\n { weight: 20, value: 2 },\n ]),\n },\n (_, n) => {\n const id = idOf(30_000_000_000, index, n);\n const opened = between(created, now);\n\n const stage = faker.helpers.weightedArrayElement([\n { weight: 35, value: dealStages[5] },\n { weight: 20, value: dealStages[6] },\n ...dealStages.slice(0, 5).map((value) => ({ weight: 9, value })),\n ]);\n\n const closed = stage.id.startsWith(\"closed\")\n ? between(opened, new Date(opened.getTime() + 90 * day))\n : null;\n\n const plan = faker.number.int({ max: 2 });\n\n const addOn = faker.helpers.maybe(() => 3 + faker.number.int({ max: 2 }), {\n probability: 0.5,\n });\n\n const lines = [plan, ...(addOn === undefined ? [] : [addOn])].map((p) => ({\n p,\n quantity: 1,\n }));\n\n const amount = lines.reduce(\n (sum, line) => sum + (products[line.p]?.price ?? 0) * line.quantity,\n 0,\n );\n\n return { id, opened, stage, closed, lines, amount, won: stage.id === \"closedwon\" };\n },\n );\n\n const dealIds = deals.map((deal) => deal.id);\n\n const lastTouch = new Date(\n Math.max(created.getTime(), ...deals.map((deal) => (deal.closed ?? deal.opened).getTime())),\n );\n\n const customer = deals.some((deal) => deal.won);\n\n rows.companies.push(\n record(companyId, created, lastTouch, now, {\n name,\n domain,\n industry: faker.helpers.arrayElement([\n \"COMPUTER_SOFTWARE\",\n \"FINANCIAL_SERVICES\",\n \"HOSPITAL_HEALTH_CARE\",\n \"RETAIL\",\n \"MARKETING_AND_ADVERTISING\",\n ]),\n numberofemployees: String(employees),\n annualrevenue: String(employees * faker.number.int({ min: 80_000, max: 200_000 })),\n city: faker.location.city(),\n country: \"United States\",\n lifecyclestage: customer ? \"customer\" : deals.length > 0 ? \"opportunity\" : \"lead\",\n hubspot_owner_id: ownerId(owner),\n num_associated_contacts: String(contacts.length),\n num_associated_deals: String(deals.length),\n }),\n );\n\n for (const contact of contacts) {\n rows.contacts.push({\n ...record(\n contact.id,\n contact.created,\n lastTouch > contact.created ? lastTouch : contact.created,\n now,\n {\n firstname: contact.first,\n lastname: contact.last,\n email: contact.email,\n jobtitle: faker.person.jobTitle(),\n phone: faker.phone.number({ style: \"international\" }),\n company: name,\n lifecyclestage: customer ? \"customer\" : \"salesqualifiedlead\",\n hubspot_owner_id: ownerId(owner),\n hs_lead_status: customer\n ? \"CONNECTED\"\n : faker.helpers.arrayElement([\"NEW\", \"OPEN\", \"IN_PROGRESS\"]),\n lastmodifieddate: iso(lastTouch > contact.created ? lastTouch : contact.created),\n },\n ),\n company_ids: [companyId],\n });\n }\n\n const main = contacts[0];\n\n if (main && !customer) {\n rows.leads.push({\n ...record(idOf(40_000_000_000, index), main.created, main.created, now, {\n hs_lead_name: `${main.first} ${main.last} - ${name}`,\n hs_lead_type: \"NEW_BUSINESS\",\n hs_pipeline: \"lead-pipeline-id\",\n hs_pipeline_stage: deals.length > 0 ? \"qualified-stage-id\" : \"new-stage-id\",\n hubspot_owner_id: ownerId(owner),\n }),\n company_ids: [companyId],\n contact_ids: [main.id],\n });\n }\n\n const company: CompanyGroup = {\n ...context,\n ...clock(context),\n rows,\n index,\n companyId,\n name,\n owner,\n created,\n contacts,\n contactIds,\n dealIds,\n customer,\n main,\n };\n\n deals.forEach((deal, n) => dealRows(company, deal, n));\n const tickets = ticketRows(company);\n activityRows(company, tickets);\n\n // Customers get a yearly NPS survey.\n if (customer && main && faker.datatype.boolean({ probability: 0.5 })) {\n const answered = between(created, now);\n\n const score = faker.helpers.weightedArrayElement([\n { weight: 50, value: faker.number.int({ min: 9, max: 10 }) },\n { weight: 30, value: faker.number.int({ min: 7, max: 8 }) },\n { weight: 20, value: faker.number.int({ min: 0, max: 6 }) },\n ]);\n\n rows.feedback_submissions.push({\n ...record(idOf(95_000_000_000, index), answered, answered, now, {\n hs_survey_type: \"NPS\",\n hs_survey_channel: \"EMAIL\",\n hs_response_value: String(score),\n hs_sentiment: score >= 9 ? \"Promoter\" : score >= 7 ? \"Passive\" : \"Detractor\",\n hs_submission_timestamp: iso(answered),\n }),\n company_ids: [companyId],\n contact_ids: [main.id],\n deal_ids: [],\n ticket_ids: [],\n });\n }\n\n if (customer) {\n const recordId = idOf(99_000_000_000, index);\n const started = deals.find((deal) => deal.won)?.closed ?? created;\n const done = at(started.getTime() + 45 * day);\n\n rows.custom_objects.push({\n key: `${customObjectTypeId}:${recordId}`,\n ...record(recordId, started, done, now, {\n project_name: `${name} onboarding`,\n project_status: done < now ? \"Live\" : \"In progress\",\n go_live_date: iso(done),\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: dealIds.slice(0, 1),\n ticket_ids: [],\n object_type_id: customObjectTypeId,\n object_type: \"implementation_project\",\n });\n }\n\n return rows;\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport type { Discount, Fee, GoalTarget, Product, Tax, User } from \"../schemas/crm\";\nimport type { List } from \"../schemas/lists\";\nimport type { Owner } from \"../schemas/owners\";\nimport type { Pipeline } from \"../schemas/pipelines\";\nimport type { Property } from \"../schemas/properties\";\nimport type { Team } from \"../schemas/teams\";\n\nimport {\n day,\n dealStages,\n iso,\n leadStages,\n ownerCount,\n ownerId,\n productId,\n products,\n record,\n teams,\n ticketStages,\n userId,\n} from \"./shared\";\n\n/** The portal setup, written once before any company. */\nexport const setupRows = ({ faker, now }: Demo.DemoContext) => {\n const setup = new Date(now.getTime() - 800 * day);\n\n const people = Array.from({ length: ownerCount }, () => {\n const first = faker.person.firstName();\n const last = faker.person.lastName();\n\n return {\n first,\n last,\n email: faker.internet.exampleEmail({ firstName: first, lastName: last }).toLowerCase(),\n };\n });\n\n const owners: Array<Owner> = people.map((person, o) => ({\n id: ownerId(o),\n version: now,\n type: \"PERSON\",\n email: person.email,\n first_name: person.first,\n last_name: person.last,\n user_id: BigInt(userId(o)),\n user_id_including_inactive: BigInt(userId(o)),\n teams: [\n {\n id: String(90_000 + (o % teams.length)),\n name: teams[o % teams.length] ?? \"Sales East\",\n primary: true,\n },\n ],\n archived: false,\n created_at: setup,\n }));\n\n const users: Array<User> = people.map((person, o) =>\n record(userId(o), setup, setup, now, {\n hs_internal_user_id: userId(o),\n hs_email: person.email,\n hs_given_name: person.first,\n hs_family_name: person.last,\n }),\n );\n\n const teamRows: Array<Team> = teams.map((name, t) => ({\n id: String(90_000 + t),\n version: now,\n name,\n members: people\n .map((_, o) => o)\n .filter((o) => o % teams.length === t)\n .map((o) => ({ user_id: userId(o), type: \"DEFAULT\" })),\n }));\n\n const pipelines: Array<Pipeline> = [\n {\n key: \"deals:default\",\n version: now,\n object_type: \"deals\",\n id: \"default\",\n label: \"Sales pipeline\",\n display_order: 0n,\n archived: false,\n stages: dealStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map([\n [\"probability\", stage.probability],\n [\"isClosed\", String(stage.id.startsWith(\"closed\"))],\n ]),\n })),\n created_at: setup,\n },\n {\n key: \"tickets:0\",\n version: now,\n object_type: \"tickets\",\n id: \"0\",\n label: \"Support pipeline\",\n display_order: 0n,\n archived: false,\n stages: ticketStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map([[\"ticketState\", stage.state]]),\n })),\n created_at: setup,\n },\n {\n key: \"leads:lead-pipeline-id\",\n version: now,\n object_type: \"leads\",\n id: \"lead-pipeline-id\",\n label: \"Lead pipeline\",\n display_order: 0n,\n archived: false,\n stages: leadStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map(),\n })),\n created_at: setup,\n },\n ];\n\n const propertyRows: Array<Property> = (\n [\n [\"contacts\", \"email\", \"Email\", \"string\", \"text\", \"contactinformation\", []],\n [\n \"contacts\",\n \"lifecyclestage\",\n \"Lifecycle stage\",\n \"enumeration\",\n \"radio\",\n \"contactinformation\",\n [\n \"subscriber\",\n \"lead\",\n \"marketingqualifiedlead\",\n \"salesqualifiedlead\",\n \"opportunity\",\n \"customer\",\n ],\n ],\n [\n \"contacts\",\n \"hubspot_owner_id\",\n \"Contact owner\",\n \"enumeration\",\n \"select\",\n \"contactinformation\",\n [],\n ],\n [\n \"companies\",\n \"industry\",\n \"Industry\",\n \"enumeration\",\n \"select\",\n \"companyinformation\",\n [\n \"COMPUTER_SOFTWARE\",\n \"FINANCIAL_SERVICES\",\n \"HOSPITAL_HEALTH_CARE\",\n \"RETAIL\",\n \"MARKETING_AND_ADVERTISING\",\n ],\n ],\n [\n \"companies\",\n \"numberofemployees\",\n \"Number of employees\",\n \"number\",\n \"number\",\n \"companyinformation\",\n [],\n ],\n [\"deals\", \"amount\", \"Amount\", \"number\", \"number\", \"dealinformation\", []],\n [\n \"deals\",\n \"dealstage\",\n \"Deal stage\",\n \"enumeration\",\n \"radio\",\n \"dealinformation\",\n dealStages.map((stage) => stage.id),\n ],\n [\"deals\", \"closedate\", \"Close date\", \"datetime\", \"date\", \"dealinformation\", []],\n [\n \"tickets\",\n \"hs_ticket_priority\",\n \"Priority\",\n \"enumeration\",\n \"select\",\n \"ticketinformation\",\n [\"LOW\", \"MEDIUM\", \"HIGH\"],\n ],\n ] as const\n ).map(([objectType, name, label, type, fieldType, group, options]) => ({\n key: `${objectType}:${name}`,\n version: now,\n object_type: objectType,\n name,\n label,\n type,\n field_type: fieldType,\n description: \"\",\n group_name: group,\n options: options.map((value, o) => ({\n label: value.toLowerCase().replaceAll(\"_\", \" \"),\n value,\n display_order: BigInt(o),\n hidden: false,\n })),\n calculated: false,\n hidden: false,\n hubspot_defined: true,\n archived: false,\n created_at: setup,\n updated_at: setup,\n }));\n\n const lists: Array<List> = [\n [\"Newsletter subscribers\", \"DYNAMIC\", 2_400n],\n [\"Webinar attendees Q3\", \"SNAPSHOT\", 380n],\n [\"Customers\", \"DYNAMIC\", 620n],\n [\"Churn risk\", \"MANUAL\", 45n],\n ].map(([name, processing, size], l) => ({\n id: String(100 + l),\n version: now,\n name: String(name),\n object_type_id: \"0-1\",\n processing_type: String(processing),\n processing_status: \"COMPLETE\",\n size: BigInt(size),\n created_at: setup,\n updated_at: new Date(now.getTime() - day),\n filters_updated_at: setup,\n }));\n\n const productRows: Array<Product> = products.map((product, p) =>\n record(productId(p), setup, setup, now, {\n name: product.name,\n hs_sku: product.sku,\n price: String(product.price),\n description: `${product.name}, billed yearly`,\n hs_recurring_billing_period: product.sku.startsWith(\"SVC-ONBOARD\") ? \"\" : \"P12M\",\n recurringbillingfrequency: product.sku.startsWith(\"SVC-ONBOARD\") ? \"\" : \"annually\",\n }),\n );\n\n const discounts: Array<Discount> = [\n [\"Annual prepay\", \"PERCENT\", \"10\"],\n [\"Startup program\", \"PERCENT\", \"25\"],\n ].map(([label, type, value], d) =>\n record(String(3_100_000 + d), setup, setup, now, {\n hs_label: String(label),\n hs_type: String(type),\n hs_value: String(value),\n }),\n );\n\n const fees: Array<Fee> = [\n record(\"3200000\", setup, setup, now, {\n hs_label: \"Setup fee\",\n hs_type: \"FIXED\",\n hs_value: \"500\",\n }),\n ];\n\n const taxes: Array<Tax> = [\n record(\"3300000\", setup, setup, now, {\n hs_label: \"Sales tax (CA)\",\n hs_type: \"PERCENT\",\n hs_value: \"7.25\",\n }),\n record(\"3300001\", setup, setup, now, {\n hs_label: \"VAT (UK)\",\n hs_type: \"PERCENT\",\n hs_value: \"20\",\n }),\n ];\n\n // A revenue goal per owner for each of the last four quarters.\n const goals: Array<GoalTarget> = people.flatMap((person, o) =>\n [0, 1, 2, 3].map((q) => {\n const start = new Date(\n Date.UTC(now.getUTCFullYear(), Math.floor(now.getUTCMonth() / 3) * 3 - q * 3, 1),\n );\n\n const end = new Date(Date.UTC(start.getUTCFullYear(), start.getUTCMonth() + 3, 1) - 1);\n\n return record(String(3_400_000 + o * 10 + q), start, start, now, {\n hs_goal_name: `${person.first} ${person.last} revenue Q${Math.floor(start.getUTCMonth() / 3) + 1} ${start.getUTCFullYear()}`,\n hs_target_amount: String(faker.helpers.arrayElement([60_000, 80_000, 100_000, 120_000])),\n hs_start_datetime: iso(start),\n hs_end_datetime: iso(end),\n hubspot_owner_id: ownerId(o),\n });\n }),\n );\n\n return {\n owners,\n users,\n teams: teamRows,\n pipelines,\n properties: propertyRows,\n lists,\n products: productRows,\n discounts,\n fees,\n taxes,\n goal_targets: goals,\n };\n};\n","import { ConnectorApp, Demo, RuntimeConfig } from \"@useairfoil/connector-kit\";\nimport { Command } from \"effect/cli\";\n\nimport {\n CallSchema,\n CartSchema,\n CommercePaymentSchema,\n CommunicationSchema,\n CompanySchema,\n ContactSchema,\n CustomObjectSchema,\n DealSchema,\n DealSplitSchema,\n DiscountSchema,\n EmailSchema,\n FeeSchema,\n FeedbackSubmissionSchema,\n GoalTargetSchema,\n InvoiceSchema,\n LeadSchema,\n LineItemSchema,\n MeetingSchema,\n NoteSchema,\n OrderSchema,\n PostalMailSchema,\n ProductSchema,\n QuoteSchema,\n SubscriptionSchema,\n TaskSchema,\n TaxSchema,\n TicketSchema,\n UserSchema,\n} from \"../schemas/crm\";\nimport { ListSchema } from \"../schemas/lists\";\nimport { OwnerSchema } from \"../schemas/owners\";\nimport { PipelineSchema } from \"../schemas/pipelines\";\nimport { PropertySchema } from \"../schemas/properties\";\nimport { TeamSchema } from \"../schemas/teams\";\nimport { companyRows } from \"./companies\";\nimport { setupRows } from \"./setup\";\n\nexport const demo = Demo.define({\n name: \"producer-hubspot\",\n setup: {\n tables: [\n Demo.table({ name: \"owners\", rowSchema: OwnerSchema, version: \"version\" }),\n Demo.table({ name: \"users\", rowSchema: UserSchema, version: \"version\" }),\n Demo.table({ name: \"teams\", rowSchema: TeamSchema, version: \"version\" }),\n Demo.table({ name: \"pipelines\", rowSchema: PipelineSchema, version: \"version\" }),\n Demo.table({ name: \"properties\", rowSchema: PropertySchema, version: \"version\" }),\n Demo.table({ name: \"lists\", rowSchema: ListSchema, version: \"version\" }),\n Demo.table({ name: \"products\", rowSchema: ProductSchema, version: \"version\" }),\n Demo.table({ name: \"discounts\", rowSchema: DiscountSchema, version: \"version\" }),\n Demo.table({ name: \"fees\", rowSchema: FeeSchema, version: \"version\" }),\n Demo.table({ name: \"taxes\", rowSchema: TaxSchema, version: \"version\" }),\n Demo.table({ name: \"goal_targets\", rowSchema: GoalTargetSchema, version: \"version\" }),\n ],\n rows: setupRows,\n },\n group: {\n tables: [\n Demo.table({ name: \"companies\", rowSchema: CompanySchema, version: \"version\" }),\n Demo.table({ name: \"contacts\", rowSchema: ContactSchema, version: \"version\" }),\n Demo.table({ name: \"deals\", rowSchema: DealSchema, version: \"version\" }),\n Demo.table({ name: \"line_items\", rowSchema: LineItemSchema, version: \"version\" }),\n Demo.table({ name: \"quotes\", rowSchema: QuoteSchema, version: \"version\" }),\n Demo.table({ name: \"deal_split\", rowSchema: DealSplitSchema, version: \"version\" }),\n Demo.table({ name: \"tickets\", rowSchema: TicketSchema, version: \"version\" }),\n Demo.table({ name: \"calls\", rowSchema: CallSchema, version: \"version\" }),\n Demo.table({ name: \"emails\", rowSchema: EmailSchema, version: \"version\" }),\n Demo.table({ name: \"meetings\", rowSchema: MeetingSchema, version: \"version\" }),\n Demo.table({ name: \"notes\", rowSchema: NoteSchema, version: \"version\" }),\n Demo.table({ name: \"tasks\", rowSchema: TaskSchema, version: \"version\" }),\n Demo.table({ name: \"communications\", rowSchema: CommunicationSchema, version: \"version\" }),\n Demo.table({ name: \"postal_mail\", rowSchema: PostalMailSchema, version: \"version\" }),\n Demo.table({\n name: \"feedback_submissions\",\n rowSchema: FeedbackSubmissionSchema,\n version: \"version\",\n }),\n Demo.table({ name: \"leads\", rowSchema: LeadSchema, version: \"version\" }),\n Demo.table({ name: \"invoices\", rowSchema: InvoiceSchema, version: \"version\" }),\n Demo.table({ name: \"orders\", rowSchema: OrderSchema, version: \"version\" }),\n Demo.table({ name: \"carts\", rowSchema: CartSchema, version: \"version\" }),\n Demo.table({\n name: \"commerce_payments\",\n rowSchema: CommercePaymentSchema,\n version: \"version\",\n }),\n Demo.table({ name: \"subscriptions\", rowSchema: SubscriptionSchema, version: \"version\" }),\n Demo.table({ name: \"custom_objects\", rowSchema: CustomObjectSchema, version: \"version\" }),\n ],\n rows: companyRows,\n },\n});\n\nexport const demoCommand = ConnectorApp.makeDemoCommand(demo).pipe(\n Command.provide(RuntimeConfig.layerHosted()),\n);\n","import {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Effect, Layer, Logger } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { HubSpotConnector } from \"./index\";\n\nconst ConnectorLayer = HubSpotConnector.layerConfig(HubSpotConnector.HubSpotConfigDef.config);\n\nconst TelemetryLayer = Layer.mergeAll(Telemetry.layerOtlp(), Telemetry.layerMetricsConsoleDump());\n\nexport const sandboxCommand = Command.make(\"sandbox\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* HubSpotConnector.HubSpotConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port });\n }).pipe(\n Effect.annotateLogs({ component: \"hubspot\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStore.layerMemory,\n Ingestor.layerConsole,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n ),\n).pipe(Command.withDescription(\"Run the connector locally and log ingested data\"));\n","import { PgClient } from \"@effect/sql-pg\";\nimport {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Config, Effect, Layer, Logger, Schema } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { HubSpotConnector } from \"./index\";\n\nconst ConnectorLayer = HubSpotConnector.layerConfig(HubSpotConnector.HubSpotConfigDef.config);\nconst TelemetryLayer = Telemetry.layerOtlp();\nconst PostgresLayer = PgClient.layerConfig({\n url: Config.schema(\n Schema.Redacted(Schema.NonEmptyString),\n RuntimeConfig.PlatformRuntimeKey.postgresConnectionString,\n ),\n maxConnections: Config.succeed(2),\n connectTimeout: Config.succeed(\"5 seconds\"),\n applicationName: Config.succeed(\"airfoil-producer-hubspot\"),\n});\nconst StateStoreLayer = StateStore.layerSql().pipe(Layer.provide(PostgresLayer));\n\nexport const startCommand = Command.make(\"start\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* HubSpotConnector.HubSpotConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port }).pipe(\n Effect.provide(Ingestor.layerWingsConfig(entrypoint)),\n );\n }).pipe(\n Effect.annotateLogs({ component: \"hubspot\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStoreLayer,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n Effect.provide(RuntimeConfig.layerHosted()),\n ),\n).pipe(Command.withDescription(\"Run the production connector against Wings\"));\n","#!/usr/bin/env node\n\nimport { NodeRuntime, NodeServices } from \"@effect/platform-node\";\nimport { Effect, Layer } from \"effect\";\nimport { Command } from \"effect/cli\";\nimport { FetchHttpClient } from \"effect/http\";\n\nimport packageJson from \"../package.json\";\nimport { createTableCommand } from \"./create-table\";\nimport { demoCommand } from \"./demo\";\nimport { sandboxCommand } from \"./sandbox\";\nimport { startCommand } from \"./start\";\n\nconst BootstrapLayer = Layer.mergeAll(FetchHttpClient.layer, NodeServices.layer);\n\nconst program = Command.make(\"producer-hubspot\", {}, () => Effect.void).pipe(\n Command.withSubcommands([startCommand, sandboxCommand, createTableCommand, demoCommand]),\n);\n\nconst cli = Command.run(program, { version: packageJson.version });\n\nNodeRuntime.runMain(cli.pipe(Effect.provide(BootstrapLayer), Effect.scoped));\n"],"mappings":";;;;;;;;;;;;;ACsCA,MAAa,eAAqD;CAChE,UAAU;CACV,WAAW;CACX,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,UAAU;CACV,OAAO;CACP,OAAO;CACP,gBAAgB;CAChB,aAAa;CACb,sBAAsB;CACtB,YAAY;CACZ,UAAU;CACV,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,mBAAmB;CACnB,eAAe;CACf,WAAW;CACX,MAAM;CACN,OAAO;CACP,cAAc;CACd,OAAO;CACP,YAAY;CACZ,gBAAgB;CAChB,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,OAAO;CACP,OAAO;AACT;;;ACpEA,MAAa,qBAAqB,aAAa,uBAAuB,YAAY;;;ACyBlF,MAAa,OAAO,SAAS,SAAS,SAAS,MAAM,CAAC,CAAC;AACvD,MAAa,MAAM,SAAS,SAAS,SAAS,KAAK,CAAC,CAAC;AAIrD,MAAa,QAAQ,MAAc,OAAe,IAAI,MAAM,OAAO,OAAO,QAAQ,MAAM,CAAC;AACzF,MAAa,WAAW,MAAc,OAAO,MAAa,CAAC;AAC3D,MAA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a,KAAK;AAE/E,MAAM,UAAU,QAAQ,KAAK,oBAAoB,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC,KACtE,QAAQ,gBAAgB;CAAC;CAAc;CAAgB;CAAoB;AAAW,CAAC,CACzF;AAEA,MAAM,MAAM,QAAQ,IAAI,SAAS,EAAWC,QAAoB,CAAC;AAEjE,YAAY,QAAQ,IAAI,KAAK,OAAO,QAAQ,cAAc,GAAG,OAAO,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.mjs","names":["ConnectorLayer","HubSpotConnector.layerConfig","TelemetryLayer","HubSpotConnector.HubSpotConnector","HubSpotConnector.layerConfig","HubSpotConnector.HubSpotConnector","packageJson.version"],"sources":["../package.json","../src/tables.ts","../src/create-table.ts","../src/demo/shared.ts","../src/demo/activity.ts","../src/demo/deals.ts","../src/demo/companies.ts","../src/demo/setup.ts","../src/demo/index.ts","../src/sandbox.ts","../src/start.ts","../src/main.ts"],"sourcesContent":["","import type { Schema } from \"effect\";\n\nimport {\n CallSchema,\n CartSchema,\n CommercePaymentSchema,\n CommunicationSchema,\n CompanySchema,\n ContactSchema,\n CustomObjectSchema,\n DealSchema,\n DealSplitSchema,\n DiscountSchema,\n EmailSchema,\n FeeSchema,\n FeedbackSubmissionSchema,\n GoalTargetSchema,\n InvoiceSchema,\n LeadSchema,\n LineItemSchema,\n MeetingSchema,\n NoteSchema,\n OrderSchema,\n PostalMailSchema,\n ProductSchema,\n QuoteSchema,\n SubscriptionSchema,\n TaskSchema,\n TaxSchema,\n TicketSchema,\n UserSchema,\n} from \"./schemas/crm\";\nimport { ListSchema } from \"./schemas/lists\";\nimport { OwnerSchema } from \"./schemas/owners\";\nimport { PipelineSchema } from \"./schemas/pipelines\";\nimport { PropertySchema } from \"./schemas/properties\";\nimport { TeamSchema } from \"./schemas/teams\";\n\nexport const tableSchemas: Readonly<Record<string, Schema.Top>> = {\n contacts: ContactSchema,\n companies: CompanySchema,\n deals: DealSchema,\n tickets: TicketSchema,\n calls: CallSchema,\n emails: EmailSchema,\n meetings: MeetingSchema,\n notes: NoteSchema,\n tasks: TaskSchema,\n communications: CommunicationSchema,\n postal_mail: PostalMailSchema,\n feedback_submissions: FeedbackSubmissionSchema,\n line_items: LineItemSchema,\n products: ProductSchema,\n quotes: QuoteSchema,\n leads: LeadSchema,\n invoices: InvoiceSchema,\n orders: OrderSchema,\n carts: CartSchema,\n commerce_payments: CommercePaymentSchema,\n subscriptions: SubscriptionSchema,\n discounts: DiscountSchema,\n fees: FeeSchema,\n taxes: TaxSchema,\n goal_targets: GoalTargetSchema,\n users: UserSchema,\n deal_split: DealSplitSchema,\n custom_objects: CustomObjectSchema,\n owners: OwnerSchema,\n pipelines: PipelineSchema,\n properties: PropertySchema,\n teams: TeamSchema,\n lists: ListSchema,\n};\n","import { ConnectorApp, RuntimeConfig } from \"@useairfoil/connector-kit\";\nimport { Command } from \"effect/cli\";\n\nimport { tableSchemas } from \"./tables\";\n\nexport const createTableCommand = ConnectorApp.makeCreateTableCommand(tableSchemas);\n\nexport const setupCommand = ConnectorApp.makeSetupCommand(tableSchemas).pipe(\n Command.provide(RuntimeConfig.layerHosted()),\n);\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { Duration } from \"effect\";\n\nimport type {\n Call,\n Cart,\n CommercePayment,\n Communication,\n Company,\n Contact,\n CustomObject,\n Deal,\n DealSplit,\n Email,\n FeedbackSubmission,\n Invoice,\n Lead,\n LineItem,\n Meeting,\n Note,\n Order,\n PostalMail,\n Quote,\n Subscription,\n Task,\n Ticket,\n} from \"../schemas/crm\";\n\nexport const hour = Duration.toMillis(Duration.hours(1));\nexport const day = Duration.toMillis(Duration.days(1));\nexport const ownerCount = 10;\n\n// HubSpot record IDs are numbers sent as text. Each object type gets its own range.\nexport const idOf = (base: number, index: number, n = 0) => String(base + index * 100 + n);\nexport const ownerId = (o: number) => String(70_000_000 + o);\nexport const userId = (o: number) => String(80_000_000 + o);\nexport const iso = (date: Date) => date.toISOString();\n\nexport const teams = [\"Sales East\", \"Sales West\", \"Customer Success\"] as const;\n\nexport const dealStages = [\n { id: \"appointmentscheduled\", label: \"Appointment scheduled\", probability: \"0.2\" },\n { id: \"qualifiedtobuy\", label: \"Qualified to buy\", probability: \"0.4\" },\n { id: \"presentationscheduled\", label: \"Presentation scheduled\", probability: \"0.6\" },\n { id: \"decisionmakerboughtin\", label: \"Decision maker bought in\", probability: \"0.8\" },\n { id: \"contractsent\", label: \"Contract sent\", probability: \"0.9\" },\n { id: \"closedwon\", label: \"Closed won\", probability: \"1.0\" },\n { id: \"closedlost\", label: \"Closed lost\", probability: \"0.0\" },\n] as const;\n\nexport const ticketStages = [\n { id: \"1\", label: \"New\", state: \"OPEN\" },\n { id: \"2\", label: \"Waiting on contact\", state: \"OPEN\" },\n { id: \"3\", label: \"Waiting on us\", state: \"OPEN\" },\n { id: \"4\", label: \"Closed\", state: \"CLOSED\" },\n] as const;\n\n// HubSpot's default lead pipeline uses these stage IDs.\nexport const leadStages = [\n { id: \"new-stage-id\", label: \"New\" },\n { id: \"attempting-stage-id\", label: \"Attempting\" },\n { id: \"connected-stage-id\", label: \"Connected\" },\n { id: \"qualified-stage-id\", label: \"Qualified\" },\n { id: \"unqualified-stage-id\", label: \"Disqualified\" },\n] as const;\n\n// Prices are yearly, in US dollars.\nexport const products = [\n { name: \"Starter plan\", sku: \"PLAN-STARTER\", price: 6000 },\n { name: \"Professional plan\", sku: \"PLAN-PRO\", price: 18000 },\n { name: \"Enterprise plan\", sku: \"PLAN-ENT\", price: 48000 },\n { name: \"Onboarding package\", sku: \"SVC-ONBOARD\", price: 5000 },\n { name: \"Premium support\", sku: \"SVC-SUPPORT\", price: 9000 },\n { name: \"Additional seats (10)\", sku: \"ADD-SEATS-10\", price: 3000 },\n] as const;\n\nexport const productId = (p: number) => String(3_000_000 + p);\n\nexport const customObjectTypeId = \"2-24512345\";\n\n/** One CRM record: the fields every table shares and its property map. */\nexport const record = (\n id: string,\n created: Date,\n updated: Date,\n now: Date,\n properties: Readonly<Record<string, string>>,\n) => ({\n id,\n // HubSpot rows use the fetch time as their version.\n version: now,\n created_at: created,\n updated_at: updated,\n _deleted: false,\n properties: new Map(\n Object.entries({\n hs_object_id: id,\n createdate: iso(created),\n hs_lastmodifieddate: iso(updated),\n ...properties,\n }),\n ),\n});\n\nexport type Rows = {\n readonly companies: Array<Company>;\n readonly contacts: Array<Contact>;\n readonly deals: Array<Deal>;\n readonly line_items: Array<LineItem>;\n readonly quotes: Array<Quote>;\n readonly deal_split: Array<DealSplit>;\n readonly tickets: Array<Ticket>;\n readonly calls: Array<Call>;\n readonly emails: Array<Email>;\n readonly meetings: Array<Meeting>;\n readonly notes: Array<Note>;\n readonly tasks: Array<Task>;\n readonly communications: Array<Communication>;\n readonly postal_mail: Array<PostalMail>;\n readonly feedback_submissions: Array<FeedbackSubmission>;\n readonly leads: Array<Lead>;\n readonly invoices: Array<Invoice>;\n readonly orders: Array<Order>;\n readonly carts: Array<Cart>;\n readonly commerce_payments: Array<CommercePayment>;\n readonly subscriptions: Array<Subscription>;\n readonly custom_objects: Array<CustomObject>;\n};\n\n/** Date helpers for one run. `at` keeps a time from going past now. */\nexport const clock = ({ faker, now }: Demo.DemoContext) => {\n const at = (time: number) => new Date(Math.min(time, now.getTime()));\n\n const between = (from: Date, to: Date) =>\n faker.date.between({ from, to: at(Math.max(from.getTime(), to.getTime())) });\n\n return { at, between };\n};\n\ntype CompanyContact = {\n readonly id: string;\n readonly first: string;\n readonly last: string;\n readonly email: string;\n readonly created: Date;\n};\n\nexport type DealPlan = {\n readonly id: string;\n readonly opened: Date;\n readonly stage: (typeof dealStages)[number];\n readonly closed: Date | null;\n readonly lines: ReadonlyArray<{ readonly p: number; readonly quantity: number }>;\n readonly amount: number;\n readonly won: boolean;\n};\n\n/** One company being built: the run's tools, its rows so far, and what its parts need to know. */\nexport type CompanyGroup = Demo.DemoContext &\n ReturnType<typeof clock> & {\n readonly rows: Rows;\n readonly index: number;\n readonly companyId: string;\n readonly name: string;\n readonly owner: number;\n readonly created: Date;\n readonly contacts: ReadonlyArray<CompanyContact>;\n readonly contactIds: ReadonlyArray<string>;\n readonly dealIds: ReadonlyArray<string>;\n readonly customer: boolean;\n readonly main: CompanyContact | undefined;\n };\n","import { type CompanyGroup, day, hour, idOf, iso, ownerId, record, ticketStages } from \"./shared\";\n\n/** Support tickets, for customers only. Returns their IDs. */\nexport const ticketRows = (company: CompanyGroup): Array<string> => {\n const { faker, now, at, between, rows, index, companyId, owner, created, customer, main } =\n company;\n\n return customer\n ? Array.from({ length: faker.number.int({ max: 3 }) }, (_, n) => {\n const opened = between(created, now);\n\n const stage = faker.helpers.weightedArrayElement([\n { weight: 70, value: ticketStages[3] },\n ...ticketStages.slice(0, 3).map((value) => ({ weight: 10, value })),\n ]);\n\n const closed =\n stage.state === \"CLOSED\"\n ? at(opened.getTime() + faker.number.int({ min: hour, max: 5 * day }))\n : null;\n\n const id = idOf(80_000_000_000, index, n);\n\n rows.tickets.push({\n ...record(id, opened, closed ?? opened, now, {\n subject: faker.helpers.arrayElement([\n \"Can't export report\",\n \"SSO login fails\",\n \"Question about invoice\",\n \"Feature request: bulk edit\",\n ]),\n content: \"Hi team, we ran into this today. Can you help?\",\n hs_pipeline: \"0\",\n hs_pipeline_stage: stage.id,\n hs_ticket_priority: faker.helpers.arrayElement([\"LOW\", \"MEDIUM\", \"HIGH\"]),\n hubspot_owner_id: ownerId(owner),\n ...(closed ? { closed_date: iso(closed) } : {}),\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [],\n });\n\n return id;\n })\n : [];\n};\n\n/** Calls, emails, meetings, notes, and other activity, tied to the company's records. */\nexport const activityRows = (company: CompanyGroup, tickets: ReadonlyArray<string>) => {\n const { faker, now, between, rows, index, companyId, name, owner, created, contacts, dealIds } =\n company;\n\n const activityCount = faker.number.int({ min: 2, max: 10 });\n\n for (let a = 0; a < activityCount; a++) {\n const when = between(created, now);\n const contact = faker.helpers.arrayElement(contacts);\n\n const links = {\n company_ids: [companyId],\n contact_ids: contact ? [contact.id] : [],\n deal_ids:\n dealIds.length > 0 && faker.datatype.boolean() ? [faker.helpers.arrayElement(dealIds)] : [],\n ticket_ids:\n tickets.length > 0 && faker.datatype.boolean({ probability: 0.3 })\n ? [faker.helpers.arrayElement(tickets)]\n : [],\n };\n\n const base = { hs_timestamp: iso(when), hubspot_owner_id: ownerId(owner) };\n const id = idOf(90_000_000_000, index, a);\n\n const kind = faker.helpers.weightedArrayElement([\n { weight: 30, value: \"email\" },\n { weight: 20, value: \"call\" },\n { weight: 15, value: \"meeting\" },\n { weight: 15, value: \"note\" },\n { weight: 15, value: \"task\" },\n { weight: 4, value: \"communication\" },\n { weight: 3, value: \"postal_mail\" },\n ] as const);\n\n switch (kind) {\n case \"email\":\n rows.emails.push({\n ...record(id, when, when, now, {\n ...base,\n hs_email_subject: faker.helpers.arrayElement([\n \"Following up\",\n \"Quick question\",\n \"Next steps\",\n \"Your trial\",\n ]),\n hs_email_direction: faker.helpers.arrayElement([\"EMAIL\", \"INCOMING_EMAIL\"]),\n hs_email_status: \"SENT\",\n hs_email_text: \"Thanks for your time today. Here is a summary of what we discussed.\",\n }),\n ...links,\n });\n\n break;\n case \"call\":\n rows.calls.push({\n ...record(id, when, when, now, {\n ...base,\n hs_call_title: `Call with ${contact?.first ?? name}`,\n hs_call_direction: faker.helpers.arrayElement([\"OUTBOUND\", \"INBOUND\"]),\n hs_call_duration: String(faker.number.int({ min: 60_000, max: 2_400_000 })),\n hs_call_status: \"COMPLETED\",\n hs_call_disposition: \"f240bbac-87c9-4f6e-bf70-924b57d47db7\",\n }),\n ...links,\n });\n\n break;\n case \"meeting\":\n rows.meetings.push({\n ...record(id, when, when, now, {\n ...base,\n hs_meeting_title: faker.helpers.arrayElement([\n \"Discovery call\",\n \"Product demo\",\n \"Quarterly review\",\n \"Onboarding kickoff\",\n ]),\n hs_meeting_start_time: iso(when),\n hs_meeting_end_time: iso(new Date(when.getTime() + hour / 2)),\n hs_meeting_outcome: when < now ? \"COMPLETED\" : \"SCHEDULED\",\n }),\n ...links,\n });\n\n break;\n case \"note\":\n rows.notes.push({\n ...record(id, when, when, now, {\n ...base,\n hs_note_body: faker.helpers.arrayElement([\n \"Budget approved for next quarter.\",\n \"They are comparing us with two other vendors.\",\n \"Champion moved teams, need a new contact.\",\n ]),\n }),\n ...links,\n });\n\n break;\n case \"task\":\n rows.tasks.push({\n ...record(id, when, when, now, {\n ...base,\n hs_task_subject: faker.helpers.arrayElement([\n \"Send proposal\",\n \"Follow up on pricing\",\n \"Book demo\",\n \"Check in after onboarding\",\n ]),\n hs_task_status: when < new Date(now.getTime() - 7 * day) ? \"COMPLETED\" : \"NOT_STARTED\",\n hs_task_priority: faker.helpers.arrayElement([\"LOW\", \"MEDIUM\", \"HIGH\"]),\n hs_task_type: faker.helpers.arrayElement([\"EMAIL\", \"CALL\", \"TODO\"]),\n }),\n ...links,\n });\n\n break;\n case \"communication\":\n rows.communications.push({\n ...record(id, when, when, now, {\n ...base,\n hs_communication_channel_type: faker.helpers.arrayElement([\n \"SMS\",\n \"WHATS_APP\",\n \"LINKEDIN_MESSAGE\",\n ]),\n hs_communication_logged_from: \"CRM\",\n hs_communication_body: \"Sounds good, talk on Thursday.\",\n }),\n ...links,\n });\n\n break;\n case \"postal_mail\":\n rows.postal_mail.push({\n ...record(id, when, when, now, {\n ...base,\n hs_postal_mail_body: \"Sent a thank-you card and swag box.\",\n }),\n ...links,\n });\n\n break;\n }\n }\n};\n","import {\n type CompanyGroup,\n day,\n type DealPlan,\n idOf,\n iso,\n ownerId,\n productId,\n products,\n record,\n} from \"./shared\";\n\n/** One deal with its line items, quote, and split. A won deal also brings billing records. */\nexport const dealRows = (company: CompanyGroup, deal: DealPlan, n: number) => {\n const { faker, now, between, rows, index, companyId, name, owner, contactIds, main } = company;\n\n const updated = deal.closed ?? deal.opened;\n\n rows.deals.push({\n ...record(deal.id, deal.opened, updated, now, {\n dealname: `${name} - ${products[deal.lines[0]?.p ?? 0]?.name ?? \"Plan\"}`,\n amount: String(deal.amount),\n dealstage: deal.stage.id,\n pipeline: \"default\",\n closedate: iso(deal.closed ?? new Date(deal.opened.getTime() + 45 * day)),\n hubspot_owner_id: ownerId(owner),\n hs_deal_stage_probability: deal.stage.probability,\n deal_currency_code: \"USD\",\n hs_is_closed_won: String(deal.won),\n }),\n company_ids: [companyId],\n contact_ids: contactIds,\n });\n\n deal.lines.forEach((line, k) => {\n const product = products[line.p] ?? products[0];\n\n rows.line_items.push({\n ...record(idOf(50_000_000_000, index, n * 10 + k), deal.opened, deal.opened, now, {\n name: product.name,\n hs_sku: product.sku,\n hs_product_id: productId(line.p),\n quantity: String(line.quantity),\n price: String(product.price),\n amount: String(product.price * line.quantity),\n hs_recurring_billing_period: \"P12M\",\n }),\n deal_ids: [deal.id],\n });\n });\n\n rows.deal_split.push({\n ...record(idOf(55_000_000_000, index, n), deal.opened, deal.opened, now, {\n hs_split_percentage: \"1\",\n hubspot_owner_id: ownerId(owner),\n }),\n deal_ids: [deal.id],\n });\n\n if (deal.stage.id === \"contractsent\" || deal.closed) {\n const sent = between(deal.opened, deal.closed ?? now);\n\n rows.quotes.push({\n ...record(idOf(60_000_000_000, index, n), sent, sent, now, {\n hs_title: `Quote for ${name}`,\n hs_quote_amount: String(deal.amount),\n hs_currency: \"USD\",\n hs_expiration_date: iso(new Date(sent.getTime() + 30 * day)),\n hs_status: deal.won ? \"APPROVED\" : deal.closed ? \"REJECTED\" : \"PENDING_APPROVAL\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n\n if (deal.won && deal.closed) {\n // A won deal becomes a subscription, an order, and yearly invoices with payments.\n const start = deal.closed;\n\n rows.subscriptions.push({\n ...record(idOf(70_000_000_000, index, n), start, start, now, {\n hs_name: `${name} subscription`,\n hs_status: \"active\",\n hs_recurring_billing_start_date: iso(start),\n hs_recurring_billing_period: \"P12M\",\n hs_last_payment_amount: String(deal.amount),\n hs_currency_code: \"USD\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n rows.orders.push({\n ...record(idOf(71_000_000_000, index, n), start, start, now, {\n hs_order_name: `Order ${index + 1}-${n + 1}`,\n hs_total_price: String(deal.amount),\n hs_currency_code: \"USD\",\n hs_fulfillment_status: \"fulfilled\",\n hs_payment_status: \"paid\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n for (\n let year = 0, billed = start;\n billed <= now;\n year++, billed = new Date(start.getTime() + year * 365 * day)\n ) {\n const paid = new Date(billed.getTime() + faker.number.int({ min: day, max: 20 * day }));\n const settled = paid <= now;\n\n rows.invoices.push({\n ...record(\n idOf(72_000_000_000, index, n * 10 + year),\n billed,\n settled ? paid : billed,\n now,\n {\n hs_number: `INV-${index + 1}${n}${year + 1}`,\n hs_amount_billed: String(deal.amount),\n hs_currency: \"USD\",\n hs_invoice_status: settled ? \"paid\" : \"open\",\n hs_due_date: iso(new Date(billed.getTime() + 30 * day)),\n },\n ),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n\n if (settled) {\n rows.commerce_payments.push({\n ...record(idOf(73_000_000_000, index, n * 10 + year), paid, paid, now, {\n hs_initial_amount: String(deal.amount),\n hs_currency_code: \"USD\",\n hs_payment_method_type: faker.helpers.arrayElement([\"card\", \"ach\"]),\n hs_latest_status: \"succeeded\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n }\n }\n\n if (!deal.closed && faker.datatype.boolean({ probability: 0.3 })) {\n const left = between(deal.opened, now);\n\n rows.carts.push({\n ...record(idOf(74_000_000_000, index, n), left, left, now, {\n hs_cart_name: `${name} checkout`,\n hs_total_price: String(deal.amount),\n hs_currency_code: \"USD\",\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: [deal.id],\n });\n }\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { activityRows, ticketRows } from \"./activity\";\nimport { dealRows } from \"./deals\";\nimport {\n clock,\n type CompanyGroup,\n customObjectTypeId,\n day,\n dealStages,\n idOf,\n iso,\n ownerCount,\n ownerId,\n products,\n record,\n type Rows,\n} from \"./shared\";\n\n/** One group is one company with its contacts, deals, tickets, activity, and billing. */\nexport const companyRows = (index: number, context: Demo.DemoContext): Rows => {\n const { faker, now } = context;\n const { at, between } = clock(context);\n\n const rows: Rows = {\n companies: [],\n contacts: [],\n deals: [],\n line_items: [],\n quotes: [],\n deal_split: [],\n tickets: [],\n calls: [],\n emails: [],\n meetings: [],\n notes: [],\n tasks: [],\n communications: [],\n postal_mail: [],\n feedback_submissions: [],\n leads: [],\n invoices: [],\n orders: [],\n carts: [],\n commerce_payments: [],\n subscriptions: [],\n custom_objects: [],\n };\n\n const owner = faker.number.int({ max: ownerCount - 1 });\n const companyId = idOf(10_000_000_000, index);\n const name = faker.company.name();\n const domain = `${name.toLowerCase().replaceAll(/[^a-z]+/g, \"\")}.example.com`;\n const employees = faker.helpers.arrayElement([12, 45, 120, 380, 1_200, 5_000]);\n const created = at(now.getTime() - faker.number.int({ min: 20 * day, max: 700 * day }));\n\n // Contacts at the company. The first one is the main contact.\n const contacts = Array.from({ length: faker.number.int({ min: 1, max: 5 }) }, (_, n) => {\n const first = faker.person.firstName();\n const last = faker.person.lastName();\n\n return {\n id: idOf(20_000_000_000, index, n),\n first,\n last,\n email: `${first}.${last}@${domain}`.toLowerCase(),\n created: between(created, new Date(created.getTime() + 60 * day)),\n };\n });\n\n const contactIds = contacts.map((contact) => contact.id);\n\n // Deals: most companies have one, some two. Won deals bring billing records.\n const deals = Array.from(\n {\n length: faker.helpers.weightedArrayElement([\n { weight: 25, value: 0 },\n { weight: 55, value: 1 },\n { weight: 20, value: 2 },\n ]),\n },\n (_, n) => {\n const id = idOf(30_000_000_000, index, n);\n const opened = between(created, now);\n\n const stage = faker.helpers.weightedArrayElement([\n { weight: 35, value: dealStages[5] },\n { weight: 20, value: dealStages[6] },\n ...dealStages.slice(0, 5).map((value) => ({ weight: 9, value })),\n ]);\n\n const closed = stage.id.startsWith(\"closed\")\n ? between(opened, new Date(opened.getTime() + 90 * day))\n : null;\n\n const plan = faker.number.int({ max: 2 });\n\n const addOn = faker.helpers.maybe(() => 3 + faker.number.int({ max: 2 }), {\n probability: 0.5,\n });\n\n const lines = [plan, ...(addOn === undefined ? [] : [addOn])].map((p) => ({\n p,\n quantity: 1,\n }));\n\n const amount = lines.reduce(\n (sum, line) => sum + (products[line.p]?.price ?? 0) * line.quantity,\n 0,\n );\n\n return { id, opened, stage, closed, lines, amount, won: stage.id === \"closedwon\" };\n },\n );\n\n const dealIds = deals.map((deal) => deal.id);\n\n const lastTouch = new Date(\n Math.max(created.getTime(), ...deals.map((deal) => (deal.closed ?? deal.opened).getTime())),\n );\n\n const customer = deals.some((deal) => deal.won);\n\n rows.companies.push(\n record(companyId, created, lastTouch, now, {\n name,\n domain,\n industry: faker.helpers.arrayElement([\n \"COMPUTER_SOFTWARE\",\n \"FINANCIAL_SERVICES\",\n \"HOSPITAL_HEALTH_CARE\",\n \"RETAIL\",\n \"MARKETING_AND_ADVERTISING\",\n ]),\n numberofemployees: String(employees),\n annualrevenue: String(employees * faker.number.int({ min: 80_000, max: 200_000 })),\n city: faker.location.city(),\n country: \"United States\",\n lifecyclestage: customer ? \"customer\" : deals.length > 0 ? \"opportunity\" : \"lead\",\n hubspot_owner_id: ownerId(owner),\n num_associated_contacts: String(contacts.length),\n num_associated_deals: String(deals.length),\n }),\n );\n\n for (const contact of contacts) {\n rows.contacts.push({\n ...record(\n contact.id,\n contact.created,\n lastTouch > contact.created ? lastTouch : contact.created,\n now,\n {\n firstname: contact.first,\n lastname: contact.last,\n email: contact.email,\n jobtitle: faker.person.jobTitle(),\n phone: faker.phone.number({ style: \"international\" }),\n company: name,\n lifecyclestage: customer ? \"customer\" : \"salesqualifiedlead\",\n hubspot_owner_id: ownerId(owner),\n hs_lead_status: customer\n ? \"CONNECTED\"\n : faker.helpers.arrayElement([\"NEW\", \"OPEN\", \"IN_PROGRESS\"]),\n lastmodifieddate: iso(lastTouch > contact.created ? lastTouch : contact.created),\n },\n ),\n company_ids: [companyId],\n });\n }\n\n const main = contacts[0];\n\n if (main && !customer) {\n rows.leads.push({\n ...record(idOf(40_000_000_000, index), main.created, main.created, now, {\n hs_lead_name: `${main.first} ${main.last} - ${name}`,\n hs_lead_type: \"NEW_BUSINESS\",\n hs_pipeline: \"lead-pipeline-id\",\n hs_pipeline_stage: deals.length > 0 ? \"qualified-stage-id\" : \"new-stage-id\",\n hubspot_owner_id: ownerId(owner),\n }),\n company_ids: [companyId],\n contact_ids: [main.id],\n });\n }\n\n const company: CompanyGroup = {\n ...context,\n ...clock(context),\n rows,\n index,\n companyId,\n name,\n owner,\n created,\n contacts,\n contactIds,\n dealIds,\n customer,\n main,\n };\n\n deals.forEach((deal, n) => dealRows(company, deal, n));\n const tickets = ticketRows(company);\n activityRows(company, tickets);\n\n // Customers get a yearly NPS survey.\n if (customer && main && faker.datatype.boolean({ probability: 0.5 })) {\n const answered = between(created, now);\n\n const score = faker.helpers.weightedArrayElement([\n { weight: 50, value: faker.number.int({ min: 9, max: 10 }) },\n { weight: 30, value: faker.number.int({ min: 7, max: 8 }) },\n { weight: 20, value: faker.number.int({ min: 0, max: 6 }) },\n ]);\n\n rows.feedback_submissions.push({\n ...record(idOf(95_000_000_000, index), answered, answered, now, {\n hs_survey_type: \"NPS\",\n hs_survey_channel: \"EMAIL\",\n hs_response_value: String(score),\n hs_sentiment: score >= 9 ? \"Promoter\" : score >= 7 ? \"Passive\" : \"Detractor\",\n hs_submission_timestamp: iso(answered),\n }),\n company_ids: [companyId],\n contact_ids: [main.id],\n deal_ids: [],\n ticket_ids: [],\n });\n }\n\n if (customer) {\n const recordId = idOf(99_000_000_000, index);\n const started = deals.find((deal) => deal.won)?.closed ?? created;\n const done = at(started.getTime() + 45 * day);\n\n rows.custom_objects.push({\n key: `${customObjectTypeId}:${recordId}`,\n ...record(recordId, started, done, now, {\n project_name: `${name} onboarding`,\n project_status: done < now ? \"Live\" : \"In progress\",\n go_live_date: iso(done),\n }),\n company_ids: [companyId],\n contact_ids: main ? [main.id] : [],\n deal_ids: dealIds.slice(0, 1),\n ticket_ids: [],\n object_type_id: customObjectTypeId,\n object_type: \"implementation_project\",\n });\n }\n\n return rows;\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport type { Discount, Fee, GoalTarget, Product, Tax, User } from \"../schemas/crm\";\nimport type { List } from \"../schemas/lists\";\nimport type { Owner } from \"../schemas/owners\";\nimport type { Pipeline } from \"../schemas/pipelines\";\nimport type { Property } from \"../schemas/properties\";\nimport type { Team } from \"../schemas/teams\";\n\nimport {\n day,\n dealStages,\n iso,\n leadStages,\n ownerCount,\n ownerId,\n productId,\n products,\n record,\n teams,\n ticketStages,\n userId,\n} from \"./shared\";\n\n/** The portal setup, written once before any company. */\nexport const setupRows = ({ faker, now }: Demo.DemoContext) => {\n const setup = new Date(now.getTime() - 800 * day);\n\n const people = Array.from({ length: ownerCount }, () => {\n const first = faker.person.firstName();\n const last = faker.person.lastName();\n\n return {\n first,\n last,\n email: faker.internet.exampleEmail({ firstName: first, lastName: last }).toLowerCase(),\n };\n });\n\n const owners: Array<Owner> = people.map((person, o) => ({\n id: ownerId(o),\n version: now,\n type: \"PERSON\",\n email: person.email,\n first_name: person.first,\n last_name: person.last,\n user_id: BigInt(userId(o)),\n user_id_including_inactive: BigInt(userId(o)),\n teams: [\n {\n id: String(90_000 + (o % teams.length)),\n name: teams[o % teams.length] ?? \"Sales East\",\n primary: true,\n },\n ],\n archived: false,\n created_at: setup,\n }));\n\n const users: Array<User> = people.map((person, o) =>\n record(userId(o), setup, setup, now, {\n hs_internal_user_id: userId(o),\n hs_email: person.email,\n hs_given_name: person.first,\n hs_family_name: person.last,\n }),\n );\n\n const teamRows: Array<Team> = teams.map((name, t) => ({\n id: String(90_000 + t),\n version: now,\n name,\n members: people\n .map((_, o) => o)\n .filter((o) => o % teams.length === t)\n .map((o) => ({ user_id: userId(o), type: \"DEFAULT\" })),\n }));\n\n const pipelines: Array<Pipeline> = [\n {\n key: \"deals:default\",\n version: now,\n object_type: \"deals\",\n id: \"default\",\n label: \"Sales pipeline\",\n display_order: 0n,\n archived: false,\n stages: dealStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map([\n [\"probability\", stage.probability],\n [\"isClosed\", String(stage.id.startsWith(\"closed\"))],\n ]),\n })),\n created_at: setup,\n },\n {\n key: \"tickets:0\",\n version: now,\n object_type: \"tickets\",\n id: \"0\",\n label: \"Support pipeline\",\n display_order: 0n,\n archived: false,\n stages: ticketStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map([[\"ticketState\", stage.state]]),\n })),\n created_at: setup,\n },\n {\n key: \"leads:lead-pipeline-id\",\n version: now,\n object_type: \"leads\",\n id: \"lead-pipeline-id\",\n label: \"Lead pipeline\",\n display_order: 0n,\n archived: false,\n stages: leadStages.map((stage, s) => ({\n id: stage.id,\n label: stage.label,\n display_order: BigInt(s),\n archived: false,\n metadata: new Map(),\n })),\n created_at: setup,\n },\n ];\n\n const propertyRows: Array<Property> = (\n [\n [\"contacts\", \"email\", \"Email\", \"string\", \"text\", \"contactinformation\", []],\n [\n \"contacts\",\n \"lifecyclestage\",\n \"Lifecycle stage\",\n \"enumeration\",\n \"radio\",\n \"contactinformation\",\n [\n \"subscriber\",\n \"lead\",\n \"marketingqualifiedlead\",\n \"salesqualifiedlead\",\n \"opportunity\",\n \"customer\",\n ],\n ],\n [\n \"contacts\",\n \"hubspot_owner_id\",\n \"Contact owner\",\n \"enumeration\",\n \"select\",\n \"contactinformation\",\n [],\n ],\n [\n \"companies\",\n \"industry\",\n \"Industry\",\n \"enumeration\",\n \"select\",\n \"companyinformation\",\n [\n \"COMPUTER_SOFTWARE\",\n \"FINANCIAL_SERVICES\",\n \"HOSPITAL_HEALTH_CARE\",\n \"RETAIL\",\n \"MARKETING_AND_ADVERTISING\",\n ],\n ],\n [\n \"companies\",\n \"numberofemployees\",\n \"Number of employees\",\n \"number\",\n \"number\",\n \"companyinformation\",\n [],\n ],\n [\"deals\", \"amount\", \"Amount\", \"number\", \"number\", \"dealinformation\", []],\n [\n \"deals\",\n \"dealstage\",\n \"Deal stage\",\n \"enumeration\",\n \"radio\",\n \"dealinformation\",\n dealStages.map((stage) => stage.id),\n ],\n [\"deals\", \"closedate\", \"Close date\", \"datetime\", \"date\", \"dealinformation\", []],\n [\n \"tickets\",\n \"hs_ticket_priority\",\n \"Priority\",\n \"enumeration\",\n \"select\",\n \"ticketinformation\",\n [\"LOW\", \"MEDIUM\", \"HIGH\"],\n ],\n ] as const\n ).map(([objectType, name, label, type, fieldType, group, options]) => ({\n key: `${objectType}:${name}`,\n version: now,\n object_type: objectType,\n name,\n label,\n type,\n field_type: fieldType,\n description: \"\",\n group_name: group,\n options: options.map((value, o) => ({\n label: value.toLowerCase().replaceAll(\"_\", \" \"),\n value,\n display_order: BigInt(o),\n hidden: false,\n })),\n calculated: false,\n hidden: false,\n hubspot_defined: true,\n archived: false,\n created_at: setup,\n updated_at: setup,\n }));\n\n const lists: Array<List> = [\n [\"Newsletter subscribers\", \"DYNAMIC\", 2_400n],\n [\"Webinar attendees Q3\", \"SNAPSHOT\", 380n],\n [\"Customers\", \"DYNAMIC\", 620n],\n [\"Churn risk\", \"MANUAL\", 45n],\n ].map(([name, processing, size], l) => ({\n id: String(100 + l),\n version: now,\n name: String(name),\n object_type_id: \"0-1\",\n processing_type: String(processing),\n processing_status: \"COMPLETE\",\n size: BigInt(size),\n created_at: setup,\n updated_at: new Date(now.getTime() - day),\n filters_updated_at: setup,\n }));\n\n const productRows: Array<Product> = products.map((product, p) =>\n record(productId(p), setup, setup, now, {\n name: product.name,\n hs_sku: product.sku,\n price: String(product.price),\n description: `${product.name}, billed yearly`,\n hs_recurring_billing_period: product.sku.startsWith(\"SVC-ONBOARD\") ? \"\" : \"P12M\",\n recurringbillingfrequency: product.sku.startsWith(\"SVC-ONBOARD\") ? \"\" : \"annually\",\n }),\n );\n\n const discounts: Array<Discount> = [\n [\"Annual prepay\", \"PERCENT\", \"10\"],\n [\"Startup program\", \"PERCENT\", \"25\"],\n ].map(([label, type, value], d) =>\n record(String(3_100_000 + d), setup, setup, now, {\n hs_label: String(label),\n hs_type: String(type),\n hs_value: String(value),\n }),\n );\n\n const fees: Array<Fee> = [\n record(\"3200000\", setup, setup, now, {\n hs_label: \"Setup fee\",\n hs_type: \"FIXED\",\n hs_value: \"500\",\n }),\n ];\n\n const taxes: Array<Tax> = [\n record(\"3300000\", setup, setup, now, {\n hs_label: \"Sales tax (CA)\",\n hs_type: \"PERCENT\",\n hs_value: \"7.25\",\n }),\n record(\"3300001\", setup, setup, now, {\n hs_label: \"VAT (UK)\",\n hs_type: \"PERCENT\",\n hs_value: \"20\",\n }),\n ];\n\n // A revenue goal per owner for each of the last four quarters.\n const goals: Array<GoalTarget> = people.flatMap((person, o) =>\n [0, 1, 2, 3].map((q) => {\n const start = new Date(\n Date.UTC(now.getUTCFullYear(), Math.floor(now.getUTCMonth() / 3) * 3 - q * 3, 1),\n );\n\n const end = new Date(Date.UTC(start.getUTCFullYear(), start.getUTCMonth() + 3, 1) - 1);\n\n return record(String(3_400_000 + o * 10 + q), start, start, now, {\n hs_goal_name: `${person.first} ${person.last} revenue Q${Math.floor(start.getUTCMonth() / 3) + 1} ${start.getUTCFullYear()}`,\n hs_target_amount: String(faker.helpers.arrayElement([60_000, 80_000, 100_000, 120_000])),\n hs_start_datetime: iso(start),\n hs_end_datetime: iso(end),\n hubspot_owner_id: ownerId(o),\n });\n }),\n );\n\n return {\n owners,\n users,\n teams: teamRows,\n pipelines,\n properties: propertyRows,\n lists,\n products: productRows,\n discounts,\n fees,\n taxes,\n goal_targets: goals,\n };\n};\n","import { ConnectorApp, Demo, RuntimeConfig } from \"@useairfoil/connector-kit\";\nimport { Command } from \"effect/cli\";\n\nimport {\n CallSchema,\n CartSchema,\n CommercePaymentSchema,\n CommunicationSchema,\n CompanySchema,\n ContactSchema,\n CustomObjectSchema,\n DealSchema,\n DealSplitSchema,\n DiscountSchema,\n EmailSchema,\n FeeSchema,\n FeedbackSubmissionSchema,\n GoalTargetSchema,\n InvoiceSchema,\n LeadSchema,\n LineItemSchema,\n MeetingSchema,\n NoteSchema,\n OrderSchema,\n PostalMailSchema,\n ProductSchema,\n QuoteSchema,\n SubscriptionSchema,\n TaskSchema,\n TaxSchema,\n TicketSchema,\n UserSchema,\n} from \"../schemas/crm\";\nimport { ListSchema } from \"../schemas/lists\";\nimport { OwnerSchema } from \"../schemas/owners\";\nimport { PipelineSchema } from \"../schemas/pipelines\";\nimport { PropertySchema } from \"../schemas/properties\";\nimport { TeamSchema } from \"../schemas/teams\";\nimport { companyRows } from \"./companies\";\nimport { setupRows } from \"./setup\";\n\nexport const demo = Demo.define({\n name: \"producer-hubspot\",\n setup: {\n tables: [\n Demo.table({ name: \"owners\", rowSchema: OwnerSchema, version: \"version\" }),\n Demo.table({ name: \"users\", rowSchema: UserSchema, version: \"version\" }),\n Demo.table({ name: \"teams\", rowSchema: TeamSchema, version: \"version\" }),\n Demo.table({ name: \"pipelines\", rowSchema: PipelineSchema, version: \"version\" }),\n Demo.table({ name: \"properties\", rowSchema: PropertySchema, version: \"version\" }),\n Demo.table({ name: \"lists\", rowSchema: ListSchema, version: \"version\" }),\n Demo.table({ name: \"products\", rowSchema: ProductSchema, version: \"version\" }),\n Demo.table({ name: \"discounts\", rowSchema: DiscountSchema, version: \"version\" }),\n Demo.table({ name: \"fees\", rowSchema: FeeSchema, version: \"version\" }),\n Demo.table({ name: \"taxes\", rowSchema: TaxSchema, version: \"version\" }),\n Demo.table({ name: \"goal_targets\", rowSchema: GoalTargetSchema, version: \"version\" }),\n ],\n rows: setupRows,\n },\n group: {\n tables: [\n Demo.table({ name: \"companies\", rowSchema: CompanySchema, version: \"version\" }),\n Demo.table({ name: \"contacts\", rowSchema: ContactSchema, version: \"version\" }),\n Demo.table({ name: \"deals\", rowSchema: DealSchema, version: \"version\" }),\n Demo.table({ name: \"line_items\", rowSchema: LineItemSchema, version: \"version\" }),\n Demo.table({ name: \"quotes\", rowSchema: QuoteSchema, version: \"version\" }),\n Demo.table({ name: \"deal_split\", rowSchema: DealSplitSchema, version: \"version\" }),\n Demo.table({ name: \"tickets\", rowSchema: TicketSchema, version: \"version\" }),\n Demo.table({ name: \"calls\", rowSchema: CallSchema, version: \"version\" }),\n Demo.table({ name: \"emails\", rowSchema: EmailSchema, version: \"version\" }),\n Demo.table({ name: \"meetings\", rowSchema: MeetingSchema, version: \"version\" }),\n Demo.table({ name: \"notes\", rowSchema: NoteSchema, version: \"version\" }),\n Demo.table({ name: \"tasks\", rowSchema: TaskSchema, version: \"version\" }),\n Demo.table({ name: \"communications\", rowSchema: CommunicationSchema, version: \"version\" }),\n Demo.table({ name: \"postal_mail\", rowSchema: PostalMailSchema, version: \"version\" }),\n Demo.table({\n name: \"feedback_submissions\",\n rowSchema: FeedbackSubmissionSchema,\n version: \"version\",\n }),\n Demo.table({ name: \"leads\", rowSchema: LeadSchema, version: \"version\" }),\n Demo.table({ name: \"invoices\", rowSchema: InvoiceSchema, version: \"version\" }),\n Demo.table({ name: \"orders\", rowSchema: OrderSchema, version: \"version\" }),\n Demo.table({ name: \"carts\", rowSchema: CartSchema, version: \"version\" }),\n Demo.table({\n name: \"commerce_payments\",\n rowSchema: CommercePaymentSchema,\n version: \"version\",\n }),\n Demo.table({ name: \"subscriptions\", rowSchema: SubscriptionSchema, version: \"version\" }),\n Demo.table({ name: \"custom_objects\", rowSchema: CustomObjectSchema, version: \"version\" }),\n ],\n rows: companyRows,\n },\n});\n\nexport const demoCommand = ConnectorApp.makeDemoCommand(demo).pipe(\n Command.provide(RuntimeConfig.layerHosted()),\n);\n","import {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Effect, Layer, Logger } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { HubSpotConnector } from \"./index\";\n\nconst ConnectorLayer = HubSpotConnector.layerConfig(HubSpotConnector.HubSpotConfigDef.config);\n\nconst TelemetryLayer = Layer.mergeAll(Telemetry.layerOtlp(), Telemetry.layerMetricsConsoleDump());\n\nexport const sandboxCommand = Command.make(\"sandbox\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* HubSpotConnector.HubSpotConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port });\n }).pipe(\n Effect.annotateLogs({ component: \"hubspot\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStore.layerMemory,\n Ingestor.layerConsole,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n ),\n).pipe(Command.withDescription(\"Run the connector locally and log ingested data\"));\n","import { PgClient } from \"@effect/sql-pg\";\nimport {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Config, Effect, Layer, Logger, Schema } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { HubSpotConnector } from \"./index\";\n\nconst ConnectorLayer = HubSpotConnector.layerConfig(HubSpotConnector.HubSpotConfigDef.config);\nconst TelemetryLayer = Telemetry.layerOtlp();\nconst PostgresLayer = PgClient.layerConfig({\n url: Config.schema(\n Schema.Redacted(Schema.NonEmptyString),\n RuntimeConfig.PlatformRuntimeKey.postgresConnectionString,\n ),\n maxConnections: Config.succeed(2),\n connectTimeout: Config.succeed(\"5 seconds\"),\n applicationName: Config.succeed(\"airfoil-producer-hubspot\"),\n});\nconst StateStoreLayer = StateStore.layerSql().pipe(Layer.provide(PostgresLayer));\n\nexport const startCommand = Command.make(\"start\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* HubSpotConnector.HubSpotConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port }).pipe(\n Effect.provide(Ingestor.layerArrowFlightConfig(entrypoint)),\n );\n }).pipe(\n Effect.annotateLogs({ component: \"hubspot\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStoreLayer,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n Effect.provide(RuntimeConfig.layerHosted()),\n ),\n).pipe(Command.withDescription(\"Run the connector\"));\n","#!/usr/bin/env node\n\nimport { NodeRuntime, NodeServices } from \"@effect/platform-node\";\nimport { Effect, Layer } from \"effect\";\nimport { Command } from \"effect/cli\";\nimport { FetchHttpClient } from \"effect/http\";\n\nimport packageJson from \"../package.json\";\nimport { createTableCommand, setupCommand } from \"./create-table\";\nimport { demoCommand } from \"./demo\";\nimport { sandboxCommand } from \"./sandbox\";\nimport { startCommand } from \"./start\";\n\nconst BootstrapLayer = Layer.mergeAll(FetchHttpClient.layer, NodeServices.layer);\n\nconst program = Command.make(\"producer-hubspot\", {}, () => Effect.void).pipe(\n Command.withSubcommands([\n setupCommand,\n startCommand,\n sandboxCommand,\n createTableCommand,\n demoCommand,\n ]),\n);\n\nconst cli = Command.run(program, { version: packageJson.version });\n\nNodeRuntime.runMain(cli.pipe(Effect.provide(BootstrapLayer), Effect.scoped));\n"],"mappings":";;;;;;;;;;;;;ACsCA,MAAa,eAAqD;CAChE,UAAU;CACV,WAAW;CACX,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,UAAU;CACV,OAAO;CACP,OAAO;CACP,gBAAgB;CAChB,aAAa;CACb,sBAAsB;CACtB,YAAY;CACZ,UAAU;CACV,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,mBAAmB;CACnB,eAAe;CACf,WAAW;CACX,MAAM;CACN,OAAO;CACP,cAAc;CACd,OAAO;CACP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