@burdenoff/microfe-headshotmarketing 2026.830.1 → 2026.923.2
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/headshotmarketing/HeadshotMarketingRoutes.d.ts +2 -2
- package/dist/headshotmarketing/HeadshotMarketingRoutes.d.ts.map +1 -1
- package/dist/headshotmarketing/HeadshotMarketingRoutes.js +57 -57
- package/dist/headshotmarketing/HeadshotMarketingRoutes.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.d.ts +4 -0
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js +215 -0
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/createAudienceForm.d.ts +38 -0
- package/dist/headshotmarketing/pages/ads/createAudienceForm.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/createAudienceForm.js +85 -0
- package/dist/headshotmarketing/pages/ads/createAudienceForm.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/index.d.ts +1 -0
- package/dist/headshotmarketing/pages/ads/index.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +69 -72
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.d.ts +4 -0
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js +145 -0
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/createSocialAccountForm.d.ts +41 -0
- package/dist/headshotmarketing/pages/social-media/createSocialAccountForm.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/social-media/createSocialAccountForm.js +80 -0
- package/dist/headshotmarketing/pages/social-media/createSocialAccountForm.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/index.d.ts +1 -0
- package/dist/headshotmarketing/pages/social-media/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/automationStats.d.ts +39 -0
- package/dist/headshotmarketing/utils/automationStats.d.ts.map +1 -0
- package/dist/headshotmarketing/utils/automationStats.js +10 -0
- package/dist/headshotmarketing/utils/automationStats.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HeadshotmarketingSocialPlatform, CreateHeadshotmarketingSocialAccountInput } from '../../../generated/wspace-types';
|
|
2
|
+
import { SocialMediaPlatform } from '../../types';
|
|
3
|
+
|
|
4
|
+
export interface SocialAccountForm {
|
|
5
|
+
platform: SocialMediaPlatform;
|
|
6
|
+
accountName: string;
|
|
7
|
+
profileUrl: string;
|
|
8
|
+
followerCount: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const EMPTY_SOCIAL_ACCOUNT_FORM: SocialAccountForm;
|
|
11
|
+
export interface SocialPlatformOption {
|
|
12
|
+
key: SocialMediaPlatform;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}
|
|
16
|
+
/** Platforms a user can connect, in display order. */
|
|
17
|
+
export declare const SOCIAL_PLATFORM_OPTIONS: readonly SocialPlatformOption[];
|
|
18
|
+
/** Map the UI platform union to the backend enum. */
|
|
19
|
+
export declare const SOCIAL_PLATFORM_TO_ENUM: Record<SocialMediaPlatform, HeadshotmarketingSocialPlatform>;
|
|
20
|
+
/** Lowercase, hyphenate and strip non-alphanumerics (for stable local ids). */
|
|
21
|
+
export declare function slugify(value: string): string;
|
|
22
|
+
export type BuildResult<T> = {
|
|
23
|
+
ok: true;
|
|
24
|
+
input: T;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
error: string;
|
|
28
|
+
};
|
|
29
|
+
export interface BuildSocialAccountOptions {
|
|
30
|
+
/** Injectable clock so the generated `platformAccountId` is deterministic in tests. */
|
|
31
|
+
now?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validate a {@link SocialAccountForm} and build the create mutation input.
|
|
35
|
+
*
|
|
36
|
+
* Returns a discriminated result so the caller can surface `error` without a
|
|
37
|
+
* throw. A synthetic, collision-resistant `platformAccountId` is generated
|
|
38
|
+
* because manual connections have no OAuth-provided platform id yet.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildSocialAccountInput(form: SocialAccountForm, options?: BuildSocialAccountOptions): BuildResult<CreateHeadshotmarketingSocialAccountInput>;
|
|
41
|
+
//# sourceMappingURL=createSocialAccountForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSocialAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/createSocialAccountForm.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,+BAA+B,EAC/B,KAAK,yCAAyC,EAC/C,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,yBAAyB,EAAE,iBAKvC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,mBAAmB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAuBlE,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,mBAAmB,EACnB,+BAA+B,CAQhC,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM7C;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,yBAAyB;IACxC,uFAAuF;IACvF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,iBAAiB,EACvB,OAAO,GAAE,yBAA8B,GACtC,WAAW,CAAC,yCAAyC,CAAC,CA2BxD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { HeadshotmarketingSocialPlatform as e } from "../../../generated/wspace-types.js";
|
|
2
|
+
//#region src/headshotmarketing/pages/social-media/createSocialAccountForm.ts
|
|
3
|
+
var t = {
|
|
4
|
+
platform: "instagram",
|
|
5
|
+
accountName: "",
|
|
6
|
+
profileUrl: "",
|
|
7
|
+
followerCount: ""
|
|
8
|
+
}, n = [
|
|
9
|
+
{
|
|
10
|
+
key: "instagram",
|
|
11
|
+
label: "Instagram",
|
|
12
|
+
description: "Share photos, reels, and stories"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: "facebook",
|
|
16
|
+
label: "Facebook",
|
|
17
|
+
description: "Pages, groups, and marketplace"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: "twitter",
|
|
21
|
+
label: "Twitter",
|
|
22
|
+
description: "Tweets, threads, and spaces"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: "linkedin",
|
|
26
|
+
label: "LinkedIn",
|
|
27
|
+
description: "Professional networking and content"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "youtube",
|
|
31
|
+
label: "YouTube",
|
|
32
|
+
description: "Video content and shorts"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "tiktok",
|
|
36
|
+
label: "TikTok",
|
|
37
|
+
description: "Short-form video content"
|
|
38
|
+
}
|
|
39
|
+
], r = {
|
|
40
|
+
facebook: e.Facebook,
|
|
41
|
+
instagram: e.Instagram,
|
|
42
|
+
twitter: e.Twitter,
|
|
43
|
+
linkedin: e.Linkedin,
|
|
44
|
+
youtube: e.Youtube,
|
|
45
|
+
tiktok: e.Tiktok
|
|
46
|
+
};
|
|
47
|
+
function i(e) {
|
|
48
|
+
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
49
|
+
}
|
|
50
|
+
function a(e, t = {}) {
|
|
51
|
+
let n = e.accountName.trim();
|
|
52
|
+
if (!n) return {
|
|
53
|
+
ok: !1,
|
|
54
|
+
error: "Account name is required."
|
|
55
|
+
};
|
|
56
|
+
let a;
|
|
57
|
+
if (e.followerCount.trim()) {
|
|
58
|
+
let t = Number(e.followerCount);
|
|
59
|
+
if (!Number.isFinite(t) || t < 0) return {
|
|
60
|
+
ok: !1,
|
|
61
|
+
error: "Follower count must be a positive number."
|
|
62
|
+
};
|
|
63
|
+
a = Math.floor(t);
|
|
64
|
+
}
|
|
65
|
+
let o = t.now ?? Date.now(), s = e.profileUrl.trim();
|
|
66
|
+
return {
|
|
67
|
+
ok: !0,
|
|
68
|
+
input: {
|
|
69
|
+
platform: r[e.platform],
|
|
70
|
+
accountName: n,
|
|
71
|
+
platformAccountId: `${e.platform}-${i(n) || "account"}-${o.toString(36)}`,
|
|
72
|
+
profileUrl: s || void 0,
|
|
73
|
+
followerCount: a
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { t as EMPTY_SOCIAL_ACCOUNT_FORM, n as SOCIAL_PLATFORM_OPTIONS, a as buildSocialAccountInput };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=createSocialAccountForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSocialAccountForm.js","names":[],"sources":["../../../../src/headshotmarketing/pages/social-media/createSocialAccountForm.ts"],"sourcesContent":["/**\n * Pure form model + validation for the \"Connect Social Account\" create page.\n *\n * Kept free of React/DOM so the mapping and validation can be unit-tested in\n * isolation (the page component only wires this to inputs + the mutation).\n *\n * @module headshotmarketing/pages/social-media\n */\n\nimport {\n HeadshotmarketingSocialPlatform,\n type CreateHeadshotmarketingSocialAccountInput,\n} from \"../../../generated/wspace-types\";\nimport type { SocialMediaPlatform } from \"../../types\";\n\nexport interface SocialAccountForm {\n platform: SocialMediaPlatform;\n accountName: string;\n profileUrl: string;\n followerCount: string;\n}\n\nexport const EMPTY_SOCIAL_ACCOUNT_FORM: SocialAccountForm = {\n platform: \"instagram\",\n accountName: \"\",\n profileUrl: \"\",\n followerCount: \"\",\n};\n\nexport interface SocialPlatformOption {\n key: SocialMediaPlatform;\n label: string;\n description: string;\n}\n\n/** Platforms a user can connect, in display order. */\nexport const SOCIAL_PLATFORM_OPTIONS: readonly SocialPlatformOption[] = [\n {\n key: \"instagram\",\n label: \"Instagram\",\n description: \"Share photos, reels, and stories\",\n },\n {\n key: \"facebook\",\n label: \"Facebook\",\n description: \"Pages, groups, and marketplace\",\n },\n {\n key: \"twitter\",\n label: \"Twitter\",\n description: \"Tweets, threads, and spaces\",\n },\n {\n key: \"linkedin\",\n label: \"LinkedIn\",\n description: \"Professional networking and content\",\n },\n { key: \"youtube\", label: \"YouTube\", description: \"Video content and shorts\" },\n { key: \"tiktok\", label: \"TikTok\", description: \"Short-form video content\" },\n];\n\n/** Map the UI platform union to the backend enum. */\nexport const SOCIAL_PLATFORM_TO_ENUM: Record<\n SocialMediaPlatform,\n HeadshotmarketingSocialPlatform\n> = {\n facebook: HeadshotmarketingSocialPlatform.Facebook,\n instagram: HeadshotmarketingSocialPlatform.Instagram,\n twitter: HeadshotmarketingSocialPlatform.Twitter,\n linkedin: HeadshotmarketingSocialPlatform.Linkedin,\n youtube: HeadshotmarketingSocialPlatform.Youtube,\n tiktok: HeadshotmarketingSocialPlatform.Tiktok,\n};\n\n/** Lowercase, hyphenate and strip non-alphanumerics (for stable local ids). */\nexport function slugify(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\nexport type BuildResult<T> =\n { ok: true; input: T } | { ok: false; error: string };\n\nexport interface BuildSocialAccountOptions {\n /** Injectable clock so the generated `platformAccountId` is deterministic in tests. */\n now?: number;\n}\n\n/**\n * Validate a {@link SocialAccountForm} and build the create mutation input.\n *\n * Returns a discriminated result so the caller can surface `error` without a\n * throw. A synthetic, collision-resistant `platformAccountId` is generated\n * because manual connections have no OAuth-provided platform id yet.\n */\nexport function buildSocialAccountInput(\n form: SocialAccountForm,\n options: BuildSocialAccountOptions = {},\n): BuildResult<CreateHeadshotmarketingSocialAccountInput> {\n const accountName = form.accountName.trim();\n if (!accountName) {\n return { ok: false, error: \"Account name is required.\" };\n }\n\n let followerCount: number | undefined;\n if (form.followerCount.trim()) {\n const parsed = Number(form.followerCount);\n if (!Number.isFinite(parsed) || parsed < 0) {\n return { ok: false, error: \"Follower count must be a positive number.\" };\n }\n followerCount = Math.floor(parsed);\n }\n\n const now = options.now ?? Date.now();\n const profileUrl = form.profileUrl.trim();\n\n const input: CreateHeadshotmarketingSocialAccountInput = {\n platform: SOCIAL_PLATFORM_TO_ENUM[form.platform],\n accountName,\n platformAccountId: `${form.platform}-${slugify(accountName) || \"account\"}-${now.toString(36)}`,\n profileUrl: profileUrl || undefined,\n followerCount,\n };\n\n return { ok: true, input };\n}\n"],"mappings":";;AAsBA,IAAa,IAA+C;CAC1D,UAAU;CACV,aAAa;CACb,YAAY;CACZ,eAAe;CAChB,EASY,IAA2D;CACtE;EACE,KAAK;EACL,OAAO;EACP,aAAa;EACd;CACD;EACE,KAAK;EACL,OAAO;EACP,aAAa;EACd;CACD;EACE,KAAK;EACL,OAAO;EACP,aAAa;EACd;CACD;EACE,KAAK;EACL,OAAO;EACP,aAAa;EACd;CACD;EAAE,KAAK;EAAW,OAAO;EAAW,aAAa;EAA4B;CAC7E;EAAE,KAAK;EAAU,OAAO;EAAU,aAAa;EAA4B;CAC5E,EAGY,IAGT;CACF,UAAU,EAAgC;CAC1C,WAAW,EAAgC;CAC3C,SAAS,EAAgC;CACzC,UAAU,EAAgC;CAC1C,SAAS,EAAgC;CACzC,QAAQ,EAAgC;CACzC;AAGD,SAAgB,EAAQ,GAAuB;AAC7C,QAAO,EACJ,MAAM,CACN,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG;;AAkB5B,SAAgB,EACd,GACA,IAAqC,EAAE,EACiB;CACxD,IAAM,IAAc,EAAK,YAAY,MAAM;AAC3C,KAAI,CAAC,EACH,QAAO;EAAE,IAAI;EAAO,OAAO;EAA6B;CAG1D,IAAI;AACJ,KAAI,EAAK,cAAc,MAAM,EAAE;EAC7B,IAAM,IAAS,OAAO,EAAK,cAAc;AACzC,MAAI,CAAC,OAAO,SAAS,EAAO,IAAI,IAAS,EACvC,QAAO;GAAE,IAAI;GAAO,OAAO;GAA6C;AAE1E,MAAgB,KAAK,MAAM,EAAO;;CAGpC,IAAM,IAAM,EAAQ,OAAO,KAAK,KAAK,EAC/B,IAAa,EAAK,WAAW,MAAM;AAUzC,QAAO;EAAE,IAAI;EAAM,OARsC;GACvD,UAAU,EAAwB,EAAK;GACvC;GACA,mBAAmB,GAAG,EAAK,SAAS,GAAG,EAAQ,EAAY,IAAI,UAAU,GAAG,EAAI,SAAS,GAAG;GAC5F,YAAY,KAAc,KAAA;GAC1B;GACD;EAEyB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { SocialMediaPage } from './SocialMediaPage';
|
|
2
2
|
export { SocialMediaComposePage } from './SocialMediaComposePage';
|
|
3
3
|
export { AccountsPage } from './AccountsPage';
|
|
4
|
+
export { CreateAccountPage } from './CreateAccountPage';
|
|
4
5
|
export { PostsPage } from './PostsPage';
|
|
5
6
|
export { ContentCalendarPage } from './ContentCalendarPage';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automation statistics helpers.
|
|
3
|
+
*
|
|
4
|
+
* The Automation overview needs a "Time Saved" metric, but the GraphQL
|
|
5
|
+
* bootstrap payload carries no per-run "time saved" field — workflow runs only
|
|
6
|
+
* expose their own execution status and (machine) duration. Rather than display
|
|
7
|
+
* a fabricated constant, we derive the figure from the number of automated runs
|
|
8
|
+
* that actually succeeded, using a single, clearly-named estimate of the manual
|
|
9
|
+
* effort each successful run replaces. The derivation is intentionally obvious
|
|
10
|
+
* so the number stays honest: zero successful runs → zero time saved.
|
|
11
|
+
*
|
|
12
|
+
* @module headshotmarketing/utils/automationStats
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Estimated minutes of manual work avoided by each successful automated run.
|
|
16
|
+
*
|
|
17
|
+
* This is a documented heuristic, not a measured value: a workflow run replaces
|
|
18
|
+
* a task a person would otherwise have done by hand (sending an email, updating
|
|
19
|
+
* a record, notifying a teammate). We assume ~15 minutes of manual effort per
|
|
20
|
+
* run. Adjust this single constant if the product settles on a different basis.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ESTIMATED_MANUAL_MINUTES_PER_RUN = 15;
|
|
23
|
+
/**
|
|
24
|
+
* Estimate total minutes saved from the count of automated runs that succeeded.
|
|
25
|
+
*
|
|
26
|
+
* @param successfulRunCount - number of workflow runs with a "success" outcome.
|
|
27
|
+
* @returns estimated minutes of manual effort saved (never negative).
|
|
28
|
+
*/
|
|
29
|
+
export declare function estimateTimeSavedMinutes(successfulRunCount: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Format an estimated minutes-saved figure for display.
|
|
32
|
+
*
|
|
33
|
+
* Shows whole hours once there is at least an hour, otherwise minutes, so an
|
|
34
|
+
* empty workspace honestly reads "0h" alongside the other zeroed stats.
|
|
35
|
+
*
|
|
36
|
+
* @param totalMinutes - estimated minutes saved (as from {@link estimateTimeSavedMinutes}).
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatTimeSaved(totalMinutes: number): string;
|
|
39
|
+
//# sourceMappingURL=automationStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automationStats.d.ts","sourceRoot":"","sources":["../../../src/headshotmarketing/utils/automationStats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAK3E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQ5D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function e(e) {
|
|
2
|
+
return !Number.isFinite(e) || e <= 0 ? 0 : Math.round(e) * 15;
|
|
3
|
+
}
|
|
4
|
+
function t(e) {
|
|
5
|
+
return !Number.isFinite(e) || e <= 0 ? "0h" : e < 60 ? `${Math.round(e)}m` : `${Math.round(e / 60)}h`;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as estimateTimeSavedMinutes, t as formatTimeSaved };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=automationStats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automationStats.js","names":[],"sources":["../../../src/headshotmarketing/utils/automationStats.ts"],"sourcesContent":["/**\n * Automation statistics helpers.\n *\n * The Automation overview needs a \"Time Saved\" metric, but the GraphQL\n * bootstrap payload carries no per-run \"time saved\" field — workflow runs only\n * expose their own execution status and (machine) duration. Rather than display\n * a fabricated constant, we derive the figure from the number of automated runs\n * that actually succeeded, using a single, clearly-named estimate of the manual\n * effort each successful run replaces. The derivation is intentionally obvious\n * so the number stays honest: zero successful runs → zero time saved.\n *\n * @module headshotmarketing/utils/automationStats\n */\n\n/**\n * Estimated minutes of manual work avoided by each successful automated run.\n *\n * This is a documented heuristic, not a measured value: a workflow run replaces\n * a task a person would otherwise have done by hand (sending an email, updating\n * a record, notifying a teammate). We assume ~15 minutes of manual effort per\n * run. Adjust this single constant if the product settles on a different basis.\n */\nexport const ESTIMATED_MANUAL_MINUTES_PER_RUN = 15;\n\n/**\n * Estimate total minutes saved from the count of automated runs that succeeded.\n *\n * @param successfulRunCount - number of workflow runs with a \"success\" outcome.\n * @returns estimated minutes of manual effort saved (never negative).\n */\nexport function estimateTimeSavedMinutes(successfulRunCount: number): number {\n if (!Number.isFinite(successfulRunCount) || successfulRunCount <= 0) {\n return 0;\n }\n return Math.round(successfulRunCount) * ESTIMATED_MANUAL_MINUTES_PER_RUN;\n}\n\n/**\n * Format an estimated minutes-saved figure for display.\n *\n * Shows whole hours once there is at least an hour, otherwise minutes, so an\n * empty workspace honestly reads \"0h\" alongside the other zeroed stats.\n *\n * @param totalMinutes - estimated minutes saved (as from {@link estimateTimeSavedMinutes}).\n */\nexport function formatTimeSaved(totalMinutes: number): string {\n if (!Number.isFinite(totalMinutes) || totalMinutes <= 0) {\n return \"0h\";\n }\n if (totalMinutes < 60) {\n return `${Math.round(totalMinutes)}m`;\n }\n return `${Math.round(totalMinutes / 60)}h`;\n}\n"],"mappings":"AA8BA,SAAgB,EAAyB,GAAoC;AAI3E,QAHI,CAAC,OAAO,SAAS,EAAmB,IAAI,KAAsB,IACzD,IAEF,KAAK,MAAM,EAAmB,GAAA;;AAWvC,SAAgB,EAAgB,GAA8B;AAO5D,QANI,CAAC,OAAO,SAAS,EAAa,IAAI,KAAgB,IAC7C,OAEL,IAAe,KACV,GAAG,KAAK,MAAM,EAAa,CAAC,KAE9B,GAAG,KAAK,MAAM,IAAe,GAAG,CAAC"}
|
package/package.json
CHANGED