@iblai/mcp 1.3.3 → 1.4.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/dist/resources/packages-playwright.d.ts.map +1 -1
- package/dist/resources/packages-playwright.js +47 -0
- package/dist/resources/packages-playwright.js.map +1 -1
- package/dist/resources/web-containers.d.ts.map +1 -1
- package/dist/resources/web-containers.js +30 -0
- package/dist/resources/web-containers.js.map +1 -1
- package/dist/resources/web-utils.d.ts.map +1 -1
- package/dist/resources/web-utils.js +36 -0
- package/dist/resources/web-utils.js.map +1 -1
- package/dist/tools/component-info.d.ts.map +1 -1
- package/dist/tools/component-info.js +804 -0
- package/dist/tools/component-info.js.map +1 -1
- package/dist/tools/hook-info.d.ts.map +1 -1
- package/dist/tools/hook-info.js +163 -0
- package/dist/tools/hook-info.js.map +1 -1
- package/dist/tools/playwright-helper-info.d.ts.map +1 -1
- package/dist/tools/playwright-helper-info.js +395 -0
- package/dist/tools/playwright-helper-info.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages-playwright.d.ts","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;
|
|
1
|
+
{"version":3,"file":"packages-playwright.d.ts","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;CA+M9B,CAAC"}
|
|
@@ -121,6 +121,53 @@ pnpm add -D @playwright/test @axe-core/playwright dotenv cross-env
|
|
|
121
121
|
| \`shouldDisplayReportCards\` | Function | \`(page, REPORT_CARDS[]) => Promise<void>\` |
|
|
122
122
|
| And 13 more CSV editor and combined report helpers | | |
|
|
123
123
|
|
|
124
|
+
### Credit Balance Helpers (paywall trigger + plan-aware dropdown assertions)
|
|
125
|
+
|
|
126
|
+
These helpers drive the navbar \`CreditBalance\` dropdown — the icon trigger gated on \`current_tenant.show_paywall\` and the plan-specific UI states (\`Free\` / \`Trial\` / \`Premium\`).
|
|
127
|
+
|
|
128
|
+
| Export | Type | Description |
|
|
129
|
+
|--------|------|-------------|
|
|
130
|
+
| \`getCurrentTenantShowPaywall\` | Function | \`(page) => Promise<boolean>\` — Read \`current_tenant.show_paywall\` from localStorage |
|
|
131
|
+
| \`creditBalanceTrigger\` | Function | \`(page) => Locator\` — Trigger button (\`data-testid="credit-balance-trigger"\`) |
|
|
132
|
+
| \`creditBalancePanel\` | Function | \`(page) => Locator\` — Dropdown panel (\`data-testid="credit-balance-panel"\`) |
|
|
133
|
+
| \`creditBalancePlanBadge\` | Function | \`(page) => Locator\` — Plan badge inside panel (\`data-testid="credit-balance-plan-badge"\`) |
|
|
134
|
+
| \`expectCreditBalanceVisibilityForTenant\` | Function | \`(page) => Promise<{ shouldBeVisible: boolean }>\` — Assert visibility against tenant flag |
|
|
135
|
+
| \`openCreditBalanceDropdown\` | Function | \`(page) => Promise<Locator>\` — Open and wait for content load |
|
|
136
|
+
| \`waitForCreditBalanceLoaded\` | Function | \`(page) => Promise<void>\` — Wait for "Loading credits..." to clear |
|
|
137
|
+
| \`closeCreditBalanceDropdown\` | Function | \`(page) => Promise<void>\` — Press Escape and assert detach |
|
|
138
|
+
| \`getCreditBalancePlanLabel\` | Function | \`(page) => Promise<'Free' \\| 'Trial' \\| 'Premium' \\| null>\` |
|
|
139
|
+
| \`getCreditBalanceRemaining\` | Function | \`(page) => Promise<number \\| null>\` — Read "X,XXX Credits" remaining |
|
|
140
|
+
| \`expectCreditBalancePanelForFreePlan\` | Function | \`(page) => Promise<void>\` |
|
|
141
|
+
| \`expectCreditBalancePanelForTrialPlan\` | Function | \`(page) => Promise<void>\` |
|
|
142
|
+
| \`expectCreditBalancePanelForPremiumPlan\` | Function | \`(page, { hasPaymentMethod }) => Promise<void>\` |
|
|
143
|
+
| \`expectCreditBalanceForCurrentPlan\` | Function | \`(page, { hasPaymentMethod? }) => Promise<CreditBalancePlan>\` — Detect plan + run matching assertions |
|
|
144
|
+
| \`CreditBalancePlan\` | Type | \`'Free' \\| 'Trial' \\| 'Premium'\` |
|
|
145
|
+
|
|
146
|
+
### Billing Tab Helpers (Profile > Billing — plan-aware section assertions)
|
|
147
|
+
|
|
148
|
+
Drive the BillingTab inside the user profile modal (\`Plan\`, \`Credits\`, \`Auto Recharge\` sections).
|
|
149
|
+
|
|
150
|
+
| Export | Type | Description |
|
|
151
|
+
|--------|------|-------------|
|
|
152
|
+
| \`billingPlanSection\` | Function | \`(page) => Locator\` — \`data-testid="billing-plan-section"\` |
|
|
153
|
+
| \`billingCreditsSection\` | Function | \`(page) => Locator\` — \`data-testid="billing-credits-section"\` |
|
|
154
|
+
| \`billingAutoRechargeSection\` | Function | \`(page) => Locator\` — \`data-testid="billing-auto-recharge-section"\` |
|
|
155
|
+
| \`getBillingPlanLabel\` | Function | \`(page) => Promise<CreditBalancePlan \\| null>\` |
|
|
156
|
+
| \`getBillingAutoRechargeStatus\` | Function | \`(page) => Promise<'Enabled' \\| 'Disabled' \\| null>\` |
|
|
157
|
+
| \`waitForBillingTabReady\` | Function | \`(page) => Promise<void>\` |
|
|
158
|
+
| \`expectBillingPlanSection\` | Function | \`(page, { plan }) => Promise<void>\` |
|
|
159
|
+
| \`expectBillingCreditsSection\` | Function | \`(page, { plan, hasPaymentMethod? }) => Promise<void>\` |
|
|
160
|
+
| \`expectBillingAutoRechargeSection\` | Function | \`(page, { expectVisible, status? }) => Promise<void>\` |
|
|
161
|
+
| \`expectBillingTabForFreePlan\` | Function | \`(page) => Promise<void>\` |
|
|
162
|
+
| \`expectBillingTabForTrialPlan\` | Function | \`(page, { hasPaymentMethod }) => Promise<void>\` |
|
|
163
|
+
| \`expectBillingTabForPremiumPlan\` | Function | \`(page, { hasPaymentMethod }) => Promise<void>\` |
|
|
164
|
+
| \`expectBillingTabForCurrentPlan\` | Function | \`(page, { hasPaymentMethod? }) => Promise<CreditBalancePlan>\` |
|
|
165
|
+
| \`clickBillingUpgrade\` | Function | \`(page) => Promise<void>\` — Click "Upgrade" in Plan section |
|
|
166
|
+
| \`clickBillingAddCredits\` | Function | \`(page) => Promise<void>\` — Click "Add Credits" in Credits section |
|
|
167
|
+
| \`clickBillingManageBilling\` | Function | \`(page) => Promise<void>\` — Click "Manage Billing" in Credits section |
|
|
168
|
+
| \`clickBillingManageUsage\` | Function | \`(page) => Promise<void>\` — Click "Manage Usage" in Auto Recharge section |
|
|
169
|
+
| \`BillingAutoRechargeStatus\` | Type | \`'Enabled' \\| 'Disabled'\` |
|
|
170
|
+
|
|
124
171
|
### Infrastructure
|
|
125
172
|
|
|
126
173
|
| Export | Type | Description |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages-playwright.js","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,2BAA2B;IAChC,IAAI,EAAE,+BAA+B;IACrC,WAAW,EACT,+FAA+F;IACjG,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"packages-playwright.js","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,2BAA2B;IAChC,IAAI,EAAE,+BAA+B;IACrC,WAAW,EACT,+FAA+F;IACjG,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMV;CACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-containers.d.ts","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;
|
|
1
|
+
{"version":3,"file":"web-containers.d.ts","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAkNzB,CAAC"}
|
|
@@ -69,6 +69,36 @@ import {
|
|
|
69
69
|
</ChartFiltersProvider>
|
|
70
70
|
\`\`\`
|
|
71
71
|
|
|
72
|
+
### Billing & Paywall
|
|
73
|
+
\`\`\`typescript
|
|
74
|
+
import {
|
|
75
|
+
CreditBalance,
|
|
76
|
+
PaywallModal,
|
|
77
|
+
UpgradePackageModal,
|
|
78
|
+
} from '@iblai/iblai-js/web-containers';
|
|
79
|
+
|
|
80
|
+
// Plan-aware credit-balance dropdown for the navbar.
|
|
81
|
+
// Gate \`enabled\` on the current tenant's \`show_paywall\` flag.
|
|
82
|
+
<CreditBalance
|
|
83
|
+
tenant={tenantKey}
|
|
84
|
+
username={username}
|
|
85
|
+
mainPlatformKey={mainPlatformKey}
|
|
86
|
+
currentUserEmail={user.email}
|
|
87
|
+
redirectUrl={window.location.href}
|
|
88
|
+
enabled={Boolean(currentTenant.show_paywall)}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
// "Free upgrade" CTA dialog — wires \`useStripeUpgrade\` to the \`free\` payment link.
|
|
92
|
+
<UpgradePackageModal
|
|
93
|
+
open={isOpen}
|
|
94
|
+
onClose={() => setIsOpen(false)}
|
|
95
|
+
redirectUrl={\`\${window.location.origin}/billing/success\`}
|
|
96
|
+
sourcePlatformKey={tenantKey}
|
|
97
|
+
mainPlatformKey={mainPlatformKey}
|
|
98
|
+
currentUserEmail={user.email}
|
|
99
|
+
/>
|
|
100
|
+
\`\`\`
|
|
101
|
+
|
|
72
102
|
### Authentication Buttons
|
|
73
103
|
\`\`\`typescript
|
|
74
104
|
import { LoginButton, SignupButton } from '@iblai/iblai-js/web-containers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-containers.js","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"web-containers.js","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4MV;CACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-utils.d.ts","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;
|
|
1
|
+
{"version":3,"file":"web-utils.d.ts","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;CAyRpB,CAAC"}
|
|
@@ -182,6 +182,42 @@ if (isMentorInappropriateContentEnabled()) {
|
|
|
182
182
|
- \\\`mentor_report_inappropriate_content\\\` (boolean, default: true) — Allow users to report inappropriate content
|
|
183
183
|
- \\\`help_center_url\\\` (string, default: "https://docs.ibl.ai") — Help center URL
|
|
184
184
|
|
|
185
|
+
## Billing / Stripe Hooks
|
|
186
|
+
|
|
187
|
+
### useStripeUpgrade
|
|
188
|
+
Resolves the Stripe Pricing Page session for a tenant and exposes ready-to-redirect checkout URLs for the \`free\` and \`premium\` plans. Used by \`CreditBalance\` and \`UpgradePackageModal\` from \`@iblai/iblai-js/web-containers\`.
|
|
189
|
+
|
|
190
|
+
\`\`\`typescript
|
|
191
|
+
import { useStripeUpgrade } from '@iblai/iblai-js/web-utils';
|
|
192
|
+
|
|
193
|
+
const { isLoading, freeUrl, premiumUrl, handleUpgrade } = useStripeUpgrade({
|
|
194
|
+
redirectUrl,
|
|
195
|
+
sourcePlatformKey: tenantKey,
|
|
196
|
+
mainPlatformKey,
|
|
197
|
+
currentUserEmail: user.email,
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// Trigger immediate redirect to a specific plan's checkout URL
|
|
201
|
+
await handleUpgrade('premium');
|
|
202
|
+
\`\`\`
|
|
203
|
+
|
|
204
|
+
The hook calls \`useLazyGetStripePricingPageSessionQuery\`, parses the returned \`payment_link_url\` (\`{ free?, premium? }\` JSON string), and appends \`locked_prefilled_email\` + \`client_reference_id\` to each link. When \`redirectPlan\` is provided, it sets \`window.location.href\` to the matching link.
|
|
205
|
+
|
|
206
|
+
## Tenant Type — Paywall Flag
|
|
207
|
+
|
|
208
|
+
The \`Tenant\` type (\`@iblai/iblai-js/web-utils\`) includes a \`show_paywall\` boolean propagated from the platform settings. \`TenantProvider\` includes it on \`current_tenant\` saved to localStorage so consumers (e.g. \`CreditBalance\`) can gate paywall UI per tenant.
|
|
209
|
+
|
|
210
|
+
\`\`\`typescript
|
|
211
|
+
import type { Tenant } from '@iblai/iblai-js/web-utils';
|
|
212
|
+
|
|
213
|
+
interface Tenant {
|
|
214
|
+
// ...
|
|
215
|
+
is_advertising?: boolean;
|
|
216
|
+
is_enterprise?: boolean;
|
|
217
|
+
show_paywall?: boolean;
|
|
218
|
+
}
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
185
221
|
## Authentication Utilities
|
|
186
222
|
|
|
187
223
|
\`\`\`typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-utils.js","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"web-utils.js","sourceRoot":"","sources":["../../src/resources/web-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmRV;CACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-info.d.ts","sourceRoot":"","sources":["../../src/tools/component-info.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAc7B,CAAC;
|
|
1
|
+
{"version":3,"file":"component-info.d.ts","sourceRoot":"","sources":["../../src/tools/component-info.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAc7B,CAAC;AAi8GF,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAyD9D"}
|