@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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensUtils = require("./CalmLensUtils-DA1_j5-P.js");
2
+ const require_CalmLensUtils = require("./CalmLensUtils-CJ6o7KRU.js");
3
3
  let zod = require("zod");
4
4
  zod = require_CalmLensUtils.__toESM(zod);
5
5
  require("zod/v4");
@@ -105,15 +105,17 @@ createMetaType({ id: "docPropertyInfo" });
105
105
  const SIZE_LIMITS = {
106
106
  small: 64,
107
107
  medium: 200,
108
- large: 1500
108
+ large: 1500,
109
+ xlarge: 1e4,
110
+ token: 1e4
109
111
  };
110
112
  const saneStringField = (options) => {
111
113
  return zod.string().transform((value) => value.trim()).refine((value) => {
112
114
  if ((options === null || options === void 0 ? void 0 : options.minWidth) && value.length < options.minWidth) return false;
113
115
  return true;
114
116
  }, "Not long enough").refine((value) => {
115
- var _options$type;
116
- const sizeLimit = SIZE_LIMITS[(_options$type = options === null || options === void 0 ? void 0 : options.type) !== null && _options$type !== void 0 ? _options$type : "medium"];
117
+ var _options$maxLength, _options$type;
118
+ const sizeLimit = (_options$maxLength = options === null || options === void 0 ? void 0 : options.maxLength) !== null && _options$maxLength !== void 0 ? _options$maxLength : SIZE_LIMITS[(_options$type = options === null || options === void 0 ? void 0 : options.type) !== null && _options$type !== void 0 ? _options$type : "medium"];
117
119
  return typeof value === "string" && value.length < sizeLimit;
118
120
  }, "Too long");
119
121
  };
@@ -598,6 +600,11 @@ const createEndpoints = (api) => {
598
600
  method: "get",
599
601
  path: "/projects/:projectId/assets/page"
600
602
  });
