calmlens 0.4.0 → 0.5.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/esm/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as UploadAssetPartOptions, D as GetAssetsPageResponse, E as GetAssetResponse, F as AssetStatus, M as Lens, N as Folder, O as GetEventsResponse, P as Asset, S as UpdateFolderOptions, T as GetAssetChildrenResponse, a as CreateFolderOptions, b as SubmitAssetOptions, c as EnsureLensesOptions, d as ListAssetsOptions, f as ListEventsOptions, h as MoveFolderOptions, i as CreateAssetSignedUrlOptions, j as AssetBinaryPayloadInput, k as PostAssetSignedUrlResponse, l as FolderIdOptions, m as MoveAssetOptions, n as CdnAssetUrlOptions, p as ModerateTextOptions, r as CdnServeOptions, s as EnsureLensOptions, t as CalmLensClientOptions, u as ListAssetChildrenOptions, v as RetrieveAssetOptions, y as RetryAssetOptions } from "./CalmLensTypes-DkqoKBwF.js";
1
+ import { A as GetEventsResponse, D as GetAssetChildrenResponse, F as Folder, N as AssetBinaryPayloadInput, O as GetAssetResponse, P as Lens, S as SubmitAssetOptions, T as UploadAssetPartOptions, U as Asset, W as AssetStatus, 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-DG_kHVqY.js";
2
2
  import * as zod from "zod";
3
3
  //#region ../shared/src/Permissions.d.ts
4
4
  declare const GRANT_SCHEMA: zod.ZodObject<{
@@ -124,7 +124,7 @@ export declare class MockCalmLensClient {
124
124
  retrieve: ({ assetId }: RetrieveAssetOptions) => Promise<GetAssetResponse>;
125
125
  listChildren: ({ assetId, ...options }: ListAssetChildrenOptions) => Promise<GetAssetChildrenResponse>;
126
126
  create: (options: SubmitAssetOptions) => Promise<Asset>;
127
- analyze: (options: SubmitAssetOptions) => Promise<Asset>;
127
+ moderate: (options: SubmitAssetOptions) => Promise<Asset>;
128
128
  uploadPart: ({ assetId, part }: UploadAssetPartOptions) => Promise<Asset>;
129
129
  createSignedUrl: ({ assetId, ...options }: CreateAssetSignedUrlOptions) => Promise<PostAssetSignedUrlResponse>;
130
130
  move: ({ assetId, folderId }: MoveAssetOptions) => Promise<Asset>;
package/esm/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as getAssetPayloadByteLength, b as _asyncToGenerator, d as getRejectedUploadMimeTypeError, f as isRejectedUploadMimeType, g as assetToData, h as assetDataToUint8Array, i as _objectWithoutProperties, m as stringifyJsonCanonical, p as PUBLIC_ERROR_CODES, r as _objectSpread2, s as calmLensError, t as toTextAssetOptions, y as validateAssetPayload } from "./CalmLensUtils-B3Eiz2Ro.js";
1
+ import { _ as validateAssetPayload, a as calmLensError, d as PUBLIC_ERROR_CODES, f as stringifyJsonCanonical, h as getAssetPayloadByteLength, l as getRejectedUploadMimeTypeError, m as assetToData, n as _objectWithoutProperties, p as assetDataToUint8Array, t as toTextAssetOptions, u as isRejectedUploadMimeType, v as _asyncToGenerator, y as _objectSpread2 } from "./CalmLensUtils-BQEgxGWk.js";
2
2
  import * as zod from "zod";
3
3
  //#region ../shared/src/Permissions.ts
4
4
  const ACTION_SCHEMA = zod.enum([
@@ -330,7 +330,7 @@ list: function() {
330
330
  var _this3 = this;
331
331
  return { moderate: function() {
332
332
  var _ref5 = _asyncToGenerator(function* (options) {
333
- return _this3.assets.analyze(toTextAssetOptions(options));
333
+ return _this3.assets.moderate(toTextAssetOptions(options));
334
334
  });
335
335
  return function moderate(_x2) {
336
336
  return _ref5.apply(this, arguments);
@@ -381,11 +381,12 @@ list: function() {
381
381
  return _ref10.apply(this, arguments);
382
382
  };
383
383
  }(),
384
- analyze: function() {
384
+ moderate: function() {
385
385
  var _ref11 = _asyncToGenerator(function* (options) {
386
+ if ("content" in options && "plainText" in options.content && (typeof options.content.plainText !== "string" || !options.content.plainText.trim())) throw calmLensError(PUBLIC_ERROR_CODES.INVALID_UPLOAD_PAYLOAD, { message: "Text to moderate must be a non-empty string" });
386
387
  return _this4.createAsset(options, _this4.analyzedStatus);
387
388
  });
388
- return function analyze(_x7) {
389
+ return function moderate(_x7) {
389
390
  return _ref11.apply(this, arguments);
390
391
  };
391
392
  }(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "calmlens",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Censkh/CalmLens.git",
@@ -87,5 +87,5 @@
87
87
  }
88
88
  }
89
89
  },
90
- "description": "CalmLens SDK Also published as @calmlens/js-sdk."
90
+ "description": "CalmLens SDK Also published as @calmlens/sdk."
91
91
  }