@calmlens/sdk 0.15.0 → 0.16.2
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 +30 -10
- package/cjs/{CalmLensConnection-DoemramF.js → CalmLensConnection-5Hj3trGr.js} +2 -2
- package/cjs/{CalmLensUtils-Cv1Ylp9-.js → CalmLensUtils-BeIl1N6N.js} +7 -7
- package/cjs/{CalmLensVersion-CuxKdijk.js → CalmLensVersion-BGpB9t4-.js} +6 -1
- package/cjs/{CalmLensWebhooks-qrL-Zdu3.js → CalmLensWebhooks-CogUYk8-.js} +7 -7
- package/cjs/Classification-BNhgwGEm-DmA9VEuE.d.ts +4806 -0
- package/cjs/TestTriggers-CRKtulyp-vrzEq2wm.d.ts +44 -0
- package/cjs/{WebhookPayload-vy8HNMaK.d.ts → WebhookPayload-CJoIkGBD.d.ts} +1019 -5100
- package/cjs/app.d.ts +4 -3
- package/cjs/app.js +3 -3
- package/cjs/{index-Dz340UQ9.d.ts → index-C9Xw1aid.d.ts} +139 -141
- package/cjs/index.d.ts +4 -3
- package/cjs/index.js +1 -1
- package/cjs/server.d.ts +8 -7
- package/cjs/server.js +17 -22
- package/cjs/test-inputs.d.ts +2 -0
- package/cjs/test-inputs.js +265 -0
- package/cjs/testing.d.ts +5 -5
- package/cjs/testing.js +7943 -101
- package/esm/{CalmLensConnection-CQLoUoBd.js → CalmLensConnection-BAJdoZHy.js} +2 -2
- package/esm/{CalmLensUtils-B3S--hBG.js → CalmLensUtils-DqniTKJ8.js} +7 -7
- package/esm/{CalmLensVersion-N71PMJAz.js → CalmLensVersion-l_khh4nS.js} +6 -1
- package/esm/{CalmLensWebhooks-BxMSx1Vm.js → CalmLensWebhooks-BtrKKLvg.js} +7 -7
- package/esm/Classification-BNhgwGEm-DmA9VEuE.d.ts +4806 -0
- package/esm/TestTriggers-CRKtulyp-vrzEq2wm.d.ts +44 -0
- package/esm/{WebhookPayload-vy8HNMaK.d.ts → WebhookPayload-CJoIkGBD.d.ts} +1019 -5100
- package/esm/app.d.ts +4 -3
- package/esm/app.js +3 -3
- package/esm/{index-Dz340UQ9.d.ts → index-C9Xw1aid.d.ts} +139 -141
- package/esm/index.d.ts +4 -3
- package/esm/index.js +1 -1
- package/esm/server.d.ts +8 -7
- package/esm/server.js +17 -22
- package/esm/test-inputs.d.ts +2 -0
- package/esm/test-inputs.js +256 -0
- package/esm/testing.d.ts +5 -5
- package/esm/testing.js +7922 -80
- package/package.json +19 -7
package/cjs/app.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, At as AssetSearchQuery, B as Lens, C as CdnAssetUrlOptions, Ct as EventType, D as CreateAssetSignedUrlOptions, Dt as Order, E as ConnectionOptions, Et as CursorPage, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHold, N as EnsureLensesOptions, Nt as AssetSafetyHoldReason, O as CreateFolderOptions, Ot as LensType, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventSeverity, T as CdnTransform, Tt as Folder, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResponse, _t as TypedEvent, a as AssetChildrenPage, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFactValues, c as AssetContentRemovalReason, ct as UploadedAsset, d as AssetModerationAction, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetModerationStatus, ft as WebhookPayloadInput, g as AssetReviewerAction, gt as EventAsset, h as AssetProcessingStatus, i as AssetChecksums, it as UpdateAssetOptions, j as DeleteAssetOptions, k as CreateMultipartUploadPartOptions, kt as AssetSearchMatchField, l as AssetContentStatus, lt as VerifyWebhookSignatureOptions, m as AssetProcessing, nt as SignedUrl, o as AssetContent, ot as UploadAssetPartOptions, p as AssetPage, pt as GetEventsResponse, q as MoveFolderOptions, r as Asset, rt as SubmitAssetOptions, s as AssetContentOptions, st as UploadPresetSubmitAssetOptions, t as ReceivedWebhookEventPayload, tt as SignedUploadToken, u as AssetModeration, ut as WaitForAssetDecisionOptions, v as AssetSearchResult, vt as EventCategory, w as CdnServeOptions, x as CalmLensAppClientOptions, xt as EventFacts, y as AssetType, yt as EventFact, z as IterateAssetsOptions } from "./WebhookPayload-CJoIkGBD.js";
|
|
2
|
+
import { _ as ApiErrorCode, a as DetectedPerson, c as ProcessingFeatureStage, d as CALMLENS_ERROR_CODES, f as CalmLensError, g as SdkErrorCode, h as CalmLensErrorOptions, i as DetectedFace, l as ProcessingFeatures, m as CalmLensErrorDetails, n as AgeRange, o as ProcessingFeatureId, p as CalmLensErrorCode, r as BoundingBox, s as ProcessingFeatureResults, t as FlaggedContentPolicy, u as SDK_VERSION } from "./index-C9Xw1aid.js";
|
|
3
|
+
import { a as ClassificationNotEvaluatedReason, c as FlaggedContentAction, i as ClassificationLabel, l as Likelihood, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as ClassificationReport, t as ClassificationCategories, u as ModerationQualifier } from "./Classification-BNhgwGEm-DmA9VEuE.js";
|
|
3
4
|
//#region src/client/CalmLensAppClient.d.ts
|
|
4
5
|
declare const inspectSymbol: unique symbol;
|
|
5
6
|
/**
|
|
@@ -40,4 +41,4 @@ declare class CalmLensAppClient {
|
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
//#endregion
|
|
43
|
-
export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type
|
|
44
|
+
export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type CursorPage, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type PreviewImage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
|
package/cjs/app.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensVersion = require("./CalmLensVersion-
|
|
2
|
+
const require_CalmLensVersion = require("./CalmLensVersion-BGpB9t4-.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensUtils = require("./CalmLensUtils-
|
|
5
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
4
|
+
const require_CalmLensUtils = require("./CalmLensUtils-BeIl1N6N.js");
|
|
5
|
+
const require_CalmLensConnection = require("./CalmLensConnection-5Hj3trGr.js");
|
|
6
6
|
//#region src/client/CalmLensAppClient.ts
|
|
7
7
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
8
8
|
/**
|
|
@@ -1,147 +1,10 @@
|
|
|
1
|
-
import "./WebhookPayload-
|
|
1
|
+
import "./WebhookPayload-CJoIkGBD.js";
|
|
2
|
+
import "./Classification-BNhgwGEm-DmA9VEuE.js";
|
|
2
3
|
import * as zod from "zod";
|
|
3
|
-
//#region ../shared/src/ProcessingFeatures.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Optional analyses a request can turn on with `processingOptions.features.<id>`. The catalog is
|
|
6
|
-
* the single source for the request and result schemas, cache keys and metering. Features are
|
|
7
|
-
* chosen per request only; there is no project-level default.
|
|
8
|
-
*/
|
|
9
|
-
/** How mature a feature is. Beta results may change shape. */
|
|
10
|
-
declare const PROCESSING_FEATURE_STAGES: readonly ["beta", "ga"];
|
|
11
|
-
type ProcessingFeatureStage = (typeof PROCESSING_FEATURE_STAGES)[number];
|
|
12
|
-
declare const PROCESSING_FEATURE_IDS: readonly ["ocr", "personDetection", "faceDetection"];
|
|
13
|
-
type ProcessingFeatureId = (typeof PROCESSING_FEATURE_IDS)[number];
|
|
14
|
-
declare const PROCESSING_FEATURES_SCHEMA: zod.ZodObject<{
|
|
15
|
-
ocr: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
16
|
-
enabled: zod.ZodBoolean;
|
|
17
|
-
}, zod.core.$strict>>>;
|
|
18
|
-
personDetection: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
19
|
-
enabled: zod.ZodBoolean;
|
|
20
|
-
}, zod.core.$strict>>>;
|
|
21
|
-
faceDetection: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
22
|
-
enabled: zod.ZodBoolean;
|
|
23
|
-
ageEstimation: zod.ZodOptional<zod.ZodBoolean>;
|
|
24
|
-
}, zod.core.$strict>>>;
|
|
25
|
-
}, zod.core.$strict>;
|
|
26
|
-
type ProcessingFeatures = zod.infer<typeof PROCESSING_FEATURES_SCHEMA>;
|
|
27
|
-
/** Position and size as fractions of the image width and height, from 0 to 1. */
|
|
28
|
-
declare const BOUNDING_BOX_SCHEMA: zod.ZodObject<{
|
|
29
|
-
left: zod.ZodNumber;
|
|
30
|
-
top: zod.ZodNumber;
|
|
31
|
-
width: zod.ZodNumber;
|
|
32
|
-
height: zod.ZodNumber;
|
|
33
|
-
}, zod.core.$strict>;
|
|
34
|
-
type BoundingBox = zod.infer<typeof BOUNDING_BOX_SCHEMA>;
|
|
35
|
-
declare const AGE_RANGE_SCHEMA: zod.ZodObject<{
|
|
36
|
-
low: zod.ZodNumber;
|
|
37
|
-
high: zod.ZodNumber;
|
|
38
|
-
}, zod.core.$strict>;
|
|
39
|
-
type AgeRange = zod.infer<typeof AGE_RANGE_SCHEMA>;
|
|
40
|
-
declare const DETECTED_PERSON_SCHEMA: zod.ZodObject<{
|
|
41
|
-
box: zod.ZodObject<{
|
|
42
|
-
left: zod.ZodNumber;
|
|
43
|
-
top: zod.ZodNumber;
|
|
44
|
-
width: zod.ZodNumber;
|
|
45
|
-
height: zod.ZodNumber;
|
|
46
|
-
}, zod.core.$strict>;
|
|
47
|
-
confidence: zod.ZodNumber;
|
|
48
|
-
}, zod.core.$strict>;
|
|
49
|
-
type DetectedPerson = zod.infer<typeof DETECTED_PERSON_SCHEMA>;
|
|
50
|
-
declare const DETECTED_FACE_SCHEMA: zod.ZodObject<{
|
|
51
|
-
box: zod.ZodObject<{
|
|
52
|
-
left: zod.ZodNumber;
|
|
53
|
-
top: zod.ZodNumber;
|
|
54
|
-
width: zod.ZodNumber;
|
|
55
|
-
height: zod.ZodNumber;
|
|
56
|
-
}, zod.core.$strict>;
|
|
57
|
-
confidence: zod.ZodNumber;
|
|
58
|
-
ageRange: zod.ZodOptional<zod.ZodObject<{
|
|
59
|
-
low: zod.ZodNumber;
|
|
60
|
-
high: zod.ZodNumber;
|
|
61
|
-
}, zod.core.$strict>>;
|
|
62
|
-
}, zod.core.$strict>;
|
|
63
|
-
type DetectedFace = zod.infer<typeof DETECTED_FACE_SCHEMA>;
|
|
64
|
-
declare const PROCESSING_FEATURE_RESULTS_SCHEMA: zod.ZodObject<{
|
|
65
|
-
personDetection: zod.ZodOptional<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
|
|
66
|
-
status: zod.ZodLiteral<"evaluated">;
|
|
67
|
-
stage: zod.ZodEnum<{
|
|
68
|
-
beta: "beta";
|
|
69
|
-
ga: "ga";
|
|
70
|
-
}>;
|
|
71
|
-
people: zod.ZodArray<zod.ZodObject<{
|
|
72
|
-
box: zod.ZodObject<{
|
|
73
|
-
left: zod.ZodNumber;
|
|
74
|
-
top: zod.ZodNumber;
|
|
75
|
-
width: zod.ZodNumber;
|
|
76
|
-
height: zod.ZodNumber;
|
|
77
|
-
}, zod.core.$strict>;
|
|
78
|
-
confidence: zod.ZodNumber;
|
|
79
|
-
}, zod.core.$strict>>;
|
|
80
|
-
}, zod.core.$strict>, zod.ZodObject<{
|
|
81
|
-
status: zod.ZodLiteral<"not-evaluated">;
|
|
82
|
-
stage: zod.ZodEnum<{
|
|
83
|
-
beta: "beta";
|
|
84
|
-
ga: "ga";
|
|
85
|
-
}>;
|
|
86
|
-
reason: zod.ZodEnum<{
|
|
87
|
-
"not-supported": "not-supported";
|
|
88
|
-
unavailable: "unavailable";
|
|
89
|
-
}>;
|
|
90
|
-
}, zod.core.$strict>], "status">>;
|
|
91
|
-
faceDetection: zod.ZodOptional<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
|
|
92
|
-
status: zod.ZodLiteral<"evaluated">;
|
|
93
|
-
stage: zod.ZodEnum<{
|
|
94
|
-
beta: "beta";
|
|
95
|
-
ga: "ga";
|
|
96
|
-
}>;
|
|
97
|
-
faces: zod.ZodArray<zod.ZodObject<{
|
|
98
|
-
box: zod.ZodObject<{
|
|
99
|
-
left: zod.ZodNumber;
|
|
100
|
-
top: zod.ZodNumber;
|
|
101
|
-
width: zod.ZodNumber;
|
|
102
|
-
height: zod.ZodNumber;
|
|
103
|
-
}, zod.core.$strict>;
|
|
104
|
-
confidence: zod.ZodNumber;
|
|
105
|
-
ageRange: zod.ZodOptional<zod.ZodObject<{
|
|
106
|
-
low: zod.ZodNumber;
|
|
107
|
-
high: zod.ZodNumber;
|
|
108
|
-
}, zod.core.$strict>>;
|
|
109
|
-
}, zod.core.$strict>>;
|
|
110
|
-
}, zod.core.$strict>, zod.ZodObject<{
|
|
111
|
-
status: zod.ZodLiteral<"not-evaluated">;
|
|
112
|
-
stage: zod.ZodEnum<{
|
|
113
|
-
beta: "beta";
|
|
114
|
-
ga: "ga";
|
|
115
|
-
}>;
|
|
116
|
-
reason: zod.ZodEnum<{
|
|
117
|
-
"not-supported": "not-supported";
|
|
118
|
-
unavailable: "unavailable";
|
|
119
|
-
}>;
|
|
120
|
-
}, zod.core.$strict>], "status">>;
|
|
121
|
-
}, zod.core.$strict>;
|
|
122
|
-
type ProcessingFeatureResults = zod.infer<typeof PROCESSING_FEATURE_RESULTS_SCHEMA>;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region ../shared/src/Project.d.ts
|
|
125
|
-
declare const FLAGGED_CONTENT_ACTION_SCHEMA: zod.ZodEnum<{
|
|
126
|
-
alert: "alert";
|
|
127
|
-
hide: "hide";
|
|
128
|
-
ignore: "ignore";
|
|
129
|
-
purge: "purge";
|
|
130
|
-
}>;
|
|
131
|
-
type FlaggedContentAction = zod.infer<typeof FLAGGED_CONTENT_ACTION_SCHEMA>;
|
|
132
|
-
declare const FLAGGED_CONTENT_POLICY_SCHEMA: zod.ZodObject<{
|
|
133
|
-
action: zod.ZodEnum<{
|
|
134
|
-
alert: "alert";
|
|
135
|
-
hide: "hide";
|
|
136
|
-
ignore: "ignore";
|
|
137
|
-
purge: "purge";
|
|
138
|
-
}>;
|
|
139
|
-
}, zod.core.$strip>;
|
|
140
|
-
type FlaggedContentPolicy = zod.infer<typeof FLAGGED_CONTENT_POLICY_SCHEMA>;
|
|
141
|
-
//#endregion
|
|
142
4
|
//#region src/client/CalmLensErrorCodes.d.ts
|
|
143
5
|
/** Error codes the CalmLens API documents, by name. */
|
|
144
6
|
declare const API_ERROR_CODES: {
|
|
7
|
+
readonly INVALID_CURSOR: "validation/invalid-cursor";
|
|
145
8
|
readonly MISSING_TOKEN: "auth/missing-token";
|
|
146
9
|
readonly INVALID_API_KEY: "auth/invalid-api-key";
|
|
147
10
|
readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
|
|
@@ -234,6 +97,7 @@ declare const SDK_ERROR_CODES: {
|
|
|
234
97
|
type SdkErrorCode = (typeof SDK_ERROR_CODES)[keyof typeof SDK_ERROR_CODES];
|
|
235
98
|
/** Every error code the SDK can throw: the documented API codes and the SDK's own `sdk/*` codes. */
|
|
236
99
|
declare const CALMLENS_ERROR_CODES: {
|
|
100
|
+
readonly INVALID_CURSOR: "validation/invalid-cursor";
|
|
237
101
|
readonly MISSING_TOKEN: "auth/missing-token";
|
|
238
102
|
readonly INVALID_API_KEY: "auth/invalid-api-key";
|
|
239
103
|
readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
|
|
@@ -375,4 +239,138 @@ declare class CalmLensError extends Error {
|
|
|
375
239
|
/** This SDK's version, from its package.json. */
|
|
376
240
|
declare const SDK_VERSION: string;
|
|
377
241
|
//#endregion
|
|
378
|
-
|
|
242
|
+
//#region src/contract/ProcessingFeatures.d.ts
|
|
243
|
+
//#region packages/shared/src/ProcessingFeatures.d.ts
|
|
244
|
+
/**
|
|
245
|
+
* Optional analyses a request can turn on with `processingOptions.features.<id>`. The catalog is
|
|
246
|
+
* the single source for the request and result schemas, cache keys and metering. Features are
|
|
247
|
+
* chosen per request only; there is no project-level default.
|
|
248
|
+
*/
|
|
249
|
+
/** How mature a feature is. Beta results may change shape. */
|
|
250
|
+
declare const PROCESSING_FEATURE_STAGES: readonly ["beta", "ga"];
|
|
251
|
+
type ProcessingFeatureStage = (typeof PROCESSING_FEATURE_STAGES)[number];
|
|
252
|
+
declare const PROCESSING_FEATURE_IDS: readonly ["ocr", "personDetection", "faceDetection"];
|
|
253
|
+
type ProcessingFeatureId = (typeof PROCESSING_FEATURE_IDS)[number];
|
|
254
|
+
declare const PROCESSING_FEATURES_SCHEMA: zod.ZodObject<{
|
|
255
|
+
ocr: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
256
|
+
enabled: zod.ZodBoolean;
|
|
257
|
+
}, zod.core.$strict>>>;
|
|
258
|
+
personDetection: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
259
|
+
enabled: zod.ZodBoolean;
|
|
260
|
+
}, zod.core.$strict>>>;
|
|
261
|
+
faceDetection: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
262
|
+
enabled: zod.ZodBoolean;
|
|
263
|
+
ageEstimation: zod.ZodOptional<zod.ZodBoolean>;
|
|
264
|
+
}, zod.core.$strict>>>;
|
|
265
|
+
}, zod.core.$strict>;
|
|
266
|
+
type ProcessingFeatures = zod.infer<typeof PROCESSING_FEATURES_SCHEMA>;
|
|
267
|
+
/** Position and size as fractions of the image width and height, from 0 to 1. */
|
|
268
|
+
declare const BOUNDING_BOX_SCHEMA: zod.ZodObject<{
|
|
269
|
+
left: zod.ZodNumber;
|
|
270
|
+
top: zod.ZodNumber;
|
|
271
|
+
width: zod.ZodNumber;
|
|
272
|
+
height: zod.ZodNumber;
|
|
273
|
+
}, zod.core.$strict>;
|
|
274
|
+
type BoundingBox = zod.infer<typeof BOUNDING_BOX_SCHEMA>;
|
|
275
|
+
declare const AGE_RANGE_SCHEMA: zod.ZodObject<{
|
|
276
|
+
low: zod.ZodNumber;
|
|
277
|
+
high: zod.ZodNumber;
|
|
278
|
+
}, zod.core.$strict>;
|
|
279
|
+
type AgeRange = zod.infer<typeof AGE_RANGE_SCHEMA>;
|
|
280
|
+
declare const DETECTED_PERSON_SCHEMA: zod.ZodObject<{
|
|
281
|
+
box: zod.ZodObject<{
|
|
282
|
+
left: zod.ZodNumber;
|
|
283
|
+
top: zod.ZodNumber;
|
|
284
|
+
width: zod.ZodNumber;
|
|
285
|
+
height: zod.ZodNumber;
|
|
286
|
+
}, zod.core.$strict>;
|
|
287
|
+
confidence: zod.ZodNumber;
|
|
288
|
+
}, zod.core.$strict>;
|
|
289
|
+
type DetectedPerson = zod.infer<typeof DETECTED_PERSON_SCHEMA>;
|
|
290
|
+
declare const DETECTED_FACE_SCHEMA: zod.ZodObject<{
|
|
291
|
+
box: zod.ZodObject<{
|
|
292
|
+
left: zod.ZodNumber;
|
|
293
|
+
top: zod.ZodNumber;
|
|
294
|
+
width: zod.ZodNumber;
|
|
295
|
+
height: zod.ZodNumber;
|
|
296
|
+
}, zod.core.$strict>;
|
|
297
|
+
confidence: zod.ZodNumber;
|
|
298
|
+
ageRange: zod.ZodOptional<zod.ZodObject<{
|
|
299
|
+
low: zod.ZodNumber;
|
|
300
|
+
high: zod.ZodNumber;
|
|
301
|
+
}, zod.core.$strict>>;
|
|
302
|
+
}, zod.core.$strict>;
|
|
303
|
+
type DetectedFace = zod.infer<typeof DETECTED_FACE_SCHEMA>;
|
|
304
|
+
declare const PROCESSING_FEATURE_RESULTS_SCHEMA: zod.ZodObject<{
|
|
305
|
+
personDetection: zod.ZodOptional<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
|
|
306
|
+
status: zod.ZodLiteral<"evaluated">;
|
|
307
|
+
stage: zod.ZodEnum<{
|
|
308
|
+
beta: "beta";
|
|
309
|
+
ga: "ga";
|
|
310
|
+
}>;
|
|
311
|
+
people: zod.ZodArray<zod.ZodObject<{
|
|
312
|
+
box: zod.ZodObject<{
|
|
313
|
+
left: zod.ZodNumber;
|
|
314
|
+
top: zod.ZodNumber;
|
|
315
|
+
width: zod.ZodNumber;
|
|
316
|
+
height: zod.ZodNumber;
|
|
317
|
+
}, zod.core.$strict>;
|
|
318
|
+
confidence: zod.ZodNumber;
|
|
319
|
+
}, zod.core.$strict>>;
|
|
320
|
+
}, zod.core.$strict>, zod.ZodObject<{
|
|
321
|
+
status: zod.ZodLiteral<"not-evaluated">;
|
|
322
|
+
stage: zod.ZodEnum<{
|
|
323
|
+
beta: "beta";
|
|
324
|
+
ga: "ga";
|
|
325
|
+
}>;
|
|
326
|
+
reason: zod.ZodEnum<{
|
|
327
|
+
"not-supported": "not-supported";
|
|
328
|
+
unavailable: "unavailable";
|
|
329
|
+
}>;
|
|
330
|
+
}, zod.core.$strict>], "status">>;
|
|
331
|
+
faceDetection: zod.ZodOptional<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
|
|
332
|
+
status: zod.ZodLiteral<"evaluated">;
|
|
333
|
+
stage: zod.ZodEnum<{
|
|
334
|
+
beta: "beta";
|
|
335
|
+
ga: "ga";
|
|
336
|
+
}>;
|
|
337
|
+
faces: zod.ZodArray<zod.ZodObject<{
|
|
338
|
+
box: zod.ZodObject<{
|
|
339
|
+
left: zod.ZodNumber;
|
|
340
|
+
top: zod.ZodNumber;
|
|
341
|
+
width: zod.ZodNumber;
|
|
342
|
+
height: zod.ZodNumber;
|
|
343
|
+
}, zod.core.$strict>;
|
|
344
|
+
confidence: zod.ZodNumber;
|
|
345
|
+
ageRange: zod.ZodOptional<zod.ZodObject<{
|
|
346
|
+
low: zod.ZodNumber;
|
|
347
|
+
high: zod.ZodNumber;
|
|
348
|
+
}, zod.core.$strict>>;
|
|
349
|
+
}, zod.core.$strict>>;
|
|
350
|
+
}, zod.core.$strict>, zod.ZodObject<{
|
|
351
|
+
status: zod.ZodLiteral<"not-evaluated">;
|
|
352
|
+
stage: zod.ZodEnum<{
|
|
353
|
+
beta: "beta";
|
|
354
|
+
ga: "ga";
|
|
355
|
+
}>;
|
|
356
|
+
reason: zod.ZodEnum<{
|
|
357
|
+
"not-supported": "not-supported";
|
|
358
|
+
unavailable: "unavailable";
|
|
359
|
+
}>;
|
|
360
|
+
}, zod.core.$strict>], "status">>;
|
|
361
|
+
}, zod.core.$strict>;
|
|
362
|
+
type ProcessingFeatureResults = zod.infer<typeof PROCESSING_FEATURE_RESULTS_SCHEMA>;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/contract/Project.d.ts
|
|
365
|
+
//#region packages/shared/src/Project.d.ts
|
|
366
|
+
declare const FLAGGED_CONTENT_POLICY_SCHEMA: zod.ZodObject<{
|
|
367
|
+
action: zod.ZodEnum<{
|
|
368
|
+
alert: "alert";
|
|
369
|
+
hide: "hide";
|
|
370
|
+
ignore: "ignore";
|
|
371
|
+
purge: "purge";
|
|
372
|
+
}>;
|
|
373
|
+
}, zod.core.$strip>;
|
|
374
|
+
type FlaggedContentPolicy = zod.infer<typeof FLAGGED_CONTENT_POLICY_SCHEMA>;
|
|
375
|
+
//#endregion
|
|
376
|
+
export { ApiErrorCode as _, DetectedPerson as a, ProcessingFeatureStage as c, CALMLENS_ERROR_CODES as d, CalmLensError as f, SdkErrorCode as g, CalmLensErrorOptions as h, DetectedFace as i, ProcessingFeatures as l, CalmLensErrorDetails as m, AgeRange as n, ProcessingFeatureId as o, CalmLensErrorCode as p, BoundingBox as r, ProcessingFeatureResults as s, FlaggedContentPolicy as t, SDK_VERSION as u };
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as
|
|
3
|
-
|
|
1
|
+
import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, At as AssetSearchQuery, B as Lens, C as CdnAssetUrlOptions, Ct as EventType, D as CreateAssetSignedUrlOptions, Dt as Order, E as ConnectionOptions, Et as CursorPage, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHold, N as EnsureLensesOptions, Nt as AssetSafetyHoldReason, O as CreateFolderOptions, Ot as LensType, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventSeverity, T as CdnTransform, Tt as Folder, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResponse, _t as TypedEvent, a as AssetChildrenPage, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFactValues, c as AssetContentRemovalReason, ct as UploadedAsset, d as AssetModerationAction, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetModerationStatus, ft as WebhookPayloadInput, g as AssetReviewerAction, gt as EventAsset, h as AssetProcessingStatus, i as AssetChecksums, it as UpdateAssetOptions, j as DeleteAssetOptions, k as CreateMultipartUploadPartOptions, kt as AssetSearchMatchField, l as AssetContentStatus, lt as VerifyWebhookSignatureOptions, m as AssetProcessing, nt as SignedUrl, o as AssetContent, ot as UploadAssetPartOptions, p as AssetPage, pt as GetEventsResponse, q as MoveFolderOptions, r as Asset, rt as SubmitAssetOptions, s as AssetContentOptions, st as UploadPresetSubmitAssetOptions, t as ReceivedWebhookEventPayload, tt as SignedUploadToken, u as AssetModeration, ut as WaitForAssetDecisionOptions, v as AssetSearchResult, vt as EventCategory, w as CdnServeOptions, x as CalmLensAppClientOptions, xt as EventFacts, y as AssetType, yt as EventFact, z as IterateAssetsOptions } from "./WebhookPayload-CJoIkGBD.js";
|
|
2
|
+
import { _ as ApiErrorCode, a as DetectedPerson, c as ProcessingFeatureStage, d as CALMLENS_ERROR_CODES, f as CalmLensError, g as SdkErrorCode, h as CalmLensErrorOptions, i as DetectedFace, l as ProcessingFeatures, m as CalmLensErrorDetails, n as AgeRange, o as ProcessingFeatureId, p as CalmLensErrorCode, r as BoundingBox, s as ProcessingFeatureResults, t as FlaggedContentPolicy, u as SDK_VERSION } from "./index-C9Xw1aid.js";
|
|
3
|
+
import { a as ClassificationNotEvaluatedReason, c as FlaggedContentAction, i as ClassificationLabel, l as Likelihood, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as ClassificationReport, t as ClassificationCategories, u as ModerationQualifier } from "./Classification-BNhgwGEm-DmA9VEuE.js";
|
|
4
|
+
export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type CursorPage, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type PreviewImage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensVersion = require("./CalmLensVersion-
|
|
2
|
+
const require_CalmLensVersion = require("./CalmLensVersion-BGpB9t4-.js");
|
|
3
3
|
exports.CALMLENS_ERROR_CODES = require_CalmLensVersion.CALMLENS_ERROR_CODES;
|
|
4
4
|
exports.CalmLensError = require_CalmLensVersion.CalmLensError;
|
|
5
5
|
exports.SDK_VERSION = require_CalmLensVersion.SDK_VERSION;
|
package/cjs/server.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, At as AssetSearchQuery, B as Lens, C as CdnAssetUrlOptions, Ct as EventType, D as CreateAssetSignedUrlOptions, Dt as Order, E as ConnectionOptions, Et as CursorPage, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHold, N as EnsureLensesOptions, Nt as AssetSafetyHoldReason, O as CreateFolderOptions, Ot as LensType, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventSeverity, T as CdnTransform, Tt as Folder, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResponse, _t as TypedEvent, a as AssetChildrenPage, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFactValues, c as AssetContentRemovalReason, ct as UploadedAsset, d as AssetModerationAction, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetModerationStatus, ft as WebhookPayloadInput, g as AssetReviewerAction, gt as EventAsset, h as AssetProcessingStatus, i as AssetChecksums, it as UpdateAssetOptions, j as DeleteAssetOptions, k as CreateMultipartUploadPartOptions, kt as AssetSearchMatchField, l as AssetContentStatus, lt as VerifyWebhookSignatureOptions, m as AssetProcessing, mt as PostAssetSignedUrlResponse, nt as SignedUrl, o as AssetContent, ot as UploadAssetPartOptions, p as AssetPage, pt as GetEventsResponse, q as MoveFolderOptions, r as Asset, rt as SubmitAssetOptions, s as AssetContentOptions, st as UploadPresetSubmitAssetOptions, t as ReceivedWebhookEventPayload, tt as SignedUploadToken, u as AssetModeration, ut as WaitForAssetDecisionOptions, v as AssetSearchResult, vt as EventCategory, w as CdnServeOptions, x as CalmLensAppClientOptions, xt as EventFacts, y as AssetType, yt as EventFact, z as IterateAssetsOptions } from "./WebhookPayload-CJoIkGBD.js";
|
|
2
|
+
import { _ as ApiErrorCode, a as DetectedPerson, c as ProcessingFeatureStage, d as CALMLENS_ERROR_CODES, f as CalmLensError, g as SdkErrorCode, h as CalmLensErrorOptions, i as DetectedFace, l as ProcessingFeatures, m as CalmLensErrorDetails, n as AgeRange, o as ProcessingFeatureId, p as CalmLensErrorCode, r as BoundingBox, s as ProcessingFeatureResults, t as FlaggedContentPolicy, u as SDK_VERSION } from "./index-C9Xw1aid.js";
|
|
3
|
+
import { a as ClassificationNotEvaluatedReason, c as FlaggedContentAction, i as ClassificationLabel, l as Likelihood, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as ClassificationReport, t as ClassificationCategories, u as ModerationQualifier } from "./Classification-BNhgwGEm-DmA9VEuE.js";
|
|
3
4
|
//#region src/client/CalmLensServerClient.d.ts
|
|
4
5
|
interface LensCache {
|
|
5
6
|
readonly ensuredLenses: Map<string, Lens>;
|
|
@@ -75,8 +76,8 @@ declare class CalmLensServerClient {
|
|
|
75
76
|
/** Lists one page of the project's assets, with optional filter and ordering. */
|
|
76
77
|
list: (options?: ListAssetsOptions) => Promise<AssetPage>;
|
|
77
78
|
/**
|
|
78
|
-
* Yields every asset matching `options`, fetching pages as needed.
|
|
79
|
-
*
|
|
79
|
+
* Yields every asset matching `options`, fetching pages as needed. The cursor keeps the position
|
|
80
|
+
* stable when other assets are inserted or deleted.
|
|
80
81
|
*/
|
|
81
82
|
iterate: (options?: IterateAssetsOptions) => AsyncGenerator<Asset, void, undefined>;
|
|
82
83
|
/** Retrieves an asset with its status and moderation report. */
|
|
@@ -201,11 +202,11 @@ export declare function verifyWebhookSignature(options: VerifyWebhookSignatureOp
|
|
|
201
202
|
/**
|
|
202
203
|
* Verifies a webhook delivery and parses its body. Throws `sdk/invalid-webhook-signature`
|
|
203
204
|
* when the signature or timestamp does not verify, and `sdk/invalid-webhook-payload` when a
|
|
204
|
-
* verified body is not a webhook event.
|
|
205
|
+
* verified body is not a webhook event. Unknown event types, fact values and fields remain available.
|
|
205
206
|
*
|
|
206
207
|
* Event types and fact keys added to CalmLens after this SDK version are returned as they are,
|
|
207
208
|
* so keep a default branch when you switch on `type`.
|
|
208
209
|
*/
|
|
209
|
-
export declare function parseWebhookEvent(options: VerifyWebhookSignatureOptions): Promise<
|
|
210
|
+
export declare function parseWebhookEvent(options: VerifyWebhookSignatureOptions): Promise<ReceivedWebhookEventPayload>;
|
|
210
211
|
//#endregion
|
|
211
|
-
export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, CalmLensServerClient, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type
|
|
212
|
+
export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, CalmLensServerClient, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type CursorPage, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type PreviewImage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
|
package/cjs/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensVersion = require("./CalmLensVersion-
|
|
2
|
+
const require_CalmLensVersion = require("./CalmLensVersion-BGpB9t4-.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensWebhooks = require("./CalmLensWebhooks-
|
|
5
|
-
const require_CalmLensUtils = require("./CalmLensUtils-
|
|
6
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
4
|
+
const require_CalmLensWebhooks = require("./CalmLensWebhooks-CogUYk8-.js");
|
|
5
|
+
const require_CalmLensUtils = require("./CalmLensUtils-BeIl1N6N.js");
|
|
6
|
+
const require_CalmLensConnection = require("./CalmLensConnection-5Hj3trGr.js");
|
|
7
7
|
const getEnsureLensCacheKey = (options) => require_CalmLensWebhooks.stringifyJsonCanonical({
|
|
8
8
|
identifier: options.identifier,
|
|
9
9
|
name: options.name,
|
|
@@ -168,33 +168,27 @@ sign: async (options) => {
|
|
|
168
168
|
/** Searches accessible assets by keyword or a natural-language description. */
|
|
169
169
|
search: async (options) => this.request("GET", `${this.projectPath}/assets/search`, { query: options }),
|
|
170
170
|
/** Lists one page of the project's assets, with optional filter and ordering. */
|
|
171
|
-
list: async (options = {}) => this.request("GET", `${this.projectPath}/assets/page`, { query:
|
|
172
|
-
...options,
|
|
173
|
-
pageIndex: options.pageIndex ?? 0
|
|
174
|
-
} }),
|
|
171
|
+
list: async (options = {}) => this.request("GET", `${this.projectPath}/assets/page`, { query: options }),
|
|
175
172
|
/**
|
|
176
|
-
* Yields every asset matching `options`, fetching pages as needed.
|
|
177
|
-
*
|
|
173
|
+
* Yields every asset matching `options`, fetching pages as needed. The cursor keeps the position
|
|
174
|
+
* stable when other assets are inserted or deleted.
|
|
178
175
|
*/
|
|
179
|
-
iterate: (options = {}) => this.iteratePages((
|
|
176
|
+
iterate: (options = {}) => this.iteratePages((cursor) => this.buildAssets().list({
|
|
180
177
|
...options,
|
|
181
|
-
|
|
178
|
+
cursor
|
|
182
179
|
})),
|
|
183
180
|
/** Retrieves an asset with its status and moderation report. */
|
|
184
181
|
retrieve: async ({ assetId }) => this.request("GET", `/assets/${requireId(assetId, "Asset ID")}`),
|
|
185
182
|
/** Updates an asset's editable fields. */
|
|
186
183
|
update: async ({ assetId, ...body }) => this.request("PATCH", `/assets/${requireId(assetId, "Asset ID")}`, { body }),
|
|
187
184
|
/** Lists one page of the assets extracted from a website or multimedia document. */
|
|
188
|
-
listChildren: async ({ assetId, ...options } = {}) => this.request("GET", `/assets/${requireId(assetId, "Asset ID")}/children`, { query:
|
|
189
|
-
...options,
|
|
190
|
-
pageIndex: options.pageIndex ?? 0
|
|
191
|
-
} }),
|
|
185
|
+
listChildren: async ({ assetId, ...options } = {}) => this.request("GET", `/assets/${requireId(assetId, "Asset ID")}/children`, { query: options }),
|
|
192
186
|
/** Yields every child of an asset, fetching pages as needed. */
|
|
193
187
|
iterateChildren: (options) => {
|
|
194
188
|
requireId(options?.assetId, "Asset ID");
|
|
195
|
-
return this.iteratePages((
|
|
189
|
+
return this.iteratePages((cursor) => this.buildAssets().listChildren({
|
|
196
190
|
...options,
|
|
197
|
-
|
|
191
|
+
cursor
|
|
198
192
|
}));
|
|
199
193
|
},
|
|
200
194
|
/**
|
|
@@ -225,7 +219,6 @@ sign: async (options) => {
|
|
|
225
219
|
*/
|
|
226
220
|
createSignedUrl: async ({ assetId, ...options }) => {
|
|
227
221
|
const encodedAssetId = requireId(assetId, "Asset ID");
|
|
228
|
-
if (options.lens && options.transform) throw require_CalmLensVersion.invalidArgument("Specify either a lens or a transform, not both");
|
|
229
222
|
return this.request("POST", `/assets/${encodedAssetId}/signed-url`, { body: {
|
|
230
223
|
resource: options.resource ?? "content",
|
|
231
224
|
expiresInSeconds: options.expiresInSeconds ?? 900,
|
|
@@ -291,10 +284,12 @@ sign: async (options) => {
|
|
|
291
284
|
}
|
|
292
285
|
}
|
|
293
286
|
async *iteratePages(listPage) {
|
|
294
|
-
|
|
295
|
-
|
|
287
|
+
let cursor;
|
|
288
|
+
for (;;) {
|
|
289
|
+
const page = await listPage(cursor);
|
|
296
290
|
yield* page.items;
|
|
297
|
-
if (!page.hasMore || page.items.length === 0) return;
|
|
291
|
+
if (!page.nextCursor || !page.hasMore || page.items.length === 0) return;
|
|
292
|
+
cursor = page.nextCursor;
|
|
298
293
|
}
|
|
299
294
|
}
|
|
300
295
|
get folders() {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as detectTestImage, c as getImageTestCategories, d as paintTestImage, i as TestImageKeyCell, l as getTestImageKeyCells, n as TEST_IMAGE_PALETTES, o as detectTestTrigger, r as TEST_INPUT_KEY_PATTERN, s as generateTestTextCode, t as ClassificationTestSignal, u as getTestImageKeyColors } from "./TestTriggers-CRKtulyp-vrzEq2wm.js";
|
|
2
|
+
export { type ClassificationTestSignal, TEST_IMAGE_PALETTES, TEST_INPUT_KEY_PATTERN, type TestImageKeyCell, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, getTestImageKeyCells, getTestImageKeyColors, paintTestImage };
|