@calmlens/sdk 0.6.0 → 0.8.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/cjs/{CalmLensTypes-BpmT60j-.d.ts → CalmLensTypes-B7hr0SBv.d.ts} +105 -0
- package/cjs/{CalmLensUtils-DA1_j5-P.js → CalmLensUtils-CJ6o7KRU.js} +8 -8
- package/cjs/index.d.ts +4874 -2
- package/cjs/index.js +76 -57
- package/cjs/testing.d.ts +1 -1
- package/cjs/testing.js +1 -1
- package/esm/{CalmLensTypes-BpmT60j-.d.ts → CalmLensTypes-B7hr0SBv.d.ts} +105 -0
- package/esm/{CalmLensUtils-UthMaLx_.js → CalmLensUtils-BZsX8yeO.js} +8 -8
- package/esm/index.d.ts +4874 -2
- package/esm/index.js +76 -57
- package/esm/testing.d.ts +1 -1
- package/esm/testing.js +1 -1
- package/package.json +4 -4
|
@@ -2979,6 +2979,109 @@ declare const EVENT_TYPE_INFO: {
|
|
|
2979
2979
|
lastError: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
2980
2980
|
}, zod.core.$strip>;
|
|
2981
2981
|
};
|
|
2982
|
+
readonly "appeal.submitted": {
|
|
2983
|
+
id: "appeal.submitted";
|
|
2984
|
+
name: string;
|
|
2985
|
+
description: string;
|
|
2986
|
+
category: EventCategory;
|
|
2987
|
+
severity: EventSeverity;
|
|
2988
|
+
/** Whether the in-app connector (notification bell) subscribes to the type by default. */
|
|
2989
|
+
notify: boolean;
|
|
2990
|
+
fields: {
|
|
2991
|
+
appealId: EventFieldDefinition<zod.ZodString>;
|
|
2992
|
+
subjectType: EventFieldDefinition<zod.ZodEnum<{
|
|
2993
|
+
post: "post";
|
|
2994
|
+
"reported-post": "reported-post";
|
|
2995
|
+
"reported-user": "reported-user";
|
|
2996
|
+
user: "user";
|
|
2997
|
+
}>>;
|
|
2998
|
+
subjectId: EventFieldDefinition<zod.ZodString>;
|
|
2999
|
+
};
|
|
3000
|
+
/** Example data, used for synthetic test sends (`createSampleEvent`). */
|
|
3001
|
+
example: NoInfer<{
|
|
3002
|
+
appealId: string;
|
|
3003
|
+
subjectType: "post" | "reported-post" | "reported-user" | "user";
|
|
3004
|
+
subjectId: string;
|
|
3005
|
+
}>;
|
|
3006
|
+
factInfo: {
|
|
3007
|
+
label: string;
|
|
3008
|
+
description: string;
|
|
3009
|
+
display: EventFieldDisplay;
|
|
3010
|
+
/** Kept in the data but left out of rendered messages (usually an ID shown by another field). */
|
|
3011
|
+
hidden?: boolean;
|
|
3012
|
+
schema: zod.ZodType<unknown, unknown, zod.core.$ZodTypeInternals<unknown, unknown>>;
|
|
3013
|
+
key: string;
|
|
3014
|
+
}[];
|
|
3015
|
+
values: zod.ZodObject<{
|
|
3016
|
+
appealId: zod.ZodString;
|
|
3017
|
+
subjectType: zod.ZodEnum<{
|
|
3018
|
+
post: "post";
|
|
3019
|
+
"reported-post": "reported-post";
|
|
3020
|
+
"reported-user": "reported-user";
|
|
3021
|
+
user: "user";
|
|
3022
|
+
}>;
|
|
3023
|
+
subjectId: zod.ZodString;
|
|
3024
|
+
}, zod.core.$strip>;
|
|
3025
|
+
};
|
|
3026
|
+
readonly "appeal.resolved": {
|
|
3027
|
+
id: "appeal.resolved";
|
|
3028
|
+
name: string;
|
|
3029
|
+
description: string;
|
|
3030
|
+
category: EventCategory;
|
|
3031
|
+
severity: EventSeverity;
|
|
3032
|
+
/** Whether the in-app connector (notification bell) subscribes to the type by default. */
|
|
3033
|
+
notify: boolean;
|
|
3034
|
+
fields: {
|
|
3035
|
+
appealId: EventFieldDefinition<zod.ZodString>;
|
|
3036
|
+
subjectType: EventFieldDefinition<zod.ZodEnum<{
|
|
3037
|
+
post: "post";
|
|
3038
|
+
"reported-post": "reported-post";
|
|
3039
|
+
"reported-user": "reported-user";
|
|
3040
|
+
user: "user";
|
|
3041
|
+
}>>;
|
|
3042
|
+
subjectId: EventFieldDefinition<zod.ZodString>;
|
|
3043
|
+
decision: EventFieldDefinition<zod.ZodEnum<{
|
|
3044
|
+
overturned: "overturned";
|
|
3045
|
+
upheld: "upheld";
|
|
3046
|
+
}>>;
|
|
3047
|
+
action: EventFieldDefinition<zod.ZodString>;
|
|
3048
|
+
appliedToAsset: EventFieldDefinition<zod.ZodBoolean>;
|
|
3049
|
+
};
|
|
3050
|
+
/** Example data, used for synthetic test sends (`createSampleEvent`). */
|
|
3051
|
+
example: NoInfer<{
|
|
3052
|
+
appealId: string;
|
|
3053
|
+
subjectType: "post" | "reported-post" | "reported-user" | "user";
|
|
3054
|
+
subjectId: string;
|
|
3055
|
+
decision: "overturned" | "upheld";
|
|
3056
|
+
action: string;
|
|
3057
|
+
appliedToAsset: boolean;
|
|
3058
|
+
}>;
|
|
3059
|
+
factInfo: {
|
|
3060
|
+
label: string;
|
|
3061
|
+
description: string;
|
|
3062
|
+
display: EventFieldDisplay;
|
|
3063
|
+
/** Kept in the data but left out of rendered messages (usually an ID shown by another field). */
|
|
3064
|
+
hidden?: boolean;
|
|
3065
|
+
schema: zod.ZodType<unknown, unknown, zod.core.$ZodTypeInternals<unknown, unknown>>;
|
|
3066
|
+
key: string;
|
|
3067
|
+
}[];
|
|
3068
|
+
values: zod.ZodObject<{
|
|
3069
|
+
appealId: zod.ZodString;
|
|
3070
|
+
subjectType: zod.ZodEnum<{
|
|
3071
|
+
post: "post";
|
|
3072
|
+
"reported-post": "reported-post";
|
|
3073
|
+
"reported-user": "reported-user";
|
|
3074
|
+
user: "user";
|
|
3075
|
+
}>;
|
|
3076
|
+
subjectId: zod.ZodString;
|
|
3077
|
+
decision: zod.ZodEnum<{
|
|
3078
|
+
overturned: "overturned";
|
|
3079
|
+
upheld: "upheld";
|
|
3080
|
+
}>;
|
|
3081
|
+
action: zod.ZodString;
|
|
3082
|
+
appliedToAsset: zod.ZodBoolean;
|
|
3083
|
+
}, zod.core.$strip>;
|
|
3084
|
+
};
|
|
2982
3085
|
};
|
|
2983
3086
|
type EventType = keyof typeof EVENT_TYPE_INFO;
|
|
2984
3087
|
type EventTypeInfo<TType extends EventType = EventType> = (typeof EVENT_TYPE_INFO)[TType];
|
|
@@ -3022,6 +3125,8 @@ declare const EVENT_SCHEMA: zod.ZodObject<{
|
|
|
3022
3125
|
projectId: zod.ZodString;
|
|
3023
3126
|
userId: zod.ZodOptional<zod.ZodNullable<zod.ZodPipe<zod.ZodString, zod.ZodTransform<string, string>>>>;
|
|
3024
3127
|
type: zod.ZodEnum<{
|
|
3128
|
+
"appeal.resolved": "appeal.resolved";
|
|
3129
|
+
"appeal.submitted": "appeal.submitted";
|
|
3025
3130
|
"asset.approved": "asset.approved";
|
|
3026
3131
|
"asset.classified": "asset.classified";
|
|
3027
3132
|
"asset.failed": "asset.failed";
|
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
//#endregion
|
|
23
23
|
let sendable_error = require("sendable-error");
|
|
24
|
-
//#region \0@oxc-project+runtime@0.
|
|
24
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
25
25
|
function _typeof(o) {
|
|
26
26
|
"@babel/helpers - typeof";
|
|
27
27
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -31,7 +31,7 @@ function _typeof(o) {
|
|
|
31
31
|
}, _typeof(o);
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
35
35
|
function toPrimitive(t, r) {
|
|
36
36
|
if ("object" != _typeof(t) || !t) return t;
|
|
37
37
|
var e = t[Symbol.toPrimitive];
|
|
@@ -43,13 +43,13 @@ function toPrimitive(t, r) {
|
|
|
43
43
|
return ("string" === r ? String : Number)(t);
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region \0@oxc-project+runtime@0.
|
|
46
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
47
47
|
function toPropertyKey(t) {
|
|
48
48
|
var i = toPrimitive(t, "string");
|
|
49
49
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
|
-
//#region \0@oxc-project+runtime@0.
|
|
52
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
53
53
|
function _defineProperty(e, r, t) {
|
|
54
54
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
55
55
|
value: t,
|
|
@@ -59,7 +59,7 @@ function _defineProperty(e, r, t) {
|
|
|
59
59
|
}) : e[r] = t, e;
|
|
60
60
|
}
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region \0@oxc-project+runtime@0.
|
|
62
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectSpread2.js
|
|
63
63
|
function ownKeys(e, r) {
|
|
64
64
|
var t = Object.keys(e);
|
|
65
65
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -82,7 +82,7 @@ function _objectSpread2(e) {
|
|
|
82
82
|
return e;
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
|
-
//#region \0@oxc-project+runtime@0.
|
|
85
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/asyncToGenerator.js
|
|
86
86
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
87
87
|
try {
|
|
88
88
|
var i = n[a](c), u = i.value;
|
|
@@ -393,7 +393,7 @@ var CalmLensError = class extends Error {
|
|
|
393
393
|
};
|
|
394
394
|
const calmLensError = (errorCode, options) => new CalmLensError(errorCode, options);
|
|
395
395
|
//#endregion
|
|
396
|
-
//#region \0@oxc-project+runtime@0.
|
|
396
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
397
397
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
398
398
|
if (null == r) return {};
|
|
399
399
|
var t = {};
|
|
@@ -404,7 +404,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
404
404
|
return t;
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
|
-
//#region \0@oxc-project+runtime@0.
|
|
407
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutProperties.js
|
|
408
408
|
function _objectWithoutProperties(e, t) {
|
|
409
409
|
if (null == e) return {};
|
|
410
410
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|