@hanzo/ui 8.0.14 → 8.0.16
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/{chunk-YAYUPOE3.js → chunk-23V6BPHG.js} +9 -96
- package/dist/chunk-23V6BPHG.js.map +1 -0
- package/dist/{chunk-VGGGGXWS.cjs → chunk-5MBAHVEO.cjs} +10 -108
- package/dist/chunk-5MBAHVEO.cjs.map +1 -0
- package/dist/chunk-MWBFAV3D.cjs +105 -0
- package/dist/chunk-MWBFAV3D.cjs.map +1 -0
- package/dist/chunk-ZGTJCJ55.js +93 -0
- package/dist/chunk-ZGTJCJ55.js.map +1 -0
- package/dist/product/index.cjs +84 -83
- package/dist/product/index.cjs.map +1 -1
- package/dist/product/index.js +3 -2
- package/dist/product/index.js.map +1 -1
- package/dist/product/social/api.cjs +53 -0
- package/dist/product/social/api.cjs.map +1 -0
- package/dist/product/social/api.js +4 -0
- package/dist/product/social/api.js.map +1 -0
- package/dist/product/social/index.cjs +47 -46
- package/dist/product/social/index.js +2 -1
- package/package.json +10 -16
- package/dist/chunk-VGGGGXWS.cjs.map +0 -1
- package/dist/chunk-YAYUPOE3.js.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// src/product/social/api.ts
|
|
5
|
+
var enc = encodeURIComponent;
|
|
6
|
+
var str = (v) => typeof v === "string" ? v : v == null ? "" : String(v);
|
|
7
|
+
var num = (v) => {
|
|
8
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
9
|
+
if (typeof v === "string" && v.trim() !== "" && Number.isFinite(Number(v))) return Number(v);
|
|
10
|
+
return 0;
|
|
11
|
+
};
|
|
12
|
+
var strs = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
13
|
+
var asRecord = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
14
|
+
var rows = (payload) => {
|
|
15
|
+
if (Array.isArray(payload)) return payload.filter((x) => x && typeof x === "object");
|
|
16
|
+
if (payload && typeof payload === "object") {
|
|
17
|
+
for (const k of ["data", "items", "rows"]) {
|
|
18
|
+
const v = payload[k];
|
|
19
|
+
if (Array.isArray(v)) return v.filter((x) => x && typeof x === "object");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
};
|
|
24
|
+
var PROVIDERS = ["x", "facebook", "instagram", "linkedin", "tiktok", "youtube", "threads"];
|
|
25
|
+
var ACCOUNT_STATUSES = ["connected", "disconnected", "error"];
|
|
26
|
+
var POST_STATUSES = ["draft", "scheduled", "published", "failed"];
|
|
27
|
+
function normalizeAccount(raw) {
|
|
28
|
+
const r = asRecord(raw);
|
|
29
|
+
return {
|
|
30
|
+
id: str(r.id),
|
|
31
|
+
provider: str(r.provider) || "x",
|
|
32
|
+
handle: str(r.handle),
|
|
33
|
+
status: str(r.status) || "connected",
|
|
34
|
+
createdAt: num(r.createdAt),
|
|
35
|
+
updatedAt: num(r.updatedAt)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function normalizePost(raw) {
|
|
39
|
+
const r = asRecord(raw);
|
|
40
|
+
return {
|
|
41
|
+
id: str(r.id),
|
|
42
|
+
content: str(r.content),
|
|
43
|
+
channel: str(r.channel) || "x",
|
|
44
|
+
status: str(r.status) || "draft",
|
|
45
|
+
scheduleAt: num(r.scheduleAt),
|
|
46
|
+
media: strs(r.media),
|
|
47
|
+
accountId: str(r.accountId) || void 0,
|
|
48
|
+
externalId: str(r.externalId) || void 0,
|
|
49
|
+
error: str(r.error) || void 0,
|
|
50
|
+
createdAt: num(r.createdAt),
|
|
51
|
+
updatedAt: num(r.updatedAt)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function normalizeSummary(raw) {
|
|
55
|
+
const r = asRecord(raw);
|
|
56
|
+
return { posts: num(r.posts), scheduled: num(r.scheduled), published: num(r.published), accounts: num(r.accounts) };
|
|
57
|
+
}
|
|
58
|
+
function normalizeProviderCapability(raw) {
|
|
59
|
+
const r = asRecord(raw);
|
|
60
|
+
return {
|
|
61
|
+
provider: str(r.provider),
|
|
62
|
+
credentialsConfigured: Boolean(r.credentialsConfigured),
|
|
63
|
+
missingCredentials: strs(r.missingCredentials)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
var normalizeAccounts = (p) => rows(p).map(normalizeAccount).filter((a) => a.id);
|
|
67
|
+
var normalizePosts = (p) => rows(p).map(normalizePost).filter((x) => x.id);
|
|
68
|
+
var normalizeProviders = (p) => rows(p).map(normalizeProviderCapability).filter((c) => c.provider);
|
|
69
|
+
function createSocialApi(rest) {
|
|
70
|
+
return {
|
|
71
|
+
summary: () => rest.get("summary").then(normalizeSummary),
|
|
72
|
+
/** Publish-readiness per network (+ the exact missing OAuth-app credentials). */
|
|
73
|
+
providers: () => rest.get("providers").then(normalizeProviders),
|
|
74
|
+
accounts: {
|
|
75
|
+
list: (provider) => rest.get(`accounts${provider ? `?provider=${enc(provider)}` : ""}`).then(normalizeAccounts),
|
|
76
|
+
get: (id) => rest.get(`accounts/${enc(id)}`).then(normalizeAccount),
|
|
77
|
+
create: (body) => rest.post("accounts", body).then(normalizeAccount),
|
|
78
|
+
update: (id, body) => rest.put(`accounts/${enc(id)}`, body).then(normalizeAccount),
|
|
79
|
+
remove: (id) => rest.del(`accounts/${enc(id)}`)
|
|
80
|
+
},
|
|
81
|
+
posts: {
|
|
82
|
+
list: (status) => rest.get(`posts${status ? `?status=${enc(status)}` : ""}`).then(normalizePosts),
|
|
83
|
+
get: (id) => rest.get(`posts/${enc(id)}`).then(normalizePost),
|
|
84
|
+
create: (body) => rest.post("posts", body).then(normalizePost),
|
|
85
|
+
update: (id, body) => rest.put(`posts/${enc(id)}`, body).then(normalizePost),
|
|
86
|
+
remove: (id) => rest.del(`posts/${enc(id)}`),
|
|
87
|
+
/** Publish a post NOW to its channel's connected accounts. */
|
|
88
|
+
publish: (id) => rest.post(`posts/${enc(id)}/publish`).then(normalizePost)
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
exports.ACCOUNT_STATUSES = ACCOUNT_STATUSES;
|
|
94
|
+
exports.POST_STATUSES = POST_STATUSES;
|
|
95
|
+
exports.PROVIDERS = PROVIDERS;
|
|
96
|
+
exports.createSocialApi = createSocialApi;
|
|
97
|
+
exports.normalizeAccount = normalizeAccount;
|
|
98
|
+
exports.normalizeAccounts = normalizeAccounts;
|
|
99
|
+
exports.normalizePost = normalizePost;
|
|
100
|
+
exports.normalizePosts = normalizePosts;
|
|
101
|
+
exports.normalizeProviderCapability = normalizeProviderCapability;
|
|
102
|
+
exports.normalizeProviders = normalizeProviders;
|
|
103
|
+
exports.normalizeSummary = normalizeSummary;
|
|
104
|
+
//# sourceMappingURL=chunk-MWBFAV3D.cjs.map
|
|
105
|
+
//# sourceMappingURL=chunk-MWBFAV3D.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/product/social/api.ts"],"names":[],"mappings":";;;AA6BA,IAAM,GAAA,GAAM,kBAAA;AAGZ,IAAM,GAAA,GAAM,CAAC,CAAA,KAAwB,OAAO,CAAA,KAAM,QAAA,GAAW,CAAA,GAAI,CAAA,IAAK,IAAA,GAAO,EAAA,GAAK,MAAA,CAAO,CAAC,CAAA;AAC1F,IAAM,GAAA,GAAM,CAAC,CAAA,KAAuB;AAClC,EAAA,IAAI,OAAO,CAAA,KAAM,QAAA,IAAY,OAAO,QAAA,CAAS,CAAC,GAAG,OAAO,CAAA;AACxD,EAAA,IAAI,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,CAAE,MAAK,KAAM,EAAA,IAAM,MAAA,CAAO,QAAA,CAAS,OAAO,CAAC,CAAC,CAAA,EAAG,OAAO,OAAO,CAAC,CAAA;AAC3F,EAAA,OAAO,CAAA;AACT,CAAA;AACA,IAAM,IAAA,GAAO,CAAC,CAAA,KAA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C,IAAA,CAAK,KAAK,OAAA,EAAS,IAAI,CAAA,CAAE,IAAA,CAAK,aAAa,CAAA;AAAA,MACrF,MAAA,EAAQ,CAAC,EAAA,EAAY,IAAA,KAAiC,KAAK,GAAA,CAAI,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,KAAK,aAAa,CAAA;AAAA,MAC3G,MAAA,EAAQ,CAAC,EAAA,KAA8B,IAAA,CAAK,IAAI,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,CAAE,CAAA;AAAA;AAAA,MAElE,OAAA,EAAS,CAAC,EAAA,KAA8B,IAAA,CAAK,IAAA,CAAK,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,QAAA,CAAU,CAAA,CAAE,IAAA,CAAK,aAAa;AAAA;AAClG,GACF;AACF","file":"chunk-MWBFAV3D.cjs","sourcesContent":["/**\n * The `/v1/social` contract — the ONE typed client for the Hanzo Social surface,\n * shared by every host that renders it (the console's Publish product, the dedicated\n * social.hanzo.ai app, any white-label admin).\n *\n * The backend is `hanzoai/cloud` `clients/social`: a native-Go per-org accounts+posts\n * store on Base/SQLite (the in-process fold of the standalone social stack, twin of\n * clients/crm) — NOT a proxy to the retired social pods. Routes (social.go):\n *\n * GET /v1/social/summary per-org roll-up\n * GET /v1/social/providers publish-readiness per network\n * GET/POST /v1/social/accounts list (?provider=) / connect\n * GET/PUT/DELETE /v1/social/accounts/:id detail / update / disconnect\n * GET/POST /v1/social/posts list (?status=) / create-or-schedule\n * GET/PUT/DELETE /v1/social/posts/:id detail / update / delete\n * POST /v1/social/posts/:id/publish publish now\n *\n * TRANSPORT IS INJECTED. This layer never picks an origin, a credential or a fetch\n * wrapper — the host passes a `SocialRest` whose paths are relative to `/v1/social`\n * (`'summary'`, `'posts/<id>/publish'`), so the console rides its session-cookie\n * `originV1Url` and another app rides its own. Every read/write is org-scoped\n * SERVER-SIDE from the validated bearer/session owner claim; no org ever travels\n * from the browser.\n *\n * Payloads are normalized DEFENSIVELY: a field rename upstream degrades a cell\n * rather than throwing, and a list is read from whichever envelope key the backend\n * uses (`data`/`items`/`rows`, or a bare array).\n */\n\nconst enc = encodeURIComponent\n\n// ── Coercion helpers (pure) ─────────────────────────────────────────────────\nconst str = (v: unknown): string => (typeof v === 'string' ? v : v == null ? '' : String(v))\nconst num = (v: unknown): number => {\n if (typeof v === 'number' && Number.isFinite(v)) return v\n if (typeof v === 'string' && v.trim() !== '' && Number.isFinite(Number(v))) return Number(v)\n return 0\n}\nconst strs = (v: unknown): string[] => (Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : [])\nconst asRecord = (v: unknown): Record<string, unknown> =>\n v && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : {}\n\nconst rows = (payload: unknown): Record<string, unknown>[] => {\n if (Array.isArray(payload)) return payload.filter((x) => x && typeof x === 'object') as Record<string, unknown>[]\n if (payload && typeof payload === 'object') {\n for (const k of ['data', 'items', 'rows']) {\n const v = (payload as Record<string, unknown>)[k]\n if (Array.isArray(v)) return v.filter((x) => x && typeof x === 'object') as Record<string, unknown>[]\n }\n }\n return []\n}\n\n// ── Domain types (mirror cloud clients/social/store.go JSON tags) ────────────\n\n/** Networks — the ONE ordered vocabulary (cloud rejects an unknown provider; '' → x). */\nexport const PROVIDERS = ['x', 'facebook', 'instagram', 'linkedin', 'tiktok', 'youtube', 'threads'] as const\nexport type Provider = (typeof PROVIDERS)[number]\n\n/** Account connection lifecycle (cloud rejects an unknown status; '' → connected). */\nexport const ACCOUNT_STATUSES = ['connected', 'disconnected', 'error'] as const\n\n/** Post lifecycle (cloud rejects an unknown status; '' → draft). */\nexport const POST_STATUSES = ['draft', 'scheduled', 'published', 'failed'] as const\n\nexport type Account = {\n id: string\n provider: string\n handle: string\n status: string\n createdAt: number\n updatedAt: number\n}\n\nexport type Post = {\n id: string\n content: string\n channel: string\n status: string\n /** Unix seconds; 0 = not scheduled / publish now. */\n scheduleAt: number\n /**\n * Attached media URLs. Cloud ALWAYS serializes an array (never null) and its PUT\n * rebuilds the row from the body — so this has to round-trip: an update that\n * omitted it would wipe the post's media.\n */\n media: string[]\n /** Server-managed publish results (empty until a publish attempt lands). */\n accountId?: string\n externalId?: string\n error?: string\n createdAt: number\n updatedAt: number\n}\n\n/** The per-org roll-up (GET /v1/social/summary) — the counts SocialSummaryBar renders. */\nexport type SocialSummary = { posts: number; scheduled: number; published: number; accounts: number }\n\n/**\n * A network's publish-readiness (GET /v1/social/providers): whether this deployment\n * holds the OAuth-app credentials to publish, and — if not — exactly which env vars\n * are missing. The honest connect affordance; never a fabricated \"connected\".\n */\nexport type ProviderCapability = {\n provider: string\n credentialsConfigured: boolean\n missingCredentials: string[]\n}\n\n/** Create/update bodies — only the writable fields (server owns id/org/timestamps). */\nexport type NewAccount = Partial<Omit<Account, 'id' | 'createdAt' | 'updatedAt'>> & { provider: string }\nexport type NewPost = Partial<Omit<Post, 'id' | 'createdAt' | 'updatedAt'>> & { content: string }\n\n// ── Normalizers (pure) ──────────────────────────────────────────────────────\n\nexport function normalizeAccount(raw: unknown): Account {\n const r = asRecord(raw)\n return {\n id: str(r.id),\n provider: str(r.provider) || 'x',\n handle: str(r.handle),\n status: str(r.status) || 'connected',\n createdAt: num(r.createdAt),\n updatedAt: num(r.updatedAt),\n }\n}\n\nexport function normalizePost(raw: unknown): Post {\n const r = asRecord(raw)\n return {\n id: str(r.id),\n content: str(r.content),\n channel: str(r.channel) || 'x',\n status: str(r.status) || 'draft',\n scheduleAt: num(r.scheduleAt),\n media: strs(r.media),\n accountId: str(r.accountId) || undefined,\n externalId: str(r.externalId) || undefined,\n error: str(r.error) || undefined,\n createdAt: num(r.createdAt),\n updatedAt: num(r.updatedAt),\n }\n}\n\nexport function normalizeSummary(raw: unknown): SocialSummary {\n const r = asRecord(raw)\n return { posts: num(r.posts), scheduled: num(r.scheduled), published: num(r.published), accounts: num(r.accounts) }\n}\n\nexport function normalizeProviderCapability(raw: unknown): ProviderCapability {\n const r = asRecord(raw)\n return {\n provider: str(r.provider),\n credentialsConfigured: Boolean(r.credentialsConfigured),\n missingCredentials: strs(r.missingCredentials),\n }\n}\n\nexport const normalizeAccounts = (p: unknown): Account[] => rows(p).map(normalizeAccount).filter((a) => a.id)\nexport const normalizePosts = (p: unknown): Post[] => rows(p).map(normalizePost).filter((x) => x.id)\nexport const normalizeProviders = (p: unknown): ProviderCapability[] =>\n rows(p).map(normalizeProviderCapability).filter((c) => c.provider)\n\n// ── The transport seam ──────────────────────────────────────────────────────\n\n/**\n * The host's REST transport. `path` is relative to `/v1/social` (no leading slash);\n * the host owns the origin, the credential and the error class. A rejected promise\n * is passed straight to `classifyBackend`, so any client's error type works.\n */\nexport type SocialRest = {\n get: (path: string) => Promise<unknown>\n post: (path: string, body?: unknown) => Promise<unknown>\n put: (path: string, body?: unknown) => Promise<unknown>\n del: (path: string) => Promise<void>\n}\n\nexport type SocialApi = ReturnType<typeof createSocialApi>\n\n/** Bind the `/v1/social` contract to a host transport. One method per documented route. */\nexport function createSocialApi(rest: SocialRest) {\n return {\n summary: (): Promise<SocialSummary> => rest.get('summary').then(normalizeSummary),\n\n /** Publish-readiness per network (+ the exact missing OAuth-app credentials). */\n providers: (): Promise<ProviderCapability[]> => rest.get('providers').then(normalizeProviders),\n\n accounts: {\n list: (provider?: string): Promise<Account[]> =>\n rest.get(`accounts${provider ? `?provider=${enc(provider)}` : ''}`).then(normalizeAccounts),\n get: (id: string): Promise<Account> => rest.get(`accounts/${enc(id)}`).then(normalizeAccount),\n create: (body: NewAccount): Promise<Account> => rest.post('accounts', body).then(normalizeAccount),\n update: (id: string, body: NewAccount): Promise<Account> =>\n rest.put(`accounts/${enc(id)}`, body).then(normalizeAccount),\n remove: (id: string): Promise<void> => rest.del(`accounts/${enc(id)}`),\n },\n\n posts: {\n list: (status?: string): Promise<Post[]> =>\n rest.get(`posts${status ? `?status=${enc(status)}` : ''}`).then(normalizePosts),\n get: (id: string): Promise<Post> => rest.get(`posts/${enc(id)}`).then(normalizePost),\n create: (body: NewPost): Promise<Post> => rest.post('posts', body).then(normalizePost),\n update: (id: string, body: NewPost): Promise<Post> => rest.put(`posts/${enc(id)}`, body).then(normalizePost),\n remove: (id: string): Promise<void> => rest.del(`posts/${enc(id)}`),\n /** Publish a post NOW to its channel's connected accounts. */\n publish: (id: string): Promise<Post> => rest.post(`posts/${enc(id)}/publish`).then(normalizePost),\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// src/product/social/api.ts
|
|
3
|
+
var enc = encodeURIComponent;
|
|
4
|
+
var str = (v) => typeof v === "string" ? v : v == null ? "" : String(v);
|
|
5
|
+
var num = (v) => {
|
|
6
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
7
|
+
if (typeof v === "string" && v.trim() !== "" && Number.isFinite(Number(v))) return Number(v);
|
|
8
|
+
return 0;
|
|
9
|
+
};
|
|
10
|
+
var strs = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
11
|
+
var asRecord = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
12
|
+
var rows = (payload) => {
|
|
13
|
+
if (Array.isArray(payload)) return payload.filter((x) => x && typeof x === "object");
|
|
14
|
+
if (payload && typeof payload === "object") {
|
|
15
|
+
for (const k of ["data", "items", "rows"]) {
|
|
16
|
+
const v = payload[k];
|
|
17
|
+
if (Array.isArray(v)) return v.filter((x) => x && typeof x === "object");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return [];
|
|
21
|
+
};
|
|
22
|
+
var PROVIDERS = ["x", "facebook", "instagram", "linkedin", "tiktok", "youtube", "threads"];
|
|
23
|
+
var ACCOUNT_STATUSES = ["connected", "disconnected", "error"];
|
|
24
|
+
var POST_STATUSES = ["draft", "scheduled", "published", "failed"];
|
|
25
|
+
function normalizeAccount(raw) {
|
|
26
|
+
const r = asRecord(raw);
|
|
27
|
+
return {
|
|
28
|
+
id: str(r.id),
|
|
29
|
+
provider: str(r.provider) || "x",
|
|
30
|
+
handle: str(r.handle),
|
|
31
|
+
status: str(r.status) || "connected",
|
|
32
|
+
createdAt: num(r.createdAt),
|
|
33
|
+
updatedAt: num(r.updatedAt)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function normalizePost(raw) {
|
|
37
|
+
const r = asRecord(raw);
|
|
38
|
+
return {
|
|
39
|
+
id: str(r.id),
|
|
40
|
+
content: str(r.content),
|
|
41
|
+
channel: str(r.channel) || "x",
|
|
42
|
+
status: str(r.status) || "draft",
|
|
43
|
+
scheduleAt: num(r.scheduleAt),
|
|
44
|
+
media: strs(r.media),
|
|
45
|
+
accountId: str(r.accountId) || void 0,
|
|
46
|
+
externalId: str(r.externalId) || void 0,
|
|
47
|
+
error: str(r.error) || void 0,
|
|
48
|
+
createdAt: num(r.createdAt),
|
|
49
|
+
updatedAt: num(r.updatedAt)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function normalizeSummary(raw) {
|
|
53
|
+
const r = asRecord(raw);
|
|
54
|
+
return { posts: num(r.posts), scheduled: num(r.scheduled), published: num(r.published), accounts: num(r.accounts) };
|
|
55
|
+
}
|
|
56
|
+
function normalizeProviderCapability(raw) {
|
|
57
|
+
const r = asRecord(raw);
|
|
58
|
+
return {
|
|
59
|
+
provider: str(r.provider),
|
|
60
|
+
credentialsConfigured: Boolean(r.credentialsConfigured),
|
|
61
|
+
missingCredentials: strs(r.missingCredentials)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
var normalizeAccounts = (p) => rows(p).map(normalizeAccount).filter((a) => a.id);
|
|
65
|
+
var normalizePosts = (p) => rows(p).map(normalizePost).filter((x) => x.id);
|
|
66
|
+
var normalizeProviders = (p) => rows(p).map(normalizeProviderCapability).filter((c) => c.provider);
|
|
67
|
+
function createSocialApi(rest) {
|
|
68
|
+
return {
|
|
69
|
+
summary: () => rest.get("summary").then(normalizeSummary),
|
|
70
|
+
/** Publish-readiness per network (+ the exact missing OAuth-app credentials). */
|
|
71
|
+
providers: () => rest.get("providers").then(normalizeProviders),
|
|
72
|
+
accounts: {
|
|
73
|
+
list: (provider) => rest.get(`accounts${provider ? `?provider=${enc(provider)}` : ""}`).then(normalizeAccounts),
|
|
74
|
+
get: (id) => rest.get(`accounts/${enc(id)}`).then(normalizeAccount),
|
|
75
|
+
create: (body) => rest.post("accounts", body).then(normalizeAccount),
|
|
76
|
+
update: (id, body) => rest.put(`accounts/${enc(id)}`, body).then(normalizeAccount),
|
|
77
|
+
remove: (id) => rest.del(`accounts/${enc(id)}`)
|
|
78
|
+
},
|
|
79
|
+
posts: {
|
|
80
|
+
list: (status) => rest.get(`posts${status ? `?status=${enc(status)}` : ""}`).then(normalizePosts),
|
|
81
|
+
get: (id) => rest.get(`posts/${enc(id)}`).then(normalizePost),
|
|
82
|
+
create: (body) => rest.post("posts", body).then(normalizePost),
|
|
83
|
+
update: (id, body) => rest.put(`posts/${enc(id)}`, body).then(normalizePost),
|
|
84
|
+
remove: (id) => rest.del(`posts/${enc(id)}`),
|
|
85
|
+
/** Publish a post NOW to its channel's connected accounts. */
|
|
86
|
+
publish: (id) => rest.post(`posts/${enc(id)}/publish`).then(normalizePost)
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { ACCOUNT_STATUSES, POST_STATUSES, PROVIDERS, createSocialApi, normalizeAccount, normalizeAccounts, normalizePost, normalizePosts, normalizeProviderCapability, normalizeProviders, normalizeSummary };
|
|
92
|
+
//# sourceMappingURL=chunk-ZGTJCJ55.js.map
|
|
93
|
+
//# sourceMappingURL=chunk-ZGTJCJ55.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/product/social/api.ts"],"names":[],"mappings":";AA6BA,IAAM,GAAA,GAAM,kBAAA;AAGZ,IAAM,GAAA,GAAM,CAAC,CAAA,KAAwB,OAA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,SAAA,EAAY,GAAA,CAAI,EAAE,CAAC,CAAA,CAAE;AAAA,KACvE;AAAA,IAEA,KAAA,EAAO;AAAA,MACL,MAAM,CAAC,MAAA,KACL,IAAA,CAAK,GAAA,CAAI,QAAQ,MAAA,GAAS,CAAA,QAAA,EAAW,GAAA,CAAI,MAAM,CAAC,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA,CAAE,KAAK,cAAc,CAAA;AAAA,MAChF,GAAA,EAAK,CAAC,EAAA,KAA8B,IAAA,CAAK,GAAA,CAAI,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,CAAE,CAAA,CAAE,IAAA,CAAK,aAAa,CAAA;AAAA,MACnF,MAAA,EAAQ,CAAC,IAAA,KAAiC,IAAA,CAAK,KAAK,OAAA,EAAS,IAAI,CAAA,CAAE,IAAA,CAAK,aAAa,CAAA;AAAA,MACrF,MAAA,EAAQ,CAAC,EAAA,EAAY,IAAA,KAAiC,KAAK,GAAA,CAAI,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,KAAK,aAAa,CAAA;AAAA,MAC3G,MAAA,EAAQ,CAAC,EAAA,KAA8B,IAAA,CAAK,IAAI,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,CAAE,CAAA;AAAA;AAAA,MAElE,OAAA,EAAS,CAAC,EAAA,KAA8B,IAAA,CAAK,IAAA,CAAK,CAAA,MAAA,EAAS,GAAA,CAAI,EAAE,CAAC,CAAA,QAAA,CAAU,CAAA,CAAE,IAAA,CAAK,aAAa;AAAA;AAClG,GACF;AACF","file":"chunk-ZGTJCJ55.js","sourcesContent":["/**\n * The `/v1/social` contract — the ONE typed client for the Hanzo Social surface,\n * shared by every host that renders it (the console's Publish product, the dedicated\n * social.hanzo.ai app, any white-label admin).\n *\n * The backend is `hanzoai/cloud` `clients/social`: a native-Go per-org accounts+posts\n * store on Base/SQLite (the in-process fold of the standalone social stack, twin of\n * clients/crm) — NOT a proxy to the retired social pods. Routes (social.go):\n *\n * GET /v1/social/summary per-org roll-up\n * GET /v1/social/providers publish-readiness per network\n * GET/POST /v1/social/accounts list (?provider=) / connect\n * GET/PUT/DELETE /v1/social/accounts/:id detail / update / disconnect\n * GET/POST /v1/social/posts list (?status=) / create-or-schedule\n * GET/PUT/DELETE /v1/social/posts/:id detail / update / delete\n * POST /v1/social/posts/:id/publish publish now\n *\n * TRANSPORT IS INJECTED. This layer never picks an origin, a credential or a fetch\n * wrapper — the host passes a `SocialRest` whose paths are relative to `/v1/social`\n * (`'summary'`, `'posts/<id>/publish'`), so the console rides its session-cookie\n * `originV1Url` and another app rides its own. Every read/write is org-scoped\n * SERVER-SIDE from the validated bearer/session owner claim; no org ever travels\n * from the browser.\n *\n * Payloads are normalized DEFENSIVELY: a field rename upstream degrades a cell\n * rather than throwing, and a list is read from whichever envelope key the backend\n * uses (`data`/`items`/`rows`, or a bare array).\n */\n\nconst enc = encodeURIComponent\n\n// ── Coercion helpers (pure) ─────────────────────────────────────────────────\nconst str = (v: unknown): string => (typeof v === 'string' ? v : v == null ? '' : String(v))\nconst num = (v: unknown): number => {\n if (typeof v === 'number' && Number.isFinite(v)) return v\n if (typeof v === 'string' && v.trim() !== '' && Number.isFinite(Number(v))) return Number(v)\n return 0\n}\nconst strs = (v: unknown): string[] => (Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : [])\nconst asRecord = (v: unknown): Record<string, unknown> =>\n v && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : {}\n\nconst rows = (payload: unknown): Record<string, unknown>[] => {\n if (Array.isArray(payload)) return payload.filter((x) => x && typeof x === 'object') as Record<string, unknown>[]\n if (payload && typeof payload === 'object') {\n for (const k of ['data', 'items', 'rows']) {\n const v = (payload as Record<string, unknown>)[k]\n if (Array.isArray(v)) return v.filter((x) => x && typeof x === 'object') as Record<string, unknown>[]\n }\n }\n return []\n}\n\n// ── Domain types (mirror cloud clients/social/store.go JSON tags) ────────────\n\n/** Networks — the ONE ordered vocabulary (cloud rejects an unknown provider; '' → x). */\nexport const PROVIDERS = ['x', 'facebook', 'instagram', 'linkedin', 'tiktok', 'youtube', 'threads'] as const\nexport type Provider = (typeof PROVIDERS)[number]\n\n/** Account connection lifecycle (cloud rejects an unknown status; '' → connected). */\nexport const ACCOUNT_STATUSES = ['connected', 'disconnected', 'error'] as const\n\n/** Post lifecycle (cloud rejects an unknown status; '' → draft). */\nexport const POST_STATUSES = ['draft', 'scheduled', 'published', 'failed'] as const\n\nexport type Account = {\n id: string\n provider: string\n handle: string\n status: string\n createdAt: number\n updatedAt: number\n}\n\nexport type Post = {\n id: string\n content: string\n channel: string\n status: string\n /** Unix seconds; 0 = not scheduled / publish now. */\n scheduleAt: number\n /**\n * Attached media URLs. Cloud ALWAYS serializes an array (never null) and its PUT\n * rebuilds the row from the body — so this has to round-trip: an update that\n * omitted it would wipe the post's media.\n */\n media: string[]\n /** Server-managed publish results (empty until a publish attempt lands). */\n accountId?: string\n externalId?: string\n error?: string\n createdAt: number\n updatedAt: number\n}\n\n/** The per-org roll-up (GET /v1/social/summary) — the counts SocialSummaryBar renders. */\nexport type SocialSummary = { posts: number; scheduled: number; published: number; accounts: number }\n\n/**\n * A network's publish-readiness (GET /v1/social/providers): whether this deployment\n * holds the OAuth-app credentials to publish, and — if not — exactly which env vars\n * are missing. The honest connect affordance; never a fabricated \"connected\".\n */\nexport type ProviderCapability = {\n provider: string\n credentialsConfigured: boolean\n missingCredentials: string[]\n}\n\n/** Create/update bodies — only the writable fields (server owns id/org/timestamps). */\nexport type NewAccount = Partial<Omit<Account, 'id' | 'createdAt' | 'updatedAt'>> & { provider: string }\nexport type NewPost = Partial<Omit<Post, 'id' | 'createdAt' | 'updatedAt'>> & { content: string }\n\n// ── Normalizers (pure) ──────────────────────────────────────────────────────\n\nexport function normalizeAccount(raw: unknown): Account {\n const r = asRecord(raw)\n return {\n id: str(r.id),\n provider: str(r.provider) || 'x',\n handle: str(r.handle),\n status: str(r.status) || 'connected',\n createdAt: num(r.createdAt),\n updatedAt: num(r.updatedAt),\n }\n}\n\nexport function normalizePost(raw: unknown): Post {\n const r = asRecord(raw)\n return {\n id: str(r.id),\n content: str(r.content),\n channel: str(r.channel) || 'x',\n status: str(r.status) || 'draft',\n scheduleAt: num(r.scheduleAt),\n media: strs(r.media),\n accountId: str(r.accountId) || undefined,\n externalId: str(r.externalId) || undefined,\n error: str(r.error) || undefined,\n createdAt: num(r.createdAt),\n updatedAt: num(r.updatedAt),\n }\n}\n\nexport function normalizeSummary(raw: unknown): SocialSummary {\n const r = asRecord(raw)\n return { posts: num(r.posts), scheduled: num(r.scheduled), published: num(r.published), accounts: num(r.accounts) }\n}\n\nexport function normalizeProviderCapability(raw: unknown): ProviderCapability {\n const r = asRecord(raw)\n return {\n provider: str(r.provider),\n credentialsConfigured: Boolean(r.credentialsConfigured),\n missingCredentials: strs(r.missingCredentials),\n }\n}\n\nexport const normalizeAccounts = (p: unknown): Account[] => rows(p).map(normalizeAccount).filter((a) => a.id)\nexport const normalizePosts = (p: unknown): Post[] => rows(p).map(normalizePost).filter((x) => x.id)\nexport const normalizeProviders = (p: unknown): ProviderCapability[] =>\n rows(p).map(normalizeProviderCapability).filter((c) => c.provider)\n\n// ── The transport seam ──────────────────────────────────────────────────────\n\n/**\n * The host's REST transport. `path` is relative to `/v1/social` (no leading slash);\n * the host owns the origin, the credential and the error class. A rejected promise\n * is passed straight to `classifyBackend`, so any client's error type works.\n */\nexport type SocialRest = {\n get: (path: string) => Promise<unknown>\n post: (path: string, body?: unknown) => Promise<unknown>\n put: (path: string, body?: unknown) => Promise<unknown>\n del: (path: string) => Promise<void>\n}\n\nexport type SocialApi = ReturnType<typeof createSocialApi>\n\n/** Bind the `/v1/social` contract to a host transport. One method per documented route. */\nexport function createSocialApi(rest: SocialRest) {\n return {\n summary: (): Promise<SocialSummary> => rest.get('summary').then(normalizeSummary),\n\n /** Publish-readiness per network (+ the exact missing OAuth-app credentials). */\n providers: (): Promise<ProviderCapability[]> => rest.get('providers').then(normalizeProviders),\n\n accounts: {\n list: (provider?: string): Promise<Account[]> =>\n rest.get(`accounts${provider ? `?provider=${enc(provider)}` : ''}`).then(normalizeAccounts),\n get: (id: string): Promise<Account> => rest.get(`accounts/${enc(id)}`).then(normalizeAccount),\n create: (body: NewAccount): Promise<Account> => rest.post('accounts', body).then(normalizeAccount),\n update: (id: string, body: NewAccount): Promise<Account> =>\n rest.put(`accounts/${enc(id)}`, body).then(normalizeAccount),\n remove: (id: string): Promise<void> => rest.del(`accounts/${enc(id)}`),\n },\n\n posts: {\n list: (status?: string): Promise<Post[]> =>\n rest.get(`posts${status ? `?status=${enc(status)}` : ''}`).then(normalizePosts),\n get: (id: string): Promise<Post> => rest.get(`posts/${enc(id)}`).then(normalizePost),\n create: (body: NewPost): Promise<Post> => rest.post('posts', body).then(normalizePost),\n update: (id: string, body: NewPost): Promise<Post> => rest.put(`posts/${enc(id)}`, body).then(normalizePost),\n remove: (id: string): Promise<void> => rest.del(`posts/${enc(id)}`),\n /** Publish a post NOW to its channel's connected accounts. */\n publish: (id: string): Promise<Post> => rest.post(`posts/${enc(id)}/publish`).then(normalizePost),\n },\n }\n}\n"]}
|
package/dist/product/index.cjs
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkYBXVUV7P_cjs = require('../chunk-YBXVUV7P.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk5MBAHVEO_cjs = require('../chunk-5MBAHVEO.cjs');
|
|
6
|
+
var chunkMWBFAV3D_cjs = require('../chunk-MWBFAV3D.cjs');
|
|
6
7
|
var react = require('react');
|
|
7
8
|
var gui = require('@hanzo/gui');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -1605,14 +1606,14 @@ function CommerceResource({
|
|
|
1605
1606
|
loadRef.current = load;
|
|
1606
1607
|
const reload = react.useCallback(() => {
|
|
1607
1608
|
setState({ phase: "loading" });
|
|
1608
|
-
loadRef.current().then((r) => setState({ phase: "ready", data: r.rows })).catch((e) => setState({ phase: "error", error:
|
|
1609
|
+
loadRef.current().then((r) => setState({ phase: "ready", data: r.rows })).catch((e) => setState({ phase: "error", error: chunk5MBAHVEO_cjs.classifyBackend(e) }));
|
|
1609
1610
|
}, []);
|
|
1610
1611
|
react.useEffect(() => {
|
|
1611
1612
|
reload();
|
|
1612
1613
|
}, [reload]);
|
|
1613
1614
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1614
1615
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1615
|
-
|
|
1616
|
+
chunk5MBAHVEO_cjs.PageHeader,
|
|
1616
1617
|
{
|
|
1617
1618
|
title,
|
|
1618
1619
|
subtitle,
|
|
@@ -1622,8 +1623,8 @@ function CommerceResource({
|
|
|
1622
1623
|
] })
|
|
1623
1624
|
}
|
|
1624
1625
|
),
|
|
1625
|
-
state.phase === "error" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1626
|
-
|
|
1626
|
+
state.phase === "error" ? /* @__PURE__ */ jsxRuntime.jsx(chunk5MBAHVEO_cjs.BackendStateCard, { state: state.error, onRetry: reload, hint }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1627
|
+
chunk5MBAHVEO_cjs.DataTable,
|
|
1627
1628
|
{
|
|
1628
1629
|
columns,
|
|
1629
1630
|
rows: state.phase === "ready" ? state.data : [],
|
|
@@ -1649,7 +1650,7 @@ function ConfirmDelete({
|
|
|
1649
1650
|
await run();
|
|
1650
1651
|
onDone();
|
|
1651
1652
|
} catch (e) {
|
|
1652
|
-
setErr(
|
|
1653
|
+
setErr(chunk5MBAHVEO_cjs.classifyBackend(e).message || "Failed to delete.");
|
|
1653
1654
|
setBusy(false);
|
|
1654
1655
|
}
|
|
1655
1656
|
};
|
|
@@ -1900,7 +1901,7 @@ function ProductIcon({
|
|
|
1900
1901
|
justify: "center",
|
|
1901
1902
|
rounded: radius,
|
|
1902
1903
|
style: { backgroundColor: color },
|
|
1903
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: glyph, color:
|
|
1904
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: glyph, color: chunk5MBAHVEO_cjs.asColor("#ffffff") })
|
|
1904
1905
|
}
|
|
1905
1906
|
);
|
|
1906
1907
|
}
|
|
@@ -2194,205 +2195,205 @@ Object.defineProperty(exports, "ThemeToggleNext", {
|
|
|
2194
2195
|
enumerable: true,
|
|
2195
2196
|
get: function () { return chunkYBXVUV7P_cjs.ThemeToggleNext; }
|
|
2196
2197
|
});
|
|
2197
|
-
Object.defineProperty(exports, "ACCOUNT_STATUSES", {
|
|
2198
|
-
enumerable: true,
|
|
2199
|
-
get: function () { return chunkVGGGGXWS_cjs.ACCOUNT_STATUSES; }
|
|
2200
|
-
});
|
|
2201
2198
|
Object.defineProperty(exports, "BackendStateCard", {
|
|
2202
2199
|
enumerable: true,
|
|
2203
|
-
get: function () { return
|
|
2200
|
+
get: function () { return chunk5MBAHVEO_cjs.BackendStateCard; }
|
|
2204
2201
|
});
|
|
2205
2202
|
Object.defineProperty(exports, "COMPOSE_MODES", {
|
|
2206
2203
|
enumerable: true,
|
|
2207
|
-
get: function () { return
|
|
2204
|
+
get: function () { return chunk5MBAHVEO_cjs.COMPOSE_MODES; }
|
|
2208
2205
|
});
|
|
2209
2206
|
Object.defineProperty(exports, "CampaignCard", {
|
|
2210
2207
|
enumerable: true,
|
|
2211
|
-
get: function () { return
|
|
2208
|
+
get: function () { return chunk5MBAHVEO_cjs.CampaignCard; }
|
|
2212
2209
|
});
|
|
2213
2210
|
Object.defineProperty(exports, "ChannelBadge", {
|
|
2214
2211
|
enumerable: true,
|
|
2215
|
-
get: function () { return
|
|
2212
|
+
get: function () { return chunk5MBAHVEO_cjs.ChannelBadge; }
|
|
2216
2213
|
});
|
|
2217
2214
|
Object.defineProperty(exports, "DataTable", {
|
|
2218
2215
|
enumerable: true,
|
|
2219
|
-
get: function () { return
|
|
2216
|
+
get: function () { return chunk5MBAHVEO_cjs.DataTable; }
|
|
2220
2217
|
});
|
|
2221
2218
|
Object.defineProperty(exports, "EmptyState", {
|
|
2222
2219
|
enumerable: true,
|
|
2223
|
-
get: function () { return
|
|
2220
|
+
get: function () { return chunk5MBAHVEO_cjs.EmptyState; }
|
|
2224
2221
|
});
|
|
2225
2222
|
Object.defineProperty(exports, "FieldRow", {
|
|
2226
2223
|
enumerable: true,
|
|
2227
|
-
get: function () { return
|
|
2224
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldRow; }
|
|
2228
2225
|
});
|
|
2229
2226
|
Object.defineProperty(exports, "FieldSelect", {
|
|
2230
2227
|
enumerable: true,
|
|
2231
|
-
get: function () { return
|
|
2228
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldSelect; }
|
|
2232
2229
|
});
|
|
2233
2230
|
Object.defineProperty(exports, "FieldSlider", {
|
|
2234
2231
|
enumerable: true,
|
|
2235
|
-
get: function () { return
|
|
2232
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldSlider; }
|
|
2236
2233
|
});
|
|
2237
2234
|
Object.defineProperty(exports, "FieldSwitch", {
|
|
2238
2235
|
enumerable: true,
|
|
2239
|
-
get: function () { return
|
|
2236
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldSwitch; }
|
|
2240
2237
|
});
|
|
2241
2238
|
Object.defineProperty(exports, "FieldText", {
|
|
2242
2239
|
enumerable: true,
|
|
2243
|
-
get: function () { return
|
|
2240
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldText; }
|
|
2244
2241
|
});
|
|
2245
2242
|
Object.defineProperty(exports, "FieldTextArea", {
|
|
2246
2243
|
enumerable: true,
|
|
2247
|
-
get: function () { return
|
|
2244
|
+
get: function () { return chunk5MBAHVEO_cjs.FieldTextArea; }
|
|
2248
2245
|
});
|
|
2249
2246
|
Object.defineProperty(exports, "HostProvider", {
|
|
2250
2247
|
enumerable: true,
|
|
2251
|
-
get: function () { return
|
|
2252
|
-
});
|
|
2253
|
-
Object.defineProperty(exports, "POST_STATUSES", {
|
|
2254
|
-
enumerable: true,
|
|
2255
|
-
get: function () { return chunkVGGGGXWS_cjs.POST_STATUSES; }
|
|
2256
|
-
});
|
|
2257
|
-
Object.defineProperty(exports, "PROVIDERS", {
|
|
2258
|
-
enumerable: true,
|
|
2259
|
-
get: function () { return chunkVGGGGXWS_cjs.PROVIDERS; }
|
|
2248
|
+
get: function () { return chunk5MBAHVEO_cjs.HostProvider; }
|
|
2260
2249
|
});
|
|
2261
2250
|
Object.defineProperty(exports, "PageHeader", {
|
|
2262
2251
|
enumerable: true,
|
|
2263
|
-
get: function () { return
|
|
2252
|
+
get: function () { return chunk5MBAHVEO_cjs.PageHeader; }
|
|
2264
2253
|
});
|
|
2265
2254
|
Object.defineProperty(exports, "PostAgenda", {
|
|
2266
2255
|
enumerable: true,
|
|
2267
|
-
get: function () { return
|
|
2256
|
+
get: function () { return chunk5MBAHVEO_cjs.PostAgenda; }
|
|
2268
2257
|
});
|
|
2269
2258
|
Object.defineProperty(exports, "PostCard", {
|
|
2270
2259
|
enumerable: true,
|
|
2271
|
-
get: function () { return
|
|
2260
|
+
get: function () { return chunk5MBAHVEO_cjs.PostCard; }
|
|
2272
2261
|
});
|
|
2273
2262
|
Object.defineProperty(exports, "PostComposer", {
|
|
2274
2263
|
enumerable: true,
|
|
2275
|
-
get: function () { return
|
|
2264
|
+
get: function () { return chunk5MBAHVEO_cjs.PostComposer; }
|
|
2276
2265
|
});
|
|
2277
2266
|
Object.defineProperty(exports, "PrimaryButton", {
|
|
2278
2267
|
enumerable: true,
|
|
2279
|
-
get: function () { return
|
|
2268
|
+
get: function () { return chunk5MBAHVEO_cjs.PrimaryButton; }
|
|
2280
2269
|
});
|
|
2281
2270
|
Object.defineProperty(exports, "ProviderReadinessList", {
|
|
2282
2271
|
enumerable: true,
|
|
2283
|
-
get: function () { return
|
|
2272
|
+
get: function () { return chunk5MBAHVEO_cjs.ProviderReadinessList; }
|
|
2284
2273
|
});
|
|
2285
2274
|
Object.defineProperty(exports, "SLIDEOVER_LG", {
|
|
2286
2275
|
enumerable: true,
|
|
2287
|
-
get: function () { return
|
|
2276
|
+
get: function () { return chunk5MBAHVEO_cjs.LG; }
|
|
2288
2277
|
});
|
|
2289
2278
|
Object.defineProperty(exports, "SlideOver", {
|
|
2290
2279
|
enumerable: true,
|
|
2291
|
-
get: function () { return
|
|
2280
|
+
get: function () { return chunk5MBAHVEO_cjs.SlideOver; }
|
|
2292
2281
|
});
|
|
2293
2282
|
Object.defineProperty(exports, "SocialResource", {
|
|
2294
2283
|
enumerable: true,
|
|
2295
|
-
get: function () { return
|
|
2284
|
+
get: function () { return chunk5MBAHVEO_cjs.SocialResource; }
|
|
2296
2285
|
});
|
|
2297
2286
|
Object.defineProperty(exports, "SocialSummaryBar", {
|
|
2298
2287
|
enumerable: true,
|
|
2299
|
-
get: function () { return
|
|
2288
|
+
get: function () { return chunk5MBAHVEO_cjs.SocialSummaryBar; }
|
|
2300
2289
|
});
|
|
2301
2290
|
Object.defineProperty(exports, "StatusTag", {
|
|
2302
2291
|
enumerable: true,
|
|
2303
|
-
get: function () { return
|
|
2292
|
+
get: function () { return chunk5MBAHVEO_cjs.StatusTag; }
|
|
2304
2293
|
});
|
|
2305
2294
|
Object.defineProperty(exports, "ViewToggle", {
|
|
2306
2295
|
enumerable: true,
|
|
2307
|
-
get: function () { return
|
|
2296
|
+
get: function () { return chunk5MBAHVEO_cjs.ViewToggle; }
|
|
2308
2297
|
});
|
|
2309
2298
|
Object.defineProperty(exports, "accentFor", {
|
|
2310
2299
|
enumerable: true,
|
|
2311
|
-
get: function () { return
|
|
2300
|
+
get: function () { return chunk5MBAHVEO_cjs.accentFor; }
|
|
2312
2301
|
});
|
|
2313
2302
|
Object.defineProperty(exports, "asColor", {
|
|
2314
2303
|
enumerable: true,
|
|
2315
|
-
get: function () { return
|
|
2304
|
+
get: function () { return chunk5MBAHVEO_cjs.asColor; }
|
|
2316
2305
|
});
|
|
2317
2306
|
Object.defineProperty(exports, "classifyBackend", {
|
|
2318
2307
|
enumerable: true,
|
|
2319
|
-
get: function () { return
|
|
2308
|
+
get: function () { return chunk5MBAHVEO_cjs.classifyBackend; }
|
|
2320
2309
|
});
|
|
2321
2310
|
Object.defineProperty(exports, "classifyRead", {
|
|
2322
2311
|
enumerable: true,
|
|
2323
|
-
get: function () { return
|
|
2312
|
+
get: function () { return chunk5MBAHVEO_cjs.classifyRead; }
|
|
2324
2313
|
});
|
|
2325
2314
|
Object.defineProperty(exports, "contrastText", {
|
|
2326
2315
|
enumerable: true,
|
|
2327
|
-
get: function () { return
|
|
2328
|
-
});
|
|
2329
|
-
Object.defineProperty(exports, "createSocialApi", {
|
|
2330
|
-
enumerable: true,
|
|
2331
|
-
get: function () { return chunkVGGGGXWS_cjs.createSocialApi; }
|
|
2316
|
+
get: function () { return chunk5MBAHVEO_cjs.contrastText; }
|
|
2332
2317
|
});
|
|
2333
2318
|
Object.defineProperty(exports, "formatPostTime", {
|
|
2334
2319
|
enumerable: true,
|
|
2335
|
-
get: function () { return
|
|
2320
|
+
get: function () { return chunk5MBAHVEO_cjs.formatPostTime; }
|
|
2336
2321
|
});
|
|
2337
2322
|
Object.defineProperty(exports, "isHexColor", {
|
|
2338
2323
|
enumerable: true,
|
|
2339
|
-
get: function () { return
|
|
2324
|
+
get: function () { return chunk5MBAHVEO_cjs.isHexColor; }
|
|
2340
2325
|
});
|
|
2341
|
-
Object.defineProperty(exports, "
|
|
2326
|
+
Object.defineProperty(exports, "parsePostTime", {
|
|
2342
2327
|
enumerable: true,
|
|
2343
|
-
get: function () { return
|
|
2328
|
+
get: function () { return chunk5MBAHVEO_cjs.parsePostTime; }
|
|
2344
2329
|
});
|
|
2345
|
-
Object.defineProperty(exports, "
|
|
2330
|
+
Object.defineProperty(exports, "postDayBucket", {
|
|
2346
2331
|
enumerable: true,
|
|
2347
|
-
get: function () { return
|
|
2332
|
+
get: function () { return chunk5MBAHVEO_cjs.postDayBucket; }
|
|
2348
2333
|
});
|
|
2349
|
-
Object.defineProperty(exports, "
|
|
2334
|
+
Object.defineProperty(exports, "postPreview", {
|
|
2350
2335
|
enumerable: true,
|
|
2351
|
-
get: function () { return
|
|
2336
|
+
get: function () { return chunk5MBAHVEO_cjs.postPreview; }
|
|
2352
2337
|
});
|
|
2353
|
-
Object.defineProperty(exports, "
|
|
2338
|
+
Object.defineProperty(exports, "resolveAccent", {
|
|
2354
2339
|
enumerable: true,
|
|
2355
|
-
get: function () { return
|
|
2340
|
+
get: function () { return chunk5MBAHVEO_cjs.resolveAccent; }
|
|
2356
2341
|
});
|
|
2357
|
-
Object.defineProperty(exports, "
|
|
2342
|
+
Object.defineProperty(exports, "setOrgAccent", {
|
|
2358
2343
|
enumerable: true,
|
|
2359
|
-
get: function () { return
|
|
2344
|
+
get: function () { return chunk5MBAHVEO_cjs.setOrgAccent; }
|
|
2360
2345
|
});
|
|
2361
|
-
Object.defineProperty(exports, "
|
|
2346
|
+
Object.defineProperty(exports, "useAccent", {
|
|
2362
2347
|
enumerable: true,
|
|
2363
|
-
get: function () { return
|
|
2348
|
+
get: function () { return chunk5MBAHVEO_cjs.useAccent; }
|
|
2364
2349
|
});
|
|
2365
|
-
Object.defineProperty(exports, "
|
|
2350
|
+
Object.defineProperty(exports, "useHost", {
|
|
2366
2351
|
enumerable: true,
|
|
2367
|
-
get: function () { return
|
|
2352
|
+
get: function () { return chunk5MBAHVEO_cjs.useHost; }
|
|
2368
2353
|
});
|
|
2369
|
-
Object.defineProperty(exports, "
|
|
2354
|
+
Object.defineProperty(exports, "ACCOUNT_STATUSES", {
|
|
2370
2355
|
enumerable: true,
|
|
2371
|
-
get: function () { return
|
|
2356
|
+
get: function () { return chunkMWBFAV3D_cjs.ACCOUNT_STATUSES; }
|
|
2372
2357
|
});
|
|
2373
|
-
Object.defineProperty(exports, "
|
|
2358
|
+
Object.defineProperty(exports, "POST_STATUSES", {
|
|
2374
2359
|
enumerable: true,
|
|
2375
|
-
get: function () { return
|
|
2360
|
+
get: function () { return chunkMWBFAV3D_cjs.POST_STATUSES; }
|
|
2376
2361
|
});
|
|
2377
|
-
Object.defineProperty(exports, "
|
|
2362
|
+
Object.defineProperty(exports, "PROVIDERS", {
|
|
2378
2363
|
enumerable: true,
|
|
2379
|
-
get: function () { return
|
|
2364
|
+
get: function () { return chunkMWBFAV3D_cjs.PROVIDERS; }
|
|
2380
2365
|
});
|
|
2381
|
-
Object.defineProperty(exports, "
|
|
2366
|
+
Object.defineProperty(exports, "createSocialApi", {
|
|
2382
2367
|
enumerable: true,
|
|
2383
|
-
get: function () { return
|
|
2368
|
+
get: function () { return chunkMWBFAV3D_cjs.createSocialApi; }
|
|
2384
2369
|
});
|
|
2385
|
-
Object.defineProperty(exports, "
|
|
2370
|
+
Object.defineProperty(exports, "normalizeAccount", {
|
|
2386
2371
|
enumerable: true,
|
|
2387
|
-
get: function () { return
|
|
2372
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizeAccount; }
|
|
2388
2373
|
});
|
|
2389
|
-
Object.defineProperty(exports, "
|
|
2374
|
+
Object.defineProperty(exports, "normalizeAccounts", {
|
|
2390
2375
|
enumerable: true,
|
|
2391
|
-
get: function () { return
|
|
2376
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizeAccounts; }
|
|
2392
2377
|
});
|
|
2393
|
-
Object.defineProperty(exports, "
|
|
2378
|
+
Object.defineProperty(exports, "normalizePost", {
|
|
2379
|
+
enumerable: true,
|
|
2380
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizePost; }
|
|
2381
|
+
});
|
|
2382
|
+
Object.defineProperty(exports, "normalizePosts", {
|
|
2383
|
+
enumerable: true,
|
|
2384
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizePosts; }
|
|
2385
|
+
});
|
|
2386
|
+
Object.defineProperty(exports, "normalizeProviderCapability", {
|
|
2387
|
+
enumerable: true,
|
|
2388
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizeProviderCapability; }
|
|
2389
|
+
});
|
|
2390
|
+
Object.defineProperty(exports, "normalizeProviders", {
|
|
2391
|
+
enumerable: true,
|
|
2392
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizeProviders; }
|
|
2393
|
+
});
|
|
2394
|
+
Object.defineProperty(exports, "normalizeSummary", {
|
|
2394
2395
|
enumerable: true,
|
|
2395
|
-
get: function () { return
|
|
2396
|
+
get: function () { return chunkMWBFAV3D_cjs.normalizeSummary; }
|
|
2396
2397
|
});
|
|
2397
2398
|
Object.defineProperty(exports, "CustomModelMark", {
|
|
2398
2399
|
enumerable: true,
|