coze-coding-dev-sdk 0.7.19-beta.18 → 0.7.19-beta.19
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/dist/cjs/cli/index.js +6 -6
- package/dist/cjs/index.js +2 -2
- package/dist/esm/131.mjs +18 -18
- package/dist/esm/index.mjs +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/url-utils.d.ts +16 -5
- package/dist/types/core/url-utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="0.3.0";export{APIError,ASRClient,BaseClient,Config,ConfigurationError,ContentPart,CozeConfig,DEFAULT_EMBEDDING_CONFIG,DataSourceType,DatabaseConfig,EmbedOptions,EmbeddingClient,EmbeddingConfig,EmbeddingData,EmbeddingInputImageURL,EmbeddingInputItem,EmbeddingInputVideoURL,EmbeddingRequest,EmbeddingResponse,EmbeddingUsage,FILE_NAME_ALLOWED_RE,FORWARD_HEADER_KEYS,FetchClient,ForwardHeaderKey,FrameExtractorClient,HeaderUtils,ImageConfig,ImageGenerationClient,ImageGenerationResponseHelper,KnowledgeClient,LLMClient,LLMConfig,LLMDefaults,LLMResponse,Message,MultiEmbeddingConfig,NetworkError,PromptTokensDetails,ReportBuffer,ReportClient,S3Config,S3Storage,SearchClient,SparseEmbeddingConfig,SparseEmbeddingItem,SupabaseClient,TTSClient,TTSConfig,URLValidationError,ValidationError,VideoConfig,VideoEditClient,VideoEditConfig,VideoGenerationClient,buildASRApiRequest,buildImageGenerationApiRequest,buildTTSApiRequest,closePool,convertContentItem,convertDisplayInfo,convertFromApiFormat,convertToApiFormat,createS3ReportMiddleware,createWrappedFetch,generateModels,getClient,getDb,getDbUrl,getPool,getReportBuffer,loadEnv,redactUrl,truncate,upgrade,validateImageSize,validateImageSizeOrDefault,validateUrl,validateUrlSync}from"./131.mjs";export{e as VERSION};
|
|
1
|
+
var e="0.3.0";export{APIError,ASRClient,BaseClient,Config,ConfigurationError,ContentPart,CozeConfig,DEFAULT_EMBEDDING_CONFIG,DataSourceType,DatabaseConfig,EmbedOptions,EmbeddingClient,EmbeddingConfig,EmbeddingData,EmbeddingInputImageURL,EmbeddingInputItem,EmbeddingInputVideoURL,EmbeddingRequest,EmbeddingResponse,EmbeddingUsage,FILE_NAME_ALLOWED_RE,FORWARD_HEADER_KEYS,FetchClient,ForwardHeaderKey,FrameExtractorClient,HeaderUtils,ImageConfig,ImageGenerationClient,ImageGenerationResponseHelper,KnowledgeClient,LLMClient,LLMConfig,LLMDefaults,LLMResponse,Message,MultiEmbeddingConfig,NetworkError,PromptTokensDetails,ReportBuffer,ReportClient,S3Config,S3Storage,SearchClient,SparseEmbeddingConfig,SparseEmbeddingItem,SupabaseClient,TTSClient,TTSConfig,URLValidationError,ValidationError,VideoConfig,VideoEditClient,VideoEditConfig,VideoGenerationClient,buildASRApiRequest,buildImageGenerationApiRequest,buildTTSApiRequest,closePool,convertContentItem,convertDisplayInfo,convertFromApiFormat,convertToApiFormat,createS3ReportMiddleware,createWrappedFetch,generateModels,getClient,getDb,getDbUrl,getPool,getReportBuffer,isBase64DataUri,loadEnv,redactUrl,truncate,upgrade,validateImageSize,validateImageSizeOrDefault,validateUrl,validateUrlSync}from"./131.mjs";export{e as VERSION};
|
|
@@ -2,5 +2,5 @@ export { Config, CozeConfig } from './config';
|
|
|
2
2
|
export { BaseClient } from './client';
|
|
3
3
|
export { ConfigurationError, APIError, NetworkError, ValidationError, } from './exceptions';
|
|
4
4
|
export { FORWARD_HEADER_KEYS, ForwardHeaderKey, HeaderUtils, } from './headers';
|
|
5
|
-
export { validateUrl, validateUrlSync, URLValidationError, type ValidateUrlOptions, } from './url-utils';
|
|
5
|
+
export { validateUrl, validateUrlSync, isBase64DataUri, URLValidationError, type ValidateUrlOptions, } from './url-utils';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* URL 校验工具模块
|
|
3
|
-
* 提供 URL 格式校验、协议校验、本地地址拦截、临时URL检测和可达性预检功能
|
|
3
|
+
* 提供 URL 格式校验、协议校验、本地地址拦截、临时URL检测、base64 data URI 检测和可达性预检功能
|
|
4
4
|
*/
|
|
5
5
|
import { ValidationError } from './exceptions';
|
|
6
6
|
export declare class URLValidationError extends ValidationError {
|
|
@@ -13,15 +13,26 @@ export interface ValidateUrlOptions {
|
|
|
13
13
|
/** HEAD 预检超时毫秒数,默认 5000 */
|
|
14
14
|
timeout?: number;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* 检测字符串是否为合法的 base64 编码 data URI。
|
|
18
|
+
*
|
|
19
|
+
* 仅匹配带 ;base64 标记且数据部分为合法 base64 字符集的 data URI,
|
|
20
|
+
* 例如 data:image/png;base64,iVBORw0KGgo...
|
|
21
|
+
* 非 base64 的 data URI(如 data:text/html,<h1>hi</h1>)不视为合法。
|
|
22
|
+
*
|
|
23
|
+
* 注意:本函数只校验「格式」,不判断 mediatype 是否为受支持的图片格式。
|
|
24
|
+
*/
|
|
25
|
+
export declare function isBase64DataUri(value: string): boolean;
|
|
16
26
|
/**
|
|
17
27
|
* 校验 URL 合法性,不触发实际内容下载。
|
|
18
28
|
*
|
|
19
29
|
* 检查项:
|
|
20
30
|
* 1. 非空、字符串类型校验
|
|
21
|
-
* 2.
|
|
22
|
-
* 3.
|
|
23
|
-
* 4.
|
|
24
|
-
* 5.
|
|
31
|
+
* 2. base64 data URI 直接放行(如 data:image/png;base64,...),但拦截老旧/不受支持的图片格式(如 image/x-wmf)
|
|
32
|
+
* 3. URL 格式校验(scheme + host)
|
|
33
|
+
* 4. 协议校验:仅允许 http/https
|
|
34
|
+
* 5. 本地地址拦截:禁止 localhost/127.0.0.1/0.0.0.0/::1
|
|
35
|
+
* 6. 可选 HEAD 预检:确认 URL 可达
|
|
25
36
|
*
|
|
26
37
|
* 注意:不做 DNS 解析到 IP 再判断私有网段的检查,避免误杀(如内部 CDN 域名解析到内网 IP 的合法场景)。
|
|
27
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../src/core/url-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../src/core/url-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA8C/C,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAK1C;AAED,MAAM,WAAW,kBAAkB;IACjC,iCAAiC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGtD;AA2BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAqEjB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAenD;AAgBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiDnD"}
|
package/package.json
CHANGED