@cellarnode/ui 0.187.0 → 0.188.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/brand/brand-assets-api.d.ts +58 -0
- package/dist/brand/brand-assets-api.d.ts.map +1 -0
- package/dist/brand/brand-assets-api.js +160 -0
- package/dist/brand/brand-assets-api.js.map +1 -0
- package/dist/brand/brand-generation-client.d.ts +8 -0
- package/dist/brand/brand-generation-client.d.ts.map +1 -1
- package/dist/brand/brand-generation-client.js +1 -1
- package/dist/brand/brand-generation-client.js.map +1 -1
- package/dist/brand/brand-generation-start.d.ts +49 -0
- package/dist/brand/brand-generation-start.d.ts.map +1 -0
- package/dist/brand/brand-generation-start.js +48 -0
- package/dist/brand/brand-generation-start.js.map +1 -0
- package/dist/brand/brand-image-chooser.d.ts +3 -1
- package/dist/brand/brand-image-chooser.d.ts.map +1 -1
- package/dist/brand/brand-image-chooser.js +7 -1
- package/dist/brand/brand-image-chooser.js.map +1 -1
- package/dist/brand/brand-image-choosers.d.ts +37 -0
- package/dist/brand/brand-image-choosers.d.ts.map +1 -0
- package/dist/brand/brand-image-choosers.js +76 -0
- package/dist/brand/brand-image-choosers.js.map +1 -0
- package/dist/brand/brand-workspace-change-notice.d.ts +20 -0
- package/dist/brand/brand-workspace-change-notice.d.ts.map +1 -0
- package/dist/brand/brand-workspace-change-notice.js +19 -0
- package/dist/brand/brand-workspace-change-notice.js.map +1 -0
- package/dist/brand/index.d.ts +17 -0
- package/dist/brand/index.d.ts.map +1 -1
- package/dist/brand/index.js +14 -0
- package/dist/brand/index.js.map +1 -1
- package/dist/brand/use-brand-image-operation-result.d.ts +43 -0
- package/dist/brand/use-brand-image-operation-result.d.ts.map +1 -0
- package/dist/brand/use-brand-image-operation-result.js +162 -0
- package/dist/brand/use-brand-image-operation-result.js.map +1 -0
- package/dist/brand/use-brand-profile-acceptance.d.ts +38 -0
- package/dist/brand/use-brand-profile-acceptance.d.ts.map +1 -0
- package/dist/brand/use-brand-profile-acceptance.js +84 -0
- package/dist/brand/use-brand-profile-acceptance.js.map +1 -0
- package/dist/brand/use-brand-public-visibility.d.ts +59 -0
- package/dist/brand/use-brand-public-visibility.d.ts.map +1 -0
- package/dist/brand/use-brand-public-visibility.js +69 -0
- package/dist/brand/use-brand-public-visibility.js.map +1 -0
- package/dist/brand/use-brand-workspace-concurrency.d.ts +132 -0
- package/dist/brand/use-brand-workspace-concurrency.d.ts.map +1 -0
- package/dist/brand/use-brand-workspace-concurrency.js +255 -0
- package/dist/brand/use-brand-workspace-concurrency.js.map +1 -0
- package/dist/brand/use-brand-workspace-image-candidates.d.ts +19 -0
- package/dist/brand/use-brand-workspace-image-candidates.d.ts.map +1 -0
- package/dist/brand/use-brand-workspace-image-candidates.js +39 -0
- package/dist/brand/use-brand-workspace-image-candidates.js.map +1 -0
- package/dist/moderation/moderation-event.d.ts +2 -0
- package/dist/moderation/moderation-event.d.ts.map +1 -1
- package/dist/moderation/moderation-event.js +7 -0
- package/dist/moderation/moderation-event.js.map +1 -1
- package/dist/moderation/moderation-store.d.ts.map +1 -1
- package/dist/moderation/moderation-store.js +4 -2
- package/dist/moderation/moderation-store.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-public-visibility.d.ts","sourceRoot":"","sources":["../../src/brand/use-brand-public-visibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ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C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC9D,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACnD;AAQD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAmElD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
function defaultIsConflict(error) {
|
|
3
|
+
if (error === null || typeof error !== "object")
|
|
4
|
+
return false;
|
|
5
|
+
const code = error.code;
|
|
6
|
+
return code === "REVISION_CONFLICT" || code === "TARGET_MISMATCH";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* CEL-2127 — the public-visibility toggle handler for the brand workspace.
|
|
10
|
+
* One in-flight write per org+field; refuses while a reload is required or a
|
|
11
|
+
* profile write is pending; a CAS conflict marks the server as changed rather
|
|
12
|
+
* than retrying (the user must see the latest values first).
|
|
13
|
+
*/
|
|
14
|
+
export function useBrandPublicVisibility(options) {
|
|
15
|
+
const pendingKeysRef = useRef(new Set());
|
|
16
|
+
const optionsRef = useRef(options);
|
|
17
|
+
optionsRef.current = options;
|
|
18
|
+
return (field, next) => {
|
|
19
|
+
const { orgId, api, profile, generatedDraftProfile, requiresReload, profileWritePending, onConflict, onOwnWrite, notify, isConflict = defaultIsConflict, } = optionsRef.current;
|
|
20
|
+
const reviewed = generatedDraftProfile ?? profile;
|
|
21
|
+
if (!orgId || !reviewed)
|
|
22
|
+
return;
|
|
23
|
+
if (requiresReload) {
|
|
24
|
+
notify?.({ kind: "reload-before-saving" });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (profileWritePending) {
|
|
28
|
+
notify?.({ kind: "wait-for-save" });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const pendingKey = `${orgId}:${field}`;
|
|
32
|
+
// Results of a write started in org A must never act in org B.
|
|
33
|
+
const stillCurrent = () => optionsRef.current.orgId === orgId;
|
|
34
|
+
if (pendingKeysRef.current.has(pendingKey))
|
|
35
|
+
return;
|
|
36
|
+
pendingKeysRef.current.add(pendingKey);
|
|
37
|
+
const target = generatedDraftProfile ? "draft" : "approved";
|
|
38
|
+
let attempt;
|
|
39
|
+
try {
|
|
40
|
+
attempt = api.save({
|
|
41
|
+
expectedProfileId: reviewed.id,
|
|
42
|
+
expectedStatus: reviewed.status,
|
|
43
|
+
expectedRevision: reviewed.revision ?? undefined,
|
|
44
|
+
publicVisibility: { [field]: next },
|
|
45
|
+
}, target);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
attempt = Promise.reject(error);
|
|
49
|
+
}
|
|
50
|
+
void attempt
|
|
51
|
+
.then((saved) => {
|
|
52
|
+
if (stillCurrent())
|
|
53
|
+
onOwnWrite?.(saved ?? undefined);
|
|
54
|
+
}, (error) => {
|
|
55
|
+
if (!stillCurrent())
|
|
56
|
+
return;
|
|
57
|
+
if (isConflict(error)) {
|
|
58
|
+
onConflict();
|
|
59
|
+
notify?.({ kind: "reload-before-saving" });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
notify?.({ kind: "save-failed" });
|
|
63
|
+
})
|
|
64
|
+
.finally(() => {
|
|
65
|
+
pendingKeysRef.current.delete(pendingKey);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=use-brand-public-visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-public-visibility.js","sourceR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CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { BrandProfileConflict } from "./brand-profile-form.js";
|
|
2
|
+
/**
|
|
3
|
+
* CEL-2127 — the ONE implementation of brand-workspace write concurrency.
|
|
4
|
+
*
|
|
5
|
+
* It owns what producer's `BrandContentController` and importer's
|
|
6
|
+
* `BrandProfileContent` each did by hand, with producer's semantics:
|
|
7
|
+
*
|
|
8
|
+
* - `409 REVISION_CONFLICT` surfaces as {@link UseBrandWorkspaceConcurrencyResult.conflict}
|
|
9
|
+
* on the form. The user then chooses, explicitly:
|
|
10
|
+
* - **reload** re-reads the server and remounts the form on the fresh values
|
|
11
|
+
* (the form key changes, so nothing of the stale edit survives);
|
|
12
|
+
* - **keep mine** re-submits the SAME sparse patch against the revision the
|
|
13
|
+
* conflict reported. It only ever runs from that explicit user action,
|
|
14
|
+
* never automatically, and the server still compare-and-swaps it, so a
|
|
15
|
+
* third write in between conflicts again instead of being overwritten.
|
|
16
|
+
* - `409 TARGET_MISMATCH` (the row this edit targeted is no longer the current
|
|
17
|
+
* target, e.g. the draft was approved elsewhere) has no revision to retry
|
|
18
|
+
* with: it reloads and closes the editor, and shows the change notice if
|
|
19
|
+
* that reload fails.
|
|
20
|
+
* - A server revision that moves underneath an open workspace, and is not our
|
|
21
|
+
* own write, raises `serverChanged` (render {@link BrandWorkspaceChangeNotice}).
|
|
22
|
+
*
|
|
23
|
+
* The data layer is injected: the hook never imports a client.
|
|
24
|
+
*/
|
|
25
|
+
/** What the hook needs to know about the profile the workspace is editing. */
|
|
26
|
+
export interface BrandWorkspaceSnapshot {
|
|
27
|
+
readonly id?: string | null;
|
|
28
|
+
readonly revision?: number | null;
|
|
29
|
+
readonly version?: number | null;
|
|
30
|
+
readonly updatedAt?: string | null;
|
|
31
|
+
readonly status?: string | null;
|
|
32
|
+
readonly profileData?: unknown;
|
|
33
|
+
}
|
|
34
|
+
export type BrandWorkspaceTarget = "approved" | "draft";
|
|
35
|
+
/** The parts of a write body the hook reads or rewrites. */
|
|
36
|
+
export interface BrandWorkspaceWriteBody {
|
|
37
|
+
expectedRevision?: number;
|
|
38
|
+
}
|
|
39
|
+
/** How a failed save is classified. {@link classifyBrandProfileApiError} is the default. */
|
|
40
|
+
export type BrandWorkspaceSaveFailure = {
|
|
41
|
+
readonly kind: "revision-conflict";
|
|
42
|
+
readonly currentRevision: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "target-mismatch";
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "validation";
|
|
47
|
+
readonly fieldErrors: Readonly<Record<string, string>>;
|
|
48
|
+
} | {
|
|
49
|
+
readonly kind: "other";
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Duck-typed classifier for the brand-profile API error both dashboards use
|
|
53
|
+
* (`status`, `code`, `currentRevision`, `fieldErrors`). It deliberately does
|
|
54
|
+
* not `instanceof` a consumer class, so one classifier serves every client.
|
|
55
|
+
*/
|
|
56
|
+
export declare function classifyBrandProfileApiError(error: unknown): BrandWorkspaceSaveFailure;
|
|
57
|
+
/** Events the consumer turns into its own (translated) toast. The hook has no strings. */
|
|
58
|
+
export type BrandWorkspaceEvent = {
|
|
59
|
+
readonly kind: "saved";
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: "save-failed";
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: "target-mismatch";
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: "reload-failed";
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: "reload-before-saving";
|
|
68
|
+
} | {
|
|
69
|
+
readonly kind: "wait-for-save";
|
|
70
|
+
};
|
|
71
|
+
export interface UseBrandWorkspaceConcurrencyOptions<TBody extends BrandWorkspaceWriteBody> {
|
|
72
|
+
readonly orgId: string;
|
|
73
|
+
/** The profile (approved or generated draft) the workspace is editing. */
|
|
74
|
+
readonly workspaceProfile: BrandWorkspaceSnapshot | null | undefined;
|
|
75
|
+
/** Whether a form is open on `workspaceProfile`; changes only matter then. */
|
|
76
|
+
readonly workspaceVisible: boolean;
|
|
77
|
+
/** Any write of this workspace in flight (save, visibility, approve, discard). */
|
|
78
|
+
readonly localWritePending: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Performs the write. Resolve with the saved profile. Its `revision` is
|
|
81
|
+
* REQUIRED for exact own-write detection: the refetch is "ours" only when
|
|
82
|
+
* the profile's revision equals it; without a revision the refetch raises
|
|
83
|
+
* the change notice (a safe false positive, never a swallowed remote edit).
|
|
84
|
+
* Reject with the transport error.
|
|
85
|
+
*/
|
|
86
|
+
readonly save: (body: TBody, target: BrandWorkspaceTarget) => Promise<{
|
|
87
|
+
readonly revision?: number | null;
|
|
88
|
+
} | null | undefined | void>;
|
|
89
|
+
/**
|
|
90
|
+
* Forces a re-read of everything the workspace derives from. MUST reject on
|
|
91
|
+
* failure so a failed reload never unlocks writes against a stale target.
|
|
92
|
+
* Resolve with the fresh workspace profile when known: it becomes the
|
|
93
|
+
* baseline, so the re-read is not reported back as a remote change.
|
|
94
|
+
*/
|
|
95
|
+
readonly reload: () => Promise<BrandWorkspaceSnapshot | null | undefined | void>;
|
|
96
|
+
readonly classifyError?: (error: unknown) => BrandWorkspaceSaveFailure;
|
|
97
|
+
/** Called after a successful save (close the editor here). */
|
|
98
|
+
readonly onSaved?: () => void;
|
|
99
|
+
/** Called after a successful reload; `closeEditor` is true for conflict resolution. */
|
|
100
|
+
readonly onReloaded?: (info: {
|
|
101
|
+
readonly closeEditor: boolean;
|
|
102
|
+
}) => void;
|
|
103
|
+
readonly notify?: (event: BrandWorkspaceEvent) => void;
|
|
104
|
+
}
|
|
105
|
+
export interface UseBrandWorkspaceConcurrencyResult<TBody extends BrandWorkspaceWriteBody> {
|
|
106
|
+
/** Pass to `BrandProfileForm`/`BrandProfileWorkspace`/`BrandGenerationSurface`. */
|
|
107
|
+
readonly conflict: BrandProfileConflict | null;
|
|
108
|
+
readonly fieldErrors: Readonly<Record<string, string>> | undefined;
|
|
109
|
+
/** The server changed underneath an open workspace; render the change notice. */
|
|
110
|
+
readonly serverChanged: boolean;
|
|
111
|
+
readonly reloadPending: boolean;
|
|
112
|
+
/** True while a write must wait for the user to reload (changed, reloading or conflicted). */
|
|
113
|
+
readonly requiresReload: boolean;
|
|
114
|
+
/** Pass as `key` on the form: it changes on every successful reload, remounting on fresh values. */
|
|
115
|
+
readonly workspaceKey: string;
|
|
116
|
+
/** Guarded submit: refuses while a reload is required or a write is pending. */
|
|
117
|
+
readonly submit: (body: TBody, target: BrandWorkspaceTarget) => void;
|
|
118
|
+
/** Conflict action: discard local edits, reload, close the editor. */
|
|
119
|
+
readonly reloadConflict: () => void;
|
|
120
|
+
/** Conflict action: deliberately re-submit the last patch against the reported revision. */
|
|
121
|
+
readonly keepMine: () => void;
|
|
122
|
+
/** Change-notice action: reload and keep the editor open. */
|
|
123
|
+
readonly reloadLatest: () => void;
|
|
124
|
+
/** Record a write made OUTSIDE `submit` (e.g. visibility) so its refetch is not a remote change. */
|
|
125
|
+
readonly noteOwnWrite: (saved: {
|
|
126
|
+
readonly revision?: number | null;
|
|
127
|
+
} | null | undefined) => void;
|
|
128
|
+
/** Mark the server as changed (e.g. a visibility write hit a conflict). */
|
|
129
|
+
readonly markServerChanged: () => void;
|
|
130
|
+
}
|
|
131
|
+
export declare function useBrandWorkspaceConcurrency<TBody extends BrandWorkspaceWriteBody>(options: UseBrandWorkspaceConcurrencyOptions<TBody>): UseBrandWorkspaceConcurrencyResult<TBody>;
|
|
132
|
+
//# sourceMappingURL=use-brand-workspace-concurrency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-workspace-concurrency.d.ts","sourceRoot":"","sources":["../../src/brand/use-brand-workspace-concurrency.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,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|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { mapBrandBackendFieldErrors } from "./brand-profile-form-field-errors.js";
|
|
3
|
+
import { useOrgScopedState } from "./use-org-scoped-state.js";
|
|
4
|
+
/**
|
|
5
|
+
* Duck-typed classifier for the brand-profile API error both dashboards use
|
|
6
|
+
* (`status`, `code`, `currentRevision`, `fieldErrors`). It deliberately does
|
|
7
|
+
* not `instanceof` a consumer class, so one classifier serves every client.
|
|
8
|
+
*/
|
|
9
|
+
export function classifyBrandProfileApiError(error) {
|
|
10
|
+
if (error === null || typeof error !== "object")
|
|
11
|
+
return { kind: "other" };
|
|
12
|
+
const e = error;
|
|
13
|
+
if (e.code === "TARGET_MISMATCH")
|
|
14
|
+
return { kind: "target-mismatch" };
|
|
15
|
+
if (e.code === "REVISION_CONFLICT" && typeof e.currentRevision === "number") {
|
|
16
|
+
return { kind: "revision-conflict", currentRevision: e.currentRevision };
|
|
17
|
+
}
|
|
18
|
+
if (e.status === 422 &&
|
|
19
|
+
e.code === "VALIDATION_ERROR" &&
|
|
20
|
+
e.fieldErrors !== null &&
|
|
21
|
+
typeof e.fieldErrors === "object") {
|
|
22
|
+
return { kind: "validation", fieldErrors: e.fieldErrors };
|
|
23
|
+
}
|
|
24
|
+
return { kind: "other" };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The fields whose movement means "the server changed".
|
|
28
|
+
*
|
|
29
|
+
* `version` is included on purpose. `revision` is the compare-and-swap counter
|
|
30
|
+
* of writes to the row, `version` the profile's own content version (importer
|
|
31
|
+
* keyed on it; producer did not). A server-side change that bumps `version`
|
|
32
|
+
* without a matching `revision` (a regeneration or backfill) still replaces
|
|
33
|
+
* what the form is showing, so it must raise the notice. It cannot cause a
|
|
34
|
+
* false positive for our own write: that is matched on `revision` before this
|
|
35
|
+
* key is consulted, and both move together on a normal save.
|
|
36
|
+
*/
|
|
37
|
+
function snapshotKey(orgId, profile) {
|
|
38
|
+
return JSON.stringify({
|
|
39
|
+
orgId,
|
|
40
|
+
id: profile?.id ?? null,
|
|
41
|
+
revision: profile?.revision ?? null,
|
|
42
|
+
version: profile?.version ?? null,
|
|
43
|
+
updatedAt: profile?.updatedAt ?? null,
|
|
44
|
+
status: profile?.status ?? null,
|
|
45
|
+
profileData: profile?.profileData ?? null,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function useBrandWorkspaceConcurrency(options) {
|
|
49
|
+
const { orgId, workspaceProfile, workspaceVisible, localWritePending } = options;
|
|
50
|
+
const optionsRef = useRef(options);
|
|
51
|
+
optionsRef.current = options;
|
|
52
|
+
const orgIdRef = useRef(orgId);
|
|
53
|
+
orgIdRef.current = orgId;
|
|
54
|
+
const [conflict, setConflict] = useOrgScopedState(orgId, null);
|
|
55
|
+
const [fieldErrors, setFieldErrors] = useOrgScopedState(orgId, undefined);
|
|
56
|
+
const [serverChanged, setServerChanged] = useOrgScopedState(orgId, false);
|
|
57
|
+
const [reloadKey, , updateReloadKey] = useOrgScopedState(orgId, 0);
|
|
58
|
+
// Every piece of state below is scoped to `orgId`: switching org mid-reload
|
|
59
|
+
// or mid-write must not leak a pending flag, a retry patch or an own-write
|
|
60
|
+
// marker from one org into the next.
|
|
61
|
+
const [reloadPending, setReloadPending] = useOrgScopedState(orgId, false);
|
|
62
|
+
const reloadingOrgRef = useRef(null);
|
|
63
|
+
// A conflict retry reuses the exact sparse patch the user submitted.
|
|
64
|
+
// Recomputing it against a refetched profile could turn untouched, stale
|
|
65
|
+
// form values into writes.
|
|
66
|
+
const lastSubmitRef = useRef(null);
|
|
67
|
+
const currentKey = snapshotKey(orgId, workspaceProfile);
|
|
68
|
+
const observedRef = useRef({ orgId, key: currentKey });
|
|
69
|
+
// Own-write detection is EXACT. A write of our own bumps the revision, and
|
|
70
|
+
// the mutation settles before (or after) the refetched read lands, so the
|
|
71
|
+
// bump must not read as a remote change. The write reports the revision it
|
|
72
|
+
// produced; a server change is "own" only when the profile's revision equals
|
|
73
|
+
// it. Any other revision (a remote edit, including one that lands while our
|
|
74
|
+
// write is still in flight) raises the change notice. Until the write has
|
|
75
|
+
// reported its revision the observed baseline is NOT advanced, so nothing
|
|
76
|
+
// that arrives meanwhile is swallowed.
|
|
77
|
+
const ownWriteRef = useRef(null);
|
|
78
|
+
// The org whose write is in flight (org-scoped like the rest of the state).
|
|
79
|
+
const writeInFlightOrgRef = useRef(null);
|
|
80
|
+
const writeInFlight = () => writeInFlightOrgRef.current === orgIdRef.current;
|
|
81
|
+
const [settledTick, setSettledTick] = useState(0);
|
|
82
|
+
const noteOwnWrite = useCallback((saved) => {
|
|
83
|
+
ownWriteRef.current = { orgId: orgIdRef.current, revision: saved?.revision ?? null };
|
|
84
|
+
setSettledTick((tick) => tick + 1);
|
|
85
|
+
}, []);
|
|
86
|
+
const currentRevision = workspaceProfile?.revision ?? null;
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const observed = observedRef.current;
|
|
89
|
+
if (observed.orgId !== orgId || !workspaceVisible) {
|
|
90
|
+
observedRef.current = { orgId, key: currentKey };
|
|
91
|
+
ownWriteRef.current = null;
|
|
92
|
+
setServerChanged(false);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (observed.key === currentKey)
|
|
96
|
+
return;
|
|
97
|
+
const own = ownWriteRef.current;
|
|
98
|
+
if (own && own.orgId === orgId && own.revision !== null && own.revision === currentRevision) {
|
|
99
|
+
observedRef.current = { orgId, key: currentKey };
|
|
100
|
+
ownWriteRef.current = null;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// A write is still settling and has not reported its revision: decide once
|
|
104
|
+
// it has (this effect re-runs on `settledTick` and `localWritePending`).
|
|
105
|
+
if (localWritePending || writeInFlightOrgRef.current === orgId)
|
|
106
|
+
return;
|
|
107
|
+
observedRef.current = { orgId, key: currentKey };
|
|
108
|
+
setServerChanged(true);
|
|
109
|
+
}, [
|
|
110
|
+
currentKey,
|
|
111
|
+
currentRevision,
|
|
112
|
+
localWritePending,
|
|
113
|
+
orgId,
|
|
114
|
+
setServerChanged,
|
|
115
|
+
settledTick,
|
|
116
|
+
workspaceVisible,
|
|
117
|
+
]);
|
|
118
|
+
const notify = (event) => optionsRef.current.notify?.(event);
|
|
119
|
+
const reloadWorkspace = async (closeEditor) => {
|
|
120
|
+
const startedOrg = orgIdRef.current;
|
|
121
|
+
if (reloadingOrgRef.current === startedOrg)
|
|
122
|
+
return;
|
|
123
|
+
reloadingOrgRef.current = startedOrg;
|
|
124
|
+
setReloadPending(true);
|
|
125
|
+
try {
|
|
126
|
+
const fresh = await optionsRef.current.reload();
|
|
127
|
+
if (orgIdRef.current !== startedOrg)
|
|
128
|
+
return;
|
|
129
|
+
setConflict(null);
|
|
130
|
+
setFieldErrors(undefined);
|
|
131
|
+
lastSubmitRef.current = null;
|
|
132
|
+
// The freshly read profile is the new baseline: its arrival is the
|
|
133
|
+
// reload itself, not a remote change.
|
|
134
|
+
if (fresh)
|
|
135
|
+
observedRef.current = { orgId: startedOrg, key: snapshotKey(startedOrg, fresh) };
|
|
136
|
+
optionsRef.current.onReloaded?.({ closeEditor });
|
|
137
|
+
updateReloadKey((current) => current + 1);
|
|
138
|
+
setServerChanged(false);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
if (orgIdRef.current === startedOrg)
|
|
142
|
+
notify({ kind: "reload-failed" });
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
if (reloadingOrgRef.current === startedOrg)
|
|
146
|
+
reloadingOrgRef.current = null;
|
|
147
|
+
setReloadPending(false);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const perform = (body, target) => {
|
|
151
|
+
const startedOrg = orgIdRef.current;
|
|
152
|
+
setConflict(null);
|
|
153
|
+
setFieldErrors(undefined);
|
|
154
|
+
lastSubmitRef.current = { orgId: startedOrg, body, target };
|
|
155
|
+
writeInFlightOrgRef.current = startedOrg;
|
|
156
|
+
const classify = optionsRef.current.classifyError ?? classifyBrandProfileApiError;
|
|
157
|
+
let attempt;
|
|
158
|
+
try {
|
|
159
|
+
attempt = optionsRef.current.save(body, target);
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
attempt = Promise.reject(error);
|
|
163
|
+
}
|
|
164
|
+
void attempt.then((saved) => {
|
|
165
|
+
// Clear only the guard of the org that started this write.
|
|
166
|
+
if (writeInFlightOrgRef.current === startedOrg)
|
|
167
|
+
writeInFlightOrgRef.current = null;
|
|
168
|
+
if (orgIdRef.current !== startedOrg) {
|
|
169
|
+
setSettledTick((tick) => tick + 1);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
noteOwnWrite(saved ?? undefined);
|
|
173
|
+
setConflict(null);
|
|
174
|
+
setFieldErrors(undefined);
|
|
175
|
+
notify({ kind: "saved" });
|
|
176
|
+
optionsRef.current.onSaved?.();
|
|
177
|
+
}, (error) => {
|
|
178
|
+
// Clear only the guard of the org that started this write.
|
|
179
|
+
if (writeInFlightOrgRef.current === startedOrg)
|
|
180
|
+
writeInFlightOrgRef.current = null;
|
|
181
|
+
setSettledTick((tick) => tick + 1);
|
|
182
|
+
if (orgIdRef.current !== startedOrg)
|
|
183
|
+
return;
|
|
184
|
+
const failure = classify(error);
|
|
185
|
+
if (failure.kind === "revision-conflict") {
|
|
186
|
+
// Keep the form open on its current (unsaved) values: the user
|
|
187
|
+
// decides reload vs keep-mine, nothing is discarded yet.
|
|
188
|
+
setConflict({ code: "REVISION_CONFLICT", currentRevision: failure.currentRevision });
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (failure.kind === "target-mismatch") {
|
|
192
|
+
// There is no revision to retry with: this can only be resolved by
|
|
193
|
+
// reloading, so do exactly that and show the real current state.
|
|
194
|
+
notify({ kind: "target-mismatch" });
|
|
195
|
+
setServerChanged(true);
|
|
196
|
+
void reloadWorkspace(true);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (failure.kind === "validation") {
|
|
200
|
+
setFieldErrors(failure.fieldErrors);
|
|
201
|
+
// Pointers the form cannot place on a control still land in its
|
|
202
|
+
// form-level summary; the toast covers the case it cannot.
|
|
203
|
+
if (mapBrandBackendFieldErrors(failure.fieldErrors).length !==
|
|
204
|
+
Object.keys(failure.fieldErrors).length)
|
|
205
|
+
notify({ kind: "save-failed" });
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
notify({ kind: "save-failed" });
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
const submit = (body, target) => {
|
|
212
|
+
if (serverChanged || reloadPending || reloadingOrgRef.current === orgIdRef.current) {
|
|
213
|
+
notify({ kind: "reload-before-saving" });
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
// `writeInFlightOrgRef` is synchronous: a second submit in the same render
|
|
217
|
+
// (before `localWritePending` can reflect the first) must not double-fire.
|
|
218
|
+
if (localWritePending || writeInFlight()) {
|
|
219
|
+
notify({ kind: "wait-for-save" });
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
perform(body, target);
|
|
223
|
+
};
|
|
224
|
+
const keepMine = () => {
|
|
225
|
+
const last = lastSubmitRef.current;
|
|
226
|
+
if (!last || last.orgId !== orgIdRef.current || !conflict)
|
|
227
|
+
return;
|
|
228
|
+
if (reloadPending || localWritePending || writeInFlight())
|
|
229
|
+
return;
|
|
230
|
+
if (reloadingOrgRef.current === orgIdRef.current)
|
|
231
|
+
return;
|
|
232
|
+
if (conflict.code === "TARGET_MISMATCH") {
|
|
233
|
+
// No revision to retry with: the only safe resolution is a reload.
|
|
234
|
+
void reloadWorkspace(true);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
// Deliberate, user-initiated: same patch, fresh revision.
|
|
238
|
+
perform({ ...last.body, expectedRevision: conflict.currentRevision }, last.target);
|
|
239
|
+
};
|
|
240
|
+
return {
|
|
241
|
+
conflict,
|
|
242
|
+
fieldErrors,
|
|
243
|
+
serverChanged,
|
|
244
|
+
reloadPending,
|
|
245
|
+
requiresReload: serverChanged || reloadPending || conflict !== null,
|
|
246
|
+
workspaceKey: `${orgId}:${reloadKey}`,
|
|
247
|
+
submit,
|
|
248
|
+
reloadConflict: () => void reloadWorkspace(true),
|
|
249
|
+
keepMine,
|
|
250
|
+
reloadLatest: () => void reloadWorkspace(false),
|
|
251
|
+
noteOwnWrite,
|
|
252
|
+
markServerChanged: () => setServerChanged(true),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=use-brand-workspace-concurrency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-workspace-concurrency.js","sourceRoot":"","sources":["../../src/brand/use-brand-workspace-concurrency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkD3D;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAc;IACzD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC1E,MAAM,CAAC,GAAG,KAKT,CAAC;IACF,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;IACrE,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,CAAC,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;QAC5E,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAC3E,CAAC;IACD,IACE,CAAC,CAAC,MAAM,KAAK,GAAG;QAChB,CAAC,CAAC,IAAI,KAAK,kBAAkB;QAC7B,CAAC,CAAC,WAA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AI,aAAa,IAAI,QAAQ,KAAK,IAAI;QACnE,YAAY,EAAE,GAAG,KAAK,IAAI,SAAS,EAAE;QACrC,MAAM;QACN,cAAc,EAAE,GAAG,EAAE,CAAC,KAAK,eAAe,CAAC,IAAI,CAAC;QAChD,QAAQ;QACR,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,eAAe,CAAC,KAAK,CAAC;QAC/C,YAAY;QACZ,iBAAiB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type BrandImageCandidate, type BrandImageCandidateSet } from "./brand-image-candidates.js";
|
|
2
|
+
import type { BrandAsset, BrandProfileAssetSlot, BrandProfileInput } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The asset slot a candidate persists to. A candidate's OWN role decides it: a
|
|
5
|
+
* favicon-role candidate offered through the "profile picture" chooser still
|
|
6
|
+
* saves to the favicon slot. Only a fresh upload falls back to its chooser's
|
|
7
|
+
* target slot.
|
|
8
|
+
*/
|
|
9
|
+
export declare function candidateAssetSlot(candidate: BrandImageCandidate): BrandProfileAssetSlot;
|
|
10
|
+
/**
|
|
11
|
+
* CEL-2127 — resolves the logo and banner candidate SETS (available and
|
|
12
|
+
* unavailable-with-reason) for the workspace. `BrandImageChooser` owns browsing,
|
|
13
|
+
* upload and cropping; this only decides what it may offer.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useBrandWorkspaceImageCandidates(profile: BrandProfileInput | undefined, assets: readonly BrandAsset[] | undefined, publicApiOrigin: string): {
|
|
16
|
+
avatarCandidateSet: BrandImageCandidateSet;
|
|
17
|
+
bannerCandidateSet: BrandImageCandidateSet;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=use-brand-workspace-image-candidates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-workspace-image-candidates.d.ts","sourceRoot":"","sources":["../../src/brand/use-brand-workspace-image-candidates.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,mBAAmB,GAAG,qBAAqB,CAUxF;AAID;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,EACzC,eAAe,EAAE,MAAM;;;EAsBxB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { resolveBrandImageCandidateSet, } from "./brand-image-candidates.js";
|
|
3
|
+
/**
|
|
4
|
+
* The asset slot a candidate persists to. A candidate's OWN role decides it: a
|
|
5
|
+
* favicon-role candidate offered through the "profile picture" chooser still
|
|
6
|
+
* saves to the favicon slot. Only a fresh upload falls back to its chooser's
|
|
7
|
+
* target slot.
|
|
8
|
+
*/
|
|
9
|
+
export function candidateAssetSlot(candidate) {
|
|
10
|
+
if (candidate.role === "favicon" || candidate.role === "uploaded_favicon")
|
|
11
|
+
return "favicon";
|
|
12
|
+
if (candidate.role === "banner" ||
|
|
13
|
+
candidate.role === "uploaded_banner" ||
|
|
14
|
+
candidate.role === "og_image") {
|
|
15
|
+
return "banner";
|
|
16
|
+
}
|
|
17
|
+
return "primary";
|
|
18
|
+
}
|
|
19
|
+
const EMPTY_CANDIDATE_SET = { available: [], unavailable: [] };
|
|
20
|
+
/**
|
|
21
|
+
* CEL-2127 — resolves the logo and banner candidate SETS (available and
|
|
22
|
+
* unavailable-with-reason) for the workspace. `BrandImageChooser` owns browsing,
|
|
23
|
+
* upload and cropping; this only decides what it may offer.
|
|
24
|
+
*/
|
|
25
|
+
export function useBrandWorkspaceImageCandidates(profile, assets, publicApiOrigin) {
|
|
26
|
+
const avatarCandidateSet = useMemo(() => profile
|
|
27
|
+
? resolveBrandImageCandidateSet({
|
|
28
|
+
profile,
|
|
29
|
+
assets,
|
|
30
|
+
target: "profilePicture",
|
|
31
|
+
publicApiOrigin,
|
|
32
|
+
})
|
|
33
|
+
: EMPTY_CANDIDATE_SET, [assets, profile, publicApiOrigin]);
|
|
34
|
+
const bannerCandidateSet = useMemo(() => profile
|
|
35
|
+
? resolveBrandImageCandidateSet({ profile, assets, target: "banner", publicApiOrigin })
|
|
36
|
+
: EMPTY_CANDIDATE_SET, [assets, profile, publicApiOrigin]);
|
|
37
|
+
return { avatarCandidateSet, bannerCandidateSet };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-brand-workspace-image-candidates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-brand-workspace-image-candidates.js","sourceRoot":"","sources":["../../src/brand/use-brand-workspace-image-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,6BAA6B,GAG9B,MAAM,0BAA0B,CAAC;AAGlC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA8B;IAC/D,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,KAAK,kBAAkB;QAAE,OAAO,SAAS,CAAC;IAC5F,IACE,SAAS,CAAC,IAAI,KAAK,QAAQ;QAC3B,SAAS,CAAC,IAAI,KAAK,iBAAiB;QACpC,SAAS,CAAC,IAAI,KAAK,UAAU,EAC7B,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,mBAAmB,GAA2B,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AAEvF;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,OAAsC,EACtC,MAAyC,EACzC,eAAuB;IAEvB,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CACH,OAAO;QACL,CAAC,CAAC,6BAA6B,CAAC;YAC5B,OAAO;YACP,MAAM;YACN,MAAM,EAAE,gBAAgB;YACxB,eAAe;SAChB,CAAC;QACJ,CAAC,CAAC,mBAAmB,EACzB,CAAC,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,CACnC,CAAC;IACF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CACH,OAAO;QACL,CAAC,CAAC,6BAA6B,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;QACvF,CAAC,CAAC,mBAAmB,EACzB,CAAC,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,CACnC,CAAC;IACF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -50,6 +50,7 @@ declare const ModerationSubjectSchema: z.ZodObject<{
|
|
|
50
50
|
attachmentId: z.ZodOptional<z.ZodString>;
|
|
51
51
|
orgImageId: z.ZodOptional<z.ZodString>;
|
|
52
52
|
brandProfileId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
53
54
|
slot: z.ZodOptional<z.ZodString>;
|
|
54
55
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
55
56
|
imageType: z.ZodOptional<z.ZodString>;
|
|
@@ -75,6 +76,7 @@ export declare const ModerationVerdictEventSchema: z.ZodObject<{
|
|
|
75
76
|
attachmentId: z.ZodOptional<z.ZodString>;
|
|
76
77
|
orgImageId: z.ZodOptional<z.ZodString>;
|
|
77
78
|
brandProfileId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
78
80
|
slot: z.ZodOptional<z.ZodString>;
|
|
79
81
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
80
82
|
imageType: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation-event.d.ts","sourceRoot":"","sources":["../../src/moderation/moderation-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,QAAA,MAAM,yBAAyB;;;;;;;;iBAS7B,CAAC;AAEH,uDAAuD;AACvD,QAAA,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"moderation-event.d.ts","sourceRoot":"","sources":["../../src/moderation/moderation-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,QAAA,MAAM,yBAAyB;;;;;;;;iBAS7B,CAAC;AAEH,uDAAuD;AACvD,QAAA,MAAM,uBAAuB;;;;;;;;;;;iBAkB3B,CAAC;AASH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAST;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAMrE"}
|
|
@@ -54,6 +54,13 @@ const ModerationSubjectSchema = z.object({
|
|
|
54
54
|
/** Stable ID of the current org image generation (CEL-1832). */
|
|
55
55
|
orgImageId: z.string().optional(),
|
|
56
56
|
brandProfileId: z.string().optional(),
|
|
57
|
+
/**
|
|
58
|
+
* Stable identity of the brand asset the verdict is about. Optional until
|
|
59
|
+
* every brand verdict event carries it: when present it is the exact
|
|
60
|
+
* correlation key (CEL-2127); when absent a consumer can only match on
|
|
61
|
+
* `brandProfileId` + `slot` and must filter by time.
|
|
62
|
+
*/
|
|
63
|
+
assetId: z.string().optional(),
|
|
57
64
|
slot: z.string().optional(),
|
|
58
65
|
organizationId: z.string().optional(),
|
|
59
66
|
imageType: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation-event.js","sourceRoot":"","sources":["../../src/moderation/moderation-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,OAAO,OAAO,KAAK,wBAAwB,CAAC;AAC9C,CAAC;AAED,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,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,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moderation-store.d.ts","sourceRoot":"","sources":["../../src/moderation/moderation-store.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAc,CAAC;AAyD5C,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAgM9E;AAWD,MAAM,WAAW,sBAAsB;IACrC;;;;iCAI6B;IAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CAAC;IAC5C,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACrC,gEAAgE;IAChE,IAAI,EAAE,OAAO,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"moderation-store.d.ts","sourceRoot":"","sources":["../../src/moderation/moderation-store.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC;;;;;GAKG;AACH,e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