603
+ const searchAssets = api.endpoint().paramsOf().queryOf().responseOf().build({
604
+ id: "searchAssets",
605
+ method: "get",
606
+ path: "/projects/:projectId/assets/search"
607
+ });
601
608
  const getAsset = api.endpoint().paramsOf().responseOf().build({
602
609
  id: "getAsset",
603
610
  method: "get",
@@ -651,6 +658,7 @@ const createEndpoints = (api) => {
651
658
  deleteFolder,
652
659
  moveFolder,
653
660
  getAssetsPage,
661
+ searchAssets,
654
662
  getAsset,
655
663
  getAssetChildren,
656
664
  patchAsset,
@@ -906,21 +914,32 @@ var CalmLensClient = class CalmLensClient {
906
914
  get assets() {
907
915
  var _this5 = this;
908
916
  return {
917
+ search: function() {
918
+ var _ref8 = require_CalmLensUtils._asyncToGenerator(function* (options) {
919
+ return (yield _this5.endpoints.searchAssets.submit({
920
+ params: { projectId: _this5.options.projectId },
921
+ query: options
922
+ })).data;
923
+ });
924
+ return function search(_x6) {
925
+ return _ref8.apply(this, arguments);
926
+ };
927
+ }(),
909
928
  /**
910
929
  * List all assets for a project
911
930
  * @param options - Pagination and filtering options
912
931
  * @returns Promise with paginated assets
913
932
  */
914
933
  list: function() {
915
- var _ref8 = require_CalmLensUtils._asyncToGenerator(function* (options) {
934
+ var _ref9 = require_CalmLensUtils._asyncToGenerator(function* (options) {
916
935
  var _options$pageIndex;
917
936
  return (yield _this5.endpoints.getAssetsPage.submit({
918
937
  params: { projectId: _this5.options.projectId },
919
938
  query: require_CalmLensUtils._objectSpread2(require_CalmLensUtils._objectSpread2({}, options), {}, { pageIndex: (_options$pageIndex = options.pageIndex) !== null && _options$pageIndex !== void 0 ? _options$pageIndex : 0 })
920
939
  })).data;
921
940
  });
922
- return function list(_x6) {
923
- return _ref8.apply(this, arguments);
941
+ return function list(_x7) {
942
+ return _ref9.apply(this, arguments);
924
943
  };
925
944
  }(),
926
945
  /**
@@ -929,25 +948,25 @@ var CalmLensClient = class CalmLensClient {
929
948
  * @returns Promise with asset data
930
949
  */
931
950
  retrieve: function() {
932
- var _ref9 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId }) {
951
+ var _ref10 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId }) {
933
952
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
934
953
  return (yield _this5.endpoints.getAsset.submit({ params: { assetId } })).data;
935
954
  });
936
- return function retrieve(_x7) {
937
- return _ref9.apply(this, arguments);
955
+ return function retrieve(_x8) {
956
+ return _ref10.apply(this, arguments);
938
957
  };
939
958
  }(),
940
959
  update: function() {
941
- var _ref11 = require_CalmLensUtils._asyncToGenerator(function* (_ref10) {
942
- let { assetId } = _ref10, body = require_CalmLensUtils._objectWithoutProperties(_ref10, _excluded5);
960
+ var _ref12 = require_CalmLensUtils._asyncToGenerator(function* (_ref11) {
961
+ let { assetId } = _ref11, body = require_CalmLensUtils._objectWithoutProperties(_ref11, _excluded5);
943
962
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
944
963
  return (yield _this5.endpoints.patchAsset.submit({
945
964
  params: { assetId },
946
965
  body
947
966
  })).data;
948
967
  });
949
- return function update(_x8) {
950
- return _ref11.apply(this, arguments);
968
+ return function update(_x9) {
969
+ return _ref12.apply(this, arguments);
951
970
  };
952
971
  }(),
953
972
  /**
@@ -957,17 +976,17 @@ var CalmLensClient = class CalmLensClient {
957
976
  * @returns Promise with paginated child assets
958
977
  */
959
978
  listChildren: function() {
960
- var _ref13 = require_CalmLensUtils._asyncToGenerator(function* (_ref12) {
979
+ var _ref14 = require_CalmLensUtils._asyncToGenerator(function* (_ref13) {
961
980
  var _options$pageIndex2;
962
- let { assetId } = _ref12, options = require_CalmLensUtils._objectWithoutProperties(_ref12, _excluded6);
981
+ let { assetId } = _ref13, options = require_CalmLensUtils._objectWithoutProperties(_ref13, _excluded6);
963
982
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
964
983
  return (yield _this5.endpoints.getAssetChildren.submit({
965
984
  params: { assetId },
966
985
  query: require_CalmLensUtils._objectSpread2(require_CalmLensUtils._objectSpread2({}, options), {}, { pageIndex: (_options$pageIndex2 = options.pageIndex) !== null && _options$pageIndex2 !== void 0 ? _options$pageIndex2 : 0 })
967
986
  })).data;
968
987
  });
969
- return function listChildren(_x9) {
970
- return _ref13.apply(this, arguments);
988
+ return function listChildren(_x10) {
989
+ return _ref14.apply(this, arguments);
971
990
  };
972
991
  }(),
973
992
  /**
@@ -977,7 +996,7 @@ var CalmLensClient = class CalmLensClient {
977
996
  * @returns Promise with created asset
978
997
  */
979
998
  create: function() {
980
- var _ref14 = require_CalmLensUtils._asyncToGenerator(function* (options) {
999
+ var _ref15 = require_CalmLensUtils._asyncToGenerator(function* (options) {
981
1000
  const body = prepareSubmitAssetOptions(options);
982
1001
  if ("content" in body || "part" in body) return yield _this5.submitRawAssetUpload(body, true);
983
1002
  return (yield _this5.endpoints.postUploadAsset.submit({
@@ -986,8 +1005,8 @@ var CalmLensClient = class CalmLensClient {
986
1005
  query: { queue: true }
987
1006
  })).data;
988
1007
  });
989
- return function create(_x10) {
990
- return _ref14.apply(this, arguments);
1008
+ return function create(_x11) {
1009
+ return _ref15.apply(this, arguments);
991
1010
  };
992
1011
  }(),
993
1012
  /**
@@ -998,7 +1017,7 @@ var CalmLensClient = class CalmLensClient {
998
1017
  * @returns Promise with created and analyzed asset
999
1018
  */
1000
1019
  moderate: function() {
1001
- var _ref15 = require_CalmLensUtils._asyncToGenerator(function* (options) {
1020
+ var _ref16 = require_CalmLensUtils._asyncToGenerator(function* (options) {
1002
1021
  if ("content" in options && "plainText" in options.content && (typeof options.content.plainText !== "string" || !options.content.plainText.trim())) throw require_CalmLensUtils.calmLensError(require_CalmLensUtils.PUBLIC_ERROR_CODES.INVALID_UPLOAD_PAYLOAD, { message: "Text to moderate must be a non-empty string" });
1003
1022
  const body = prepareSubmitAssetOptions(options);
1004
1023
  if ("content" in body || "part" in body) return yield _this5.submitRawAssetUpload(body, false);
@@ -1008,8 +1027,8 @@ var CalmLensClient = class CalmLensClient {
1008
1027
  query: { queue: false }
1009
1028
  })).data;
1010
1029
  });
1011
- return function moderate(_x11) {
1012
- return _ref15.apply(this, arguments);
1030
+ return function moderate(_x12) {
1031
+ return _ref16.apply(this, arguments);
1013
1032
  };
1014
1033
  }(),
1015
1034
  /**
@@ -1019,7 +1038,7 @@ var CalmLensClient = class CalmLensClient {
1019
1038
  * @returns Promise with asset data
1020
1039
  */
1021
1040
  uploadPart: function() {
1022
- var _ref16 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId, part }) {
1041
+ var _ref17 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId, part }) {
1023
1042
  var _part$sizeInBytes3, _this$multipartUpload;
1024
1043
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
1025
1044
  if (!part) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Part options are required" });
@@ -1037,8 +1056,8 @@ var CalmLensClient = class CalmLensClient {
1037
1056
  }
1038
1057
  return yield _this5.submitRawAssetPart(assetId, part, (_this$multipartUpload = _this5.multipartUploadQueues.get(assetId)) !== null && _this$multipartUpload !== void 0 ? _this$multipartUpload : false);
1039
1058
  });
1040
- return function uploadPart(_x12) {
1041
- return _ref16.apply(this, arguments);
1059
+ return function uploadPart(_x13) {
1060
+ return _ref17.apply(this, arguments);
1042
1061
  };
1043
1062
  }(),
1044
1063
  /**
@@ -1047,9 +1066,9 @@ var CalmLensClient = class CalmLensClient {
1047
1066
  * auth cookies or API keys to the CDN on every media request.
1048
1067
  */
1049
1068
  createSignedUrl: function() {
1050
- var _ref18 = require_CalmLensUtils._asyncToGenerator(function* (_ref17) {
1069
+ var _ref19 = require_CalmLensUtils._asyncToGenerator(function* (_ref18) {
1051
1070
  var _options$resource2, _options$expiresInSec;
1052
- let { assetId } = _ref17, options = require_CalmLensUtils._objectWithoutProperties(_ref17, _excluded7);
1071
+ let { assetId } = _ref18, options = require_CalmLensUtils._objectWithoutProperties(_ref18, _excluded7);
1053
1072
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
1054
1073
  if (options.lens && options.transform) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Specify either a lens or a transform, not both" });
1055
1074
  return (yield _this5.endpoints.postAssetSignedUrl.submit({
@@ -1062,20 +1081,20 @@ var CalmLensClient = class CalmLensClient {
1062
1081
  params: { assetId }
1063
1082
  })).data;
1064
1083
  });
1065
- return function createSignedUrl(_x13) {
1066
- return _ref18.apply(this, arguments);
1084
+ return function createSignedUrl(_x14) {
1085
+ return _ref19.apply(this, arguments);
1067
1086
  };
1068
1087
  }(),
1069
1088
  move: function() {
1070
- var _ref19 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId, folderId }) {
1089
+ var _ref20 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId, folderId }) {
1071
1090
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
1072
1091
  return (yield _this5.endpoints.moveAsset.submit({
1073
1092
  params: { assetId },
1074
1093
  body: { folderId }
1075
1094
  })).data;
1076
1095
  });
1077
- return function move(_x14) {
1078
- return _ref19.apply(this, arguments);
1096
+ return function move(_x15) {
1097
+ return _ref20.apply(this, arguments);
1079
1098
  };
1080
1099
  }(),
1081
1100
  /**
@@ -1083,12 +1102,12 @@ var CalmLensClient = class CalmLensClient {
1083
1102
  * moderated like a new upload; its content must still be stored.
1084
1103
  */
1085
1104
  retry: function() {
1086
- var _ref20 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId }) {
1105
+ var _ref21 = require_CalmLensUtils._asyncToGenerator(function* ({ assetId }) {
1087
1106
  if (!assetId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Asset ID is required" });
1088
1107
  return (yield _this5.endpoints.retryAsset.submit({ params: { assetId } })).data;
1089
1108
  });
1090
- return function retry(_x15) {
1091
- return _ref20.apply(this, arguments);
1109
+ return function retry(_x16) {
1110
+ return _ref21.apply(this, arguments);
1092
1111
  };
1093
1112
  }()
1094
1113
  };
@@ -1102,14 +1121,14 @@ var CalmLensClient = class CalmLensClient {
1102
1121
  * reshaped as `{ id, type, createdAt, projectId, data }`.
1103
1122
  */
1104
1123
  list: function() {
1105
- var _ref21 = require_CalmLensUtils._asyncToGenerator(function* (options = {}) {
1124
+ var _ref22 = require_CalmLensUtils._asyncToGenerator(function* (options = {}) {
1106
1125
  return (yield _this6.endpoints.getEvents.submit({
1107
1126
  params: { projectId: _this6.options.projectId },
1108
1127
  query: options
1109
1128
  })).data;
1110
1129
  });
1111
1130
  return function list() {
1112
- return _ref21.apply(this, arguments);
1131
+ return _ref22.apply(this, arguments);
1113
1132
  };
1114
1133
  }() };
1115
1134
  }
@@ -1117,65 +1136,65 @@ list: function() {
1117
1136
  var _this7 = this;
1118
1137
  return {
1119
1138
  list: function() {
1120
- var _ref22 = require_CalmLensUtils._asyncToGenerator(function* () {
1139
+ var _ref23 = require_CalmLensUtils._asyncToGenerator(function* () {
1121
1140
  return (yield _this7.endpoints.getFolders.submit({ params: { projectId: _this7.options.projectId } })).data.folders;
1122
1141
  });
1123
1142
  return function list() {
1124
- return _ref22.apply(this, arguments);
1143
+ return _ref23.apply(this, arguments);
1125
1144
  };
1126
1145
  }(),
1127
1146
  retrieve: function() {
1128
- var _ref23 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId }) {
1147
+ var _ref24 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId }) {
1129
1148
  if (!folderId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Folder ID is required" });
1130
1149
  return (yield _this7.endpoints.getFolder.submit({ params: { folderId } })).data;
1131
1150
  });
1132
- return function retrieve(_x16) {
1133
- return _ref23.apply(this, arguments);
1151
+ return function retrieve(_x17) {
1152
+ return _ref24.apply(this, arguments);
1134
1153
  };
1135
1154
  }(),
1136
1155
  create: function() {
1137
- var _ref24 = require_CalmLensUtils._asyncToGenerator(function* (options) {
1156
+ var _ref25 = require_CalmLensUtils._asyncToGenerator(function* (options) {
1138
1157
  return (yield _this7.endpoints.postFolder.submit({
1139
1158
  params: { projectId: _this7.options.projectId },
1140
1159
  body: options
1141
1160
  })).data;
1142
1161
  });
1143
- return function create(_x17) {
1144
- return _ref24.apply(this, arguments);
1162
+ return function create(_x18) {
1163
+ return _ref25.apply(this, arguments);
1145
1164
  };
1146
1165
  }(),
1147
1166
  update: function() {
1148
- var _ref26 = require_CalmLensUtils._asyncToGenerator(function* (_ref25) {
1149
- let { folderId } = _ref25, body = require_CalmLensUtils._objectWithoutProperties(_ref25, _excluded8);
1167
+ var _ref27 = require_CalmLensUtils._asyncToGenerator(function* (_ref26) {
1168
+ let { folderId } = _ref26, body = require_CalmLensUtils._objectWithoutProperties(_ref26, _excluded8);
1150
1169
  if (!folderId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Folder ID is required" });
1151
1170
  return (yield _this7.endpoints.patchFolder.submit({
1152
1171
  params: { folderId },
1153
1172
  body
1154
1173
  })).data;
1155
1174
  });
1156
- return function update(_x18) {
1157
- return _ref26.apply(this, arguments);
1175
+ return function update(_x19) {
1176
+ return _ref27.apply(this, arguments);
1158
1177
  };
1159
1178
  }(),
1160
1179
  delete: function() {
1161
- var _ref27 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId }) {
1180
+ var _ref28 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId }) {
1162
1181
  if (!folderId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Folder ID is required" });
1163
1182
  yield _this7.endpoints.deleteFolder.submit({ params: { folderId } });
1164
1183
  });
1165
- return function _delete(_x19) {
1166
- return _ref27.apply(this, arguments);
1184
+ return function _delete(_x20) {
1185
+ return _ref28.apply(this, arguments);
1167
1186
  };
1168
1187
  }(),
1169
1188
  move: function() {
1170
- var _ref28 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId, parentId }) {
1189
+ var _ref29 = require_CalmLensUtils._asyncToGenerator(function* ({ folderId, parentId }) {
1171
1190
  if (!folderId) throw require_CalmLensUtils.calmLensError({ id: "upload/invalid-payload" }, { message: "Folder ID is required" });
1172
1191
  return (yield _this7.endpoints.moveFolder.submit({
1173
1192
  params: { folderId },
1174
1193
  body: { parentId }
1175
1194
  })).data;
1176
1195
  });
1177
- return function move(_x20) {
1178
- return _ref28.apply(this, arguments);
1196
+ return function move(_x21) {
1197
+ return _ref29.apply(this, arguments);
1179
1198
  };
1180
1199
  }()
1181
1200
  };
package/cjs/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as GetEventsResponse, C as UpdateAssetOptions, D as GetAssetChildrenResponse, F as Folder, G as AssetStatus, N as AssetBinaryPayloadInput, O as GetAssetResponse, P as Lens, S as SubmitAssetOptions, T as UploadAssetPartOptions, W as Asset, a as CreateAssetSignedUrlOptions, b as RetrieveAssetOptions, c as EnsureLensOptions, d as ListAssetChildrenOptions, f as ListAssetsOptions, g as MoveFolderOptions, h as MoveAssetOptions, i as CdnServeOptions, j as PostAssetSignedUrlResponse, k as GetAssetsPageResponse, l as EnsureLensesOptions, m as ModerateTextOptions, n as CalmLensClientOptions, o as CreateFolderOptions, p as ListEventsOptions, r as CdnAssetUrlOptions, u as FolderIdOptions, w as UpdateFolderOptions, x as RetryAssetOptions } from "./CalmLensTypes-BpmT60j-.js";
1
+ import { A as GetEventsResponse, C as UpdateAssetOptions, D as GetAssetChildrenResponse, F as Folder, G as AssetStatus, N as AssetBinaryPayloadInput, O as GetAssetResponse, P as Lens, S as SubmitAssetOptions, T as UploadAssetPartOptions, W as Asset, a as CreateAssetSignedUrlOptions, b as RetrieveAssetOptions, c as EnsureLensOptions, d as ListAssetChildrenOptions, f as ListAssetsOptions, g as MoveFolderOptions, h as MoveAssetOptions, i as CdnServeOptions, j as PostAssetSignedUrlResponse, k as GetAssetsPageResponse, l as EnsureLensesOptions, m as ModerateTextOptions, n as CalmLensClientOptions, o as CreateFolderOptions, p as ListEventsOptions, r as CdnAssetUrlOptions, u as FolderIdOptions, w as UpdateFolderOptions, x as RetryAssetOptions } from "./CalmLensTypes-B7hr0SBv.js";
2
2
  import * as zod from "zod";
3
3
  //#region ../shared/src/Permissions.d.ts
4
4
  declare const GRANT_SCHEMA: zod.ZodObject<{
package/cjs/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensUtils = require("./CalmLensUtils-DA1_j5-P.js");
2
+ const require_CalmLensUtils = require("./CalmLensUtils-CJ6o7KRU.js");
3
3
  let zod = require("zod");
4
4
  zod = require_CalmLensUtils.__toESM(zod);
5
5
  //#region ../shared/src/Permissions.ts
@@ -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";
@@ -1,5 +1,5 @@
1
1
  import { ErrorCode } from "sendable-error";
2
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
2
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
3
3
  function _typeof(o) {
4
4
  "@babel/helpers - typeof";
5
5
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -9,7 +9,7 @@ function _typeof(o) {
9
9
  }, _typeof(o);
10
10
  }
11
11
  //#endregion
12
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
12
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
13
13
  function toPrimitive(t, r) {
14
14
  if ("object" != _typeof(t) || !t) return t;
15
15
  var e = t[Symbol.toPrimitive];
@@ -21,13 +21,13 @@ function toPrimitive(t, r) {
21
21
  return ("string" === r ? String : Number)(t);
22
22
  }
23
23
  //#endregion
24
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
24
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
25
25
  function toPropertyKey(t) {
26
26
  var i = toPrimitive(t, "string");
27
27
  return "symbol" == _typeof(i) ? i : i + "";
28
28
  }
29
29
  //#endregion
30
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
30
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
31
31
  function _defineProperty(e, r, t) {
32
32
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
33
33
  value: t,
@@ -37,7 +37,7 @@ function _defineProperty(e, r, t) {
37
37
  }) : e[r] = t, e;
38
38
  }
39
39
  //#endregion
40
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/objectSpread2.js
40
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectSpread2.js
41
41
  function ownKeys(e, r) {
42
42
  var t = Object.keys(e);
43
43
  if (Object.getOwnPropertySymbols) {
@@ -60,7 +60,7 @@ function _objectSpread2(e) {
60
60
  return e;
61
61
  }
62
62
  //#endregion
63
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/asyncToGenerator.js
63
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/asyncToGenerator.js
64
64
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
65
65
  try {
66
66
  var i = n[a](c), u = i.value;
@@ -371,7 +371,7 @@ var CalmLensError = class extends Error {
371
371
  };
372
372
  const calmLensError = (errorCode, options) => new CalmLensError(errorCode, options);
373
373
  //#endregion
374
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/objectWithoutPropertiesLoose.js
374
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutPropertiesLoose.js
375
375
  function _objectWithoutPropertiesLoose(r, e) {
376
376
  if (null == r) return {};
377
377
  var t = {};
@@ -382,7 +382,7 @@ function _objectWithoutPropertiesLoose(r, e) {
382
382
  return t;
383
383
  }
384
384
  //#endregion
385
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/objectWithoutProperties.js
385
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutProperties.js
386
386
  function _objectWithoutProperties(e, t) {
387
387
  if (null == e) return {};
388
388
  var o, r, i = _objectWithoutPropertiesLoose(e, t);