@atlasauth/embed 0.13.0 → 0.15.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/CHANGELOG.md +8 -0
- package/dist/embed.js +11 -10
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/lead-form.d.ts +30 -0
- package/dist/lead-form.js +86 -0
- package/dist/lead-form.js.map +1 -0
- package/dist/org-admin.d.ts +22 -0
- package/dist/org-admin.js +228 -0
- package/dist/org-admin.js.map +1 -0
- package/dist/pricing.d.ts +38 -0
- package/dist/pricing.js +96 -0
- package/dist/pricing.js.map +1 -0
- package/dist/standalone.d.ts +9 -0
- package/dist/standalone.js +4 -1
- package/dist/standalone.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/widget/flow.js +8 -2
- package/dist/widget/flow.js.map +1 -1
- package/dist/widget/forms.js +2 -0
- package/dist/widget/forms.js.map +1 -1
- package/dist/widget.d.ts +1 -1
- package/dist/widget.js +12 -9
- package/dist/widget.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export { AtlasWidget, type WidgetOptions } from './widget';
|
|
|
14
14
|
export type { PasskeyPrfEventDetail } from './widget/passkey';
|
|
15
15
|
export { defineElements, AtlasSignInElement, AtlasSignUpElement } from './element';
|
|
16
16
|
export { mountSignIn, mountSignUp, type MountTarget } from './mount';
|
|
17
|
+
export { mountLeadForm, type LeadFormOptions } from './lead-form';
|
|
18
|
+
export { mountPricingTable, type PricingTableOptions } from './pricing';
|
|
19
|
+
export { mountOrganizationAdmin, type OrgAdminOptions, type OrgAdminSection } from './org-admin';
|
|
17
20
|
export { setScriptDefaults, readScriptTag, type ScriptDefaults } from './config';
|
|
18
21
|
export { validateRedirect } from './redirect';
|
|
19
22
|
export { resolveTokens, cssVariables, orderedProviders, providerLabel, classFor, resolveSocialButtons, type DesignTokens, type ElementKey, type WidgetAppearance, type WidgetVariables, type PublicAppearance, type PublicStrategies, type AppearanceResponse, type EmailDeliveryAvailability, type SocialButtonsConfig, type SocialButtonVariant, type SocialButtonSize, type SocialButtonLayout, type ResolvedSocialButtons, } from './appearance';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ATLAS_EMBED_VERSION = exports.ATLAS_EMBED_SDK = exports.widgetDesign = exports.providerIcon = exports.resolveSocialButtons = exports.classFor = exports.providerLabel = exports.orderedProviders = exports.cssVariables = exports.resolveTokens = exports.validateRedirect = exports.readScriptTag = exports.setScriptDefaults = exports.mountSignUp = exports.mountSignIn = exports.AtlasSignUpElement = exports.AtlasSignInElement = exports.defineElements = exports.AtlasWidget = void 0;
|
|
3
|
+
exports.ATLAS_EMBED_VERSION = exports.ATLAS_EMBED_SDK = exports.widgetDesign = exports.providerIcon = exports.resolveSocialButtons = exports.classFor = exports.providerLabel = exports.orderedProviders = exports.cssVariables = exports.resolveTokens = exports.validateRedirect = exports.readScriptTag = exports.setScriptDefaults = exports.mountOrganizationAdmin = exports.mountPricingTable = exports.mountLeadForm = exports.mountSignUp = exports.mountSignIn = exports.AtlasSignUpElement = exports.AtlasSignInElement = exports.defineElements = exports.AtlasWidget = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* `@atlasauth/embed` — the universal, framework-agnostic sign-in widget.
|
|
6
6
|
*
|
|
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "AtlasSignUpElement", { enumerable: true, get: fu
|
|
|
22
22
|
var mount_1 = require("./mount");
|
|
23
23
|
Object.defineProperty(exports, "mountSignIn", { enumerable: true, get: function () { return mount_1.mountSignIn; } });
|
|
24
24
|
Object.defineProperty(exports, "mountSignUp", { enumerable: true, get: function () { return mount_1.mountSignUp; } });
|
|
25
|
+
var lead_form_1 = require("./lead-form");
|
|
26
|
+
Object.defineProperty(exports, "mountLeadForm", { enumerable: true, get: function () { return lead_form_1.mountLeadForm; } });
|
|
27
|
+
var pricing_1 = require("./pricing");
|
|
28
|
+
Object.defineProperty(exports, "mountPricingTable", { enumerable: true, get: function () { return pricing_1.mountPricingTable; } });
|
|
29
|
+
var org_admin_1 = require("./org-admin");
|
|
30
|
+
Object.defineProperty(exports, "mountOrganizationAdmin", { enumerable: true, get: function () { return org_admin_1.mountOrganizationAdmin; } });
|
|
25
31
|
var config_1 = require("./config");
|
|
26
32
|
Object.defineProperty(exports, "setScriptDefaults", { enumerable: true, get: function () { return config_1.setScriptDefaults; } });
|
|
27
33
|
Object.defineProperty(exports, "readScriptTag", { enumerable: true, get: function () { return config_1.readScriptTag; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,mCAA2D;AAAlD,qGAAA,WAAW,OAAA;AAEpB,qCAAmF;AAA1E,yGAAA,cAAc,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAC/D,iCAAqE;AAA5D,oGAAA,WAAW,OAAA;AAAE,oGAAA,WAAW,OAAA;AACjC,mCAAiF;AAAxE,2GAAA,iBAAiB,OAAA;AAAE,uGAAA,aAAa,OAAA;AACzC,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,2CAoBsB;AAnBpB,2GAAA,aAAa,OAAA;AACb,0GAAA,YAAY,OAAA;AACZ,8GAAA,gBAAgB,OAAA;AAChB,2GAAA,aAAa,OAAA;AACb,sGAAA,QAAQ,OAAA;AACR,kHAAA,oBAAoB,OAAA;AAetB,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,mCAA2D;AAAlD,sGAAA,YAAY,OAAA;AAErB,qCAAiE;AAAxD,0GAAA,eAAe,OAAA;AAAE,8GAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,mCAA2D;AAAlD,qGAAA,WAAW,OAAA;AAEpB,qCAAmF;AAA1E,yGAAA,cAAc,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAC/D,iCAAqE;AAA5D,oGAAA,WAAW,OAAA;AAAE,oGAAA,WAAW,OAAA;AACjC,yCAAkE;AAAzD,0GAAA,aAAa,OAAA;AACtB,qCAAwE;AAA/D,4GAAA,iBAAiB,OAAA;AAC1B,yCAAiG;AAAxF,mHAAA,sBAAsB,OAAA;AAC/B,mCAAiF;AAAxE,2GAAA,iBAAiB,OAAA;AAAE,uGAAA,aAAa,OAAA;AACzC,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,2CAoBsB;AAnBpB,2GAAA,aAAa,OAAA;AACb,0GAAA,YAAY,OAAA;AACZ,8GAAA,gBAAgB,OAAA;AAChB,2GAAA,aAAa,OAAA;AACb,sGAAA,QAAQ,OAAA;AACR,kHAAA,oBAAoB,OAAA;AAetB,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,mCAA2D;AAAlD,sGAAA,YAAY,OAAA;AAErB,qCAAiE;AAAxD,0GAAA,eAAe,OAAA;AAAE,8GAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MountTarget } from './mount';
|
|
2
|
+
export interface LeadFormOptions {
|
|
3
|
+
publishableKey?: string;
|
|
4
|
+
frontendApi?: string;
|
|
5
|
+
/** Which form this is (default `default`); one row per email per form. */
|
|
6
|
+
form?: string;
|
|
7
|
+
showName?: boolean;
|
|
8
|
+
/** Show the consent checkbox and require it. */
|
|
9
|
+
requireConsent?: boolean;
|
|
10
|
+
labels?: Partial<{
|
|
11
|
+
email: string;
|
|
12
|
+
name: string;
|
|
13
|
+
submit: string;
|
|
14
|
+
consent: string;
|
|
15
|
+
thanks: string;
|
|
16
|
+
invalid: string;
|
|
17
|
+
failed: string;
|
|
18
|
+
}>;
|
|
19
|
+
locale?: string;
|
|
20
|
+
fetchImpl?: typeof fetch;
|
|
21
|
+
onSubmitted?: (email: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Mount a lead / newsletter signup into an element. Stores the address with the
|
|
25
|
+
* campaign attribution captured on the page (when the instance captures it and the
|
|
26
|
+
* visitor consented) and starts that capture itself, so one script tag is enough.
|
|
27
|
+
*/
|
|
28
|
+
export declare function mountLeadForm(target: MountTarget, options?: LeadFormOptions): {
|
|
29
|
+
destroy(): void;
|
|
30
|
+
} | null;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mountLeadForm = mountLeadForm;
|
|
4
|
+
const js_1 = require("@atlasauth/js");
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const h = (tag, props = {}, ...kids) => {
|
|
8
|
+
const node = document.createElement(tag);
|
|
9
|
+
for (const [k, v] of Object.entries(props))
|
|
10
|
+
node.setAttribute(k, v);
|
|
11
|
+
for (const kid of kids)
|
|
12
|
+
if (kid !== null)
|
|
13
|
+
node.append(kid);
|
|
14
|
+
return node;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Mount a lead / newsletter signup into an element. Stores the address with the
|
|
18
|
+
* campaign attribution captured on the page (when the instance captures it and the
|
|
19
|
+
* visitor consented) and starts that capture itself, so one script tag is enough.
|
|
20
|
+
*/
|
|
21
|
+
function mountLeadForm(target, options = {}) {
|
|
22
|
+
const host = typeof target === 'string' ? document.querySelector(target) : target;
|
|
23
|
+
const defaults = (0, config_1.getScriptDefaults)();
|
|
24
|
+
const publishableKey = options.publishableKey ?? defaults.publishableKey;
|
|
25
|
+
const frontendApi = options.frontendApi ?? defaults.frontendApi;
|
|
26
|
+
if (!host)
|
|
27
|
+
return null;
|
|
28
|
+
if (!publishableKey || !frontendApi) {
|
|
29
|
+
host.textContent = 'Atlas: a publishable key and a frontend API origin are required.';
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const client = (0, client_1.createClient)({ publishableKey, frontendApi, locale: options.locale ?? defaults.locale, fetchImpl: options.fetchImpl });
|
|
33
|
+
void (0, js_1.captureMarketing)(client).catch(() => undefined);
|
|
34
|
+
const L = {
|
|
35
|
+
email: 'Email address', name: 'Name', submit: 'Subscribe', consent: 'I agree to receive emails',
|
|
36
|
+
thanks: 'Thanks — you are on the list.', invalid: 'Enter a valid email address.', failed: 'Could not subscribe. Try again.',
|
|
37
|
+
...options.labels,
|
|
38
|
+
};
|
|
39
|
+
const form = h('form', { class: 'atlas-card', 'data-atlas': 'lead-form', novalidate: 'true' });
|
|
40
|
+
const field = (label, name, type, autocomplete) => {
|
|
41
|
+
const input = h('input', { class: 'atlas-input', type, name, autocomplete });
|
|
42
|
+
return [h('label', { class: 'atlas-field' }, h('span', { class: 'atlas-field-label' }, label), input), input];
|
|
43
|
+
};
|
|
44
|
+
const [nameLabel, nameInput] = field(L.name, 'name', 'text', 'name');
|
|
45
|
+
const [emailLabel, emailInput] = field(L.email, 'email', 'email', 'email');
|
|
46
|
+
const consent = h('input', { type: 'checkbox' });
|
|
47
|
+
const honeypot = h('input', { name: 'website', 'aria-hidden': 'true', tabindex: '-1', autocomplete: 'off', style: 'position:absolute;left:-10000px;width:1px;height:1px;opacity:0' });
|
|
48
|
+
const error = h('p', { class: 'atlas-error', role: 'alert' });
|
|
49
|
+
error.hidden = true;
|
|
50
|
+
const button = h('button', { class: 'atlas-button', type: 'submit' }, L.submit);
|
|
51
|
+
if (options.showName)
|
|
52
|
+
form.append(nameLabel);
|
|
53
|
+
form.append(emailLabel);
|
|
54
|
+
if (options.requireConsent) {
|
|
55
|
+
button.disabled = true;
|
|
56
|
+
consent.addEventListener('change', () => {
|
|
57
|
+
button.disabled = !consent.checked;
|
|
58
|
+
});
|
|
59
|
+
form.append(h('label', { class: 'atlas-field' }, consent, ` ${L.consent}`));
|
|
60
|
+
}
|
|
61
|
+
form.append(honeypot, error, button);
|
|
62
|
+
form.addEventListener('submit', async (event) => {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
const email = emailInput.value.trim();
|
|
65
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
66
|
+
error.textContent = L.invalid;
|
|
67
|
+
error.hidden = false;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
button.disabled = true;
|
|
71
|
+
error.hidden = true;
|
|
72
|
+
const out = await (0, js_1.submitLead)(client, { email, name: nameInput.value.trim() || undefined, form: options.form, consent: consent.checked, website: honeypot.value });
|
|
73
|
+
if (out.ok) {
|
|
74
|
+
host.replaceChildren(h('div', { class: 'atlas-card', 'data-atlas': 'lead-form', role: 'status' }, L.thanks));
|
|
75
|
+
options.onSubmitted?.(email);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
button.disabled = options.requireConsent ? !consent.checked : false;
|
|
79
|
+
error.textContent = out.error ?? L.failed;
|
|
80
|
+
error.hidden = false;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
host.replaceChildren(form);
|
|
84
|
+
return { destroy: () => host.replaceChildren() };
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=lead-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead-form.js","sourceRoot":"","sources":["../src/lead-form.ts"],"names":[],"mappings":";;AA+BA,sCA+DC;AA9FD,sCAA6D;AAC7D,qCAAwC;AACxC,qCAA6C;AAiB7C,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,QAAgC,EAAE,EAAE,GAAG,IAAwC,EAAe,EAAE;IACtH,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,CA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
3
|
+
export type OrgAdminSection = 'sso' | 'directory' | 'domains' | 'logStreams' | 'apiKeys' | 'ipAllowlist' | 'webhooks' | 'appWebhooks';
|
|
4
|
+
export interface OrgAdminOptions {
|
|
5
|
+
section: OrgAdminSection;
|
|
6
|
+
/** The organization to manage; the signed-in user must be an admin of it (the active one). */
|
|
7
|
+
organizationId: string;
|
|
8
|
+
publishableKey?: string;
|
|
9
|
+
frontendApi?: string;
|
|
10
|
+
locale?: string;
|
|
11
|
+
fetchImpl?: typeof fetch;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mount one tenant-admin section (SSO, directory sync, domains, log streams, API
|
|
15
|
+
* keys, sign-in IP allowlist, webhooks, or the app's own webhook endpoints) into an element. Plain DOM, no
|
|
16
|
+
* framework: it re-renders itself after every change, shows a secret the server
|
|
17
|
+
* returns once exactly once, and renders nothing for a caller the server refuses
|
|
18
|
+
* (not an admin, or not the active organization).
|
|
19
|
+
*/
|
|
20
|
+
export declare function mountOrganizationAdmin(target: MountTarget, options: OrgAdminOptions): {
|
|
21
|
+
destroy(): void;
|
|
22
|
+
} | null;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mountOrganizationAdmin = mountOrganizationAdmin;
|
|
4
|
+
const js_1 = require("@atlasauth/js");
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const h = (tag, props = {}, ...kids) => {
|
|
8
|
+
const node = document.createElement(tag);
|
|
9
|
+
for (const [k, v] of Object.entries(props))
|
|
10
|
+
node.setAttribute(k, v);
|
|
11
|
+
for (const kid of kids)
|
|
12
|
+
if (kid !== null)
|
|
13
|
+
node.append(kid);
|
|
14
|
+
return node;
|
|
15
|
+
};
|
|
16
|
+
/** A column of plain-text rows with a trailing action button per row. */
|
|
17
|
+
function rows(items, action, run) {
|
|
18
|
+
const list = h('ul', { class: 'atlas-list' });
|
|
19
|
+
for (const item of items) {
|
|
20
|
+
const li = h('li', { 'data-id': item.id }, item.text);
|
|
21
|
+
const btn = h('button', { type: 'button', class: 'atlas-button-secondary' }, action);
|
|
22
|
+
btn.addEventListener('click', () => void run(item.id));
|
|
23
|
+
li.append(' ', btn);
|
|
24
|
+
list.append(li);
|
|
25
|
+
}
|
|
26
|
+
return list;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Mount one tenant-admin section (SSO, directory sync, domains, log streams, API
|
|
30
|
+
* keys, sign-in IP allowlist, webhooks, or the app's own webhook endpoints) into an element. Plain DOM, no
|
|
31
|
+
* framework: it re-renders itself after every change, shows a secret the server
|
|
32
|
+
* returns once exactly once, and renders nothing for a caller the server refuses
|
|
33
|
+
* (not an admin, or not the active organization).
|
|
34
|
+
*/
|
|
35
|
+
function mountOrganizationAdmin(target, options) {
|
|
36
|
+
const host = typeof target === 'string' ? document.querySelector(target) : target;
|
|
37
|
+
const defaults = (0, config_1.getScriptDefaults)();
|
|
38
|
+
const publishableKey = options.publishableKey ?? defaults.publishableKey;
|
|
39
|
+
const frontendApi = options.frontendApi ?? defaults.frontendApi;
|
|
40
|
+
if (!host)
|
|
41
|
+
return null;
|
|
42
|
+
if (!publishableKey || !frontendApi) {
|
|
43
|
+
host.textContent = 'Atlas: a publishable key and a frontend API origin are required.';
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const client = (0, client_1.createClient)({ publishableKey, frontendApi, locale: options.locale ?? defaults.locale, fetchImpl: options.fetchImpl });
|
|
47
|
+
const org = options.organizationId;
|
|
48
|
+
let secret = null;
|
|
49
|
+
// appWebhooks: the endpoint whose delivery log is open.
|
|
50
|
+
let openEndpoint = null;
|
|
51
|
+
let message = null;
|
|
52
|
+
let alive = true;
|
|
53
|
+
const guarded = async (fn) => {
|
|
54
|
+
try {
|
|
55
|
+
await fn();
|
|
56
|
+
message = null;
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
message = err instanceof Error ? err.message : 'The request failed.';
|
|
60
|
+
}
|
|
61
|
+
await render();
|
|
62
|
+
};
|
|
63
|
+
const withSecret = (fn) => guarded(async () => {
|
|
64
|
+
const out = await fn();
|
|
65
|
+
secret = out.secret ?? out.token ?? null;
|
|
66
|
+
});
|
|
67
|
+
const input = (label, type = 'text', placeholder = '') => {
|
|
68
|
+
const field = h('input', { type, placeholder, 'aria-label': label });
|
|
69
|
+
return [h('label', { class: 'atlas-field' }, h('span', {}, label), field), field];
|
|
70
|
+
};
|
|
71
|
+
const button = (label, run, primary = true) => {
|
|
72
|
+
const b = h('button', { type: 'button', class: primary ? 'atlas-button' : 'atlas-button-secondary' }, label);
|
|
73
|
+
b.addEventListener('click', run);
|
|
74
|
+
return b;
|
|
75
|
+
};
|
|
76
|
+
async function body() {
|
|
77
|
+
switch (options.section) {
|
|
78
|
+
case 'domains': {
|
|
79
|
+
const list = await js_1.organizationAdmin.listDomains(client, org);
|
|
80
|
+
const [label, field] = input('Email domain', 'text', 'acme.com');
|
|
81
|
+
return [
|
|
82
|
+
rows(list.map((d) => ({ id: d.id, text: `${d.domain} — ${d.status}${d.status === 'verified' ? '' : ` (TXT ${d.verification.record_name} = ${d.verification.record_value})`}` })), 'Remove', (id) => guarded(() => js_1.organizationAdmin.removeDomain(client, org, id))),
|
|
83
|
+
...list.filter((d) => d.status !== 'verified').map((d) => button(`Verify ${d.domain}`, () => void guarded(() => js_1.organizationAdmin.verifyDomain(client, org, d.id)), false)),
|
|
84
|
+
label,
|
|
85
|
+
button('Add domain', () => void guarded(() => js_1.organizationAdmin.addDomain(client, org, field.value.trim()))),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
case 'logStreams': {
|
|
89
|
+
const list = await js_1.organizationAdmin.listLogStreams(client, org);
|
|
90
|
+
const [label, field] = input('HTTPS endpoint', 'url', 'https://siem.example.com/ingest');
|
|
91
|
+
return [
|
|
92
|
+
rows(list.map((s) => ({ id: s.id, text: s.url })), 'Remove', (id) => guarded(() => js_1.organizationAdmin.removeLogStream(client, org, id))),
|
|
93
|
+
label,
|
|
94
|
+
button('Add destination', () => void withSecret(() => js_1.organizationAdmin.addLogStream(client, org, { url: field.value.trim() }))),
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
case 'apiKeys': {
|
|
98
|
+
const list = await js_1.organizationAdmin.listApiKeys(client, org);
|
|
99
|
+
const [label, field] = input('Key name');
|
|
100
|
+
return [
|
|
101
|
+
rows(list.map((k) => ({ id: k.id, text: `${k.name ?? k.prefix} (${k.prefix})` })), 'Revoke', (id) => guarded(() => js_1.organizationAdmin.revokeApiKey(client, org, id))),
|
|
102
|
+
label,
|
|
103
|
+
button('Create key', () => void withSecret(() => js_1.organizationAdmin.createApiKey(client, org, { name: field.value.trim() || undefined }))),
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
case 'webhooks': {
|
|
107
|
+
const list = await js_1.organizationAdmin.listWebhooks(client, org);
|
|
108
|
+
const [label, field] = input('HTTPS endpoint', 'url', 'https://example.com/hooks/atlas');
|
|
109
|
+
return [
|
|
110
|
+
rows(list.map((w) => ({ id: w.id, text: `${w.url} — ${w.health}` })), 'Remove', (id) => guarded(() => js_1.organizationAdmin.deleteWebhook(client, org, id))),
|
|
111
|
+
label,
|
|
112
|
+
button('Add endpoint', () => void withSecret(() => js_1.organizationAdmin.createWebhook(client, org, { url: field.value.trim() }))),
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
case 'appWebhooks': {
|
|
116
|
+
// Endpoints for the APP's own events (Standard Webhooks signed), with the catalog picker.
|
|
117
|
+
const [list, types] = await Promise.all([js_1.organizationAdmin.listAppWebhooks(client, org), js_1.organizationAdmin.listAppEventTypes(client, org)]);
|
|
118
|
+
const [label, field] = input('HTTPS endpoint', 'url', 'https://example.com/webhooks');
|
|
119
|
+
const picks = types.map((t) => {
|
|
120
|
+
const box = h('input', { type: 'checkbox', value: t.type, 'aria-label': t.type });
|
|
121
|
+
return { box, el: h('label', { class: 'atlas-text' }, box, ` ${t.type}${t.description ? ` — ${t.description}` : ''}`) };
|
|
122
|
+
});
|
|
123
|
+
const items = [];
|
|
124
|
+
for (const w of list) {
|
|
125
|
+
const li = h('li', { 'data-id': w.id, 'data-health': w.health }, `${w.url} — ${w.health} — ${w.enabled_events.includes('*') ? 'all events' : w.enabled_events.join(', ')} `);
|
|
126
|
+
li.append(button('Send test', () => void guarded(async () => {
|
|
127
|
+
const r = await js_1.organizationAdmin.testAppWebhook(client, org, w.id);
|
|
128
|
+
if (r.status !== 'success')
|
|
129
|
+
throw new Error(`Test failed: ${r.error ?? `HTTP ${r.http_status}`}`);
|
|
130
|
+
}), false), w.active
|
|
131
|
+
? button('Pause', () => void guarded(() => js_1.organizationAdmin.updateAppWebhook(client, org, w.id, { active: false })), false)
|
|
132
|
+
: button('Enable', () => void guarded(async () => {
|
|
133
|
+
await js_1.organizationAdmin.updateAppWebhook(client, org, w.id, { active: true });
|
|
134
|
+
if (w.health !== 'healthy')
|
|
135
|
+
await js_1.organizationAdmin.replayAppWebhook(client, org, w.id);
|
|
136
|
+
}), false), button('Reveal secret', () => void withSecret(() => js_1.organizationAdmin.revealAppWebhookSecret(client, org, w.id)), false), button('Rotate secret', () => void withSecret(() => js_1.organizationAdmin.rotateAppWebhookSecret(client, org, w.id)), false), button('Deliveries', () => {
|
|
137
|
+
openEndpoint = openEndpoint === w.id ? null : w.id;
|
|
138
|
+
void render();
|
|
139
|
+
}, false), button('Remove', () => void guarded(() => js_1.organizationAdmin.deleteAppWebhook(client, org, w.id)), false));
|
|
140
|
+
if (openEndpoint === w.id) {
|
|
141
|
+
const deliveries = await js_1.organizationAdmin.appWebhookDeliveries(client, org, w.id);
|
|
142
|
+
li.append(rows(deliveries.map((d) => ({ id: d.id, text: `${d.event_type ?? '—'} · ${d.status}${d.http_status ? ` · HTTP ${d.http_status}` : ''} · ${new Date(d.created_at).toLocaleString()}` })), 'Redeliver', (id) => guarded(() => js_1.organizationAdmin.redeliverAppWebhook(client, org, w.id, id))));
|
|
143
|
+
}
|
|
144
|
+
items.push(li);
|
|
145
|
+
}
|
|
146
|
+
return [
|
|
147
|
+
h('ul', { class: 'atlas-list' }, ...items),
|
|
148
|
+
label,
|
|
149
|
+
h('fieldset', { class: 'atlas-field' }, h('legend', {}, 'Events (none selected = all)'), ...picks.map((p) => p.el)),
|
|
150
|
+
button('Add endpoint', () => {
|
|
151
|
+
const chosen = picks.filter((p) => p.box.checked).map((p) => p.box.value);
|
|
152
|
+
void withSecret(() => js_1.organizationAdmin.createAppWebhook(client, org, { url: field.value.trim(), enabled_events: chosen.length ? chosen : ['*'] }));
|
|
153
|
+
}),
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
case 'directory': {
|
|
157
|
+
const dir = await js_1.organizationAdmin.getDirectory(client, org);
|
|
158
|
+
return [
|
|
159
|
+
h('p', {}, `SCIM base URL: ${dir.base_url}`),
|
|
160
|
+
rows(dir.tokens.map((t) => ({ id: t.id, text: t.prefix })), 'Revoke', (id) => guarded(() => js_1.organizationAdmin.revokeDirectoryToken(client, org, id))),
|
|
161
|
+
button('Generate token', () => void withSecret(() => js_1.organizationAdmin.createDirectoryToken(client, org))),
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
case 'ipAllowlist': {
|
|
165
|
+
const list = await js_1.organizationAdmin.getIpAllowlist(client, org);
|
|
166
|
+
const area = h('textarea', { rows: '5', 'aria-label': 'Sign-in IP allowlist' });
|
|
167
|
+
area.value = list.entries.join('\n');
|
|
168
|
+
return [
|
|
169
|
+
h('p', {}, `One IP or CIDR per line; empty allows anywhere. Your IP: ${list.your_ip}`),
|
|
170
|
+
area,
|
|
171
|
+
button('Save', () => void guarded(() => js_1.organizationAdmin.setIpAllowlist(client, org, area.value.split(/[\s,]+/).filter(Boolean)))),
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
case 'sso': {
|
|
175
|
+
const view = await js_1.organizationAdmin.getSso(client, org);
|
|
176
|
+
const type = view.connection?.type ?? 'oidc';
|
|
177
|
+
const fields = type === 'oidc'
|
|
178
|
+
? [['oidc_issuer', 'Issuer URL', 'text'], ['oidc_client_id', 'Client ID', 'text'], ['oidc_client_secret', 'Client secret', 'password']]
|
|
179
|
+
: [['saml_metadata_xml', 'IdP metadata XML', 'text'], ['saml_idp_certificate', 'IdP certificate (PEM)', 'text']];
|
|
180
|
+
const inputs = fields.map(([key, label, kind]) => {
|
|
181
|
+
const [l, f] = input(label, kind);
|
|
182
|
+
return { key, l, f };
|
|
183
|
+
});
|
|
184
|
+
return [
|
|
185
|
+
h('p', {}, view.connection ? `${view.connection.type.toUpperCase()} — ${view.connection.status}` : 'No connection yet.'),
|
|
186
|
+
h('p', {}, `ACS URL: ${view.sp.acs_url} · Redirect URI: ${view.sp.oidc_redirect_uri}`),
|
|
187
|
+
...inputs.map((i) => i.l),
|
|
188
|
+
button('Save connection', () => {
|
|
189
|
+
const payload = {};
|
|
190
|
+
for (const i of inputs)
|
|
191
|
+
if (i.f.value)
|
|
192
|
+
payload[i.key] = i.f.value;
|
|
193
|
+
void guarded(() => js_1.organizationAdmin.saveSso(client, org, { type, ...payload }));
|
|
194
|
+
}),
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async function render() {
|
|
200
|
+
if (!alive)
|
|
201
|
+
return;
|
|
202
|
+
let children;
|
|
203
|
+
try {
|
|
204
|
+
children = await body();
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
// 403/404 → the server says this caller may not manage the organization: show nothing.
|
|
208
|
+
const status = err.status;
|
|
209
|
+
host.replaceChildren(...(status === 403 || status === 404 ? [] : [h('p', { role: 'alert' }, err instanceof Error ? err.message : 'The request failed.')]));
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const extra = [];
|
|
213
|
+
if (message)
|
|
214
|
+
extra.push(h('p', { role: 'alert' }, message));
|
|
215
|
+
if (secret)
|
|
216
|
+
extra.push(h('p', { 'data-atlas': 'one-time-secret' }, 'Copy this now — it will not be shown again: ', h('code', {}, secret)));
|
|
217
|
+
host.dataset.atlas = `organization-admin-${options.section}`;
|
|
218
|
+
host.replaceChildren(...extra, ...children);
|
|
219
|
+
}
|
|
220
|
+
void render();
|
|
221
|
+
return {
|
|
222
|
+
destroy() {
|
|
223
|
+
alive = false;
|
|
224
|
+
host.replaceChildren();
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=org-admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-admin.js","sourceRoot":"","sources":["../src/org-admin.ts"],"names":[],"mappings":";;AA8CA,wDA8MC;AA5PD,sCAA0E;AAC1E,qCAAwC;AACxC,qCAA6C;AAiB7C,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,QAAgC,EAAE,EAAE,GAAG,IAA+B,EAAM,EAAE;IACpG,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpE,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,IAAI,GAAG,KAAK,IAAI;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,yEAAyE;AACzE,SAAS,IAAI,CAAC,KAA0C,EAAE,MAAc,EAAE,GAAqC;IAC7G,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EA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,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MountTarget } from './mount';
|
|
2
|
+
export interface PricingTableOptions {
|
|
3
|
+
publishableKey?: string;
|
|
4
|
+
frontendApi?: string;
|
|
5
|
+
/** `user` or `org` plans only (default: every plan). */
|
|
6
|
+
audience?: 'user' | 'org';
|
|
7
|
+
/** An organization to buy for (its admin). */
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
/** Currency formatting language; default the page's. */
|
|
10
|
+
locale?: string;
|
|
11
|
+
/** Where the provider returns on success (default the current page). */
|
|
12
|
+
successUrl?: string;
|
|
13
|
+
/** Replace the English text the table adds. */
|
|
14
|
+
labels?: Partial<{
|
|
15
|
+
monthly: string;
|
|
16
|
+
yearly: string;
|
|
17
|
+
perMonth: string;
|
|
18
|
+
perYear: string;
|
|
19
|
+
free: string;
|
|
20
|
+
subscribe: string;
|
|
21
|
+
trial: (days: number) => string;
|
|
22
|
+
useCode: (code: string) => string;
|
|
23
|
+
}>;
|
|
24
|
+
fetchImpl?: typeof fetch;
|
|
25
|
+
/** Navigate to the Checkout URL (default `location.assign`). */
|
|
26
|
+
navigate?: (url: string) => void;
|
|
27
|
+
/** Called when checkout cannot start (not signed in, provider error). */
|
|
28
|
+
onError?: (message: string) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Mount the instance's pricing table into an element: locale-formatted prices, a
|
|
32
|
+
* free-trial badge, a monthly/yearly switch when a plan has an annual price, and a
|
|
33
|
+
* plan's promotion (label, struck-through price, code to use at checkout). The
|
|
34
|
+
* subscribe button starts the provider's hosted Checkout for the signed-in visitor.
|
|
35
|
+
*/
|
|
36
|
+
export declare function mountPricingTable(target: MountTarget, options?: PricingTableOptions): {
|
|
37
|
+
destroy(): void;
|
|
38
|
+
} | null;
|
package/dist/pricing.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mountPricingTable = mountPricingTable;
|
|
4
|
+
const js_1 = require("@atlasauth/js");
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const h = (tag, props = {}, ...kids) => {
|
|
8
|
+
const node = document.createElement(tag);
|
|
9
|
+
for (const [k, v] of Object.entries(props))
|
|
10
|
+
node.setAttribute(k, v);
|
|
11
|
+
for (const kid of kids)
|
|
12
|
+
if (kid !== null)
|
|
13
|
+
node.append(kid);
|
|
14
|
+
return node;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Mount the instance's pricing table into an element: locale-formatted prices, a
|
|
18
|
+
* free-trial badge, a monthly/yearly switch when a plan has an annual price, and a
|
|
19
|
+
* plan's promotion (label, struck-through price, code to use at checkout). The
|
|
20
|
+
* subscribe button starts the provider's hosted Checkout for the signed-in visitor.
|
|
21
|
+
*/
|
|
22
|
+
function mountPricingTable(target, options = {}) {
|
|
23
|
+
const host = typeof target === 'string' ? document.querySelector(target) : target;
|
|
24
|
+
const defaults = (0, config_1.getScriptDefaults)();
|
|
25
|
+
const publishableKey = options.publishableKey ?? defaults.publishableKey;
|
|
26
|
+
const frontendApi = options.frontendApi ?? defaults.frontendApi;
|
|
27
|
+
if (!host)
|
|
28
|
+
return null;
|
|
29
|
+
if (!publishableKey || !frontendApi) {
|
|
30
|
+
host.textContent = 'Atlas: a publishable key and a frontend API origin are required.';
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const client = (0, client_1.createClient)({ publishableKey, frontendApi, locale: options.locale ?? defaults.locale, fetchImpl: options.fetchImpl });
|
|
34
|
+
const L = {
|
|
35
|
+
monthly: 'Monthly', yearly: 'Yearly', perMonth: 'month', perYear: 'year', free: 'Free', subscribe: 'Subscribe',
|
|
36
|
+
trial: (d) => `${d}-day free trial`, useCode: (c) => `Use code ${c} at checkout`,
|
|
37
|
+
...options.labels,
|
|
38
|
+
};
|
|
39
|
+
const locale = options.locale ?? (document.documentElement.lang || undefined);
|
|
40
|
+
let interval = 'month';
|
|
41
|
+
let plans = [];
|
|
42
|
+
let alive = true;
|
|
43
|
+
const render = () => {
|
|
44
|
+
if (!alive)
|
|
45
|
+
return;
|
|
46
|
+
const children = [];
|
|
47
|
+
if (plans.some((p) => p.annual_available)) {
|
|
48
|
+
const group = h('div', { role: 'group', 'aria-label': 'Billing interval', 'data-atlas': 'pricing-interval' });
|
|
49
|
+
for (const i of ['month', 'year']) {
|
|
50
|
+
const b = h('button', { type: 'button', class: 'atlas-button-secondary', 'aria-pressed': String(interval === i) }, i === 'month' ? L.monthly : L.yearly);
|
|
51
|
+
b.addEventListener('click', () => {
|
|
52
|
+
interval = i;
|
|
53
|
+
render();
|
|
54
|
+
});
|
|
55
|
+
group.append(b);
|
|
56
|
+
}
|
|
57
|
+
children.push(group);
|
|
58
|
+
}
|
|
59
|
+
for (const plan of plans) {
|
|
60
|
+
const view = (0, js_1.planPriceView)(plan, { interval, locale });
|
|
61
|
+
const price = h('p', { class: 'atlas-price' });
|
|
62
|
+
if (view.originalPrice)
|
|
63
|
+
price.append(h('s', { 'data-atlas': 'pricing-original' }, view.originalPrice), ' ');
|
|
64
|
+
price.append(view.free ? L.free : view.price);
|
|
65
|
+
if (!view.free)
|
|
66
|
+
price.append(h('span', { class: 'atlas-interval' }, ` / ${view.interval === 'year' ? L.perYear : L.perMonth}`));
|
|
67
|
+
const button = h('button', { type: 'button', class: 'atlas-button' }, L.subscribe);
|
|
68
|
+
button.addEventListener('click', async () => {
|
|
69
|
+
const out = await (0, js_1.startPlanCheckout)(client, {
|
|
70
|
+
planId: plan.id,
|
|
71
|
+
orgId: options.organizationId,
|
|
72
|
+
...(plan.annual_available ? { interval } : {}),
|
|
73
|
+
successUrl: options.successUrl ?? window.location.href,
|
|
74
|
+
});
|
|
75
|
+
if (out.url)
|
|
76
|
+
(options.navigate ?? ((u) => window.location.assign(u)))(out.url);
|
|
77
|
+
else
|
|
78
|
+
options.onError?.(out.error ?? 'Could not start checkout.');
|
|
79
|
+
});
|
|
80
|
+
children.push(h('div', { class: 'atlas-card', 'data-atlas': 'pricing-plan' }, h('h3', { class: 'atlas-plan-name' }, plan.name), view.promotionLabel ? h('p', { 'data-atlas': 'pricing-promotion', class: 'atlas-badge' }, view.promotionLabel) : null, price, view.trialDays ? h('p', { 'data-atlas': 'pricing-trial', class: 'atlas-badge' }, L.trial(view.trialDays)) : null, view.promotionCode ? h('p', { 'data-atlas': 'pricing-code' }, L.useCode(view.promotionCode)) : null, plan.features.length ? h('ul', { class: 'atlas-list' }, ...plan.features.map((f) => h('li', {}, f))) : null, button));
|
|
81
|
+
}
|
|
82
|
+
host.dataset.atlas = 'pricing-table';
|
|
83
|
+
host.replaceChildren(...children);
|
|
84
|
+
};
|
|
85
|
+
void (0, js_1.listPublicPlans)(client, { audience: options.audience }).then((list) => {
|
|
86
|
+
plans = list;
|
|
87
|
+
render();
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
destroy() {
|
|
91
|
+
alive = false;
|
|
92
|
+
host.replaceChildren();
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=pricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":";;AAsCA,8CAiFC;AAvHD,sCAA0G;AAC1G,qCAAwC;AACxC,qCAA6C;AAuB7C,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,QAAgC,EAAE,EAAE,GAAG,IAAwC,EAAe,EAAE;IACtH,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAA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,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAC3G,MAAM,CACP,CACF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC;QACrC,IAAI,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,KAAK,IAAA,oBAAe,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACzE,KAAK,GAAG,IAAI,CAAC;QACb,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;IACH,OAAO;QACL,OAAO;YACL,KAAK,GAAG,KAAK,CAAC;YACd,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/standalone.d.ts
CHANGED
|
@@ -13,9 +13,18 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { defineElements } from './element';
|
|
15
15
|
import { mountSignIn, mountSignUp } from './mount';
|
|
16
|
+
import { mountOrganizationAdmin } from './org-admin';
|
|
17
|
+
import { mountPricingTable } from './pricing';
|
|
18
|
+
import { mountLeadForm } from './lead-form';
|
|
16
19
|
export interface AtlasGlobal {
|
|
17
20
|
mountSignIn: typeof mountSignIn;
|
|
18
21
|
mountSignUp: typeof mountSignUp;
|
|
22
|
+
/** Mount a tenant-admin section (SSO, directory, domains, log streams, API keys, IP allowlist, webhooks). */
|
|
23
|
+
mountOrganizationAdmin: typeof mountOrganizationAdmin;
|
|
24
|
+
/** Mount the instance's pricing table (plans, trial, promotion, checkout). */
|
|
25
|
+
mountPricingTable: typeof mountPricingTable;
|
|
26
|
+
/** Mount a lead / newsletter signup form. */
|
|
27
|
+
mountLeadForm: typeof mountLeadForm;
|
|
19
28
|
defineElements: typeof defineElements;
|
|
20
29
|
}
|
|
21
30
|
declare global {
|