@calmlens/sdk 0.16.3 → 0.18.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/README.md +425 -181
- package/bin/calmlens.js +16016 -0
- package/bin/package.json +1 -0
- package/cjs/BrowserUpload-BT091eOB.d.ts +11 -0
- package/cjs/BrowserUpload-CQwXEGFv.js +10 -0
- package/cjs/CalmLensAppClient-CHQGu-Do.js +89 -0
- package/cjs/CalmLensAppClient-CV_K26Ce.d.ts +40 -0
- package/cjs/CalmLensConnection-B8Bu2j3y.js +659 -0
- package/cjs/CalmLensServerClient-C5o2A8MW.js +645 -0
- package/cjs/CalmLensServerClient-JtP687a3.d.ts +235 -0
- package/cjs/CalmLensTypes-9Vt16pc7.d.ts +40400 -0
- package/cjs/Classification-94kSYWZw-CMnQKW13.d.ts +5873 -0
- package/cjs/CryptoUtils-B_x8lMIx-YBW1-bvL.js +42 -0
- package/cjs/FileIcons-Ob003MdS.js +175 -0
- package/cjs/Jurisdiction-FusEXb4U-zVs21tDv.js +91 -0
- package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +67 -0
- package/cjs/ModerationContextLimits-DelWfmiJ.js +1311 -0
- package/cjs/ReactUpload-CAyCsyG6.d.ts +17 -0
- package/cjs/ReactUpload-Cfg5JYUq.js +54 -0
- package/cjs/TestTriggers-By07LR31-CmK0yTyR.d.ts +271 -0
- package/cjs/TestTriggers-DTc_iMJF-BjMPq4_3.js +1327 -0
- package/cjs/UploadController-BGO1eyzb.js +618 -0
- package/{esm/index-C9Xw1aid.d.ts → cjs/WebhookPayload-2aL31v0J.d.ts} +131 -155
- package/cjs/app.d.ts +7 -44
- package/cjs/app.js +11 -89
- package/cjs/elements.d.ts +88 -0
- package/cjs/elements.js +555 -0
- package/cjs/file-icons.d.ts +67 -0
- package/cjs/file-icons.js +10 -0
- package/cjs/index-CI4BzN4W.d.ts +252 -0
- package/cjs/index.d.ts +6 -4
- package/cjs/index.js +9 -4
- package/cjs/react-native.d.ts +56 -0
- package/cjs/react-native.js +495 -0
- package/cjs/react.d.ts +30 -0
- package/cjs/react.js +370 -0
- package/cjs/server.d.ts +12 -191
- package/cjs/server.js +18 -378
- package/cjs/test-inputs.d.ts +2 -2
- package/cjs/test-inputs.js +9 -264
- package/cjs/testing.d.ts +285 -190
- package/cjs/testing.js +2393 -1203
- package/cjs/ui-CC1GOoMg.js +583 -0
- package/cjs/ui-wIiMfqMB.d.ts +526 -0
- package/cjs/ui.d.ts +2 -0
- package/cjs/ui.js +27 -0
- package/cjs/vue.d.ts +490 -0
- package/cjs/vue.js +419 -0
- package/esm/BrowserUpload-BT091eOB.d.ts +11 -0
- package/esm/BrowserUpload-D2xBWqhm.js +5 -0
- package/esm/CalmLensAppClient-CV_K26Ce.d.ts +40 -0
- package/esm/CalmLensAppClient-DuFas_dW.js +84 -0
- package/esm/CalmLensConnection-MxwwLXdl.js +582 -0
- package/esm/CalmLensServerClient-D80_mKpW.js +586 -0
- package/esm/CalmLensServerClient-JtP687a3.d.ts +235 -0
- package/esm/CalmLensTypes-9Vt16pc7.d.ts +40400 -0
- package/esm/Classification-94kSYWZw-CMnQKW13.d.ts +5873 -0
- package/esm/CryptoUtils-B_x8lMIx-DhuWGzqn.js +25 -0
- package/esm/FileIcons-M6dzjFxd.js +128 -0
- package/esm/Jurisdiction-FusEXb4U-1ov6m5yE.js +46 -0
- package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +67 -0
- package/esm/ModerationContextLimits-BaX2QnU8.js +1114 -0
- package/esm/ReactUpload-CAyCsyG6.d.ts +17 -0
- package/esm/ReactUpload-CL2XC8WS.js +37 -0
- package/esm/TestTriggers-By07LR31-CmK0yTyR.d.ts +271 -0
- package/esm/TestTriggers-DTc_iMJF-HfB533Gx.js +1267 -0
- package/esm/UploadController-qjoYGCwx.js +589 -0
- package/{cjs/index-C9Xw1aid.d.ts → esm/WebhookPayload-2aL31v0J.d.ts} +131 -155
- package/esm/app.d.ts +7 -44
- package/esm/app.js +3 -86
- package/esm/elements.d.ts +88 -0
- package/esm/elements.js +528 -0
- package/esm/file-icons.d.ts +67 -0
- package/esm/file-icons.js +1 -0
- package/esm/index-CI4BzN4W.d.ts +252 -0
- package/esm/index.d.ts +6 -4
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +56 -0
- package/esm/react-native.js +467 -0
- package/esm/react.d.ts +30 -0
- package/esm/react.js +343 -0
- package/esm/server.d.ts +12 -191
- package/esm/server.js +3 -369
- package/esm/styles.css +147 -0
- package/esm/svelte/CalmLensMedia.svelte +134 -0
- package/esm/svelte/CalmLensUploader.svelte +175 -0
- package/esm/svelte/Icon.svelte +7 -0
- package/esm/svelte/index.d.ts +37 -0
- package/esm/svelte/index.js +6 -0
- package/esm/test-inputs.d.ts +2 -2
- package/esm/test-inputs.js +1 -256
- package/esm/testing.d.ts +285 -190
- package/esm/testing.js +2329 -1122
- package/esm/ui-CCY3yXFn.js +458 -0
- package/esm/ui-wIiMfqMB.d.ts +526 -0
- package/esm/ui.d.ts +2 -0
- package/esm/ui.js +3 -0
- package/esm/vue.d.ts +490 -0
- package/esm/vue.js +392 -0
- package/package.json +118 -13
- package/cjs/CalmLensConnection-BNUHp_AQ.js +0 -234
- package/cjs/CalmLensUtils-o171ownK.js +0 -699
- package/cjs/CalmLensVersion-DwhgxQK5.js +0 -480
- package/cjs/CalmLensWebhooks-BKrq30Yp.js +0 -201
- package/cjs/Classification-BNhgwGEm-DmA9VEuE.d.ts +0 -4806
- package/cjs/TestTriggers-CRKtulyp-vrzEq2wm.d.ts +0 -44
- package/cjs/WebhookPayload-CJoIkGBD.d.ts +0 -11753
- package/esm/CalmLensConnection-XTqmlwzG.js +0 -193
- package/esm/CalmLensUtils-DsF8Aa_x.js +0 -574
- package/esm/CalmLensVersion-DcifRKsx.js +0 -415
- package/esm/CalmLensWebhooks-BvGyk5d3.js +0 -148
- package/esm/Classification-BNhgwGEm-DmA9VEuE.d.ts +0 -4806
- package/esm/TestTriggers-CRKtulyp-vrzEq2wm.d.ts +0 -44
- package/esm/WebhookPayload-CJoIkGBD.d.ts +0 -11753
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { I as UploadSnapshot, M as UploadController, N as UploadControllerOptions, P as UploadFile } from "./ui-wIiMfqMB.js";
|
|
2
|
+
interface UseCalmLensUploadResult<F extends UploadFile = UploadFile> extends UploadSnapshot<F> {
|
|
3
|
+
controller: UploadController<F>;
|
|
4
|
+
addFiles: UploadController<F>["addFiles"];
|
|
5
|
+
retry: UploadController<F>["retry"];
|
|
6
|
+
cancel: UploadController<F>["cancel"];
|
|
7
|
+
remove: UploadController<F>["remove"];
|
|
8
|
+
clear: UploadController<F>["clear"];
|
|
9
|
+
start: UploadController<F>["start"];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Uploads files through an upload preset and re-renders as each one uploads and is checked. Use
|
|
13
|
+
* it to build your own upload UI; `CalmLensUploader` is built on it. Uploads still running when
|
|
14
|
+
* the component unmounts are cancelled.
|
|
15
|
+
*/
|
|
16
|
+
declare const useCalmLensUpload: <F extends UploadFile = UploadFile>(options: UploadControllerOptions<F>) => UseCalmLensUploadResult<F>;
|
|
17
|
+
export { useCalmLensUpload as n, UseCalmLensUploadResult as t };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const require_UploadController = require("./UploadController-BGO1eyzb.js");
|
|
2
|
+
let react = require("react");
|
|
3
|
+
// src/ui/ReactUpload.ts
|
|
4
|
+
/** Re-renders with a controller's snapshot. */
|
|
5
|
+
const useUploadSnapshot = (controller) => {
|
|
6
|
+
const snapshot = (0, react.useSyncExternalStore)(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
7
|
+
return (0, react.useMemo)(() => ({
|
|
8
|
+
...snapshot,
|
|
9
|
+
controller,
|
|
10
|
+
addFiles: (files) => controller.addFiles(files),
|
|
11
|
+
retry: (key) => controller.retry(key),
|
|
12
|
+
cancel: (key) => controller.cancel(key),
|
|
13
|
+
remove: (key) => controller.remove(key),
|
|
14
|
+
clear: () => controller.clear(),
|
|
15
|
+
start: () => controller.start()
|
|
16
|
+
}), [snapshot, controller]);
|
|
17
|
+
};
|
|
18
|
+
/** A controller this component owns: it takes the latest options and cancels on unmount. */
|
|
19
|
+
const useOwnController = (options, active = true) => {
|
|
20
|
+
const [controller] = (0, react.useState)(() => require_UploadController.createUploadController(options));
|
|
21
|
+
if (active) controller.setOptions(options);
|
|
22
|
+
const pendingClear = (0, react.useRef)(void 0);
|
|
23
|
+
(0, react.useEffect)(() => {
|
|
24
|
+
clearTimeout(pendingClear.current);
|
|
25
|
+
return () => {
|
|
26
|
+
pendingClear.current = setTimeout(() => controller.clear());
|
|
27
|
+
};
|
|
28
|
+
}, [controller]);
|
|
29
|
+
return controller;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Uploads files through an upload preset and re-renders as each one uploads and is checked. Use
|
|
33
|
+
* it to build your own upload UI; `CalmLensUploader` is built on it. Uploads still running when
|
|
34
|
+
* the component unmounts are cancelled.
|
|
35
|
+
*/
|
|
36
|
+
const useCalmLensUpload = (options) => useUploadSnapshot(useOwnController(options));
|
|
37
|
+
Object.defineProperty(exports, "useCalmLensUpload", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function() {
|
|
40
|
+
return useCalmLensUpload;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "useOwnController", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return useOwnController;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "useUploadSnapshot", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return useUploadSnapshot;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { n as ClassificationCategory } from "./Classification-94kSYWZw-CMnQKW13.js";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
type ClassificationTestSignal = ClassificationCategory | "sexual.involving-minors" | "violence.graphic" | "harassment.insult" | "sexual.adult" | "hate.regional-symbol";
|
|
4
|
+
/** A project's test input key: 32 hexadecimal characters only its members can see. */
|
|
5
|
+
declare const TEST_INPUT_KEY_PATTERN: RegExp;
|
|
6
|
+
/** Category shortcuts are presets in the same instance-based format. */
|
|
7
|
+
declare function testInputForSignal(signal: ClassificationTestSignal, kind?: "image" | "text"): TestInput;
|
|
8
|
+
declare const getImageTestCategories: () => ClassificationTestSignal[];
|
|
9
|
+
/** Each row is one qualifying instance. Unselected qualifiers are explicitly absent. */
|
|
10
|
+
declare const TEST_INPUT_SCHEMA: z.ZodObject<{
|
|
11
|
+
regionalActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
+
region: z.ZodEnum<{
|
|
13
|
+
AT: "AT";
|
|
14
|
+
AU: "AU";
|
|
15
|
+
BR: "BR";
|
|
16
|
+
DE: "DE";
|
|
17
|
+
EU: "EU";
|
|
18
|
+
FR: "FR";
|
|
19
|
+
GB: "GB";
|
|
20
|
+
}>;
|
|
21
|
+
action: z.ZodEnum<{
|
|
22
|
+
"age-restrict": "age-restrict";
|
|
23
|
+
block: "block";
|
|
24
|
+
limit: "limit";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strict>>>;
|
|
27
|
+
unassessedCategories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
28
|
+
"criminal-activity": "criminal-activity";
|
|
29
|
+
harassment: "harassment";
|
|
30
|
+
hate: "hate";
|
|
31
|
+
"personal-information": "personal-information";
|
|
32
|
+
profanity: "profanity";
|
|
33
|
+
"self-harm": "self-harm";
|
|
34
|
+
sexual: "sexual";
|
|
35
|
+
violence: "violence";
|
|
36
|
+
}>>>;
|
|
37
|
+
instances: z.ZodArray<z.ZodObject<{
|
|
38
|
+
category: z.ZodEnum<{
|
|
39
|
+
"criminal-activity": "criminal-activity";
|
|
40
|
+
harassment: "harassment";
|
|
41
|
+
hate: "hate";
|
|
42
|
+
"personal-information": "personal-information";
|
|
43
|
+
profanity: "profanity";
|
|
44
|
+
"self-harm": "self-harm";
|
|
45
|
+
sexual: "sexual";
|
|
46
|
+
violence: "violence";
|
|
47
|
+
}>;
|
|
48
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
"age-restrict": "age-restrict";
|
|
51
|
+
allow: "allow";
|
|
52
|
+
block: "block";
|
|
53
|
+
limit: "limit";
|
|
54
|
+
}>>;
|
|
55
|
+
qualifiers: z.ZodArray<z.ZodEnum<{
|
|
56
|
+
"criminal-activity-alcohol": "criminal-activity-alcohol";
|
|
57
|
+
"criminal-activity-coded-incitement": "criminal-activity-coded-incitement";
|
|
58
|
+
"criminal-activity-csam": "criminal-activity-csam";
|
|
59
|
+
"criminal-activity-demonstration": "criminal-activity-demonstration";
|
|
60
|
+
"criminal-activity-discussion": "criminal-activity-discussion";
|
|
61
|
+
"criminal-activity-documentary": "criminal-activity-documentary";
|
|
62
|
+
"criminal-activity-educational": "criminal-activity-educational";
|
|
63
|
+
"criminal-activity-fictional": "criminal-activity-fictional";
|
|
64
|
+
"criminal-activity-fraud": "criminal-activity-fraud";
|
|
65
|
+
"criminal-activity-gambling": "criminal-activity-gambling";
|
|
66
|
+
"criminal-activity-graffiti": "criminal-activity-graffiti";
|
|
67
|
+
"criminal-activity-grooming": "criminal-activity-grooming";
|
|
68
|
+
"criminal-activity-historical": "criminal-activity-historical";
|
|
69
|
+
"criminal-activity-instructions": "criminal-activity-instructions";
|
|
70
|
+
"criminal-activity-preparation": "criminal-activity-preparation";
|
|
71
|
+
"criminal-activity-promotion": "criminal-activity-promotion";
|
|
72
|
+
"criminal-activity-request": "criminal-activity-request";
|
|
73
|
+
"criminal-activity-sexual-solicitation": "criminal-activity-sexual-solicitation";
|
|
74
|
+
"criminal-activity-substances": "criminal-activity-substances";
|
|
75
|
+
"criminal-activity-support-prevention": "criminal-activity-support-prevention";
|
|
76
|
+
"criminal-activity-tobacco": "criminal-activity-tobacco";
|
|
77
|
+
"harassment-abuse": "harassment-abuse";
|
|
78
|
+
"harassment-bullying": "harassment-bullying";
|
|
79
|
+
"harassment-documentary": "harassment-documentary";
|
|
80
|
+
"harassment-educational": "harassment-educational";
|
|
81
|
+
"harassment-encouragement": "harassment-encouragement";
|
|
82
|
+
"harassment-fictional": "harassment-fictional";
|
|
83
|
+
"harassment-historical": "harassment-historical";
|
|
84
|
+
"harassment-mild": "harassment-mild";
|
|
85
|
+
"harassment-public-target": "harassment-public-target";
|
|
86
|
+
"harassment-sexual": "harassment-sexual";
|
|
87
|
+
"harassment-support-prevention": "harassment-support-prevention";
|
|
88
|
+
"harassment-threat": "harassment-threat";
|
|
89
|
+
"hate-abuse": "hate-abuse";
|
|
90
|
+
"hate-adjudicated-nazi-crimes-denial": "hate-adjudicated-nazi-crimes-denial";
|
|
91
|
+
"hate-counterspeech": "hate-counterspeech";
|
|
92
|
+
"hate-dehumanization": "hate-dehumanization";
|
|
93
|
+
"hate-documentary": "hate-documentary";
|
|
94
|
+
"hate-educational": "hate-educational";
|
|
95
|
+
"hate-exclusion": "hate-exclusion";
|
|
96
|
+
"hate-fictional": "hate-fictional";
|
|
97
|
+
"hate-historical": "hate-historical";
|
|
98
|
+
"hate-hostility": "hate-hostility";
|
|
99
|
+
"hate-inferiority": "hate-inferiority";
|
|
100
|
+
"hate-nazi-genocide-denial-or-approval": "hate-nazi-genocide-denial-or-approval";
|
|
101
|
+
"hate-nazi-genocide-public-peace": "hate-nazi-genocide-public-peace";
|
|
102
|
+
"hate-nazi-insignia-public-display": "hate-nazi-insignia-public-display";
|
|
103
|
+
"hate-nazi-symbols-public-display": "hate-nazi-symbols-public-display";
|
|
104
|
+
"hate-personal": "hate-personal";
|
|
105
|
+
"hate-slurs": "hate-slurs";
|
|
106
|
+
"hate-support-prevention": "hate-support-prevention";
|
|
107
|
+
"hate-symbol": "hate-symbol";
|
|
108
|
+
"hate-threat": "hate-threat";
|
|
109
|
+
"personal-information-contact": "personal-information-contact";
|
|
110
|
+
"personal-information-credentials": "personal-information-credentials";
|
|
111
|
+
"personal-information-documentary": "personal-information-documentary";
|
|
112
|
+
"personal-information-educational": "personal-information-educational";
|
|
113
|
+
"personal-information-email": "personal-information-email";
|
|
114
|
+
"personal-information-fictional": "personal-information-fictional";
|
|
115
|
+
"personal-information-financial": "personal-information-financial";
|
|
116
|
+
"personal-information-government-id": "personal-information-government-id";
|
|
117
|
+
"personal-information-historical": "personal-information-historical";
|
|
118
|
+
"personal-information-identifiers": "personal-information-identifiers";
|
|
119
|
+
"personal-information-location": "personal-information-location";
|
|
120
|
+
"personal-information-phone": "personal-information-phone";
|
|
121
|
+
"personal-information-request": "personal-information-request";
|
|
122
|
+
"personal-information-self-disclosure": "personal-information-self-disclosure";
|
|
123
|
+
"personal-information-support-prevention": "personal-information-support-prevention";
|
|
124
|
+
"personal-information-third-party": "personal-information-third-party";
|
|
125
|
+
"profanity-documentary": "profanity-documentary";
|
|
126
|
+
"profanity-educational": "profanity-educational";
|
|
127
|
+
"profanity-fictional": "profanity-fictional";
|
|
128
|
+
"profanity-historical": "profanity-historical";
|
|
129
|
+
"profanity-mild": "profanity-mild";
|
|
130
|
+
"profanity-obfuscated": "profanity-obfuscated";
|
|
131
|
+
"profanity-slurs": "profanity-slurs";
|
|
132
|
+
"profanity-strong": "profanity-strong";
|
|
133
|
+
"profanity-support-prevention": "profanity-support-prevention";
|
|
134
|
+
"self-harm-act": "self-harm-act";
|
|
135
|
+
"self-harm-age-restricted": "self-harm-age-restricted";
|
|
136
|
+
"self-harm-documentary": "self-harm-documentary";
|
|
137
|
+
"self-harm-educational": "self-harm-educational";
|
|
138
|
+
"self-harm-encouragement": "self-harm-encouragement";
|
|
139
|
+
"self-harm-fictional": "self-harm-fictional";
|
|
140
|
+
"self-harm-historical": "self-harm-historical";
|
|
141
|
+
"self-harm-methods": "self-harm-methods";
|
|
142
|
+
"self-harm-preparation": "self-harm-preparation";
|
|
143
|
+
"self-harm-support-prevention": "self-harm-support-prevention";
|
|
144
|
+
"self-harm-thoughts": "self-harm-thoughts";
|
|
145
|
+
"sexual-activity": "sexual-activity";
|
|
146
|
+
"sexual-adult-promotion": "sexual-adult-promotion";
|
|
147
|
+
"sexual-assault-media": "sexual-assault-media";
|
|
148
|
+
"sexual-discussion": "sexual-discussion";
|
|
149
|
+
"sexual-documentary": "sexual-documentary";
|
|
150
|
+
"sexual-educational": "sexual-educational";
|
|
151
|
+
"sexual-explicit-language": "sexual-explicit-language";
|
|
152
|
+
"sexual-extreme": "sexual-extreme";
|
|
153
|
+
"sexual-fictional": "sexual-fictional";
|
|
154
|
+
"sexual-historical": "sexual-historical";
|
|
155
|
+
"sexual-intimate-image-abuse": "sexual-intimate-image-abuse";
|
|
156
|
+
"sexual-minors": "sexual-minors";
|
|
157
|
+
"sexual-non-consensual": "sexual-non-consensual";
|
|
158
|
+
"sexual-non-erotic-nudity": "sexual-non-erotic-nudity";
|
|
159
|
+
"sexual-nudity": "sexual-nudity";
|
|
160
|
+
"sexual-paid": "sexual-paid";
|
|
161
|
+
"sexual-pornographic-media": "sexual-pornographic-media";
|
|
162
|
+
"sexual-revealing-clothing": "sexual-revealing-clothing";
|
|
163
|
+
"sexual-solicitation": "sexual-solicitation";
|
|
164
|
+
"sexual-suggestive": "sexual-suggestive";
|
|
165
|
+
"sexual-support-prevention": "sexual-support-prevention";
|
|
166
|
+
"sexual-text": "sexual-text";
|
|
167
|
+
"violence-attack": "violence-attack";
|
|
168
|
+
"violence-coded-incitement": "violence-coded-incitement";
|
|
169
|
+
"violence-decapitation-act": "violence-decapitation-act";
|
|
170
|
+
"violence-discussion": "violence-discussion";
|
|
171
|
+
"violence-documentary": "violence-documentary";
|
|
172
|
+
"violence-educational": "violence-educational";
|
|
173
|
+
"violence-encouragement": "violence-encouragement";
|
|
174
|
+
"violence-extremism": "violence-extremism";
|
|
175
|
+
"violence-fantasy": "violence-fantasy";
|
|
176
|
+
"violence-fictional": "violence-fictional";
|
|
177
|
+
"violence-gore": "violence-gore";
|
|
178
|
+
"violence-graphic": "violence-graphic";
|
|
179
|
+
"violence-high-impact": "violence-high-impact";
|
|
180
|
+
"violence-historical": "violence-historical";
|
|
181
|
+
"violence-injury": "violence-injury";
|
|
182
|
+
"violence-natural-death": "violence-natural-death";
|
|
183
|
+
"violence-preparation": "violence-preparation";
|
|
184
|
+
"violence-sport": "violence-sport";
|
|
185
|
+
"violence-support-prevention": "violence-support-prevention";
|
|
186
|
+
"violence-text": "violence-text";
|
|
187
|
+
"violence-threat": "violence-threat";
|
|
188
|
+
"violence-violent-death": "violence-violent-death";
|
|
189
|
+
"violence-weapon": "violence-weapon";
|
|
190
|
+
"violence-wish": "violence-wish";
|
|
191
|
+
}>>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
type TestInput = z.infer<typeof TEST_INPUT_SCHEMA>;
|
|
195
|
+
declare const TEST_INPUT_PRESETS: {
|
|
196
|
+
clean: {
|
|
197
|
+
instances: never[];
|
|
198
|
+
};
|
|
199
|
+
limited: {
|
|
200
|
+
instances: {
|
|
201
|
+
category: "harassment";
|
|
202
|
+
qualifiers: "harassment-abuse"[];
|
|
203
|
+
}[];
|
|
204
|
+
};
|
|
205
|
+
adultImage: {
|
|
206
|
+
instances: {
|
|
207
|
+
category: "sexual";
|
|
208
|
+
qualifiers: "sexual-pornographic-media"[];
|
|
209
|
+
}[];
|
|
210
|
+
};
|
|
211
|
+
adultText: {
|
|
212
|
+
instances: {
|
|
213
|
+
category: "sexual";
|
|
214
|
+
qualifiers: "sexual-explicit-language"[];
|
|
215
|
+
}[];
|
|
216
|
+
};
|
|
217
|
+
regionalDelivery: {
|
|
218
|
+
instances: never[];
|
|
219
|
+
regionalActions: ({
|
|
220
|
+
region: "DE";
|
|
221
|
+
action: "block";
|
|
222
|
+
} | {
|
|
223
|
+
region: "GB";
|
|
224
|
+
action: "age-restrict";
|
|
225
|
+
} | {
|
|
226
|
+
region: "FR";
|
|
227
|
+
action: "limit";
|
|
228
|
+
})[];
|
|
229
|
+
};
|
|
230
|
+
germany: {
|
|
231
|
+
instances: {
|
|
232
|
+
category: "hate";
|
|
233
|
+
qualifiers: ("hate-nazi-symbols-public-display" | "hate-symbol")[];
|
|
234
|
+
}[];
|
|
235
|
+
};
|
|
236
|
+
mixed: {
|
|
237
|
+
instances: ({
|
|
238
|
+
category: "harassment";
|
|
239
|
+
qualifiers: ("harassment-abuse" | "harassment-documentary")[];
|
|
240
|
+
} | {
|
|
241
|
+
category: "harassment";
|
|
242
|
+
qualifiers: "harassment-threat"[];
|
|
243
|
+
})[];
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
declare function generateTestTextCode(scenario: TestInput | ClassificationTestSignal, key: string): Promise<string>;
|
|
247
|
+
declare function detectTestTrigger(text: string, key: string): Promise<TestInput | undefined>;
|
|
248
|
+
/** One byte per 4px cell, stored in the low RGB bits to preserve the category colour. */
|
|
249
|
+
declare function paintTestImage(scenario: TestInput | ClassificationTestSignal, key: string): Promise<{
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
rgba: Uint8Array<ArrayBuffer>;
|
|
253
|
+
}>;
|
|
254
|
+
declare function detectTestImage(image: {
|
|
255
|
+
width: number;
|
|
256
|
+
height: number;
|
|
257
|
+
rgba: Uint8Array;
|
|
258
|
+
}, key: string): Promise<{
|
|
259
|
+
regionalActions?: {
|
|
260
|
+
region: "AT" | "AU" | "BR" | "DE" | "EU" | "FR" | "GB";
|
|
261
|
+
action: "age-restrict" | "block" | "limit";
|
|
262
|
+
}[] | undefined;
|
|
263
|
+
unassessedCategories?: ("criminal-activity" | "harassment" | "hate" | "personal-information" | "profanity" | "self-harm" | "sexual" | "violence")[] | undefined;
|
|
264
|
+
instances: {
|
|
265
|
+
category: "criminal-activity" | "harassment" | "hate" | "personal-information" | "profanity" | "self-harm" | "sexual" | "violence";
|
|
266
|
+
score?: number | undefined;
|
|
267
|
+
action?: "age-restrict" | "allow" | "block" | "limit" | undefined;
|
|
268
|
+
qualifiers: ("criminal-activity-alcohol" | "criminal-activity-coded-incitement" | "criminal-activity-csam" | "criminal-activity-demonstration" | "criminal-activity-discussion" | "criminal-activity-documentary" | "criminal-activity-educational" | "criminal-activity-fictional" | "criminal-activity-fraud" | "criminal-activity-gambling" | "criminal-activity-graffiti" | "criminal-activity-grooming" | "criminal-activity-historical" | "criminal-activity-instructions" | "criminal-activity-preparation" | "criminal-activity-promotion" | "criminal-activity-request" | "criminal-activity-sexual-solicitation" | "criminal-activity-substances" | "criminal-activity-support-prevention" | "criminal-activity-tobacco" | "harassment-abuse" | "harassment-bullying" | "harassment-documentary" | "harassment-educational" | "harassment-encouragement" | "harassment-fictional" | "harassment-historical" | "harassment-mild" | "harassment-public-target" | "harassment-sexual" | "harassment-support-prevention" | "harassment-threat" | "hate-abuse" | "hate-adjudicated-nazi-crimes-denial" | "hate-counterspeech" | "hate-dehumanization" | "hate-documentary" | "hate-educational" | "hate-exclusion" | "hate-fictional" | "hate-historical" | "hate-hostility" | "hate-inferiority" | "hate-nazi-genocide-denial-or-approval" | "hate-nazi-genocide-public-peace" | "hate-nazi-insignia-public-display" | "hate-nazi-symbols-public-display" | "hate-personal" | "hate-slurs" | "hate-support-prevention" | "hate-symbol" | "hate-threat" | "personal-information-contact" | "personal-information-credentials" | "personal-information-documentary" | "personal-information-educational" | "personal-information-email" | "personal-information-fictional" | "personal-information-financial" | "personal-information-government-id" | "personal-information-historical" | "personal-information-identifiers" | "personal-information-location" | "personal-information-phone" | "personal-information-request" | "personal-information-self-disclosure" | "personal-information-support-prevention" | "personal-information-third-party" | "profanity-documentary" | "profanity-educational" | "profanity-fictional" | "profanity-historical" | "profanity-mild" | "profanity-obfuscated" | "profanity-slurs" | "profanity-strong" | "profanity-support-prevention" | "self-harm-act" | "self-harm-age-restricted" | "self-harm-documentary" | "self-harm-educational" | "self-harm-encouragement" | "self-harm-fictional" | "self-harm-historical" | "self-harm-methods" | "self-harm-preparation" | "self-harm-support-prevention" | "self-harm-thoughts" | "sexual-activity" | "sexual-adult-promotion" | "sexual-assault-media" | "sexual-discussion" | "sexual-documentary" | "sexual-educational" | "sexual-explicit-language" | "sexual-extreme" | "sexual-fictional" | "sexual-historical" | "sexual-intimate-image-abuse" | "sexual-minors" | "sexual-non-consensual" | "sexual-non-erotic-nudity" | "sexual-nudity" | "sexual-paid" | "sexual-pornographic-media" | "sexual-revealing-clothing" | "sexual-solicitation" | "sexual-suggestive" | "sexual-support-prevention" | "sexual-text" | "violence-attack" | "violence-coded-incitement" | "violence-decapitation-act" | "violence-discussion" | "violence-documentary" | "violence-educational" | "violence-encouragement" | "violence-extremism" | "violence-fantasy" | "violence-fictional" | "violence-gore" | "violence-graphic" | "violence-high-impact" | "violence-historical" | "violence-injury" | "violence-natural-death" | "violence-preparation" | "violence-sport" | "violence-support-prevention" | "violence-text" | "violence-threat" | "violence-violent-death" | "violence-weapon" | "violence-wish")[];
|
|
269
|
+
}[];
|
|
270
|
+
} | undefined>;
|
|
271
|
+
export { detectTestImage as a, getImageTestCategories as c, TestInput as i, paintTestImage as l, TEST_INPUT_KEY_PATTERN as n, detectTestTrigger as o, TEST_INPUT_PRESETS as r, generateTestTextCode as s, ClassificationTestSignal as t, testInputForSignal as u };
|