@taskforcehq/taskforce 0.3.302 → 0.3.303
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/Taskforce.module.css +11 -0
- package/dist/TaskforceCore.js +59 -9
- package/dist/TaskforceCore.test.js +717 -14
- package/dist/components/task/TaskKanban.test.js +17 -0
- package/dist/components/views/PlansPage.d.ts +3 -1
- package/dist/components/views/PlansPage.js +110 -51
- package/dist/components/views/PlansPage.test.d.ts +1 -0
- package/dist/components/views/PlansPage.test.js +100 -0
- package/dist/components/views/StandaloneLayout.d.ts +1 -0
- package/dist/components/views/StandaloneLayout.js +106 -151
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +8 -3
- package/dist/components/views/standalone/modals/AccountHubModal.js +16 -2
- package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +1 -0
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +26 -0
- package/dist/core/EntitlementsPolicy.test.js +2 -2
- package/dist/core/GlobalSettingsService.js +78 -18
- package/dist/core/PlanEntitlementService.d.ts +29 -5
- package/dist/core/PlanEntitlementService.js +297 -219
- package/dist/core/SignupMonetizationSettings.test.js +173 -49
- package/dist/core/SystemAdmin.test.js +186 -96
- package/dist/core/Taskforce.d.ts +51 -10
- package/dist/core/Taskforce.js +218 -49
- package/dist/core/Taskforce.mcpAuth.test.js +0 -2
- package/dist/core/UserProfileAvatarDrafts.test.js +12 -3
- package/dist/core/types.d.ts +11 -12
- package/dist/hooks/useSyncOrchestrator.js +17 -3
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +97 -5
- package/dist/hooks/useTaskforce.d.ts +3 -0
- package/dist/hooks/useTaskforce.js +9 -4
- package/dist/mcp/runtime.js +90 -29
- package/dist/mcp/runtime.test.js +272 -81
- package/dist/migrations/billingSchemaParity.test.js +3 -0
- package/dist/migrations/taskSchemaMigrations.js +15 -0
- package/dist/server/index.cookieProxy.test.js +1 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.test.js +2 -1
- package/dist/server/mockStripe.d.ts +1 -0
- package/dist/server/mockStripe.js +2 -0
- package/dist/server/routes/admin.js +80 -23
- package/dist/server/routes/auth.d.ts +1 -0
- package/dist/server/routes/auth.js +194 -53
- package/dist/server/routes/billing.js +506 -23
- package/dist/server/routes/billing.test.js +937 -45
- package/dist/server/routes/shared.js +5 -3
- package/dist/server/routes/sync.integration.test.js +160 -0
- package/dist/server/routes/sync.js +15 -5
- package/dist/server/routes.js +3 -3
- package/dist/server/routes.test.js +287 -76
- package/dist/sync/cloudSyncApi.d.ts +1 -0
- package/dist/sync/contentSyncState.d.ts +10 -0
- package/dist/sync/contentSyncState.js +277 -16
- package/dist/sync/syncService.d.ts +1 -0
- package/dist/sync/syncService.js +21 -8
- package/dist/sync/workspacePullFeed.d.ts +10 -0
- package/dist/sync/workspacePullFeed.js +111 -63
- package/dist/sync/workspacePullFeed.test.js +112 -0
- package/dist/ui/assets/{AgentsModule-JG5jc3he.js → AgentsModule-CpsTmrIW.js} +1 -1
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-Dvi02Y7q.js → AnnotatedAttachmentWorkspace-C_TmXZwA.js} +1 -1
- package/dist/ui/assets/{DocumentWorkspace-iys3zfca.js → DocumentWorkspace-C3GyzrWm.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-DJvLJI3A.js → InitiativesModule-4-Rh2K2n.js} +1 -1
- package/dist/ui/assets/PlansPage-BP7AYOqr.js +1 -0
- package/dist/ui/assets/{TaskSettings-Bqd4cCzW.js → TaskSettings-BOC5F6Ag.js} +1 -1
- package/dist/ui/assets/{WorkflowsModule-BguHeQaV.js → WorkflowsModule-CGk9s3NJ.js} +1 -1
- package/dist/ui/assets/index-CLIMgR6g.js +6 -0
- package/dist/ui/assets/index-DneETxcu.css +1 -0
- package/dist/ui/assets/{vendor-icons-C8EED3Oh.js → vendor-icons-pWocEipT.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/accountProfileSummaryCache.d.ts +31 -0
- package/dist/utils/accountProfileSummaryCache.js +97 -0
- package/dist/utils/accountProfileSummaryCache.test.d.ts +1 -0
- package/dist/utils/accountProfileSummaryCache.test.js +63 -0
- package/package.json +3 -3
- package/dist/ui/assets/PlansPage-BMPlpFpw.js +0 -1
- package/dist/ui/assets/index-MXeWoebC.css +0 -1
- package/dist/ui/assets/index-YJ4k5QNa.js +0 -6
- package/dist/utils/billingStatusCache.d.ts +0 -21
- package/dist/utils/billingStatusCache.js +0 -70
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type BillingStatusPayload = {
|
|
2
|
-
stripeStatus?: string | null;
|
|
3
|
-
stripeCustomerId?: string | null;
|
|
4
|
-
stripeSubscriptionId?: string | null;
|
|
5
|
-
stripePriceId?: string | null;
|
|
6
|
-
billingInterval?: 'month' | 'year' | null;
|
|
7
|
-
trialEnd?: string | null;
|
|
8
|
-
currentPeriodEnd?: string | null;
|
|
9
|
-
effectiveUntil?: string | null;
|
|
10
|
-
entitlementState?: string;
|
|
11
|
-
planVersionId?: string;
|
|
12
|
-
planId?: string;
|
|
13
|
-
planName?: string | null;
|
|
14
|
-
gate?: string | null;
|
|
15
|
-
message?: string | null;
|
|
16
|
-
planSelectionRequired?: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare function invalidateBillingStatusCache(rawUrl: string): void;
|
|
19
|
-
export declare function loadBillingStatusCached(rawUrl: string, options?: {
|
|
20
|
-
force?: boolean;
|
|
21
|
-
}): Promise<BillingStatusPayload | null>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { logBootstrapDebug } from '../hooks/workspace/workspaceLocalState';
|
|
2
|
-
const BILLING_STATUS_CACHE_TTL_MS = 5_000;
|
|
3
|
-
const billingStatusCache = new Map();
|
|
4
|
-
function getTimingNow() {
|
|
5
|
-
return typeof performance !== 'undefined' ? performance.now() : Date.now();
|
|
6
|
-
}
|
|
7
|
-
function normalizeBillingStatusUrl(raw) {
|
|
8
|
-
return String(raw || '').trim();
|
|
9
|
-
}
|
|
10
|
-
export function invalidateBillingStatusCache(rawUrl) {
|
|
11
|
-
billingStatusCache.delete(normalizeBillingStatusUrl(rawUrl));
|
|
12
|
-
}
|
|
13
|
-
export async function loadBillingStatusCached(rawUrl, options) {
|
|
14
|
-
const url = normalizeBillingStatusUrl(rawUrl);
|
|
15
|
-
if (!url)
|
|
16
|
-
return null;
|
|
17
|
-
const force = options?.force === true;
|
|
18
|
-
const now = Date.now();
|
|
19
|
-
const cached = billingStatusCache.get(url);
|
|
20
|
-
if (!force && cached?.payload !== undefined && (now - cached.fetchedAt) < BILLING_STATUS_CACHE_TTL_MS) {
|
|
21
|
-
logBootstrapDebug('billing_status_cache_hit', {
|
|
22
|
-
url,
|
|
23
|
-
ageMs: now - cached.fetchedAt
|
|
24
|
-
});
|
|
25
|
-
return cached.payload;
|
|
26
|
-
}
|
|
27
|
-
if (!force && cached?.promise) {
|
|
28
|
-
logBootstrapDebug('billing_status_request_reused', {
|
|
29
|
-
url
|
|
30
|
-
});
|
|
31
|
-
return cached.promise;
|
|
32
|
-
}
|
|
33
|
-
const startedAt = getTimingNow();
|
|
34
|
-
const request = (async () => {
|
|
35
|
-
const res = await fetch(url, {
|
|
36
|
-
method: 'GET',
|
|
37
|
-
credentials: 'include'
|
|
38
|
-
});
|
|
39
|
-
if (!res.ok) {
|
|
40
|
-
throw new Error(String((await res.json().catch(() => ({})))?.error || 'Failed to load billing status.'));
|
|
41
|
-
}
|
|
42
|
-
const payload = await res.json().catch(() => ({}));
|
|
43
|
-
const normalized = (payload || null);
|
|
44
|
-
billingStatusCache.set(url, {
|
|
45
|
-
payload: normalized,
|
|
46
|
-
fetchedAt: Date.now(),
|
|
47
|
-
promise: null
|
|
48
|
-
});
|
|
49
|
-
logBootstrapDebug('billing_status_loaded', {
|
|
50
|
-
url,
|
|
51
|
-
durationMs: Math.round(getTimingNow() - startedAt),
|
|
52
|
-
fromCache: false
|
|
53
|
-
});
|
|
54
|
-
return normalized;
|
|
55
|
-
})().catch((error) => {
|
|
56
|
-
billingStatusCache.delete(url);
|
|
57
|
-
logBootstrapDebug('billing_status_failed', {
|
|
58
|
-
url,
|
|
59
|
-
durationMs: Math.round(getTimingNow() - startedAt),
|
|
60
|
-
error: error instanceof Error ? error.message : String(error || 'Unknown error')
|
|
61
|
-
});
|
|
62
|
-
throw error;
|
|
63
|
-
});
|
|
64
|
-
billingStatusCache.set(url, {
|
|
65
|
-
payload: cached?.payload ?? null,
|
|
66
|
-
fetchedAt: cached?.fetchedAt ?? 0,
|
|
67
|
-
promise: request
|
|
68
|
-
});
|
|
69
|
-
return request;
|
|
70
|
-
}
|