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/README.md +61 -39
- package/bin/calmlens.js +217 -80
- package/cjs/CalmLensTypes-DG_kHVqY.d.ts +3521 -0
- package/cjs/{CalmLensUtils-CjdO9v--.js → CalmLensUtils-0QaxbI3A.js} +95 -93
- package/cjs/index.d.ts +2602 -24
- package/cjs/index.js +533 -124
- package/cjs/testing.d.ts +2 -2
- package/cjs/testing.js +6 -27
- package/esm/CalmLensTypes-DG_kHVqY.d.ts +3521 -0
- package/esm/{CalmLensUtils-B3Eiz2Ro.js → CalmLensUtils-BQEgxGWk.js} +68 -88
- package/esm/index.d.ts +2602 -24
- package/esm/index.js +526 -124
- package/esm/testing.d.ts +2 -2
- package/esm/testing.js +5 -4
- package/package.json +2 -2
- package/cjs/CalmLensTypes-DkqoKBwF.d.ts +0 -1761
- package/esm/CalmLensTypes-DkqoKBwF.d.ts +0 -1761
package/esm/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
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.
|
|
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/
|
|
90
|
+
"description": "CalmLens SDK Also published as @calmlens/sdk."
|
|
91
91
|
}
|