calmlens 0.3.0 → 0.3.1
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/bin/calmlens.js +5 -0
- package/cjs/{CalmLensUtils-DioFUAmI.js → CalmLensUtils-DocJkqQj.js} +5 -0
- package/cjs/index.js +1 -1
- package/cjs/testing.js +8 -1
- package/esm/{CalmLensUtils-Dixed1Ox.js → CalmLensUtils--N_91gHC.js} +5 -0
- package/esm/index.js +1 -1
- package/esm/testing.js +8 -1
- package/package.json +1 -1
package/bin/calmlens.js
CHANGED
|
@@ -100,6 +100,11 @@ const PUBLIC_ERROR_CODES = {
|
|
|
100
100
|
defaultMessage: "This API key belongs to a different project. Use a key created for the project that owns this resource.",
|
|
101
101
|
status: 403
|
|
102
102
|
}),
|
|
103
|
+
API_KEY_NOT_ACCEPTED: new sendable_error.ErrorCode({
|
|
104
|
+
id: "auth/api-key-not-accepted",
|
|
105
|
+
defaultMessage: "API keys are only accepted by the public API at /v1.",
|
|
106
|
+
status: 403
|
|
107
|
+
}),
|
|
103
108
|
FILE_TOO_LARGE: new sendable_error.ErrorCode({
|
|
104
109
|
id: "upload/file-too-large",
|
|
105
110
|
defaultMessage: "File size exceeds limit. Maximum size for images is 10MB, for other files is 5GB.",
|
|
@@ -135,6 +135,11 @@ const PUBLIC_ERROR_CODES = {
|
|
|
135
135
|
defaultMessage: "This API key belongs to a different project. Use a key created for the project that owns this resource.",
|
|
136
136
|
status: 403
|
|
137
137
|
}),
|
|
138
|
+
API_KEY_NOT_ACCEPTED: new sendable_error.ErrorCode({
|
|
139
|
+
id: "auth/api-key-not-accepted",
|
|
140
|
+
defaultMessage: "API keys are only accepted by the public API at /v1.",
|
|
141
|
+
status: 403
|
|
142
|
+
}),
|
|
138
143
|
FILE_TOO_LARGE: new sendable_error.ErrorCode({
|
|
139
144
|
id: "upload/file-too-large",
|
|
140
145
|
defaultMessage: "File size exceeds limit. Maximum size for images is 10MB, for other files is 5GB.",
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensUtils = require("./CalmLensUtils-
|
|
2
|
+
const require_CalmLensUtils = require("./CalmLensUtils-DocJkqQj.js");
|
|
3
3
|
let api_def = require("api-def");
|
|
4
4
|
//#region src/client/CalmLensClient.ts
|
|
5
5
|
const _excluded = ["uint8Array"];
|
package/cjs/testing.js
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_CalmLensUtils = require("./CalmLensUtils-
|
|
24
|
+
const require_CalmLensUtils = require("./CalmLensUtils-DocJkqQj.js");
|
|
25
25
|
let zod = require("zod");
|
|
26
26
|
zod = __toESM(zod);
|
|
27
27
|
//#region ../shared/src/Permissions.ts
|
|
@@ -64,6 +64,13 @@ const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
|
64
64
|
}
|
|
65
65
|
return false;
|
|
66
66
|
});
|
|
67
|
+
const SYSTEM_PERMISSION_SCHEMA = zod.enum([
|
|
68
|
+
"system:admin",
|
|
69
|
+
"system:assets:read-all",
|
|
70
|
+
"system:uploads:unlimited"
|
|
71
|
+
]);
|
|
72
|
+
zod.array(SYSTEM_PERMISSION_SCHEMA);
|
|
73
|
+
zod.enum(["active", "banned"]);
|
|
67
74
|
//#endregion
|
|
68
75
|
//#region src/testing/MockApiKey.ts
|
|
69
76
|
const MOCK_API_KEY_PREFIX = "sk_test_";
|
|
@@ -135,6 +135,11 @@ const PUBLIC_ERROR_CODES = {
|
|
|
135
135
|
defaultMessage: "This API key belongs to a different project. Use a key created for the project that owns this resource.",
|
|
136
136
|
status: 403
|
|
137
137
|
}),
|
|
138
|
+
API_KEY_NOT_ACCEPTED: new ErrorCode({
|
|
139
|
+
id: "auth/api-key-not-accepted",
|
|
140
|
+
defaultMessage: "API keys are only accepted by the public API at /v1.",
|
|
141
|
+
status: 403
|
|
142
|
+
}),
|
|
138
143
|
FILE_TOO_LARGE: new ErrorCode({
|
|
139
144
|
id: "upload/file-too-large",
|
|
140
145
|
defaultMessage: "File size exceeds limit. Maximum size for images is 10MB, for other files is 5GB.",
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as getAssetPayloadByteLength, a as CalmLensError, b as _asyncToGenerator, c as DOMAIN, d as getRejectedUploadMimeTypeError, f as isRejectedUploadMimeType, g as assetToData, i as _objectWithoutProperties, m as stringifyJsonCanonical, n as verifyWebhookSignature, o as SDK_ERRORS, p as PUBLIC_ERROR_CODES, r as _objectSpread2, s as calmLensError, t as toTextAssetOptions, v as getRawBase64, y as validateAssetPayload } from "./CalmLensUtils
|
|
1
|
+
import { _ as getAssetPayloadByteLength, a as CalmLensError, b as _asyncToGenerator, c as DOMAIN, d as getRejectedUploadMimeTypeError, f as isRejectedUploadMimeType, g as assetToData, i as _objectWithoutProperties, m as stringifyJsonCanonical, n as verifyWebhookSignature, o as SDK_ERRORS, p as PUBLIC_ERROR_CODES, r as _objectSpread2, s as calmLensError, t as toTextAssetOptions, v as getRawBase64, y as validateAssetPayload } from "./CalmLensUtils--N_91gHC.js";
|
|
2
2
|
import { Api, RequestCoalescingMiddleware, RequestEvent, getErrorResponse, isRequestError } from "api-def";
|
|
3
3
|
//#region src/client/CalmLensClient.ts
|
|
4
4
|
const _excluded = ["uint8Array"];
|
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
|
|
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--N_91gHC.js";
|
|
2
2
|
import * as zod from "zod";
|
|
3
3
|
//#region ../shared/src/Permissions.ts
|
|
4
4
|
const ACTION_SCHEMA = zod.enum([
|
|
@@ -40,6 +40,13 @@ const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
|
40
40
|
}
|
|
41
41
|
return false;
|
|
42
42
|
});
|
|
43
|
+
const SYSTEM_PERMISSION_SCHEMA = zod.enum([
|
|
44
|
+
"system:admin",
|
|
45
|
+
"system:assets:read-all",
|
|
46
|
+
"system:uploads:unlimited"
|
|
47
|
+
]);
|
|
48
|
+
zod.array(SYSTEM_PERMISSION_SCHEMA);
|
|
49
|
+
zod.enum(["active", "banned"]);
|
|
43
50
|
//#endregion
|
|
44
51
|
//#region src/testing/MockApiKey.ts
|
|
45
52
|
const MOCK_API_KEY_PREFIX = "sk_test_";
|