@wirechunk/cli 0.0.4 → 0.0.6
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/build/main.js +205 -35
- package/package.json +1 -1
- package/src/commands/bootstrap.ts +17 -7
- package/src/commands/create-user.ts +80 -14
- package/src/commands/ext-dev/init-db.ts +2 -2
- package/src/core-api/api.ts +641 -97
- package/src/main.ts +4 -3
- package/tsconfig.json +1 -1
package/build/main.js
CHANGED
|
@@ -3957,8 +3957,6 @@ const normalizeEmailAddress = (email) => {
|
|
|
3957
3957
|
};
|
|
3958
3958
|
const siteDomainKey = "siteDomain";
|
|
3959
3959
|
const submittedAtKey = "submittedAt";
|
|
3960
|
-
const defaultFormattedDataTemplate = `{{#each .}}{{@key}}: {{{.}}}
|
|
3961
|
-
{{/each}}`;
|
|
3962
3960
|
const defaultNotificationEmailBodyTemplate = `Form entry from your site {{${siteDomainKey}}}:
|
|
3963
3961
|
|
|
3964
3962
|
{{#each .}}{{@key}}: {{{.}}}
|
|
@@ -21292,11 +21290,11 @@ const isDirty = (x) => x.status === "dirty";
|
|
|
21292
21290
|
const isValid = (x) => x.status === "valid";
|
|
21293
21291
|
const isAsync$1 = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
21294
21292
|
function __classPrivateFieldGet(receiver, state2, kind, f) {
|
|
21295
|
-
if (typeof state2 === "function" ? receiver !== state2 ||
|
|
21293
|
+
if (typeof state2 === "function" ? receiver !== state2 || true : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
21296
21294
|
return state2.get(receiver);
|
|
21297
21295
|
}
|
|
21298
21296
|
function __classPrivateFieldSet(receiver, state2, value, kind, f) {
|
|
21299
|
-
if (typeof state2 === "function" ? receiver !== state2 ||
|
|
21297
|
+
if (typeof state2 === "function" ? receiver !== state2 || true : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21300
21298
|
return state2.set(receiver, value), value;
|
|
21301
21299
|
}
|
|
21302
21300
|
typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) {
|
|
@@ -24958,9 +24956,22 @@ const bootstrap = async (opts, env2) => {
|
|
|
24958
24956
|
}
|
|
24959
24957
|
await db.transaction(async (db2) => {
|
|
24960
24958
|
await db2.query(
|
|
24961
|
-
distExports$1.sql.type(
|
|
24962
|
-
|
|
24963
|
-
|
|
24959
|
+
distExports$1.sql.type(voidSelectSchema)`
|
|
24960
|
+
insert into "Platforms" (
|
|
24961
|
+
"id",
|
|
24962
|
+
"handle",
|
|
24963
|
+
"name",
|
|
24964
|
+
"defaultFormNotificationEmailBodyTemplate",
|
|
24965
|
+
"emailSendFromAddress"
|
|
24966
|
+
)
|
|
24967
|
+
values (
|
|
24968
|
+
${platformId},
|
|
24969
|
+
${handle},
|
|
24970
|
+
${name},
|
|
24971
|
+
${defaultNotificationEmailBodyTemplate},
|
|
24972
|
+
${emailSendFrom}
|
|
24973
|
+
)
|
|
24974
|
+
`
|
|
24964
24975
|
);
|
|
24965
24976
|
});
|
|
24966
24977
|
console.log(`Created platform ${name} with handle ${handle} (ID ${platformId})`);
|
|
@@ -25113,6 +25124,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
25113
25124
|
return false;
|
|
25114
25125
|
} else {
|
|
25115
25126
|
if (data6.path !== void 0) {
|
|
25127
|
+
const _errs16 = errors2;
|
|
25116
25128
|
if (typeof data6.path !== "string") {
|
|
25117
25129
|
validate25.errors = [
|
|
25118
25130
|
{
|
|
@@ -25125,6 +25137,67 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
25125
25137
|
];
|
|
25126
25138
|
return false;
|
|
25127
25139
|
}
|
|
25140
|
+
var valid4 = _errs16 === errors2;
|
|
25141
|
+
} else {
|
|
25142
|
+
var valid4 = true;
|
|
25143
|
+
}
|
|
25144
|
+
if (valid4) {
|
|
25145
|
+
if (data6.description !== void 0) {
|
|
25146
|
+
const _errs18 = errors2;
|
|
25147
|
+
if (typeof data6.description !== "string") {
|
|
25148
|
+
validate25.errors = [
|
|
25149
|
+
{
|
|
25150
|
+
instancePath: instancePath + "/components/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/description",
|
|
25151
|
+
schemaPath: "#/properties/components/additionalProperties/properties/description/type",
|
|
25152
|
+
keyword: "type",
|
|
25153
|
+
params: { type: "string" },
|
|
25154
|
+
message: "must be string"
|
|
25155
|
+
}
|
|
25156
|
+
];
|
|
25157
|
+
return false;
|
|
25158
|
+
}
|
|
25159
|
+
var valid4 = _errs18 === errors2;
|
|
25160
|
+
} else {
|
|
25161
|
+
var valid4 = true;
|
|
25162
|
+
}
|
|
25163
|
+
if (valid4) {
|
|
25164
|
+
if (data6.supports !== void 0) {
|
|
25165
|
+
let data9 = data6.supports;
|
|
25166
|
+
const _errs20 = errors2;
|
|
25167
|
+
{
|
|
25168
|
+
if (data9 && typeof data9 == "object" && !Array.isArray(data9)) {
|
|
25169
|
+
if (data9.children !== void 0) {
|
|
25170
|
+
if (typeof data9.children !== "boolean") {
|
|
25171
|
+
validate25.errors = [
|
|
25172
|
+
{
|
|
25173
|
+
instancePath: instancePath + "/components/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/supports/children",
|
|
25174
|
+
schemaPath: "#/properties/components/additionalProperties/properties/supports/properties/children/type",
|
|
25175
|
+
keyword: "type",
|
|
25176
|
+
params: { type: "boolean" },
|
|
25177
|
+
message: "must be boolean"
|
|
25178
|
+
}
|
|
25179
|
+
];
|
|
25180
|
+
return false;
|
|
25181
|
+
}
|
|
25182
|
+
}
|
|
25183
|
+
} else {
|
|
25184
|
+
validate25.errors = [
|
|
25185
|
+
{
|
|
25186
|
+
instancePath: instancePath + "/components/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/supports",
|
|
25187
|
+
schemaPath: "#/properties/components/additionalProperties/properties/supports/type",
|
|
25188
|
+
keyword: "type",
|
|
25189
|
+
params: { type: "object" },
|
|
25190
|
+
message: "must be object"
|
|
25191
|
+
}
|
|
25192
|
+
];
|
|
25193
|
+
return false;
|
|
25194
|
+
}
|
|
25195
|
+
}
|
|
25196
|
+
var valid4 = _errs20 === errors2;
|
|
25197
|
+
} else {
|
|
25198
|
+
var valid4 = true;
|
|
25199
|
+
}
|
|
25200
|
+
}
|
|
25128
25201
|
}
|
|
25129
25202
|
}
|
|
25130
25203
|
} else {
|
|
@@ -25186,6 +25259,16 @@ validate25.evaluated = {
|
|
|
25186
25259
|
dynamicProps: false,
|
|
25187
25260
|
dynamicItems: false
|
|
25188
25261
|
};
|
|
25262
|
+
const $schema$e = "https://json-schema.org/draft/2020-12/schema";
|
|
25263
|
+
const type$a = "array";
|
|
25264
|
+
const items$1 = { "$ref": "#/$defs/component" };
|
|
25265
|
+
const $defs$8 = JSON.parse(`{"arrayExpression":{"title":"ArrayExpression","oneOf":[{"$ref":"#/$defs/arrayExpressionArrayLiteral"},{"$ref":"#/$defs/arrayExpressionFilter"},{"$ref":"#/$defs/arrayExpressionInputChangeEventArrayValue"},{"$ref":"#/$defs/arrayExpressionInputDataArray"},{"$ref":"#/$defs/arrayExpressionMap"},{"$ref":"#/$defs/arrayExpressionPropsArray"},{"$ref":"#/$defs/arrayExpressionUserFeatureTags"}]},"arrayExpressionArrayLiteral":{"type":"object","properties":{"operator":{"const":"arrayLiteral"},"value":{"type":"array","items":{"$ref":"#/$defs/expression"}}},"required":["operator","value"]},"arrayExpressionFilter":{"type":"object","properties":{"operator":{"const":"filter"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"},"filterExpression":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","arrayExpression","filterExpression"]},"arrayExpressionInputChangeEventArrayValue":{"type":"object","properties":{"operator":{"const":"inputChangeEventArrayValue"}},"required":["operator"]},"arrayExpressionInputDataArray":{"type":"object","properties":{"operator":{"const":"inputDataArray"},"fieldKey":{"type":"string"}},"required":["operator","fieldKey"]},"arrayExpressionPropsArray":{"type":"object","properties":{"operator":{"const":"propsArray"},"prop":{"type":"string"}},"required":["operator","prop"]},"arrayExpressionMap":{"type":"object","properties":{"operator":{"const":"map"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"},"mapExpression":{"$ref":"#/$defs/expression"}},"required":["operator","arrayExpression","mapExpression"]},"arrayExpressionUserFeatureTags":{"type":"object","properties":{"operator":{"const":"userFeatureTags"}},"required":["operator"]},"booleanExpression":{"title":"BooleanExpression","oneOf":[{"$ref":"#/$defs/booleanExpressionAll"},{"$ref":"#/$defs/booleanExpressionArrayIncludes"},{"$ref":"#/$defs/booleanExpressionBooleanValue"},{"$ref":"#/$defs/booleanExpressionBoth"},{"$ref":"#/$defs/booleanExpressionGreaterThan"},{"$ref":"#/$defs/booleanExpressionBooleanLiteral"},{"$ref":"#/$defs/booleanExpressionEither"},{"$ref":"#/$defs/booleanExpressionEquals"},{"$ref":"#/$defs/booleanExpressionExists"},{"$ref":"#/$defs/booleanExpressionInputChangeEventBooleanValue"},{"$ref":"#/$defs/booleanExpressionInputDataBoolean"},{"$ref":"#/$defs/booleanExpressionNot"},{"$ref":"#/$defs/booleanExpressionPropsBoolean"},{"$ref":"#/$defs/booleanExpressionSome"}]},"booleanExpressionAll":{"type":"object","properties":{"operator":{"const":"all"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"},"condition":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","arrayExpression","condition"]},"booleanExpressionArrayIncludes":{"type":"object","properties":{"operator":{"const":"arrayIncludes"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"},"value":{"$ref":"#/$defs/expression"}},"required":["operator","arrayExpression","value"]},"booleanExpressionBooleanLiteral":{"type":"object","properties":{"operator":{"const":"booleanLiteral"},"value":{"type":"boolean"}},"required":["operator","value"]},"booleanExpressionBooleanValue":{"type":"object","properties":{"operator":{"const":"booleanValue"},"model":{"type":"object","properties":{"model":{"const":"dataPropertyBoolean"},"fieldKey":{"type":"string"}},"required":["model","fieldKey"]}},"required":["operator","model"]},"booleanExpressionBoth":{"type":"object","properties":{"operator":{"const":"both"},"left":{"$ref":"#/$defs/booleanExpression"},"right":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","left","right"]},"booleanExpressionEither":{"type":"object","properties":{"operator":{"const":"either"},"left":{"$ref":"#/$defs/booleanExpression"},"right":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","left","right"]},"booleanExpressionEquals":{"type":"object","properties":{"operator":{"const":"equals"},"left":{"$ref":"#/$defs/expression"},"right":{"$ref":"#/$defs/expression"}},"required":["operator","left","right"]},"booleanExpressionExists":{"type":"object","properties":{"operator":{"const":"exists"},"expression":{"$ref":"#/$defs/expression"}},"required":["operator","expression"]},"booleanExpressionGreaterThan":{"type":"object","properties":{"operator":{"const":"greaterThan"},"left":{"$ref":"#/$defs/numberExpression"},"right":{"$ref":"#/$defs/numberExpression"}},"required":["operator","left","right"]},"booleanExpressionInputChangeEventBooleanValue":{"type":"object","properties":{"operator":{"const":"inputChangeEventBooleanValue"}},"required":["operator"]},"booleanExpressionInputDataBoolean":{"type":"object","properties":{"operator":{"const":"inputDataBoolean"},"fieldKey":{"type":"string"}},"required":["operator","fieldKey"]},"booleanExpressionNot":{"type":"object","properties":{"operator":{"const":"not"},"expression":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","expression"]},"booleanExpressionSome":{"type":"object","properties":{"operator":{"const":"some"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"},"condition":{"$ref":"#/$defs/booleanExpression"}},"required":["operator","arrayExpression","condition"]},"booleanExpressionPropsBoolean":{"type":"object","properties":{"operator":{"const":"propsBoolean"},"prop":{"type":"string"}},"required":["operator","prop"]},"contextData":{"title":"ContextData","type":"object","additionalProperties":{"$ref":"#/$defs/contextDataDataValue"}},"contextDataTimeDuration":{"type":"object","properties":{"hours":{"oneOf":[{"type":"number"},{"type":"null"}]},"minutes":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["hours","minutes"]},"contextDataDataValue":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"type":"null"},{"$ref":"#/$defs/contextDataTimeDuration"},{"type":"array","items":{"$ref":"#/$defs/contextDataDataTableRow"}},{"$ref":"#/$defs/contextDataUploadedFile"},{"type":"array","items":{"type":"string"}}]},"contextDataDataTableRow":{"type":"object","properties":{"id":{"type":"string"},"data":{"$ref":"#/$defs/contextData"}},"required":["id","data"]},"contextDataUploadedFile":{"type":"object","properties":{"fileId":{"type":"string"}},"required":["fileId"]},"component":{"title":"Component","anyOf":[{"$ref":"#/$defs/boxComponent"},{"$ref":"#/$defs/buttonComponent"},{"$ref":"#/$defs/calendlyEmbedComponent"},{"$ref":"#/$defs/checkboxInputComponent"},{"$ref":"#/$defs/collapsiblePanelComponent"},{"$ref":"#/$defs/completableVideoInputComponent"},{"$ref":"#/$defs/conditionalLogicComponent"},{"$ref":"#/$defs/courseComponent"},{"$ref":"#/$defs/currentYearComponent"},{"$ref":"#/$defs/customComponentComponent"},{"$ref":"#/$defs/dashboardComponent"},{"$ref":"#/$defs/dataInputTableComponent"},{"$ref":"#/$defs/dateInputComponent"},{"$ref":"#/$defs/documentComponent"},{"$ref":"#/$defs/dropdownInputComponent"},{"$ref":"#/$defs/formComponent"},{"$ref":"#/$defs/formStepComponent"},{"$ref":"#/$defs/formatPropsComponent"},{"$ref":"#/$defs/googlePlaceInputComponent"},{"$ref":"#/$defs/helpTicketsPortalComponent"},{"$ref":"#/$defs/htmlComponent"},{"$ref":"#/$defs/iconComponent"},{"$ref":"#/$defs/imageComponent"},{"$ref":"#/$defs/inputValidationErrorMessageComponent"},{"$ref":"#/$defs/lessonNotesFieldComponent"},{"$ref":"#/$defs/linkComponent"},{"$ref":"#/$defs/mapComponent"},{"$ref":"#/$defs/moveUserPlanComponent"},{"$ref":"#/$defs/multiOrgViewComponent"},{"$ref":"#/$defs/multipleChoiceInputComponent"},{"$ref":"#/$defs/multiSelectInputComponent"},{"$ref":"#/$defs/numberInputComponent"},{"$ref":"#/$defs/orderPageComponent"},{"$ref":"#/$defs/orgBillingSettingsComponent"},{"$ref":"#/$defs/orgSitePagesComponent"},{"$ref":"#/$defs/orgSiteReviewsComponent"},{"$ref":"#/$defs/organizationTeamComponent"},{"$ref":"#/$defs/pageComponent"},{"$ref":"#/$defs/plainTextComponent"},{"$ref":"#/$defs/popoverComponent"},{"$ref":"#/$defs/productItemGuardComponent"},{"$ref":"#/$defs/providePropsComponent"},{"$ref":"#/$defs/radioGroupInputComponent"},{"$ref":"#/$defs/radioGroupInputButtonComponent"},{"$ref":"#/$defs/remoteComponentComponent"},{"$ref":"#/$defs/repeatingGroupInputComponent"},{"$ref":"#/$defs/requestPasswordResetComponent"},{"$ref":"#/$defs/resetPasswordComponent"},{"$ref":"#/$defs/reviewComponent"},{"$ref":"#/$defs/signInGuardComponent"},{"$ref":"#/$defs/siteLogoComponent"},{"$ref":"#/$defs/sitePrivacyPolicyComponent"},{"$ref":"#/$defs/siteTermsOfUseComponent"},{"$ref":"#/$defs/stageComponent"},{"$ref":"#/$defs/stageBodyComponent"},{"$ref":"#/$defs/stageNameComponent"},{"$ref":"#/$defs/textComponent"},{"$ref":"#/$defs/textInputComponent"},{"$ref":"#/$defs/textareaInputComponent"},{"$ref":"#/$defs/typeformComponent"},{"$ref":"#/$defs/userProfileComponent"},{"$ref":"#/$defs/verifiedEmailAddressGuardComponent"},{"$ref":"#/$defs/verifyEmailAddressComponent"},{"$ref":"#/$defs/videoComponent"},{"$ref":"#/$defs/viewPlanStagesButtonComponent"},{"$ref":"#/$defs/widthContainerComponent"}]},"boxComponent":{"title":"BoxComponent","description":"A generic HTML element.","allOf":[{"type":"object","properties":{"type":{"const":"Box"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"tag":{"type":"string","enum":["article","aside","blockquote","code","div","footer","h1","h2","h3","h4","h5","h6","header","label","legend","li","main","nav","ol","p","pre","section","span","ul"],"description":"The HTML tag to use for the element. Defaults to div."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentElementId"}]},"buttonComponent":{"title":"ButtonComponent","description":"A button.","allOf":[{"type":"object","properties":{"type":{"const":"Button"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"onClick":{"anyOf":[{"type":"object","properties":{"type":{"const":"doNothing"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"submitForm"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"resetForm"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"goBack"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"goBackFormStep"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"navigate"},"url":{"type":"string"},"openInNewTab":{"type":"boolean"}},"required":["type","url"]}]},"variant":{"type":"string","description":"Controls the visual style of the button. Options are: 'solid' (default, filled background), 'soft' (lighter background, --accent-a11 text), 'surface' (subtle background, solid border, --accent-a11 text), 'outline' (transparent background, solid border, --accent-a11 text), and 'ghost' (no background, no border, --accent-a11 text, behaves like text in layout with negative margins).","enum":["solid","soft","surface","outline","ghost"]}}},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentName","description":"The name of the button. This is not displayed but is useful for triggers to be able to reference the button."}]},"calendlyEmbedComponent":{"title":"CalendlyEmbedComponent","description":"An embedded Calendly scheduling widget.","allOf":[{"type":"object","properties":{"type":{"const":"CalendlyEmbed"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"url":{"$ref":"#/$defs/componentStringValueSource"},"queryParameters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A random unique string for identification."},"parameter":{"type":"string"},"value":{"$ref":"#/$defs/componentStringValueSource"}},"required":["id","parameter","value"]}}}},{"$ref":"#/$defs/componentStyles"}]},"checkboxInputComponent":{"title":"CheckboxInputComponent","description":"If value set to a string and is not an empty string, it is used as the value for the input when the box is checked. Otherwise, true or false is set as the value.","allOf":[{"type":"object","properties":{"type":{"const":"CheckboxInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentStringValue"},{"$ref":"#/$defs/componentDefaultBooleanValue"}]},"collapsiblePanelComponent":{"title":"CollapsiblePanelComponent","description":"A panel that can be collapsed or expanded.","allOf":[{"type":"object","properties":{"type":{"const":"CollapsiblePanel"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"header":{"type":"string","description":"The text displayed in the clickable header."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"completableVideoInputComponent":{"title":"CompletableVideoInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"CompletableVideoInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"src":{"type":"string"},"showHeader":{"type":"boolean"},"collapseCompleted":{"type":"boolean","description":"By default, collapseCompleted is false."},"initiallyCollapsed":{"type":"boolean","description":"Default initialCollapsed is false."}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentDefaultBooleanValue"}]},"conditionalLogicComponent":{"title":"ConditionalLogicComponent","allOf":[{"type":"object","properties":{"type":{"const":"ConditionalLogic"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"condition":{"$ref":"#/$defs/booleanExpression"}}},{"$ref":"#/$defs/componentChildren"}]},"courseComponent":{"title":"CourseComponent","allOf":[{"type":"object","properties":{"type":{"const":"Course"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"courseId":{"type":"string","description":"If set, a Course is used instead of the legacy Plan."},"planId":{"type":"string"},"enableNotes":{"type":"boolean"},"emptyNotesMessage":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"currentYearComponent":{"title":"CurrentYearComponent","description":"Displays the current year.","allOf":[{"type":"object","properties":{"type":{"const":"CurrentYear"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"customComponentComponent":{"title":"CustomComponentComponent","description":"A custom component (a saved fragment of components).","allOf":[{"type":"object","properties":{"type":{"const":"CustomComponent"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"customComponentId":{"type":"string","description":"The ID of the custom component to display."},"customProps":{"$ref":"#/$defs/contextData"}},"required":["customComponentId"]}]},"dashboardComponent":{"title":"DashboardComponent","description":"A dashboard layout with a header, sidebar, and main content area.","allOf":[{"type":"object","properties":{"type":{"const":"Dashboard"}},"required":["type"]},{"type":"object","properties":{"mainNavItems":{"type":"array","items":{"$ref":"#/$defs/componentDashboardNavItem"}},"extraNavItems":{"type":"array","items":{"$ref":"#/$defs/componentDashboardNavItem"}},"collapseSidebarOnPaths":{"description":"An array of path patterns as globs. If set, the sidebar will automatically be collapsed on matching paths.","type":"array","items":{"type":"string"}}}},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentChildren"}]},"dataInputTableComponent":{"title":"DataInputTableComponent","description":"A component for displaying and editing tabular data.","allOf":[{"type":"object","properties":{"type":{"const":"DataInputTable"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"dateInputComponent":{"title":"DateInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"DateInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"placeholder":{"type":"string"},"clearable":{"type":"boolean"},"style":{"type":"string","enum":["Calendar","3Fields"]},"minimumDate":{"anyOf":[{"type":"object","properties":{"type":{"const":"today"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"date"},"value":{"type":"string"}},"required":["type","value"]}]},"maximumDate":{"anyOf":[{"type":"object","properties":{"type":{"const":"today"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"date"},"value":{"type":"string"}},"required":["type","value"]}]},"monthPlaceholder":{"type":"string"},"dayPlaceholder":{"type":"string"},"yearPlaceholder":{"type":"string"}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"documentComponent":{"title":"DocumentComponent","description":"A component that displays a document that can be downloaded.","allOf":[{"type":"object","properties":{"type":{"const":"Document"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"documentId":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"dropdownInputComponent":{"title":"DropdownInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"DropdownInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"clearable":{"type":"boolean","description":"Clearable is ignored if the input is required. When the input is not required, it may or may not be clearable. The default is false."},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"number"},"value":{"type":"string"}},"required":["key","value"]}}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"formComponent":{"title":"FormComponent","allOf":[{"type":"object","properties":{"type":{"const":"Form"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"formId":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"formStepComponent":{"title":"FormStepComponent","description":"Represents the current step in a multi-step form.","allOf":[{"type":"object","properties":{"type":{"const":"FormStep"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"formatPropsComponent":{"title":"FormatPropsComponent","description":"A component that can provide string props to children components by formatting higher props or with a LiquidJS template.","allOf":[{"type":"object","properties":{"type":{"const":"FormatProps"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"props":{"type":"array","items":{"type":"object","description":"The configuration for a prop to provide.","properties":{"id":{"type":"string","description":"A random unique string for identification."},"outputPropName":{"type":"string"},"mode":{"type":"string","enum":["Transform","Template"],"description":"If mode is Transform, the output is a function of the input using one of the built-in format functions. If mode is Template, the output is derived from the configured template."},"inputPropName":{"type":"string","description":"Used only in transform mode."},"format":{"type":"string","enum":["Phone number (###) ###-####","Phone number ###-###-####","U.S. State abbreviation spelled out"],"description":"Used only in transform mode."},"template":{"type":"string","description":"Used only in template mode. A LiquidJS template."}},"required":["id","outputPropName"]}}}},{"$ref":"#/$defs/componentChildren"}]},"googlePlaceInputComponent":{"title":"GooglePlaceInputComponent","description":"A map with a search field that lets you select a Place in Google Maps.","allOf":[{"type":"object","properties":{"type":{"const":"GooglePlaceInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"helpTicketsPortalComponent":{"title":"HelpTicketsPortalComponent","description":"A portal for help tickets.","allOf":[{"type":"object","properties":{"type":{"const":"HelpTicketsPortal"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"htmlComponent":{"title":"HTMLComponent","description":"A component that renders raw HTML.","allOf":[{"type":"object","properties":{"type":{"const":"HTML"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"html":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"iconComponent":{"title":"IconComponent","allOf":[{"type":"object","properties":{"type":{"const":"Icon"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"icon":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"imageComponent":{"title":"ImageComponent","description":"A component that displays an image.","allOf":[{"type":"object","properties":{"type":{"const":"Image"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"src":{"anyOf":[{"$ref":"#/$defs/componentStringValueSource"},{"type":"object","properties":{"type":{"const":"SiteLogoUrl"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"Asset"},"assetId":{"type":"string"},"variantId":{"type":"string","description":"Optional ID of a specific variant to use. Should not be set together with variantIds. If not provided and variantIds is also not provided or is empty, the image is rendered with a srcset including all variants by default."},"variantIds":{"type":"array","items":{"type":"string"},"description":"Optional IDs of specific variants to use in the srcset attribute. Should not be set together with variantId."}},"required":["type","assetId"]}]},"alt":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"inputValidationErrorMessageComponent":{"title":"InputValidationErrorMessageComponent","description":"Displays error messages for input validation.","allOf":[{"type":"object","properties":{"type":{"const":"InputValidationErrorMessage"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"lessonNotesFieldComponent":{"title":"LessonNotesFieldComponent","description":"A text field for users to save notes related to a lesson (for courses).","allOf":[{"type":"object","properties":{"type":{"const":"LessonNotesField"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentStyles"}]},"linkComponent":{"title":"LinkComponent","description":"A link.","allOf":[{"type":"object","properties":{"type":{"const":"Link"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"to":{"description":"The URL that the link points to. A router link will be rendered for a path without a host (using the History API). A regular link will be rendered for a full URL.","$ref":"#/$defs/componentStringValueSource"},"target":{"type":"string","enum":["_blank","_self","_parent","_top"]},"protocol":{"type":"string","description":"Adds the specified protocol prefix to the href attribute's value.","enum":["mailto","tel"]}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"mapComponent":{"title":"MapComponent","description":"A component that displays a map.","allOf":[{"type":"object","properties":{"type":{"const":"Map"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"focus":{"anyOf":[{"$ref":"#/$defs/componentStringValueSource"},{"type":"object","properties":{"type":{"const":"Direct"},"value":{"type":"null"}},"required":["type"]}]}}},{"$ref":"#/$defs/componentStyles"}]},"moveUserPlanComponent":{"title":"MoveUserPlanComponent","description":"A component for a user to move between sequence stages.","allOf":[{"type":"object","properties":{"type":{"const":"MoveUserPlan"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"previousButtonLabel":{"type":"string"},"nextButtonLabel":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"multiOrgViewComponent":{"title":"MultiOrgViewComponent","description":"A view for viewing all the orgs under a subscription, including all the users of each org and their training progress.","allOf":[{"type":"object","properties":{"type":{"const":"MultiOrgView"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"showUserTrainingProgress":{"type":"boolean"},"userTrainingProgressCourseIds":{"type":"array","items":{"type":"string"}},"userTrainingProgressSequenceIds":{"type":"array","items":{"type":"string"}},"userTrainingProgressContentPlanIds":{"type":"array","items":{"type":"string"}}}},{"$ref":"#/$defs/componentStyles"}]},"multiSelectInputComponent":{"title":"MultiSelectInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"MultiSelectInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"question":{"type":"string"},"choices":{"type":"array","items":{"type":"string"}},"answerIndices":{"type":"array","items":{"type":"number"}}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"multipleChoiceInputComponent":{"title":"MultipleChoiceInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"MultipleChoiceInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"question":{"type":"string"},"choices":{"type":"array","items":{"type":"string"}},"answerIndex":{"type":"number"}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"numberInputComponent":{"title":"NumberInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"NumberInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"maxDecimalDigits":{"type":"number"},"placeholder":{"type":"string"},"format":{"type":"string","enum":["Number","Currency","Integer"]}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"}]},"orderPageComponent":{"title":"OrderPageComponent","description":"A component for order pages.","allOf":[{"type":"object","properties":{"type":{"const":"OrderPage"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"enablePromoCode":{"type":"string","enum":["Stripe","Custom"]},"checkoutOptions":{"type":"array","items":{"type":"object","properties":{"subscriptionPlanId":{"type":"string"},"condition":{"$ref":"#/$defs/booleanExpression"}},"required":["subscriptionPlanId"]}}}},{"$ref":"#/$defs/componentStyles"}]},"orgBillingSettingsComponent":{"title":"OrgBillingSettingsComponent","description":"Org billing settings dashboard.","allOf":[{"type":"object","properties":{"type":{"const":"OrgBillingSettings"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"orgSitePagesComponent":{"title":"OrgSitePagesComponent","description":"Shows the pages of an org site and allows authorized users to activate and edit pages.","allOf":[{"type":"object","properties":{"type":{"const":"OrgSitePages"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"pageTemplates":{"oneOf":[{"type":"object","properties":{"filter":{"const":"include"},"ids":{"type":"array","items":{"type":"string"}}},"required":["filter","ids"]},{"type":"object","properties":{"filter":{"const":"exclude"},"ids":{"type":"array","items":{"type":"string"}}},"required":["filter","ids"]}]},"defaultPageTemplatePreviewImageUrl":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"orgSiteReviewsComponent":{"title":"OrgSiteReviewsComponent","description":"Organization site reviews component.","allOf":[{"type":"object","properties":{"type":{"const":"OrgSiteReviews"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"organizationTeamComponent":{"title":"OrganizationTeamComponent","description":"Organization team/members dashboard.","allOf":[{"type":"object","properties":{"type":{"const":"OrganizationTeam"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"showUserTrainingProgress":{"type":"boolean"},"userTrainingProgressCourseIds":{"type":"array","items":{"type":"string"}},"userTrainingProgressContentPlanIds":{"type":"array","items":{"type":"string"}}}},{"$ref":"#/$defs/componentStyles"}]},"pageComponent":{"title":"PageComponent","description":"Represents the current page when rendered inside a layout.","allOf":[{"type":"object","properties":{"type":{"const":"Page"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"plainTextComponent":{"title":"PlainTextComponent","allOf":[{"type":"object","properties":{"type":{"const":"PlainText"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"text":{"anyOf":[{"$ref":"#/$defs/componentStringValueSource"},{"type":"object","properties":{"type":{"const":"PageTitle"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"SiteName"}},"required":["type"]}]}}}]},"popoverComponent":{"title":"PopoverComponent","description":"A popover.","allOf":[{"type":"object","properties":{"type":{"const":"Popover"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"showTriggers":{"type":"array","items":{"$ref":"#/$defs/componentTrigger"},"description":"How the popover can be shown."},"hideTriggers":{"type":"array","items":{"$ref":"#/$defs/componentTrigger"},"description":"How the popover can be hidden."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"productItemGuardComponent":{"title":"ProductItemGuardComponent","description":"Ensures that a user is signed in and belongs to an org that has access to the specified product item in an active subscription. Otherwise, the component shows a default message, a custom children, or nothing, depending on how it is configured. The styling applies only to the default message.","allOf":[{"type":"object","properties":{"type":{"const":"ProductItemGuard"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"productItem":{"type":"string","description":"The product item to require. If not set, this component does not require anything and displays its children."},"accessDeniedMode":{"type":"string","enum":["CustomMessage","DefaultMessage","Empty"],"description":"The default accessDeniedMode is DefaultMessage. A custom message is defined through children with an AccessDenied slot key."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"providePropsComponent":{"title":"ProvidePropsComponent","allOf":[{"type":"object","properties":{"type":{"const":"ProvideProps"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"props":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A random unique string for identification."},"name":{"type":"string","description":"The name of the prop to provide."},"source":{"anyOf":[{"type":"object","properties":{"type":{"const":"Direct"},"value":{"anyOf":[{"type":"object","properties":{"type":{"const":"Number"},"value":{"type":"number"}},"required":["type","value"]},{"type":"object","properties":{"type":{"const":"String"},"value":{"type":"string"}},"required":["type","value"]}]}},"required":["type","value"]},{"type":"object","properties":{"type":{"const":"CustomField"},"object":{"type":"string","enum":["Site","Page","User"],"description":"The object from which to read the specified field. For a page template being previewed, when the object is 'Page' the custom fields are taken instead from the page template."},"fieldName":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"QueryParameter"},"parameter":{"type":"string"}},"required":["type"]}]}},"required":["id","name","source"]}}}},{"$ref":"#/$defs/componentChildren"}]},"radioGroupInputButtonComponent":{"title":"RadioGroupInputButtonComponent","description":"A button within a radio group input.","allOf":[{"type":"object","properties":{"type":{"const":"RadioGroupInputButton"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"childrenOrLabel":{"type":"string","enum":["children","label"],"description":"Whether to use children or a label, applicable only when the parent RadioGroupInput is in indicators mode. When the parent RadioGroupInput is in cards mode, label is ignored and children are displayed."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentConditionalStyles"},{"$ref":"#/$defs/componentStringValue"},{"$ref":"#/$defs/componentStyles"}]},"radioGroupInputComponent":{"title":"RadioGroupInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"RadioGroupInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"displayType":{"type":"string","enum":["indicators","cards"],"description":"The style to use for items. Defaults to indicators (bubble icons). For indicators, children or a label is displayed, depending on each RadioGroupInputButton. For cards, there is default styling with a border color that indicates which item, if any, is selected, and children are displayed."}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentStringValue"},{"$ref":"#/$defs/componentDefaultStringValue"}]},"remoteComponentComponent":{"title":"RemoteComponentComponent","description":"A component that dynamically loads a remote React component with custom code from an extension.","allOf":[{"type":"object","properties":{"type":{"const":"RemoteComponent"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"extensionName":{"type":"string","description":"The name of the extension that contains the remote component."},"componentName":{"type":"string","description":"The name of the component to display."}}},{"$ref":"#/$defs/componentChildren"}]},"repeatingGroupInputComponent":{"title":"RepeatingGroupInputComponent","description":"An input component that can include multiple input components and other components, allowing an array of records to be entered.","allOf":[{"type":"object","properties":{"type":{"const":"RepeatingGroupInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentName"}]},"requestPasswordResetComponent":{"title":"RequestPasswordResetComponent","description":"A component to request password reset.","allOf":[{"type":"object","properties":{"type":{"const":"RequestPasswordReset"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"resetPasswordComponent":{"title":"ResetPasswordComponent","description":"A component to reset a password.","allOf":[{"type":"object","properties":{"type":{"const":"ResetPassword"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"mode":{"type":"string","enum":["create","reset"]}}},{"$ref":"#/$defs/componentStyles"}]},"reviewComponent":{"title":"ReviewComponent","description":"Displays a review form with 1-5 stars and redirects to the configured Google Place if the user clicks 5 stars.","allOf":[{"type":"object","properties":{"type":{"const":"Review"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"googlePlace":{"anyOf":[{"$ref":"#/$defs/componentStringValueSource"},{"type":"object","properties":{"type":{"const":"Direct"},"value":{"type":"null"}},"required":["type"]},{"type":"object","description":"Deprecated.","properties":{"type":{"const":"Direct"},"googlePlaceId":{"type":["string","null"]}},"required":["type"]}]},"selectStarsLabel":{"type":"string"},"reviewFieldPlaceholder":{"type":"string"}}},{"$ref":"#/$defs/componentStyles"}]},"signInGuardComponent":{"title":"SignInGuardComponent","allOf":[{"type":"object","properties":{"type":{"const":"SignInGuard"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentChildren"}]},"siteLogoComponent":{"title":"SiteLogoComponent","description":"A component that displays the site logo.","allOf":[{"type":"object","properties":{"type":{"const":"SiteLogo"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"alt":{"type":"string","description":"Alternative text for the logo, defaults to the site name"},"fallbackSiteName":{"type":"boolean","description":"Whether to display the site name if the logo is not available"}}},{"$ref":"#/$defs/componentStyles"}]},"sitePrivacyPolicyComponent":{"title":"SitePrivacyPolicyComponent","description":"A component that displays the site privacy policy.","allOf":[{"type":"object","properties":{"type":{"const":"SitePrivacyPolicy"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"siteTermsOfUseComponent":{"title":"SiteTermsOfUseComponent","description":"A component that displays the site terms of use.","allOf":[{"type":"object","properties":{"type":{"const":"SiteTermsOfUse"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"stageBodyComponent":{"title":"StageBodyComponent","description":"The body of a stage in a sequence.","allOf":[{"type":"object","properties":{"type":{"const":"StageBody"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"}]},"stageComponent":{"title":"StageComponent","description":"A stage in a sequence.","allOf":[{"type":"object","properties":{"type":{"const":"Stage"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"enableWrappedStageBody":{"type":"boolean","description":"Whether to enable the wrapped stage body"}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"stageNameComponent":{"title":"StageNameComponent","description":"A component that displays the name of a stage.","allOf":[{"type":"object","properties":{"type":{"const":"StageName"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"textComponent":{"title":"TextComponent","description":"A component that displays rich text.","allOf":[{"type":"object","properties":{"type":{"const":"Text"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"content":{"type":"object","properties":{"delta":{"type":"string","description":"A Quill Delta object as JSON."}},"required":["delta"]}}}]},"textInputComponent":{"title":"TextInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"TextInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"placeholder":{"type":"string"},"format":{"type":"string","enum":["None","Email","Phone","Url"],"description":"Validation format for the input"}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentMaxLength"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentDefaultStringValue"}]},"textareaInputComponent":{"title":"TextareaInputComponent","allOf":[{"type":"object","properties":{"type":{"const":"TextareaInput"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"placeholder":{"type":"string"}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentName"},{"$ref":"#/$defs/componentRequired"},{"$ref":"#/$defs/componentMaxLength"},{"$ref":"#/$defs/componentStyles"},{"$ref":"#/$defs/componentDefaultStringValue"}]},"typeformComponent":{"title":"TypeformComponent","description":"A component that embeds a Typeform.","allOf":[{"type":"object","properties":{"type":{"const":"Typeform"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"url":{"$ref":"#/$defs/componentStringValue","description":"The URL of the Typeform"},"height":{"type":"number","description":"The height of the embedded form"}}},{"$ref":"#/$defs/componentStyles"}]},"userProfileComponent":{"title":"UserProfileComponent","description":"A component that displays a user profile.","allOf":[{"type":"object","properties":{"type":{"const":"UserProfile"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"verifiedEmailAddressGuardComponent":{"title":"VerifiedEmailAddressGuardComponent","description":"Requires that a user be signed in and have a verified email address. Otherwise displays either a message that you need to be signed in or a message and a button to send a verification email.","allOf":[{"type":"object","properties":{"type":{"const":"VerifiedEmailAddressGuard"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"verifyEmailAddressComponent":{"title":"VerifyEmailAddressComponent","description":"Reads a URL query parameter that contains a unique token for verifying a user’s email address and makes an API request to mark the email address as verified. If the token is valid, it displays a message that the email address has been verified. Otherwise, it displays an error message. In either case, at the bottom it displays a 'Go to {siteName}' link that navigates to the home page.","allOf":[{"type":"object","properties":{"type":{"const":"VerifyEmailAddress"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"$ref":"#/$defs/componentStyles"}]},"videoComponent":{"title":"VideoComponent","description":"A component that displays a video.","allOf":[{"type":"object","properties":{"type":{"const":"Video"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"tag":{"type":"string","enum":["iframe","video"],"description":"The way to render the video. Defaults to 'iframe'."},"src":{"$ref":"#/$defs/componentStringValueSource"},"poster":{"$ref":"#/$defs/componentStringValueSource","description":"The URL of an image to display while the video is loading. Applicable only when tag is 'video'."},"controls":{"type":"boolean","description":"Applicable only when tag is 'video'."},"autoPlay":{"type":"boolean","description":"Applicable only when tag is 'video'."},"playsInline":{"type":"boolean","description":"Applicable only when tag is 'video'."},"loop":{"type":"boolean","description":"Applicable only when tag is 'video'."},"muted":{"type":"boolean","description":"Applicable only when tag is 'video'."}}},{"$ref":"#/$defs/componentStyles"}]},"viewPlanStagesButtonComponent":{"title":"ViewPlanStagesButtonComponent","description":"A button that opens a dialog that displays the stages of a sequence and allows the user to move to another stage.","allOf":[{"type":"object","properties":{"type":{"const":"ViewPlanStagesButton"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"dialogHeader":{"type":"string"},"stageNameTableHeader":{"type":"string"}}},{"$ref":"#/$defs/componentLabel"},{"$ref":"#/$defs/componentStyles"}]},"widthContainerComponent":{"title":"WidthContainerComponent","description":"A container with a specified width.","allOf":[{"type":"object","properties":{"type":{"const":"WidthContainer"}},"required":["type"]},{"$ref":"#/$defs/componentComponentBase"},{"type":"object","properties":{"width":{"type":"string","enum":["Medium","Large","XLarge","XXLarge"]}}},{"$ref":"#/$defs/componentChildren"},{"$ref":"#/$defs/componentStyles"}]},"componentBaseStyles":{"type":"object","properties":{"styles":{"type":"object","additionalProperties":{"type":"string"}},"smStyles":{"type":"object","additionalProperties":{"type":"string"}},"mdStyles":{"type":"object","additionalProperties":{"type":"string"}},"lgStyles":{"type":"object","additionalProperties":{"type":"string"}},"xlStyles":{"type":"object","additionalProperties":{"type":"string"}},"xxlStyles":{"type":"object","additionalProperties":{"type":"string"}}}},"componentBooleanValueSource":{"anyOf":[{"type":"object","properties":{"type":{"const":"Direct"},"value":{"type":"boolean"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"Prop"},"name":{"type":"string"}},"required":["type","name"]}]},"componentChildren":{"type":"object","properties":{"children":{"type":"array","items":{"$ref":"#/$defs/component"}}}},"componentChildrenOrLabel":{"type":"object","properties":{"childrenOrLabel":{"description":"Whether to display children components or a label.","type":"string","enum":["children","label"]}}},"componentComponentBase":{"type":"object","properties":{"conditionalLogicSlot":{"type":"string","enum":["True","False"],"description":"The slot to render as when a direct child of a ConditionalLogic component."},"productItemGuardSlot":{"type":"string","enum":["AccessAllowed","AccessDenied"],"description":"The slot to render as when a direct child of a ProductItemGuard component."}}},"componentConditionalStyles":{"type":"object","description":"Sets of conditional styling rules that be set on an element depending on any boolean expression (e.g., referencing form state).","properties":{"conditionalStyles":{"type":"array","items":{"type":"object","properties":{"key":{"description":"A random unique string for identification.","type":"string"},"condition":{"$ref":"#/$defs/booleanExpression"},"styles":{"$ref":"#/$defs/componentStyles"}}}}}},"componentDashboardNavItem":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"},"productItem":{"oneOf":[{"type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"openInNewTab":{"type":"boolean"}},"required":["id"]},"componentDefaultBooleanValue":{"type":"object","properties":{"defaultValue":{"$ref":"#/$defs/componentBooleanValueSource"}}},"componentDefaultStringValue":{"type":"object","properties":{"defaultValue":{"$ref":"#/$defs/componentStringValueSource"}}},"componentElementId":{"type":"object","properties":{"elementId":{"type":"string"}}},"componentLabel":{"type":"object","properties":{"label":{"anyOf":[{"$ref":"#/$defs/componentStringValueSource"},{"type":"object","properties":{"type":{"const":"PageTitle"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"SiteName"}},"required":["type"]}]},"labelStyles":{"$ref":"#/$defs/componentStyles"}}},"componentMaxLength":{"type":"object","properties":{"maxLength":{"type":"number"}}},"componentName":{"type":"object","properties":{"name":{"type":"string"}}},"componentNumberValueSource":{"anyOf":[{"type":"object","properties":{"type":{"const":"Direct"},"value":{"type":"number"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"Prop"},"name":{"type":"string"}},"required":["type","name"]}]},"componentRequired":{"type":"object","properties":{"required":{"type":"boolean"}}},"componentStringValue":{"type":"object","properties":{"value":{"$ref":"#/$defs/componentStringValueSource"}}},"componentStringValueSource":{"anyOf":[{"type":"object","properties":{"type":{"const":"Direct"},"value":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"Prop"},"name":{"type":"string"}},"required":["type","name"]}]},"componentStyles":{"type":"object","allOf":[{"$ref":"#/$defs/componentBaseStyles"},{"properties":{"hoverStyles":{"$ref":"#/$defs/componentBaseStyles"},"focusVisibleStyles":{"$ref":"#/$defs/componentBaseStyles"}}}]},"componentTrigger":{"type":"object","properties":{"id":{"type":"string","description":"A random unique string for identification."},"type":{"type":"string","enum":["Click","InputChange"]},"condition":{"$ref":"#/$defs/booleanExpression","description":"An optional condition that, if set, needs to evaluate to true for the trigger to apply."}},"required":["id","type"]},"expression":{"title":"Expression","oneOf":[{"$ref":"#/$defs/arrayExpression"},{"$ref":"#/$defs/booleanExpression"},{"$ref":"#/$defs/numberExpression"},{"$ref":"#/$defs/stringExpression"}]},"numberExpression":{"title":"NumberExpression","oneOf":[{"$ref":"#/$defs/numberExpressionCount"},{"$ref":"#/$defs/numberExpressionCurrentTime"},{"$ref":"#/$defs/numberExpressionInputChangeEventNumberValue"},{"$ref":"#/$defs/numberExpressionInputDataNumber"},{"$ref":"#/$defs/numberExpressionNumberLiteral"},{"$ref":"#/$defs/numberExpressionPropsNumber"},{"$ref":"#/$defs/numberExpressionSum"},{"$ref":"#/$defs/numberExpressionSumArray"},{"$ref":"#/$defs/numberExpressionTimeLiteral"}]},"numberExpressionCount":{"type":"object","properties":{"operator":{"const":"count"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"}},"required":["operator","arrayExpression"]},"numberExpressionCurrentTime":{"type":"object","description":"A timestamp in milliseconds since epoch.","properties":{"operator":{"const":"currentTime"}},"required":["operator"]},"numberExpressionNumberLiteral":{"type":"object","properties":{"operator":{"const":"numberLiteral"},"value":{"type":"number"}},"required":["operator","value"]},"numberExpressionPropsNumber":{"type":"object","properties":{"operator":{"const":"propsNumber"},"prop":{"type":"string"}},"required":["operator","prop"]},"numberExpressionInputChangeEventNumberValue":{"type":"object","properties":{"operator":{"const":"inputChangeEventNumberValue"}},"required":["operator"]},"numberExpressionInputDataNumber":{"type":"object","properties":{"operator":{"const":"inputDataNumber"},"fieldKey":{"type":"string"}},"required":["operator","fieldKey"]},"numberExpressionSum":{"type":"object","properties":{"operator":{"const":"sum"},"left":{"$ref":"#/$defs/numberExpression"},"right":{"$ref":"#/$defs/numberExpression"}},"required":["operator","left","right"]},"numberExpressionSumArray":{"type":"object","properties":{"operator":{"const":"sumArray"},"arrayExpression":{"$ref":"#/$defs/arrayExpression"}},"required":["operator","arrayExpression"]},"numberExpressionTimeLiteral":{"type":"object","description":"A timestamp in milliseconds since epoch.","properties":{"operator":{"const":"timeLiteral"},"value":{"type":"number"}},"required":["operator","value"]},"stringExpression":{"title":"StringExpression","oneOf":[{"$ref":"#/$defs/stringExpressionEventSourceComponentName"},{"$ref":"#/$defs/stringExpressionEventSourceComponentType"},{"$ref":"#/$defs/stringExpressionFeatureTag"},{"$ref":"#/$defs/stringExpressionInputChangeEventStringValue"},{"$ref":"#/$defs/stringExpressionInputDataString"},{"$ref":"#/$defs/stringExpressionPropsString"},{"$ref":"#/$defs/stringExpressionStringLiteral"},{"$ref":"#/$defs/stringExpressionUserEmail"},{"$ref":"#/$defs/stringExpressionUserOrgId"},{"$ref":"#/$defs/stringExpressionUserRole"}]},"stringExpressionEventSourceComponentName":{"type":"object","properties":{"operator":{"const":"eventSourceComponentName"}},"required":["operator"]},"stringExpressionEventSourceComponentType":{"type":"object","properties":{"operator":{"const":"eventSourceComponentType"}},"required":["operator"]},"stringExpressionFeatureTag":{"type":"object","properties":{"operator":{"const":"featureTag"},"tag":{"type":"string"}},"required":["operator","tag"]},"stringExpressionInputChangeEventStringValue":{"type":"object","properties":{"operator":{"const":"inputChangeEventStringValue"}},"required":["operator"]},"stringExpressionInputDataString":{"type":"object","properties":{"operator":{"const":"inputDataString"},"fieldKey":{"type":"string"}},"required":["operator","fieldKey"]},"stringExpressionPropsString":{"type":"object","properties":{"operator":{"const":"propsString"},"prop":{"type":"string"}},"required":["operator","prop"]},"stringExpressionStringLiteral":{"type":"object","properties":{"operator":{"const":"stringLiteral"},"value":{"type":"string"}},"required":["operator","value"]},"stringExpressionUserEmail":{"type":"object","properties":{"operator":{"const":"userEmail"}},"required":["operator"]},"stringExpressionUserOrgId":{"type":"object","properties":{"operator":{"const":"userOrgId"}},"required":["operator"]},"stringExpressionUserRole":{"type":"object","properties":{"operator":{"const":"userRole"}},"required":["operator"]}}`);
|
|
25266
|
+
const strippedComponentsSchema = {
|
|
25267
|
+
$schema: $schema$e,
|
|
25268
|
+
type: type$a,
|
|
25269
|
+
items: items$1,
|
|
25270
|
+
$defs: $defs$8
|
|
25271
|
+
};
|
|
25189
25272
|
const $schema$d = "https://json-schema.org/draft/2020-12/schema";
|
|
25190
25273
|
const $id$e = "/context-data/context-data.json";
|
|
25191
25274
|
const title$d = "ContextData";
|
|
@@ -32004,6 +32087,7 @@ function require_2020() {
|
|
|
32004
32087
|
var _2020Exports = require_2020();
|
|
32005
32088
|
const instance = new _2020Exports.Ajv2020();
|
|
32006
32089
|
instance.addSchema([
|
|
32090
|
+
strippedComponentsSchema,
|
|
32007
32091
|
arrayExpressionSchema,
|
|
32008
32092
|
booleanExpressionSchema,
|
|
32009
32093
|
contextDataSchema,
|
|
@@ -41376,8 +41460,8 @@ function requireReadable() {
|
|
|
41376
41460
|
this.pipes = [];
|
|
41377
41461
|
this.flowing = null;
|
|
41378
41462
|
this[kPaused] = null;
|
|
41379
|
-
if (options && options.emitClose === false) this.state &=
|
|
41380
|
-
if (options && options.autoDestroy === false) this.state &=
|
|
41463
|
+
if (options && options.emitClose === false) this.state &= -2049;
|
|
41464
|
+
if (options && options.autoDestroy === false) this.state &= -4097;
|
|
41381
41465
|
this.errored = null;
|
|
41382
41466
|
this.defaultEncoding = options && options.defaultEncoding || "utf8";
|
|
41383
41467
|
this.awaitDrainWriters = null;
|
|
@@ -41454,7 +41538,7 @@ function requireReadable() {
|
|
|
41454
41538
|
if (err) {
|
|
41455
41539
|
errorOrDestroy(stream2, err);
|
|
41456
41540
|
} else if (chunk === null) {
|
|
41457
|
-
state2.state &=
|
|
41541
|
+
state2.state &= -9;
|
|
41458
41542
|
onEofChunk(stream2, state2);
|
|
41459
41543
|
} else if ((state2.state & kObjectMode) !== 0 || chunk && chunk.length > 0) {
|
|
41460
41544
|
if (addToFront) {
|
|
@@ -41466,7 +41550,7 @@ function requireReadable() {
|
|
|
41466
41550
|
} else if (state2.destroyed || state2.errored) {
|
|
41467
41551
|
return false;
|
|
41468
41552
|
} else {
|
|
41469
|
-
state2.state &=
|
|
41553
|
+
state2.state &= -9;
|
|
41470
41554
|
if (state2.decoder && !encoding) {
|
|
41471
41555
|
chunk = state2.decoder.write(chunk);
|
|
41472
41556
|
if (state2.objectMode || chunk.length !== 0) addChunk(stream2, state2, chunk, false);
|
|
@@ -41476,7 +41560,7 @@ function requireReadable() {
|
|
|
41476
41560
|
}
|
|
41477
41561
|
}
|
|
41478
41562
|
} else if (!addToFront) {
|
|
41479
|
-
state2.state &=
|
|
41563
|
+
state2.state &= -9;
|
|
41480
41564
|
maybeReadMore(stream2, state2);
|
|
41481
41565
|
}
|
|
41482
41566
|
return !state2.ended && (state2.length < state2.highWaterMark || state2.length === 0);
|
|
@@ -41551,7 +41635,7 @@ function requireReadable() {
|
|
|
41551
41635
|
const state2 = this._readableState;
|
|
41552
41636
|
const nOrig = n;
|
|
41553
41637
|
if (n > state2.highWaterMark) state2.highWaterMark = computeNewHighWaterMark(n);
|
|
41554
|
-
if (n !== 0) state2.state &=
|
|
41638
|
+
if (n !== 0) state2.state &= -129;
|
|
41555
41639
|
if (n === 0 && state2.needReadable && ((state2.highWaterMark !== 0 ? state2.length >= state2.highWaterMark : state2.length > 0) || state2.ended)) {
|
|
41556
41640
|
debug("read: emitReadable", state2.length, state2.ended);
|
|
41557
41641
|
if (state2.length === 0 && state2.ended) endReadable(this);
|
|
@@ -41581,7 +41665,7 @@ function requireReadable() {
|
|
|
41581
41665
|
} catch (err) {
|
|
41582
41666
|
errorOrDestroy(this, err);
|
|
41583
41667
|
}
|
|
41584
|
-
state2.state &=
|
|
41668
|
+
state2.state &= -33;
|
|
41585
41669
|
if (!state2.reading) n = howMuchToRead(nOrig, state2);
|
|
41586
41670
|
}
|
|
41587
41671
|
let ret;
|
|
@@ -46180,7 +46264,7 @@ function requireAst() {
|
|
|
46180
46264
|
this.#hasMagic = void 0;
|
|
46181
46265
|
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
|
46182
46266
|
}
|
|
46183
|
-
let bodyDotAllowed = !repeated || allowDot || dot ||
|
|
46267
|
+
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : this.#partsToRegExp(true);
|
|
46184
46268
|
if (bodyDotAllowed === body) {
|
|
46185
46269
|
bodyDotAllowed = "";
|
|
46186
46270
|
}
|
|
@@ -49376,7 +49460,7 @@ function requireCommonjs$1() {
|
|
|
49376
49460
|
const IFLNK = 10;
|
|
49377
49461
|
const IFSOCK = 12;
|
|
49378
49462
|
const IFMT = 15;
|
|
49379
|
-
const IFMT_UNKNOWN =
|
|
49463
|
+
const IFMT_UNKNOWN = -16;
|
|
49380
49464
|
const READDIR_CALLED = 16;
|
|
49381
49465
|
const LSTAT_CALLED = 32;
|
|
49382
49466
|
const ENOTDIR = 64;
|
|
@@ -49638,7 +49722,7 @@ function requireCommonjs$1() {
|
|
|
49638
49722
|
}
|
|
49639
49723
|
const children = Object.assign([], { provisional: 0 });
|
|
49640
49724
|
this.#children.set(this, children);
|
|
49641
|
-
this.#type &=
|
|
49725
|
+
this.#type &= -17;
|
|
49642
49726
|
return children;
|
|
49643
49727
|
}
|
|
49644
49728
|
/**
|
|
@@ -60858,6 +60942,12 @@ const validatePasswordComplexity = (password) => {
|
|
|
60858
60942
|
const hashPassword = (password) => hash(password, {
|
|
60859
60943
|
type: argon2id
|
|
60860
60944
|
});
|
|
60945
|
+
const roleSchema = z.object({
|
|
60946
|
+
id: z.string(),
|
|
60947
|
+
name: z.string(),
|
|
60948
|
+
default: z.boolean().optional().default(false)
|
|
60949
|
+
});
|
|
60950
|
+
const rolesSchema = z.array(roleSchema);
|
|
60861
60951
|
const detailedUniqueIntegrityConstraintViolationError = (error2) => {
|
|
60862
60952
|
const message = error2.message === "Query violates a unique integrity constraint." ? `A database uniqueness constraint was violated when inserting or updating` : error2.message;
|
|
60863
60953
|
const details = [];
|
|
@@ -60876,15 +60966,13 @@ const detailedUniqueIntegrityConstraintViolationError = (error2) => {
|
|
|
60876
60966
|
return message;
|
|
60877
60967
|
};
|
|
60878
60968
|
const isDuplicateDatabaseError = (error2) => !!error2 && typeof error2 === "object" && "code" in error2 && error2.code === "42P04";
|
|
60879
|
-
const insertUserResult = z.object({
|
|
60880
|
-
id: z.string()
|
|
60881
|
-
});
|
|
60882
60969
|
const findOrgResult = z.object({
|
|
60883
60970
|
platformId: z.string()
|
|
60884
60971
|
});
|
|
60885
60972
|
const findPlatformResult = z.object({
|
|
60886
60973
|
id: z.string(),
|
|
60887
|
-
name: z.string()
|
|
60974
|
+
name: z.string(),
|
|
60975
|
+
roles: rolesSchema.nullable()
|
|
60888
60976
|
});
|
|
60889
60977
|
const createUser = async (opts, env2) => {
|
|
60890
60978
|
const db = await distExports$1.createPool(requireCoreDbUrl(env2));
|
|
@@ -60900,7 +60988,7 @@ const createUser = async (opts, env2) => {
|
|
|
60900
60988
|
process.exit(1);
|
|
60901
60989
|
}
|
|
60902
60990
|
const password = await hashPassword(opts.password);
|
|
60903
|
-
const
|
|
60991
|
+
const inputRole = opts.role || "";
|
|
60904
60992
|
const status = opts.pending ? "Pending" : "Active";
|
|
60905
60993
|
const firstName = opts.firstName.trim();
|
|
60906
60994
|
if (!firstName.length) {
|
|
@@ -60916,7 +61004,8 @@ const createUser = async (opts, env2) => {
|
|
|
60916
61004
|
let orgId = opts.orgId;
|
|
60917
61005
|
let orgPrimary = false;
|
|
60918
61006
|
try {
|
|
60919
|
-
const
|
|
61007
|
+
const userId = cleanSmallId();
|
|
61008
|
+
await db.transaction(async (db2) => {
|
|
60920
61009
|
if (!platformId) {
|
|
60921
61010
|
if (!orgId) {
|
|
60922
61011
|
throw new Error("Either --org-id or --platform-id must be specified");
|
|
@@ -60941,7 +61030,7 @@ const createUser = async (opts, env2) => {
|
|
|
60941
61030
|
const platform = await db2.maybeOne(
|
|
60942
61031
|
distExports$1.sql.type(
|
|
60943
61032
|
findPlatformResult
|
|
60944
|
-
)`select "id", "name" from "Platforms" where "id" = ${platformId}`
|
|
61033
|
+
)`select "id", "name", "roles" from "Platforms" where "id" = ${platformId}`
|
|
60945
61034
|
);
|
|
60946
61035
|
if (!platform) {
|
|
60947
61036
|
throw new Error(`No platform found with ID ${platformId}`);
|
|
@@ -60949,6 +61038,43 @@ const createUser = async (opts, env2) => {
|
|
|
60949
61038
|
if (opts.verbose) {
|
|
60950
61039
|
console.log(`Found platform ${platform.name} (ID ${platform.id})`);
|
|
60951
61040
|
}
|
|
61041
|
+
let roleToUse = "";
|
|
61042
|
+
if (platform.roles && platform.roles.length) {
|
|
61043
|
+
if (inputRole) {
|
|
61044
|
+
const roleExists = platform.roles.some((r) => r.name === inputRole);
|
|
61045
|
+
if (roleExists) {
|
|
61046
|
+
roleToUse = inputRole;
|
|
61047
|
+
} else {
|
|
61048
|
+
const validRoles = platform.roles.map((r) => r.name).join(", ");
|
|
61049
|
+
console.error(
|
|
61050
|
+
`Error: Invalid role "${inputRole}". Valid roles for this platform are: ${validRoles}`
|
|
61051
|
+
);
|
|
61052
|
+
process.exit(1);
|
|
61053
|
+
}
|
|
61054
|
+
} else {
|
|
61055
|
+
const defaultRole = platform.roles.find((r) => r.default);
|
|
61056
|
+
if (defaultRole) {
|
|
61057
|
+
roleToUse = defaultRole.name;
|
|
61058
|
+
if (opts.verbose) {
|
|
61059
|
+
console.log(`No role provided. Using default role: ${roleToUse}`);
|
|
61060
|
+
}
|
|
61061
|
+
} else {
|
|
61062
|
+
if (opts.verbose) {
|
|
61063
|
+
console.log(
|
|
61064
|
+
"No default role exists and no role was provided. Using empty string for the role."
|
|
61065
|
+
);
|
|
61066
|
+
}
|
|
61067
|
+
}
|
|
61068
|
+
}
|
|
61069
|
+
} else {
|
|
61070
|
+
if (inputRole) {
|
|
61071
|
+
console.error("Error: A role was specified but no roles are defined for this platform.");
|
|
61072
|
+
process.exit(1);
|
|
61073
|
+
}
|
|
61074
|
+
if (opts.verbose) {
|
|
61075
|
+
console.log("No roles defined for this platform. Using empty string for the role.");
|
|
61076
|
+
}
|
|
61077
|
+
}
|
|
60952
61078
|
if (!orgId) {
|
|
60953
61079
|
orgId = cleanSmallId();
|
|
60954
61080
|
await db2.maybeOne(
|
|
@@ -60961,21 +61087,44 @@ const createUser = async (opts, env2) => {
|
|
|
60961
61087
|
}
|
|
60962
61088
|
orgPrimary = true;
|
|
60963
61089
|
}
|
|
60964
|
-
const
|
|
60965
|
-
distExports$1.sql.type(
|
|
60966
|
-
|
|
60967
|
-
|
|
61090
|
+
const user = await db2.maybeOne(
|
|
61091
|
+
distExports$1.sql.type(voidSelectSchema)`insert into "Users" (
|
|
61092
|
+
"id",
|
|
61093
|
+
"platformId",
|
|
61094
|
+
"email",
|
|
61095
|
+
"emailVerified",
|
|
61096
|
+
"password",
|
|
61097
|
+
"passwordStatus",
|
|
61098
|
+
"orgId",
|
|
61099
|
+
"role",
|
|
61100
|
+
"status",
|
|
61101
|
+
"firstName",
|
|
61102
|
+
"lastName"
|
|
61103
|
+
)
|
|
61104
|
+
values (
|
|
61105
|
+
${userId},
|
|
61106
|
+
${platformId},
|
|
61107
|
+
${email},
|
|
61108
|
+
${opts.emailVerified},
|
|
61109
|
+
${password},
|
|
61110
|
+
'Ok',
|
|
61111
|
+
${orgId},
|
|
61112
|
+
${roleToUse},
|
|
61113
|
+
${status},
|
|
61114
|
+
${firstName},
|
|
61115
|
+
${lastName}
|
|
61116
|
+
)`
|
|
60968
61117
|
);
|
|
60969
61118
|
if (orgPrimary) {
|
|
60970
61119
|
await db2.maybeOne(
|
|
60971
61120
|
distExports$1.sql.type(
|
|
60972
61121
|
voidSelectSchema
|
|
60973
|
-
)`update "Orgs" set "primaryUserId" = ${
|
|
61122
|
+
)`update "Orgs" set "primaryUserId" = ${userId} where "id" = ${orgId}`
|
|
60974
61123
|
);
|
|
60975
61124
|
}
|
|
60976
|
-
return
|
|
61125
|
+
return user;
|
|
60977
61126
|
});
|
|
60978
|
-
console.log(`Created user (ID ${
|
|
61127
|
+
console.log(`Created user (ID ${userId})`);
|
|
60979
61128
|
} catch (e) {
|
|
60980
61129
|
if (e instanceof distExports$1.UniqueIntegrityConstraintViolationError) {
|
|
60981
61130
|
console.error(detailedUniqueIntegrityConstraintViolationError(e));
|
|
@@ -60985,6 +61134,14 @@ const createUser = async (opts, env2) => {
|
|
|
60985
61134
|
process.exit(1);
|
|
60986
61135
|
}
|
|
60987
61136
|
};
|
|
61137
|
+
const permissionAssetEdit = {
|
|
61138
|
+
object: "Asset",
|
|
61139
|
+
action: "edit"
|
|
61140
|
+
};
|
|
61141
|
+
const permissionAssetView = {
|
|
61142
|
+
object: "Asset",
|
|
61143
|
+
action: "view"
|
|
61144
|
+
};
|
|
60988
61145
|
const permissionExtensionCreate = {
|
|
60989
61146
|
object: "Extension",
|
|
60990
61147
|
action: "create"
|
|
@@ -61033,6 +61190,10 @@ const permissionExtensionEdit = {
|
|
|
61033
61190
|
object: "Extension",
|
|
61034
61191
|
action: "edit"
|
|
61035
61192
|
};
|
|
61193
|
+
const permissionFileUploadAsExtension = {
|
|
61194
|
+
object: "File",
|
|
61195
|
+
action: "uploadAsExtension"
|
|
61196
|
+
};
|
|
61036
61197
|
const permissionHelpTicketEditStatus = {
|
|
61037
61198
|
object: "HelpTicket",
|
|
61038
61199
|
action: "editStatus"
|
|
@@ -61089,6 +61250,10 @@ const permissionUserEditProfile = {
|
|
|
61089
61250
|
object: "User",
|
|
61090
61251
|
action: "editProfile"
|
|
61091
61252
|
};
|
|
61253
|
+
const permissionUserEditCustomFields = {
|
|
61254
|
+
object: "User",
|
|
61255
|
+
action: "editCustomFields"
|
|
61256
|
+
};
|
|
61092
61257
|
const permissionFormTemplateSync = {
|
|
61093
61258
|
object: "FormTemplate",
|
|
61094
61259
|
action: "sync"
|
|
@@ -61118,6 +61283,8 @@ const permissionTemplateView = {
|
|
|
61118
61283
|
action: "view"
|
|
61119
61284
|
};
|
|
61120
61285
|
const allPermissions = [
|
|
61286
|
+
permissionAssetEdit,
|
|
61287
|
+
permissionAssetView,
|
|
61121
61288
|
permissionExtensionCreate,
|
|
61122
61289
|
permissionExtensionCreateVersion,
|
|
61123
61290
|
permissionSiteCreate,
|
|
@@ -61130,6 +61297,7 @@ const allPermissions = [
|
|
|
61130
61297
|
permissionCustomFieldEdit,
|
|
61131
61298
|
permissionCustomerSiteEdit,
|
|
61132
61299
|
permissionExtensionEdit,
|
|
61300
|
+
permissionFileUploadAsExtension,
|
|
61133
61301
|
permissionHelpTicketEditStatus,
|
|
61134
61302
|
permissionPlatformSiteEdit,
|
|
61135
61303
|
permissionSequenceEdit,
|
|
@@ -61144,6 +61312,7 @@ const allPermissions = [
|
|
|
61144
61312
|
permissionUserEditStatus,
|
|
61145
61313
|
permissionUserEditRole,
|
|
61146
61314
|
permissionUserEditProfile,
|
|
61315
|
+
permissionUserEditCustomFields,
|
|
61147
61316
|
permissionFormTemplateSync,
|
|
61148
61317
|
permissionPageTemplateSync,
|
|
61149
61318
|
permissionPlatformView,
|
|
@@ -61330,7 +61499,7 @@ const initExtDb = async ({
|
|
|
61330
61499
|
`);
|
|
61331
61500
|
await db.query(distExports$1.sql.unsafe`
|
|
61332
61501
|
create foreign table if not exists "Users" (
|
|
61333
|
-
"id"
|
|
61502
|
+
"id" text not null,
|
|
61334
61503
|
"firstName" text not null,
|
|
61335
61504
|
"lastName" text not null,
|
|
61336
61505
|
"email" text not null,
|
|
@@ -61352,7 +61521,7 @@ const initExtDb = async ({
|
|
|
61352
61521
|
`);
|
|
61353
61522
|
await db.query(distExports$1.sql.unsafe`
|
|
61354
61523
|
create foreign table if not exists "Sites" (
|
|
61355
|
-
"id"
|
|
61524
|
+
"id" text not null,
|
|
61356
61525
|
"domain" text not null,
|
|
61357
61526
|
"orgId" text,
|
|
61358
61527
|
"name" text not null,
|
|
@@ -61522,8 +61691,9 @@ program.command("create-user").description("create a user").requiredOption("--em
|
|
|
61522
61691
|
).option(
|
|
61523
61692
|
"--platform-id <string>",
|
|
61524
61693
|
"the ID of the platform ID to which the users will be added, used only if org ID is not specified"
|
|
61525
|
-
).
|
|
61526
|
-
|
|
61694
|
+
).option(
|
|
61695
|
+
"--role <string>",
|
|
61696
|
+
"the role the user will have (defaults to the default role set on the platform, if defined, or an empty string)"
|
|
61527
61697
|
).option("--email-verified", "mark the email address as already verified by the user", false).option("--pending", "create the user in a pending state", false).action(withOptionsAndEnv(createUser));
|
|
61528
61698
|
const extDev = program.command("ext-dev").description("extension development commands");
|
|
61529
61699
|
extDev.command("get-db-url").description(
|