@koda-sl/baker-cli 0.332.0 → 0.334.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +367 -330
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4918,7 +4918,15 @@ var scheduledEffectSchema = z13.object({
|
|
|
4918
4918
|
op: effectOpSchema,
|
|
4919
4919
|
staged: z13.boolean(),
|
|
4920
4920
|
name: z13.string(),
|
|
4921
|
-
summary: z13.string().nullable()
|
|
4921
|
+
summary: z13.string().nullable(),
|
|
4922
|
+
/**
|
|
4923
|
+
* What the publish did with this op, or null while it is still staged. `op`
|
|
4924
|
+
* is what was asked for; this is whether it happened — a task whose schedule
|
|
4925
|
+
* could not be saved still reads `op: "created"`.
|
|
4926
|
+
*/
|
|
4927
|
+
outcome: z13.enum(["applied", "failed", "skipped"]).nullable(),
|
|
4928
|
+
/** Why it failed or was skipped, or how it was applied differently (e.g. switched off). */
|
|
4929
|
+
reason: z13.string().nullable()
|
|
4922
4930
|
});
|
|
4923
4931
|
var tagEffectSchema = z13.object({
|
|
4924
4932
|
op: effectOpSchema,
|
|
@@ -5919,6 +5927,321 @@ var historyListResponseSchema = z17.object({
|
|
|
5919
5927
|
|
|
5920
5928
|
// ../api/src/hubspot.ts
|
|
5921
5929
|
import { z as z18 } from "zod";
|
|
5930
|
+
|
|
5931
|
+
// ../api/src/event-ingest/currency.ts
|
|
5932
|
+
var MINOR_UNITS = {
|
|
5933
|
+
AED: 2,
|
|
5934
|
+
AFN: 2,
|
|
5935
|
+
ALL: 2,
|
|
5936
|
+
AMD: 2,
|
|
5937
|
+
ANG: 2,
|
|
5938
|
+
AOA: 2,
|
|
5939
|
+
ARS: 2,
|
|
5940
|
+
AUD: 2,
|
|
5941
|
+
AWG: 2,
|
|
5942
|
+
AZN: 2,
|
|
5943
|
+
BAM: 2,
|
|
5944
|
+
BBD: 2,
|
|
5945
|
+
BDT: 2,
|
|
5946
|
+
BGN: 2,
|
|
5947
|
+
BHD: 3,
|
|
5948
|
+
BIF: 0,
|
|
5949
|
+
BMD: 2,
|
|
5950
|
+
BND: 2,
|
|
5951
|
+
BOB: 2,
|
|
5952
|
+
BOV: 2,
|
|
5953
|
+
BRL: 2,
|
|
5954
|
+
BSD: 2,
|
|
5955
|
+
BTN: 2,
|
|
5956
|
+
BWP: 2,
|
|
5957
|
+
BYN: 2,
|
|
5958
|
+
BZD: 2,
|
|
5959
|
+
CAD: 2,
|
|
5960
|
+
CDF: 2,
|
|
5961
|
+
CHE: 2,
|
|
5962
|
+
CHF: 2,
|
|
5963
|
+
CHW: 2,
|
|
5964
|
+
CLF: 4,
|
|
5965
|
+
CLP: 0,
|
|
5966
|
+
CNY: 2,
|
|
5967
|
+
COP: 2,
|
|
5968
|
+
COU: 4,
|
|
5969
|
+
CRC: 2,
|
|
5970
|
+
CUP: 2,
|
|
5971
|
+
CVE: 2,
|
|
5972
|
+
CZK: 2,
|
|
5973
|
+
DJF: 0,
|
|
5974
|
+
DKK: 2,
|
|
5975
|
+
DOP: 2,
|
|
5976
|
+
DZD: 2,
|
|
5977
|
+
EGP: 2,
|
|
5978
|
+
ERN: 2,
|
|
5979
|
+
ETB: 2,
|
|
5980
|
+
EUR: 2,
|
|
5981
|
+
FJD: 2,
|
|
5982
|
+
FKP: 2,
|
|
5983
|
+
GBP: 2,
|
|
5984
|
+
GEL: 2,
|
|
5985
|
+
GHS: 2,
|
|
5986
|
+
GIP: 2,
|
|
5987
|
+
GMD: 2,
|
|
5988
|
+
GNF: 0,
|
|
5989
|
+
GTQ: 2,
|
|
5990
|
+
GYD: 2,
|
|
5991
|
+
HKD: 2,
|
|
5992
|
+
HNL: 2,
|
|
5993
|
+
HTG: 2,
|
|
5994
|
+
HUF: 2,
|
|
5995
|
+
IDR: 2,
|
|
5996
|
+
ILS: 2,
|
|
5997
|
+
INR: 2,
|
|
5998
|
+
IQD: 3,
|
|
5999
|
+
IRR: 2,
|
|
6000
|
+
ISK: 0,
|
|
6001
|
+
JMD: 2,
|
|
6002
|
+
JOD: 3,
|
|
6003
|
+
JPY: 0,
|
|
6004
|
+
KES: 2,
|
|
6005
|
+
KGS: 2,
|
|
6006
|
+
KHR: 2,
|
|
6007
|
+
KMF: 0,
|
|
6008
|
+
KPW: 2,
|
|
6009
|
+
KRW: 0,
|
|
6010
|
+
KWD: 3,
|
|
6011
|
+
KYD: 2,
|
|
6012
|
+
KZT: 2,
|
|
6013
|
+
LAK: 2,
|
|
6014
|
+
LBP: 2,
|
|
6015
|
+
LKR: 2,
|
|
6016
|
+
LRD: 2,
|
|
6017
|
+
LSL: 2,
|
|
6018
|
+
LYD: 3,
|
|
6019
|
+
MAD: 2,
|
|
6020
|
+
MDL: 2,
|
|
6021
|
+
MGA: 2,
|
|
6022
|
+
MKD: 2,
|
|
6023
|
+
MMK: 2,
|
|
6024
|
+
MNT: 2,
|
|
6025
|
+
MOP: 2,
|
|
6026
|
+
MRU: 2,
|
|
6027
|
+
MUR: 2,
|
|
6028
|
+
MVR: 2,
|
|
6029
|
+
MWK: 2,
|
|
6030
|
+
MXN: 2,
|
|
6031
|
+
MXV: 2,
|
|
6032
|
+
MYR: 2,
|
|
6033
|
+
MZN: 2,
|
|
6034
|
+
NAD: 2,
|
|
6035
|
+
NGN: 2,
|
|
6036
|
+
NIO: 2,
|
|
6037
|
+
NOK: 2,
|
|
6038
|
+
NPR: 2,
|
|
6039
|
+
NZD: 2,
|
|
6040
|
+
OMR: 3,
|
|
6041
|
+
PAB: 2,
|
|
6042
|
+
PEN: 2,
|
|
6043
|
+
PGK: 2,
|
|
6044
|
+
PHP: 2,
|
|
6045
|
+
PKR: 2,
|
|
6046
|
+
PLN: 2,
|
|
6047
|
+
PYG: 0,
|
|
6048
|
+
QAR: 2,
|
|
6049
|
+
RON: 2,
|
|
6050
|
+
RSD: 2,
|
|
6051
|
+
RUB: 2,
|
|
6052
|
+
RWF: 0,
|
|
6053
|
+
SAR: 2,
|
|
6054
|
+
SBD: 2,
|
|
6055
|
+
SCR: 2,
|
|
6056
|
+
SDG: 2,
|
|
6057
|
+
SEK: 2,
|
|
6058
|
+
SGD: 2,
|
|
6059
|
+
SHP: 2,
|
|
6060
|
+
SLE: 2,
|
|
6061
|
+
SOS: 2,
|
|
6062
|
+
SRD: 2,
|
|
6063
|
+
SSP: 2,
|
|
6064
|
+
STN: 2,
|
|
6065
|
+
SVC: 2,
|
|
6066
|
+
SYP: 2,
|
|
6067
|
+
SZL: 2,
|
|
6068
|
+
THB: 2,
|
|
6069
|
+
TJS: 2,
|
|
6070
|
+
TMT: 2,
|
|
6071
|
+
TND: 3,
|
|
6072
|
+
TOP: 2,
|
|
6073
|
+
TRY: 2,
|
|
6074
|
+
TTD: 2,
|
|
6075
|
+
TWD: 2,
|
|
6076
|
+
TZS: 2,
|
|
6077
|
+
UAH: 2,
|
|
6078
|
+
UGX: 0,
|
|
6079
|
+
USD: 2,
|
|
6080
|
+
USN: 2,
|
|
6081
|
+
UYI: 0,
|
|
6082
|
+
UYU: 2,
|
|
6083
|
+
UYW: 4,
|
|
6084
|
+
UZS: 2,
|
|
6085
|
+
VED: 2,
|
|
6086
|
+
VES: 2,
|
|
6087
|
+
VND: 0,
|
|
6088
|
+
VUV: 0,
|
|
6089
|
+
WST: 2,
|
|
6090
|
+
XAF: 0,
|
|
6091
|
+
XAG: 0,
|
|
6092
|
+
XAU: 0,
|
|
6093
|
+
XBA: 0,
|
|
6094
|
+
XBB: 0,
|
|
6095
|
+
XBC: 0,
|
|
6096
|
+
XBD: 0,
|
|
6097
|
+
XCD: 2,
|
|
6098
|
+
XCG: 2,
|
|
6099
|
+
XDR: 0,
|
|
6100
|
+
XOF: 0,
|
|
6101
|
+
XPD: 0,
|
|
6102
|
+
XPF: 0,
|
|
6103
|
+
XPT: 0,
|
|
6104
|
+
XSU: 0,
|
|
6105
|
+
XTS: 0,
|
|
6106
|
+
XUA: 0,
|
|
6107
|
+
XXX: 0,
|
|
6108
|
+
YER: 2,
|
|
6109
|
+
ZAR: 2,
|
|
6110
|
+
ZMW: 2,
|
|
6111
|
+
ZWG: 2,
|
|
6112
|
+
// Withdrawn recently enough that a client's CRM still carries them. Accepting
|
|
6113
|
+
// a code that was legal tender last year costs nothing; rejecting a real
|
|
6114
|
+
// historical `won` costs the client a reconciliation they cannot fix.
|
|
6115
|
+
SLL: 2,
|
|
6116
|
+
ZWL: 2,
|
|
6117
|
+
CUC: 2,
|
|
6118
|
+
HRK: 2
|
|
6119
|
+
};
|
|
6120
|
+
var ISO_4217_CODES = new Set(Object.keys(MINOR_UNITS));
|
|
6121
|
+
|
|
6122
|
+
// ../api/src/event-ingest/names.ts
|
|
6123
|
+
var STANDARD_EVENT_NAMES = [
|
|
6124
|
+
{ name: "page_view", means: "A page was served somewhere Baker does not run." },
|
|
6125
|
+
{ name: "view_content", means: "Someone looked at a specific thing \u2014 a listing, a property, an article." },
|
|
6126
|
+
{ name: "lead", means: "Someone became a lead: they handed over a way to reach them." },
|
|
6127
|
+
{ name: "contact", means: "Someone got in touch \u2014 a call, a chat, an email in." },
|
|
6128
|
+
{ name: "schedule", means: "A meeting, viewing or call was booked." },
|
|
6129
|
+
{ name: "sign_up", means: "An account was created." },
|
|
6130
|
+
{ name: "start_trial", means: "A trial began." },
|
|
6131
|
+
{ name: "subscribe", means: "A subscription started." },
|
|
6132
|
+
{ name: "qualified_lead", means: "Sales judged the lead worth working. The first event only you can send." },
|
|
6133
|
+
{ name: "opportunity", means: "A deal was opened against the lead." },
|
|
6134
|
+
{ name: "deal_won", means: "The deal closed. Send the money on it." },
|
|
6135
|
+
{ name: "deal_lost", means: "The deal was lost. Send it \u2014 a campaign that only reports wins reads as free." },
|
|
6136
|
+
{ name: "purchase", means: "Something was paid for. Send the money on it." },
|
|
6137
|
+
{ name: "refund", means: "Money went back. A separate event, never a negative amount." }
|
|
6138
|
+
];
|
|
6139
|
+
|
|
6140
|
+
// ../api/src/event-ingest/validation.ts
|
|
6141
|
+
var REJECTION_CODES = [
|
|
6142
|
+
"invalid_event_id",
|
|
6143
|
+
"invalid_name",
|
|
6144
|
+
"missing_identity",
|
|
6145
|
+
"invalid_timestamp",
|
|
6146
|
+
"invalid_value",
|
|
6147
|
+
"batch_too_large"
|
|
6148
|
+
];
|
|
6149
|
+
var EVENT_INGEST_BATCH_MAX = 500;
|
|
6150
|
+
var EVENT_INGEST_BODY_MAX_BYTES = 8 * 1024 * 1024;
|
|
6151
|
+
var EVENT_INGEST_REQUESTS_PER_MINUTE = 60;
|
|
6152
|
+
var FUTURE_TOLERANCE_MS = 5 * 6e4;
|
|
6153
|
+
var MAX_EVENT_NAME = 80;
|
|
6154
|
+
var EVENT_NAME = /^[\p{L}\p{N}][\p{L}\p{M}\p{N} ._-]*$/u;
|
|
6155
|
+
function validateEventName(name) {
|
|
6156
|
+
const value = typeof name === "string" ? name.trim() : "";
|
|
6157
|
+
if (value === "" || value.length > MAX_EVENT_NAME || !EVENT_NAME.test(value)) return "invalid_name";
|
|
6158
|
+
return null;
|
|
6159
|
+
}
|
|
6160
|
+
var REJECTION_MESSAGES = {
|
|
6161
|
+
invalid_event_id: "event_id, when sent, must be 1-128 characters of A-Z a-z 0-9 . _ : -",
|
|
6162
|
+
invalid_name: "event_name is required: up to 80 characters of letters (any language), digits, spaces, . _ and -, starting with a letter or a digit",
|
|
6163
|
+
missing_identity: "user_data named nobody, and no url named a page",
|
|
6164
|
+
invalid_timestamp: "event_time must be an ISO-8601 instant with an offset or Unix seconds, and not in the future",
|
|
6165
|
+
invalid_value: "value and currency go together: a non-negative decimal and an ISO-4217 code",
|
|
6166
|
+
batch_too_large: `a request carries at most ${EVENT_INGEST_BATCH_MAX} events and ${EVENT_INGEST_BODY_MAX_BYTES / (1024 * 1024)} MB`
|
|
6167
|
+
};
|
|
6168
|
+
|
|
6169
|
+
// ../api/src/event-sources/hubspotTrigger.ts
|
|
6170
|
+
var HUBSPOT_PROPERTY_KINDS = ["string", "number", "date", "boolean", "select"];
|
|
6171
|
+
var EMPTY = [
|
|
6172
|
+
{ value: "isEmpty", label: "is empty", hubspotLabel: "is unknown", arity: "none" },
|
|
6173
|
+
{ value: "isNotEmpty", label: "is not empty", hubspotLabel: "is known", arity: "none" }
|
|
6174
|
+
];
|
|
6175
|
+
var HUBSPOT_OPERATORS = {
|
|
6176
|
+
string: [
|
|
6177
|
+
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
6178
|
+
{ value: "isNot", label: "is not", hubspotLabel: "is not equal to", arity: "one" },
|
|
6179
|
+
{ value: "contains", label: "contains", hubspotLabel: "contains", arity: "one" },
|
|
6180
|
+
{ value: "doesNotContain", label: "does not contain", hubspotLabel: "doesn't contain", arity: "one" },
|
|
6181
|
+
{ value: "startsWith", label: "starts with", hubspotLabel: "starts with", arity: "one" },
|
|
6182
|
+
{ value: "endsWith", label: "ends with", hubspotLabel: "ends with", arity: "one" },
|
|
6183
|
+
...EMPTY
|
|
6184
|
+
],
|
|
6185
|
+
number: [
|
|
6186
|
+
{ value: "equal", label: "=", hubspotLabel: "is equal to", arity: "one" },
|
|
6187
|
+
{ value: "notEqual", label: "\u2260", hubspotLabel: "is not equal to", arity: "one" },
|
|
6188
|
+
{ value: "lessThan", label: "<", hubspotLabel: "is less than", arity: "one" },
|
|
6189
|
+
{ value: "lessThanOrEqual", label: "\u2264", hubspotLabel: "is less than or equal to", arity: "one" },
|
|
6190
|
+
{ value: "greaterThan", label: ">", hubspotLabel: "is greater than", arity: "one" },
|
|
6191
|
+
{ value: "greaterThanOrEqual", label: "\u2265", hubspotLabel: "is greater than or equal to", arity: "one" },
|
|
6192
|
+
...EMPTY
|
|
6193
|
+
],
|
|
6194
|
+
date: [
|
|
6195
|
+
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
6196
|
+
{ value: "isBefore", label: "is before", hubspotLabel: "is before", arity: "one" },
|
|
6197
|
+
{ value: "isAfter", label: "is after", hubspotLabel: "is after", arity: "one" },
|
|
6198
|
+
{ value: "isOnOrBefore", label: "is on or before", hubspotLabel: "is on or before", arity: "one" },
|
|
6199
|
+
{ value: "isOnOrAfter", label: "is on or after", hubspotLabel: "is on or after", arity: "one" },
|
|
6200
|
+
{ value: "isBetween", label: "is between", hubspotLabel: "is between", arity: "two" },
|
|
6201
|
+
...EMPTY
|
|
6202
|
+
],
|
|
6203
|
+
boolean: [
|
|
6204
|
+
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
6205
|
+
{ value: "isNot", label: "is not", hubspotLabel: "is not equal to", arity: "one" }
|
|
6206
|
+
],
|
|
6207
|
+
select: [
|
|
6208
|
+
{ value: "is", label: "is", hubspotLabel: "is any of", arity: "many" },
|
|
6209
|
+
{ value: "isNot", label: "is not", hubspotLabel: "is none of", arity: "many" },
|
|
6210
|
+
...EMPTY
|
|
6211
|
+
]
|
|
6212
|
+
};
|
|
6213
|
+
var CONDITION_LOGICS = ["And", "Or"];
|
|
6214
|
+
var TRIGGER_CONDITIONS_MAX = 10;
|
|
6215
|
+
function isConditionGroup(item) {
|
|
6216
|
+
return "logic" in item && "conditions" in item && Array.isArray(item.conditions);
|
|
6217
|
+
}
|
|
6218
|
+
function onlyCondition(condition) {
|
|
6219
|
+
return { logic: "And", conditions: [condition] };
|
|
6220
|
+
}
|
|
6221
|
+
function triggerConditions(trigger) {
|
|
6222
|
+
return trigger.conditions.flatMap((item) => isConditionGroup(item) ? item.conditions : [item]);
|
|
6223
|
+
}
|
|
6224
|
+
function triggerProblem(trigger) {
|
|
6225
|
+
if (trigger.conditions.length === 0) return "A trigger needs at least one condition.";
|
|
6226
|
+
for (const item of trigger.conditions) {
|
|
6227
|
+
if (!isConditionGroup(item)) continue;
|
|
6228
|
+
if (item.conditions.length === 0) return "A group needs at least one condition.";
|
|
6229
|
+
if (item.conditions.some((inner) => isConditionGroup(inner))) {
|
|
6230
|
+
return "Groups go one level deep, as in a Form's filter: a group cannot hold another group.";
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
if (triggerConditions(trigger).length > TRIGGER_CONDITIONS_MAX) {
|
|
6234
|
+
return `A trigger takes at most ${TRIGGER_CONDITIONS_MAX} conditions.`;
|
|
6235
|
+
}
|
|
6236
|
+
return null;
|
|
6237
|
+
}
|
|
6238
|
+
var HUBSPOT_OBJECTS = ["contact", "deal", "lead"];
|
|
6239
|
+
var HUBSPOT_DEAL_CONTACTS = ["first", "every"];
|
|
6240
|
+
function readsAssociatedContact(object) {
|
|
6241
|
+
return object !== "contact";
|
|
6242
|
+
}
|
|
6243
|
+
|
|
6244
|
+
// ../api/src/hubspot.ts
|
|
5922
6245
|
var hubspotEmbedTypeSchema = z18.enum(["legacy", "v4", "unknown"]);
|
|
5923
6246
|
var hubspotPostSubmitActionSchema = z18.object({
|
|
5924
6247
|
type: z18.enum(["redirect_url", "thank_you"]),
|
|
@@ -6161,7 +6484,7 @@ var hubspotContactLookupResponseSchema = z18.object({
|
|
|
6161
6484
|
companyReadable: z18.boolean()
|
|
6162
6485
|
})
|
|
6163
6486
|
});
|
|
6164
|
-
var hubspotObjectRequestSchema = z18.enum(
|
|
6487
|
+
var hubspotObjectRequestSchema = z18.enum(HUBSPOT_OBJECTS).default("contact");
|
|
6165
6488
|
var hubspotContactPropertiesListRequestSchema = z18.object({ object: hubspotObjectRequestSchema });
|
|
6166
6489
|
var hubspotContactPropertyOptionSchema = z18.object({
|
|
6167
6490
|
value: z18.string(),
|
|
@@ -29546,244 +29869,6 @@ function eventSourceCurl(url) {
|
|
|
29546
29869
|
return [`curl -X POST ${url} \\`, ` -H 'Content-Type: application/json' \\`, ` -d '${body}'`].join("\n");
|
|
29547
29870
|
}
|
|
29548
29871
|
|
|
29549
|
-
// ../api/src/event-ingest/currency.ts
|
|
29550
|
-
var MINOR_UNITS = {
|
|
29551
|
-
AED: 2,
|
|
29552
|
-
AFN: 2,
|
|
29553
|
-
ALL: 2,
|
|
29554
|
-
AMD: 2,
|
|
29555
|
-
ANG: 2,
|
|
29556
|
-
AOA: 2,
|
|
29557
|
-
ARS: 2,
|
|
29558
|
-
AUD: 2,
|
|
29559
|
-
AWG: 2,
|
|
29560
|
-
AZN: 2,
|
|
29561
|
-
BAM: 2,
|
|
29562
|
-
BBD: 2,
|
|
29563
|
-
BDT: 2,
|
|
29564
|
-
BGN: 2,
|
|
29565
|
-
BHD: 3,
|
|
29566
|
-
BIF: 0,
|
|
29567
|
-
BMD: 2,
|
|
29568
|
-
BND: 2,
|
|
29569
|
-
BOB: 2,
|
|
29570
|
-
BOV: 2,
|
|
29571
|
-
BRL: 2,
|
|
29572
|
-
BSD: 2,
|
|
29573
|
-
BTN: 2,
|
|
29574
|
-
BWP: 2,
|
|
29575
|
-
BYN: 2,
|
|
29576
|
-
BZD: 2,
|
|
29577
|
-
CAD: 2,
|
|
29578
|
-
CDF: 2,
|
|
29579
|
-
CHE: 2,
|
|
29580
|
-
CHF: 2,
|
|
29581
|
-
CHW: 2,
|
|
29582
|
-
CLF: 4,
|
|
29583
|
-
CLP: 0,
|
|
29584
|
-
CNY: 2,
|
|
29585
|
-
COP: 2,
|
|
29586
|
-
COU: 4,
|
|
29587
|
-
CRC: 2,
|
|
29588
|
-
CUP: 2,
|
|
29589
|
-
CVE: 2,
|
|
29590
|
-
CZK: 2,
|
|
29591
|
-
DJF: 0,
|
|
29592
|
-
DKK: 2,
|
|
29593
|
-
DOP: 2,
|
|
29594
|
-
DZD: 2,
|
|
29595
|
-
EGP: 2,
|
|
29596
|
-
ERN: 2,
|
|
29597
|
-
ETB: 2,
|
|
29598
|
-
EUR: 2,
|
|
29599
|
-
FJD: 2,
|
|
29600
|
-
FKP: 2,
|
|
29601
|
-
GBP: 2,
|
|
29602
|
-
GEL: 2,
|
|
29603
|
-
GHS: 2,
|
|
29604
|
-
GIP: 2,
|
|
29605
|
-
GMD: 2,
|
|
29606
|
-
GNF: 0,
|
|
29607
|
-
GTQ: 2,
|
|
29608
|
-
GYD: 2,
|
|
29609
|
-
HKD: 2,
|
|
29610
|
-
HNL: 2,
|
|
29611
|
-
HTG: 2,
|
|
29612
|
-
HUF: 2,
|
|
29613
|
-
IDR: 2,
|
|
29614
|
-
ILS: 2,
|
|
29615
|
-
INR: 2,
|
|
29616
|
-
IQD: 3,
|
|
29617
|
-
IRR: 2,
|
|
29618
|
-
ISK: 0,
|
|
29619
|
-
JMD: 2,
|
|
29620
|
-
JOD: 3,
|
|
29621
|
-
JPY: 0,
|
|
29622
|
-
KES: 2,
|
|
29623
|
-
KGS: 2,
|
|
29624
|
-
KHR: 2,
|
|
29625
|
-
KMF: 0,
|
|
29626
|
-
KPW: 2,
|
|
29627
|
-
KRW: 0,
|
|
29628
|
-
KWD: 3,
|
|
29629
|
-
KYD: 2,
|
|
29630
|
-
KZT: 2,
|
|
29631
|
-
LAK: 2,
|
|
29632
|
-
LBP: 2,
|
|
29633
|
-
LKR: 2,
|
|
29634
|
-
LRD: 2,
|
|
29635
|
-
LSL: 2,
|
|
29636
|
-
LYD: 3,
|
|
29637
|
-
MAD: 2,
|
|
29638
|
-
MDL: 2,
|
|
29639
|
-
MGA: 2,
|
|
29640
|
-
MKD: 2,
|
|
29641
|
-
MMK: 2,
|
|
29642
|
-
MNT: 2,
|
|
29643
|
-
MOP: 2,
|
|
29644
|
-
MRU: 2,
|
|
29645
|
-
MUR: 2,
|
|
29646
|
-
MVR: 2,
|
|
29647
|
-
MWK: 2,
|
|
29648
|
-
MXN: 2,
|
|
29649
|
-
MXV: 2,
|
|
29650
|
-
MYR: 2,
|
|
29651
|
-
MZN: 2,
|
|
29652
|
-
NAD: 2,
|
|
29653
|
-
NGN: 2,
|
|
29654
|
-
NIO: 2,
|
|
29655
|
-
NOK: 2,
|
|
29656
|
-
NPR: 2,
|
|
29657
|
-
NZD: 2,
|
|
29658
|
-
OMR: 3,
|
|
29659
|
-
PAB: 2,
|
|
29660
|
-
PEN: 2,
|
|
29661
|
-
PGK: 2,
|
|
29662
|
-
PHP: 2,
|
|
29663
|
-
PKR: 2,
|
|
29664
|
-
PLN: 2,
|
|
29665
|
-
PYG: 0,
|
|
29666
|
-
QAR: 2,
|
|
29667
|
-
RON: 2,
|
|
29668
|
-
RSD: 2,
|
|
29669
|
-
RUB: 2,
|
|
29670
|
-
RWF: 0,
|
|
29671
|
-
SAR: 2,
|
|
29672
|
-
SBD: 2,
|
|
29673
|
-
SCR: 2,
|
|
29674
|
-
SDG: 2,
|
|
29675
|
-
SEK: 2,
|
|
29676
|
-
SGD: 2,
|
|
29677
|
-
SHP: 2,
|
|
29678
|
-
SLE: 2,
|
|
29679
|
-
SOS: 2,
|
|
29680
|
-
SRD: 2,
|
|
29681
|
-
SSP: 2,
|
|
29682
|
-
STN: 2,
|
|
29683
|
-
SVC: 2,
|
|
29684
|
-
SYP: 2,
|
|
29685
|
-
SZL: 2,
|
|
29686
|
-
THB: 2,
|
|
29687
|
-
TJS: 2,
|
|
29688
|
-
TMT: 2,
|
|
29689
|
-
TND: 3,
|
|
29690
|
-
TOP: 2,
|
|
29691
|
-
TRY: 2,
|
|
29692
|
-
TTD: 2,
|
|
29693
|
-
TWD: 2,
|
|
29694
|
-
TZS: 2,
|
|
29695
|
-
UAH: 2,
|
|
29696
|
-
UGX: 0,
|
|
29697
|
-
USD: 2,
|
|
29698
|
-
USN: 2,
|
|
29699
|
-
UYI: 0,
|
|
29700
|
-
UYU: 2,
|
|
29701
|
-
UYW: 4,
|
|
29702
|
-
UZS: 2,
|
|
29703
|
-
VED: 2,
|
|
29704
|
-
VES: 2,
|
|
29705
|
-
VND: 0,
|
|
29706
|
-
VUV: 0,
|
|
29707
|
-
WST: 2,
|
|
29708
|
-
XAF: 0,
|
|
29709
|
-
XAG: 0,
|
|
29710
|
-
XAU: 0,
|
|
29711
|
-
XBA: 0,
|
|
29712
|
-
XBB: 0,
|
|
29713
|
-
XBC: 0,
|
|
29714
|
-
XBD: 0,
|
|
29715
|
-
XCD: 2,
|
|
29716
|
-
XCG: 2,
|
|
29717
|
-
XDR: 0,
|
|
29718
|
-
XOF: 0,
|
|
29719
|
-
XPD: 0,
|
|
29720
|
-
XPF: 0,
|
|
29721
|
-
XPT: 0,
|
|
29722
|
-
XSU: 0,
|
|
29723
|
-
XTS: 0,
|
|
29724
|
-
XUA: 0,
|
|
29725
|
-
XXX: 0,
|
|
29726
|
-
YER: 2,
|
|
29727
|
-
ZAR: 2,
|
|
29728
|
-
ZMW: 2,
|
|
29729
|
-
ZWG: 2,
|
|
29730
|
-
// Withdrawn recently enough that a client's CRM still carries them. Accepting
|
|
29731
|
-
// a code that was legal tender last year costs nothing; rejecting a real
|
|
29732
|
-
// historical `won` costs the client a reconciliation they cannot fix.
|
|
29733
|
-
SLL: 2,
|
|
29734
|
-
ZWL: 2,
|
|
29735
|
-
CUC: 2,
|
|
29736
|
-
HRK: 2
|
|
29737
|
-
};
|
|
29738
|
-
var ISO_4217_CODES = new Set(Object.keys(MINOR_UNITS));
|
|
29739
|
-
|
|
29740
|
-
// ../api/src/event-ingest/names.ts
|
|
29741
|
-
var STANDARD_EVENT_NAMES = [
|
|
29742
|
-
{ name: "page_view", means: "A page was served somewhere Baker does not run." },
|
|
29743
|
-
{ name: "view_content", means: "Someone looked at a specific thing \u2014 a listing, a property, an article." },
|
|
29744
|
-
{ name: "lead", means: "Someone became a lead: they handed over a way to reach them." },
|
|
29745
|
-
{ name: "contact", means: "Someone got in touch \u2014 a call, a chat, an email in." },
|
|
29746
|
-
{ name: "schedule", means: "A meeting, viewing or call was booked." },
|
|
29747
|
-
{ name: "sign_up", means: "An account was created." },
|
|
29748
|
-
{ name: "start_trial", means: "A trial began." },
|
|
29749
|
-
{ name: "subscribe", means: "A subscription started." },
|
|
29750
|
-
{ name: "qualified_lead", means: "Sales judged the lead worth working. The first event only you can send." },
|
|
29751
|
-
{ name: "opportunity", means: "A deal was opened against the lead." },
|
|
29752
|
-
{ name: "deal_won", means: "The deal closed. Send the money on it." },
|
|
29753
|
-
{ name: "deal_lost", means: "The deal was lost. Send it \u2014 a campaign that only reports wins reads as free." },
|
|
29754
|
-
{ name: "purchase", means: "Something was paid for. Send the money on it." },
|
|
29755
|
-
{ name: "refund", means: "Money went back. A separate event, never a negative amount." }
|
|
29756
|
-
];
|
|
29757
|
-
|
|
29758
|
-
// ../api/src/event-ingest/validation.ts
|
|
29759
|
-
var REJECTION_CODES = [
|
|
29760
|
-
"invalid_event_id",
|
|
29761
|
-
"invalid_name",
|
|
29762
|
-
"missing_identity",
|
|
29763
|
-
"invalid_timestamp",
|
|
29764
|
-
"invalid_value",
|
|
29765
|
-
"batch_too_large"
|
|
29766
|
-
];
|
|
29767
|
-
var EVENT_INGEST_BATCH_MAX = 500;
|
|
29768
|
-
var EVENT_INGEST_BODY_MAX_BYTES = 8 * 1024 * 1024;
|
|
29769
|
-
var EVENT_INGEST_REQUESTS_PER_MINUTE = 60;
|
|
29770
|
-
var FUTURE_TOLERANCE_MS = 5 * 6e4;
|
|
29771
|
-
var MAX_EVENT_NAME = 80;
|
|
29772
|
-
var EVENT_NAME = /^[\p{L}\p{N}][\p{L}\p{M}\p{N} ._-]*$/u;
|
|
29773
|
-
function validateEventName(name) {
|
|
29774
|
-
const value = typeof name === "string" ? name.trim() : "";
|
|
29775
|
-
if (value === "" || value.length > MAX_EVENT_NAME || !EVENT_NAME.test(value)) return "invalid_name";
|
|
29776
|
-
return null;
|
|
29777
|
-
}
|
|
29778
|
-
var REJECTION_MESSAGES = {
|
|
29779
|
-
invalid_event_id: "event_id, when sent, must be 1-128 characters of A-Z a-z 0-9 . _ : -",
|
|
29780
|
-
invalid_name: "event_name is required: up to 80 characters of letters (any language), digits, spaces, . _ and -, starting with a letter or a digit",
|
|
29781
|
-
missing_identity: "user_data named nobody, and no url named a page",
|
|
29782
|
-
invalid_timestamp: "event_time must be an ISO-8601 instant with an offset or Unix seconds, and not in the future",
|
|
29783
|
-
invalid_value: "value and currency go together: a non-negative decimal and an ISO-4217 code",
|
|
29784
|
-
batch_too_large: `a request carries at most ${EVENT_INGEST_BATCH_MAX} events and ${EVENT_INGEST_BODY_MAX_BYTES / (1024 * 1024)} MB`
|
|
29785
|
-
};
|
|
29786
|
-
|
|
29787
29872
|
// ../api/src/event-ingest/fields.ts
|
|
29788
29873
|
var BODY_MAX_MB = EVENT_INGEST_BODY_MAX_BYTES / (1024 * 1024);
|
|
29789
29874
|
var FUTURE_TOLERANCE_MINUTES = FUTURE_TOLERANCE_MS / 6e4;
|
|
@@ -31671,16 +31756,19 @@ var HUBSPOT_DEFAULT_PROPERTIES = {
|
|
|
31671
31756
|
gclid: "hs_google_click_id",
|
|
31672
31757
|
fbclid: "hs_facebook_click_id"
|
|
31673
31758
|
};
|
|
31759
|
+
var throughContact = Object.fromEntries(
|
|
31760
|
+
Object.entries(HUBSPOT_DEFAULT_PROPERTIES).map(([field, property]) => [field, contactPath(property)])
|
|
31761
|
+
);
|
|
31674
31762
|
var HUBSPOT_DEAL_DEFAULT_PROPERTIES = {
|
|
31675
|
-
...
|
|
31676
|
-
Object.entries(HUBSPOT_DEFAULT_PROPERTIES).map(([field, property]) => [field, contactPath(property)])
|
|
31677
|
-
),
|
|
31763
|
+
...throughContact,
|
|
31678
31764
|
value: "amount",
|
|
31679
31765
|
currency: "deal_currency_code"
|
|
31680
31766
|
};
|
|
31767
|
+
var HUBSPOT_LEAD_DEFAULT_PROPERTIES = throughContact;
|
|
31681
31768
|
var DEFAULTS = {
|
|
31682
31769
|
contact: HUBSPOT_DEFAULT_PROPERTIES,
|
|
31683
|
-
deal: HUBSPOT_DEAL_DEFAULT_PROPERTIES
|
|
31770
|
+
deal: HUBSPOT_DEAL_DEFAULT_PROPERTIES,
|
|
31771
|
+
lead: HUBSPOT_LEAD_DEFAULT_PROPERTIES
|
|
31684
31772
|
};
|
|
31685
31773
|
function hubspotDefaultMapping(sourceName, object = "contact") {
|
|
31686
31774
|
const mapping = { event_name: sourceName };
|
|
@@ -31690,78 +31778,6 @@ function hubspotDefaultMapping(sourceName, object = "contact") {
|
|
|
31690
31778
|
return mapping;
|
|
31691
31779
|
}
|
|
31692
31780
|
|
|
31693
|
-
// ../api/src/event-sources/hubspotTrigger.ts
|
|
31694
|
-
var HUBSPOT_PROPERTY_KINDS = ["string", "number", "date", "boolean", "select"];
|
|
31695
|
-
var EMPTY = [
|
|
31696
|
-
{ value: "isEmpty", label: "is empty", hubspotLabel: "is unknown", arity: "none" },
|
|
31697
|
-
{ value: "isNotEmpty", label: "is not empty", hubspotLabel: "is known", arity: "none" }
|
|
31698
|
-
];
|
|
31699
|
-
var HUBSPOT_OPERATORS = {
|
|
31700
|
-
string: [
|
|
31701
|
-
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
31702
|
-
{ value: "isNot", label: "is not", hubspotLabel: "is not equal to", arity: "one" },
|
|
31703
|
-
{ value: "contains", label: "contains", hubspotLabel: "contains", arity: "one" },
|
|
31704
|
-
{ value: "doesNotContain", label: "does not contain", hubspotLabel: "doesn't contain", arity: "one" },
|
|
31705
|
-
{ value: "startsWith", label: "starts with", hubspotLabel: "starts with", arity: "one" },
|
|
31706
|
-
{ value: "endsWith", label: "ends with", hubspotLabel: "ends with", arity: "one" },
|
|
31707
|
-
...EMPTY
|
|
31708
|
-
],
|
|
31709
|
-
number: [
|
|
31710
|
-
{ value: "equal", label: "=", hubspotLabel: "is equal to", arity: "one" },
|
|
31711
|
-
{ value: "notEqual", label: "\u2260", hubspotLabel: "is not equal to", arity: "one" },
|
|
31712
|
-
{ value: "lessThan", label: "<", hubspotLabel: "is less than", arity: "one" },
|
|
31713
|
-
{ value: "lessThanOrEqual", label: "\u2264", hubspotLabel: "is less than or equal to", arity: "one" },
|
|
31714
|
-
{ value: "greaterThan", label: ">", hubspotLabel: "is greater than", arity: "one" },
|
|
31715
|
-
{ value: "greaterThanOrEqual", label: "\u2265", hubspotLabel: "is greater than or equal to", arity: "one" },
|
|
31716
|
-
...EMPTY
|
|
31717
|
-
],
|
|
31718
|
-
date: [
|
|
31719
|
-
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
31720
|
-
{ value: "isBefore", label: "is before", hubspotLabel: "is before", arity: "one" },
|
|
31721
|
-
{ value: "isAfter", label: "is after", hubspotLabel: "is after", arity: "one" },
|
|
31722
|
-
{ value: "isOnOrBefore", label: "is on or before", hubspotLabel: "is on or before", arity: "one" },
|
|
31723
|
-
{ value: "isOnOrAfter", label: "is on or after", hubspotLabel: "is on or after", arity: "one" },
|
|
31724
|
-
{ value: "isBetween", label: "is between", hubspotLabel: "is between", arity: "two" },
|
|
31725
|
-
...EMPTY
|
|
31726
|
-
],
|
|
31727
|
-
boolean: [
|
|
31728
|
-
{ value: "is", label: "is", hubspotLabel: "is equal to", arity: "one" },
|
|
31729
|
-
{ value: "isNot", label: "is not", hubspotLabel: "is not equal to", arity: "one" }
|
|
31730
|
-
],
|
|
31731
|
-
select: [
|
|
31732
|
-
{ value: "is", label: "is", hubspotLabel: "is any of", arity: "many" },
|
|
31733
|
-
{ value: "isNot", label: "is not", hubspotLabel: "is none of", arity: "many" },
|
|
31734
|
-
...EMPTY
|
|
31735
|
-
]
|
|
31736
|
-
};
|
|
31737
|
-
var CONDITION_LOGICS = ["And", "Or"];
|
|
31738
|
-
var TRIGGER_CONDITIONS_MAX = 10;
|
|
31739
|
-
function isConditionGroup(item) {
|
|
31740
|
-
return "logic" in item && "conditions" in item && Array.isArray(item.conditions);
|
|
31741
|
-
}
|
|
31742
|
-
function onlyCondition(condition) {
|
|
31743
|
-
return { logic: "And", conditions: [condition] };
|
|
31744
|
-
}
|
|
31745
|
-
function triggerConditions(trigger) {
|
|
31746
|
-
return trigger.conditions.flatMap((item) => isConditionGroup(item) ? item.conditions : [item]);
|
|
31747
|
-
}
|
|
31748
|
-
function triggerProblem(trigger) {
|
|
31749
|
-
if (trigger.conditions.length === 0) return "A trigger needs at least one condition.";
|
|
31750
|
-
for (const item of trigger.conditions) {
|
|
31751
|
-
if (!isConditionGroup(item)) continue;
|
|
31752
|
-
if (item.conditions.length === 0) return "A group needs at least one condition.";
|
|
31753
|
-
if (item.conditions.some((inner) => isConditionGroup(inner))) {
|
|
31754
|
-
return "Groups go one level deep, as in a Form's filter: a group cannot hold another group.";
|
|
31755
|
-
}
|
|
31756
|
-
}
|
|
31757
|
-
if (triggerConditions(trigger).length > TRIGGER_CONDITIONS_MAX) {
|
|
31758
|
-
return `A trigger takes at most ${TRIGGER_CONDITIONS_MAX} conditions.`;
|
|
31759
|
-
}
|
|
31760
|
-
return null;
|
|
31761
|
-
}
|
|
31762
|
-
var HUBSPOT_OBJECTS = ["contact", "deal"];
|
|
31763
|
-
var HUBSPOT_DEAL_CONTACTS = ["first", "every"];
|
|
31764
|
-
|
|
31765
31781
|
// ../api/src/event-sources/wire.ts
|
|
31766
31782
|
import { z as z37 } from "zod";
|
|
31767
31783
|
var SOURCE_KINDS = ["webhook", "hubspot"];
|
|
@@ -31825,9 +31841,9 @@ var sampleRecordSchema = z37.strictObject({ id: z37.string(), properties: z37.re
|
|
|
31825
31841
|
var hubspotPreviewRequestSchema = z37.strictObject({
|
|
31826
31842
|
object: hubspotObjectSchema.default("contact"),
|
|
31827
31843
|
trigger: hubspotTriggerInputSchema,
|
|
31828
|
-
/** Property names to read off the sample; `id` is always there. On a deal, `contact.<name>` reads its first contact. */
|
|
31844
|
+
/** Property names to read off the sample; `id` is always there. On a deal or a lead, `contact.<name>` reads its first contact. */
|
|
31829
31845
|
properties: z37.array(z37.string().trim().min(1)).max(60).optional(),
|
|
31830
|
-
/** The record to draw the preview from — an id, or text to search (an email or a name for a contact, a deal's name). The one most recently at the trigger when unsaid. */
|
|
31846
|
+
/** The record to draw the preview from — an id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently at the trigger when unsaid. */
|
|
31831
31847
|
contact: z37.string().trim().min(1).max(200).optional()
|
|
31832
31848
|
});
|
|
31833
31849
|
var hubspotPreviewSchema = z37.strictObject({
|
|
@@ -31835,10 +31851,16 @@ var hubspotPreviewSchema = z37.strictObject({
|
|
|
31835
31851
|
total: z37.number(),
|
|
31836
31852
|
/** False when the trigger has more combinations than HubSpot's search takes, so `total` is only near. */
|
|
31837
31853
|
exact: z37.boolean().optional(),
|
|
31838
|
-
/**
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31854
|
+
/**
|
|
31855
|
+
* The sample record the trigger is on, with the properties asked for and
|
|
31856
|
+
* the contacts behind it, first first; none when nothing fits.
|
|
31857
|
+
*
|
|
31858
|
+
* One field rather than one per object: a contact source's record *is* the
|
|
31859
|
+
* person and its `contacts` is empty, while a deal's and a lead's carry the
|
|
31860
|
+
* people the event is about. Three parallel nullable fields, exactly one of
|
|
31861
|
+
* them ever set, would say the same thing and let a caller read the wrong one.
|
|
31862
|
+
*/
|
|
31863
|
+
record: sampleRecordSchema.extend({ contacts: z37.array(sampleRecordSchema) }).nullable()
|
|
31842
31864
|
});
|
|
31843
31865
|
var sourcesRequestSchema = z37.strictObject({
|
|
31844
31866
|
/** The company's own server door: made once, `counting` from the start, the same address for ever after. */
|
|
@@ -31847,7 +31869,7 @@ var sourcesRequestSchema = z37.strictObject({
|
|
|
31847
31869
|
/** A HubSpot event: read every five minutes, counting from now. The labels are looked up server-side. */
|
|
31848
31870
|
createHubspot: z37.strictObject({
|
|
31849
31871
|
name: sourceNameSchema.optional(),
|
|
31850
|
-
/** A contact, or a
|
|
31872
|
+
/** A contact, a deal or a lead. A deal's and a lead's event is about its contact, read through `contact.<property>` rows. */
|
|
31851
31873
|
object: hubspotObjectSchema.default("contact"),
|
|
31852
31874
|
trigger: hubspotTriggerInputSchema,
|
|
31853
31875
|
/** On a deal: the deal's first contact (the default), or every contact on it, each its own event. */
|
|
@@ -32061,17 +32083,17 @@ var args3 = {
|
|
|
32061
32083
|
},
|
|
32062
32084
|
object: {
|
|
32063
32085
|
type: "string",
|
|
32064
|
-
description: "With --create-hubspot or --preview: what the trigger is on \u2014 `contact` (the default) or `
|
|
32086
|
+
description: "With --create-hubspot or --preview: what the trigger is on \u2014 `contact` (the default), `deal` or `lead`. A deal's and a lead's event is about the contact the record is associated with: its rows read the record's own properties bare ({{amount}}, {{dealstage}}, {{hs_pipeline_stage}}) and the contact's as {{contact.<name>}} (`baker hubspot deals fields` / `baker hubspot leads fields`). A deal's amount defaults to its own amount in its currency; a lead has none, so it counts the step rather than money. Use `lead` for qualification and disqualification \u2014 HubSpot records both as a lead stage, and nothing on the contact or the deal says a lead was disqualified",
|
|
32065
32087
|
required: false
|
|
32066
32088
|
},
|
|
32067
32089
|
contacts: {
|
|
32068
32090
|
type: "string",
|
|
32069
|
-
description: "With --object deal (on --create-hubspot or --set-trigger): whose event it is \u2014 `every` (the default: every contact on the
|
|
32091
|
+
description: "With --object deal or --object lead (on --create-hubspot or --set-trigger): whose event it is \u2014 `every` (the default: every contact on the record, each its own event; on a deal each worth the deal's amount) or `first` (the record's first contact only)",
|
|
32070
32092
|
required: false
|
|
32071
32093
|
},
|
|
32072
32094
|
property: {
|
|
32073
32095
|
type: "string",
|
|
32074
|
-
description: "With --create-hubspot, --set-trigger or --preview: the property to watch, by HubSpot's internal name (lifecyclestage, hs_lead_status, a custom one on a contact; dealstage, amount, closedate on a deal) \u2014 any property, whatever its kind",
|
|
32096
|
+
description: "With --create-hubspot, --set-trigger or --preview: the property to watch, by HubSpot's internal name (lifecyclestage, hs_lead_status, a custom one on a contact; dealstage, amount, closedate on a deal; hs_pipeline_stage, hs_lead_label on a lead) \u2014 any property, whatever its kind",
|
|
32075
32097
|
required: false
|
|
32076
32098
|
},
|
|
32077
32099
|
operator: {
|
|
@@ -32091,7 +32113,7 @@ var args3 = {
|
|
|
32091
32113
|
},
|
|
32092
32114
|
contact: {
|
|
32093
32115
|
type: "string",
|
|
32094
|
-
description: "With --preview: the record to draw the sample from \u2014 a HubSpot id, or text to search (an email or a name for a contact, a deal's
|
|
32116
|
+
description: "With --preview: the record to draw the sample from \u2014 a HubSpot id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently satisfying the trigger when unsaid",
|
|
32095
32117
|
required: false
|
|
32096
32118
|
},
|
|
32097
32119
|
"amount-property": {
|
|
@@ -32260,8 +32282,10 @@ function createHubspotArgs(raw, argv, name) {
|
|
|
32260
32282
|
const mapping = parseFieldArgs(argv);
|
|
32261
32283
|
const object = objectArg(raw, argv);
|
|
32262
32284
|
const contacts = contactsArg(raw, argv);
|
|
32263
|
-
if (contacts !== void 0 && object
|
|
32264
|
-
throw new ConversionArgsError(
|
|
32285
|
+
if (contacts !== void 0 && !readsAssociatedContact(object)) {
|
|
32286
|
+
throw new ConversionArgsError(
|
|
32287
|
+
"--contacts says whose event a deal's or a lead's is; it needs --object deal or --object lead."
|
|
32288
|
+
);
|
|
32265
32289
|
}
|
|
32266
32290
|
return {
|
|
32267
32291
|
// A contact is the wire's default, so it is left unsaid — the way the schema reads it back.
|
|
@@ -51759,6 +51783,11 @@ var OBJECT_WORDS = {
|
|
|
51759
51783
|
plural: "deals",
|
|
51760
51784
|
command: "baker hubspot deals",
|
|
51761
51785
|
rows: "`--field value={{amount}}`, `--field currency={{deal_currency_code}}`, `--field email={{contact.email}}` \u2014 a deal's own properties bare, its contact's as `contact.<name>`; `{{id}}` is the deal's own id, `{{contact.id}}` the contact's"
|
|
51786
|
+
},
|
|
51787
|
+
lead: {
|
|
51788
|
+
plural: "leads",
|
|
51789
|
+
command: "baker hubspot leads",
|
|
51790
|
+
rows: "`--field email={{contact.email}}`, `--field properties.stage={{hs_pipeline_stage}}` \u2014 a lead's own properties bare, its contact's as `contact.<name>`; `{{id}}` is the lead's own id, `{{contact.id}}` the contact's. A lead carries no amount of its own, so `value` is empty unless you point it at a property"
|
|
51762
51791
|
}
|
|
51763
51792
|
};
|
|
51764
51793
|
function propertiesCommand2(object) {
|
|
@@ -51887,7 +51916,7 @@ function fieldsCommand(object) {
|
|
|
51887
51916
|
return defineCommand143({
|
|
51888
51917
|
meta: {
|
|
51889
51918
|
name: "fields",
|
|
51890
|
-
description: `List every property a HubSpot event on a ${object} can read into its rows, with HubSpot's type${object === "
|
|
51919
|
+
description: `List every property a HubSpot event on a ${object} can read into its rows, with HubSpot's type${object === "contact" ? "" : ` \u2014 the ${object}'s own, and its contact's as contact.<name>`}. Example: ${words2.command} fields`
|
|
51891
51920
|
},
|
|
51892
51921
|
args: {},
|
|
51893
51922
|
run: async () => {
|
|
@@ -51915,6 +51944,13 @@ var dealsCommand = defineCommand143({
|
|
|
51915
51944
|
},
|
|
51916
51945
|
subCommands: { properties: propertiesCommand2("deal"), fields: fieldsCommand("deal") }
|
|
51917
51946
|
});
|
|
51947
|
+
var leadsCommand3 = defineCommand143({
|
|
51948
|
+
meta: {
|
|
51949
|
+
name: "leads",
|
|
51950
|
+
description: "Leads on the connected HubSpot account: what a HubSpot event on a lead can watch (`properties`) and read (`fields`). Start here for qualification and disqualification \u2014 a lead's stage is where HubSpot records both, and `hs_pipeline_stage` lists the account's own stages with their labels. Needs Sales Hub Professional or Enterprise; on any other plan the account has no leads to read."
|
|
51951
|
+
},
|
|
51952
|
+
subCommands: { properties: propertiesCommand2("lead"), fields: fieldsCommand("lead") }
|
|
51953
|
+
});
|
|
51918
51954
|
var contactsCommand = defineCommand143({
|
|
51919
51955
|
meta: { name: "contacts", description: "Contacts on the connected HubSpot account." },
|
|
51920
51956
|
subCommands: {
|
|
@@ -51976,6 +52012,7 @@ Full guide: __tooling__/docs/tools/baker/hubspot.md`
|
|
|
51976
52012
|
pipelines: pipelinesCommand,
|
|
51977
52013
|
contacts: contactsCommand,
|
|
51978
52014
|
deals: dealsCommand,
|
|
52015
|
+
leads: leadsCommand3,
|
|
51979
52016
|
meetings: meetingsCommand
|
|
51980
52017
|
}
|
|
51981
52018
|
});
|