diff --git a/types/alicloud__log/alicloud__log-tests.ts b/types/alicloud__log/alicloud__log-tests.ts index f685db1bddd044..89c798485ce7a9 100644 --- a/types/alicloud__log/alicloud__log-tests.ts +++ b/types/alicloud__log/alicloud__log-tests.ts @@ -7,6 +7,7 @@ const credentials: Client.Credentials = { securityToken: "test-security-token", }; +// Test credentials object without token. const credentialsWithoutToken: Client.Credentials = { accessKeyId: "test-access-key-id", accessKeySecret: "test-access-key-secret", @@ -22,6 +23,7 @@ class TestCredentialsProvider implements Client.CredentialsProvider { } } +// Instantiate TestCredentialsProvider const credentialsProvider = new TestCredentialsProvider(); // Test ClientConfig interface @@ -35,10 +37,28 @@ const clientConfig: Client.ClientConfig = { endpoint: "https://test.log.aliyuncs.com", }; +// Minimal ClientConfig interface const minimalClientConfig: Client.ClientConfig = { region: "cn-hangzhou", }; +// Additional ClientConfig variations +const clientConfigWithNet: Client.ClientConfig = { + region: "cn-hangzhou", + net: "ipv6", +}; + +const clientConfigWithCredentials: Client.ClientConfig = { + region: "cn-hangzhou", + accessKeyId: "test-key", + accessKeySecret: "test-secret", +}; + +const clientConfigWithProviderOnly: Client.ClientConfig = { + region: "cn-hangzhou", + credentialsProvider, +}; + // Test RequestOptions interface const requestOptions: Client.RequestOptions = { timeout: 5000, @@ -49,11 +69,60 @@ const requestOptions: Client.RequestOptions = { customProperty: "custom-value", }; +// Additional RequestOptions variations +const minimalRequestOptions: Client.RequestOptions = {}; +const requestOptionsTimeout: Client.RequestOptions = { + timeout: 10000, +}; + // Test ProjectData interface const projectData: Client.ProjectData = { description: "Test project description", }; +// Test ProjectQuota interface +const projectQuota: Client.ProjectQuota = { + logstore: 200, + shard: 400, + config: 200, + machineGroup: 200, + dashboard: 100, + chart: 200, + savedsearch: 100, + ETL: 100, + domain: 1, + export: 100, + ingestion: 100, + alert: 100, + report: 100, + scheduledSQL: 100, + storeView: 10, + storeViewStore: 50, + materializedView: 30, + ingestProcessor: 100, + consumeProcessor: 100, + writeSizePerMin: 100000000000, + writeQpsPerMin: 600000, + readQpsPerMin: 600000, +}; + +// Test ProjectResponse interface +const projectResponse: Client.GetProjectResponse = { + projectName: "ykerp", + status: "Normal", + owner: "1015810200442489", + description: "Yike ERP Project", + createTime: "2025-07-04 15:05:32", + lastModifyTime: "2025-07-04 15:05:32", + region: "cn-hangzhou", + location: "cn-hangzhou", + resourceGroupId: "rg-acfmvpxejaibm6i", + dataRedundancyType: "LRS", + transferAcceleration: "Disabled", + recycleBinEnabled: false, + quota: projectQuota, +}; + // Test ProjectLogsQuery interface const projectLogsQuery: Client.ProjectLogsQuery = { logstoreName: "test-logstore", @@ -69,20 +138,64 @@ const listLogStoreQuery: Client.ListLogStoreQuery = { size: 100, }; +// Partial ListLogStoreQuery interface const partialListLogStoreQuery: Client.ListLogStoreQuery = { offset: 10, }; -// Test LogStoreData interface +// Test ListLogStoresResponse interface +const listLogStoresResponse: Client.ListLogStoresResponse = { + total: 2, + count: 2, + logstores: ["test-1", "test-2"], +}; + +// Test LogStoreResourceQuota interface const logStoreData: Client.LogStoreData = { ttl: 30, shardCount: 2, }; +// Partial LogStoreData interface const partialLogStoreData: Client.LogStoreData = { ttl: 7, }; +// Additional LogStoreData variations +const logStoreDataShard: Client.LogStoreData = { + shardCount: 4, +}; + +const logStoreDataTtl: Client.LogStoreData = { + ttl: 365, +}; + +// Test LogStoreResourceQuota interface +const logStoreResourceQuota: Client.LogStoreResourceQuota = { + storage: { + preserved: -1, + used: 0, + }, +}; + +// Test LogStoreResponse interface +const logStoreResponse: Client.GetLogStoreResponse = { + logstoreName: "resources-operations", + ttl: 3650, + shardCount: 2, + enable_tracking: false, + autoSplit: false, + maxSplitShard: 0, + createTime: 1751613373, + lastModifyTime: 1760179655, + archiveSeconds: 0, + appendMeta: false, + telemetryType: "", + mode: "standard", + productType: "", + resourceQuota: logStoreResourceQuota, +}; + // Test IndexConfig interface const indexConfig: Client.IndexConfig = { ttl: 90, @@ -122,6 +235,47 @@ const indexConfig: Client.IndexConfig = { }, }; +// Test GetIndexConfigResponse interface +const getIndexConfigResponse: Client.GetIndexConfigResponse = { + ttl: 30, + max_text_len: 2048, + log_reduce_white_list: ["a"], + log_reduce_black_list: ["b"], + line: { + chn: false, + caseSensitive: false, + token: [","], + include_keys: ["includeField"], + exclude_keys: ["excludeField"], + }, + keys: { + key: { + chn: true, + caseSensitive: true, + token: ["|"], + alias: "myAlias", + type: "text", + doc_value: true, + index_all: true, + max_depth: 0, + json_keys: { + subkey: { + chn: true, + caseSensitive: true, + token: ["|"], + alias: "myAlias", + type: "text", + doc_value: true, + }, + }, + }, + }, + log_reduce: false, + lastModifyTime: 1524155379, + index_mode: "v2", + storage: "pg", +}; + // Test LogContent interface const logContent: Client.LogContent = { level: "INFO", @@ -163,6 +317,12 @@ const minimalPostLogStoreLogsData: Client.PostLogStoreLogsData = { logs: [minimalLogEntry], }; +// Additional PostLogStoreLogsData variations +const postLogStoreLogsDataNoTags: Client.PostLogStoreLogsData = { + logs: [logEntry], + topic: "topic", +}; + // Test GetLogsQuery interface const getLogsQuery: Client.GetLogsQuery = { query: "level: ERROR", @@ -177,6 +337,11 @@ const partialGetLogsQuery: Client.GetLogsQuery = { query: "level: INFO", }; +// Additional GetLogsQuery variations +const getLogsQueryMinimal: Client.GetLogsQuery = { + query: "test", +}; + // Test GetHistogramsQuery interface const getHistogramsQuery: Client.GetHistogramsQuery = { query: "level: *", @@ -186,6 +351,63 @@ const getHistogramsQuery: Client.GetHistogramsQuery = { const minimalGetHistogramsQuery: Client.GetHistogramsQuery = {}; +// Additional GetHistogramsQuery variations +const getHistogramsQueryWithTopic: Client.GetHistogramsQuery = { + topic: "test-topic", +}; + +// Test GetHistogramsResponse type +const getHistogramsResponse: Client.GetHistogramsResponse = [ + { + from: 1409529600, + to: 1409569200, + count: 2, + progress: "Complete", + }, +]; + +// Test GetProjectLogsResponse type +const getProjectLogsResponse: Client.GetProjectLogsResponse = [ + { + key: [ + { + "__time__": 1409529660, + "__source__": "192.168.1.100", + "Key1": "error", + "Key2": "Value2", + }, + { + "__time__": 1409529680, + "__source__": "192.168.1.100", + "Key3": "error", + "Key4": "Value4", + }, + ], + }, +]; + +// Test GetLogsResponse type +const getLogsResponse: Client.GetLogsResponse[] = [ + { + __time__: "1409529660", + __topic__: "test-topic", + __source__: "192.168.1.100", + level: "INFO", + message: "Test log message", + timestamp: "2022-01-01T00:00:00Z", + source: "test-source", + }, + { + __time__: "1409529680", + __topic__: "test-topic", + __source__: "192.168.1.100", + level: "ERROR", + message: "Error log message", + timestamp: "2022-01-01T00:01:00Z", + source: "test-source", + }, +]; + // Test ApiResponse interface const apiResponse: Client.ApiResponse = { count: 100, @@ -194,6 +416,13 @@ const apiResponse: Client.ApiResponse = { requestId: "test-request-id", }; +// Additional ApiResponse variations +const apiResponseMinimal: Client.ApiResponse = {}; +const apiResponseWithError: Client.ApiResponse = { + error: "test error", + code: 500, +}; + // Test Client class constructor const client = new Client(clientConfig); const minimalClient = new Client(minimalClientConfig); @@ -210,13 +439,16 @@ const endpoint: string = client.endpoint; // Test Client class methods - Project operations async function testProjectOperations() { // getProject - const project: Client.ApiResponse = await client.getProject("test-project"); - const projectWithOptions: Client.ApiResponse = await client.getProject("test-project", requestOptions); + const project: Client.GetProjectResponse = await client.getProject("test-project"); + const projectWithOptions: Client.GetProjectResponse = await client.getProject("test-project", requestOptions); // getProjectLogs - const projectLogs: Client.ApiResponse = await client.getProjectLogs("test-project"); - const projectLogsWithData: Client.ApiResponse = await client.getProjectLogs("test-project", projectLogsQuery); - const projectLogsWithOptions: Client.ApiResponse = await client.getProjectLogs( + const projectLogs: Client.GetProjectLogsResponse = await client.getProjectLogs("test-project"); + const projectLogsWithData: Client.GetProjectLogsResponse = await client.getProjectLogs( + "test-project", + projectLogsQuery, + ); + const projectLogsWithOptions: Client.GetProjectLogsResponse = await client.getProjectLogs( "test-project", projectLogsQuery, requestOptions, @@ -238,9 +470,12 @@ async function testProjectOperations() { // Test Client class methods - LogStore operations async function testLogStoreOperations() { // listLogStore - const logStores: Client.ApiResponse = await client.listLogStore("test-project"); - const logStoresWithData: Client.ApiResponse = await client.listLogStore("test-project", listLogStoreQuery); - const logStoresWithOptions: Client.ApiResponse = await client.listLogStore( + const logStores: Client.ListLogStoresResponse = await client.listLogStore("test-project"); + const logStoresWithData: Client.ListLogStoresResponse = await client.listLogStore( + "test-project", + listLogStoreQuery, + ); + const logStoresWithOptions: Client.ListLogStoresResponse = await client.listLogStore( "test-project", listLogStoreQuery, requestOptions, @@ -283,8 +518,8 @@ async function testLogStoreOperations() { ); // getLogStore - const logStore: Client.ApiResponse = await client.getLogStore("test-project", "test-logstore"); - const logStoreWithOptions: Client.ApiResponse = await client.getLogStore( + const logStore: Client.GetLogStoreResponse = await client.getLogStore("test-project", "test-logstore"); + const logStoreWithOptions: Client.GetLogStoreResponse = await client.getLogStore( "test-project", "test-logstore", requestOptions, @@ -294,8 +529,11 @@ async function testLogStoreOperations() { // Test Client class methods - Index operations async function testIndexOperations() { // getIndexConfig - const indexConfigResult: Client.ApiResponse = await client.getIndexConfig("test-project", "test-logstore"); - const indexConfigWithOptions: Client.ApiResponse = await client.getIndexConfig( + const indexConfigResult: Client.GetIndexConfigResponse = await client.getIndexConfig( + "test-project", + "test-logstore", + ); + const indexConfigWithOptions: Client.GetIndexConfigResponse = await client.getIndexConfig( "test-project", "test-logstore", requestOptions, @@ -334,15 +572,15 @@ async function testLogOperations() { const toDate = new Date("2022-01-01T23:59:59Z"); // getLogs - const logs: Client.ApiResponse = await client.getLogs("test-project", "test-logstore", fromDate, toDate); - const logsWithQuery: Client.ApiResponse = await client.getLogs( + const logs: Client.GetLogsResponse[] = await client.getLogs("test-project", "test-logstore", fromDate, toDate); + const logsWithQuery: Client.GetLogsResponse[] = await client.getLogs( "test-project", "test-logstore", fromDate, toDate, getLogsQuery, ); - const logsWithOptions: Client.ApiResponse = await client.getLogs( + const logsWithOptions: Client.GetLogsResponse[] = await client.getLogs( "test-project", "test-logstore", fromDate, @@ -352,20 +590,20 @@ async function testLogOperations() { ); // getHistograms - const histograms: Client.ApiResponse = await client.getHistograms( + const histograms: Client.GetHistogramsResponse = await client.getHistograms( "test-project", "test-logstore", fromDate, toDate, ); - const histogramsWithQuery: Client.ApiResponse = await client.getHistograms( + const histogramsWithQuery: Client.GetHistogramsResponse = await client.getHistograms( "test-project", "test-logstore", fromDate, toDate, getHistogramsQuery, ); - const histogramsWithOptions: Client.ApiResponse = await client.getHistograms( + const histogramsWithOptions: Client.GetHistogramsResponse = await client.getHistograms( "test-project", "test-logstore", fromDate, diff --git a/types/alicloud__log/index.d.ts b/types/alicloud__log/index.d.ts index f0c6cc13779171..140c0c4493e7df 100644 --- a/types/alicloud__log/index.d.ts +++ b/types/alicloud__log/index.d.ts @@ -1,169 +1,813 @@ +/** Namespace for AliCloud Log Client types and interfaces. */ declare namespace Client { + /** Represents the credentials for accessing AliCloud Log services. */ interface Credentials { + /** The access key ID. */ accessKeyId: string; + /** The access key secret. */ accessKeySecret: string; + /** Optional security token. */ securityToken?: string; } + /** Interface for providing credentials asynchronously. */ interface CredentialsProvider { + /** Retrieves the credentials. */ getCredentials(): Promise; } + /** Configuration options for the Client. */ interface ClientConfig { + /** + * The region for the client. + * @example "cn-hangzhou" + */ region: string; + /** Optional network type. */ net?: string; + /** Optional access key ID. */ accessKeyId?: string; + /** Optional access key secret. */ accessKeySecret?: string; + /** Optional security token. */ securityToken?: string; + /** Optional credentials provider. */ credentialsProvider?: CredentialsProvider; + /** Optional endpoint URL. */ endpoint?: string; } + /** Options for HTTP requests. */ interface RequestOptions { + /** Optional request timeout in milliseconds. */ timeout?: number; + /** Optional headers for the request. */ headers?: Record; + /** Additional custom options. */ [key: string]: any; } + // Project-related interfaces + /** Data for creating a project. */ interface ProjectData { + /** The description of the project. */ description: string; } + /** Quota information for a project. */ + interface ProjectQuota { + /** + * Maximum number of log stores allowed. + * @example 200 + */ + logstore: number; + /** + * Maximum number of shards allowed. + * @example 400 + */ + shard: number; + /** + * Maximum number of configurations allowed. + * @example 200 + */ + config: number; + /** + * Maximum number of machine groups allowed. + * @example 200 + */ + machineGroup: number; + /** + * Maximum number of dashboards allowed. + * @example 100 + */ + dashboard: number; + /** + * Maximum number of charts allowed. + * @example 200 + */ + chart: number; + /** + * Maximum number of saved searches allowed. + * @example 100 + */ + savedsearch: number; + /** + * Maximum number of ETL jobs allowed. + * @example 100 + */ + ETL: number; + /** + * Maximum number of domains allowed. + * @example 1 + */ + domain: number; + /** + * Maximum number of exports allowed. + * @example 100 + */ + export: number; + /** + * Maximum number of ingestions allowed. + * @example 100 + */ + ingestion: number; + /** + * Maximum number of alerts allowed. + * @example 100 + */ + alert: number; + /** + * Maximum number of reports allowed. + * @example 100 + */ + report: number; + /** + * Maximum number of scheduled SQL queries allowed. + * @example 100 + */ + scheduledSQL: number; + /** + * Maximum number of store views allowed. + * @example 10 + */ + storeView: number; + /** + * Maximum number of store view stores allowed. + * @example 50 + */ + storeViewStore: number; + /** + * Maximum number of materialized views allowed. + * @example 30 + */ + materializedView: number; + /** + * Maximum number of ingest processors allowed. + * @example 100 + */ + ingestProcessor: number; + /** + * Maximum number of consume processors allowed. + * @example 100 + */ + consumeProcessor: number; + /** + * Maximum write size per minute in bytes. + * @example 100000000000 + */ + writeSizePerMin: number; + /** + * Maximum write queries per minute. + * @example 600000 + */ + writeQpsPerMin: number; + /** + * Maximum read queries per minute. + * @example 600000 + */ + readQpsPerMin: number; + + /** Additional quota properties. */ + [key: string]: unknown; + } + + /** Response from getProject API call. */ + interface GetProjectResponse { + /** + * The name of the project. + * @example "ali-test-project" + */ + projectName: string; + /** + * The status of the project. + * - `Normal` - The project is active. + * - `Disable` - The project has been disabled. + * @example "Normal" + */ + status: string; + /** + * The owner of the project. + * @example "1015810200442489" + */ + owner: string; + /** The description of the project. + * @example "Description of my-project" + */ + description: string; + /** + * The creation time of the project. + * @example "2021-07-07 14:08:09" + */ + createTime: string; + /** + * The last modification time of the project. + * @example "2022-04-18 13:30:19" + */ + lastModifyTime: string; + /** + * The region where the project is located. + * @example "cn-hangzhou" + */ + region: string; + /** + * The location of the project. + * @example "cn-hangzhou" + */ + location: string; + /** + * The resource group ID associated with the project. + * @example "rg-acfmvpxejaibm6i" + */ + resourceGroupId: string; + /** + * The data redundancy type. + * @example "LRS" + */ + dataRedundancyType: string; + /** + * The transfer acceleration status. + * @example "Disabled" + */ + transferAcceleration: string; + /** + * Whether recycle bin is enabled. + * @example false + */ + recycleBinEnabled: boolean; + /** The quota information for the project. */ + quota: ProjectQuota; + } + + /** Query parameters for project logs. */ interface ProjectLogsQuery { + /** Optional [SPL](https://help.aliyun.com/zh/sls/spl-instructions-and-functions/) query string. */ + query?: string; + /** Optional flag to enable dedicated SQL. */ + powerSql?: boolean; + /** Additional query parameters. */ [key: string]: any; } + // Store-related interfaces + /** Query parameters for listing log stores. */ interface ListLogStoreQuery { + /** Optional log store name to filter. */ logstoreName?: string; + /** Optional offset for pagination. */ offset?: number; + /** Optional size for pagination. */ size?: number; } + /** Data for log store operations. */ interface LogStoreData { + /** Optional time to live in days. */ ttl?: number; + /** Optional number of shards. */ shardCount?: number; } + /** Resource quota information for a log store. */ + interface LogStoreResourceQuota { + /** Storage quota information. */ + storage: { + /** Preserved storage quota in bytes. */ + preserved: number; + /** Used storage in bytes. */ + used: number; + }; + /** Additional log store quota properties. */ + [key: string]: unknown; + } + + /** Response from getLogStore API call. */ + interface GetLogStoreResponse { + /** + * The name of the log store. + * @example "resources-operations" + */ + logstoreName: string; + /** + * Time to live in days for the log store. + * @example 3650 + */ + ttl: number; + /** + * Number of shards in the log store. + * @example 2 + */ + shardCount: number; + /** + * Whether tracking is enabled for the log store. + * @example false + */ + enable_tracking: boolean; + /** + * Whether automatic splitting is enabled. + * @example false + */ + autoSplit: boolean; + /** + * Maximum number of shards for automatic splitting. + * @example 6 + */ + maxSplitShard: number; + /** + * Creation time as Unix timestamp. + * @example 1751613373 + */ + createTime: number; + /** + * Last modification time as Unix timestamp. + * @example 1760179655 + */ + lastModifyTime: number; + /** + * Archive time in seconds. + * @example 0 + */ + archiveSeconds: number; + /** + * Whether to append metadata to logs. + * @example false + */ + appendMeta: boolean; + /** + * Type of telemetry data. + * @example "" + */ + telemetryType: string; + /** + * Mode of the log store. + * @example "standard" + */ + mode: string; + /** + * Product type associated with the log store. + * @example "" + */ + productType: string; + /** Resource quota information for the log store. */ + resourceQuota: LogStoreResourceQuota; + /** Additional log store properties. */ + [key: string]: unknown; + } + + /** Response from listLogStore API call. */ + interface ListLogStoresResponse { + /** + * Total number of log stores. + * @example 2 + */ + total: number; + /** + * Number of log stores returned in this response. + * @example 2 + */ + count: number; + /** + * List of log store names. + * @example ["test-1", "test-2"] + */ + logstores: string[]; + } + + // Index-related interfaces + /** Configuration for log index. */ interface IndexConfig { + /** Index configuration properties. */ [key: string]: any; } + /** Configuration for a single index key. */ + interface IndexKeyConfig { + /** + * Whether to enable Chinese word segmentation. + * @example true + */ + chn: boolean; + /** + * Whether the search is case sensitive. + * @example true + */ + caseSensitive: boolean; + /** + * Token delimiters for text splitting. + * @example ["|"] + */ + token: string[]; + /** + * Alias for the key. + * @example "myAlias" + */ + alias?: string; + /** + * Data type of the key. + * @example "text" + */ + type: string; + /** + * Whether to enable doc value for faster queries. + * @example true + */ + doc_value: boolean; + /** + * Whether to index all subfields. + * @example true + */ + index_all?: boolean; + /** + * Maximum depth for JSON indexing. + * @example 0 + */ + max_depth?: number; + /** Nested JSON key configurations. */ + json_keys?: Record; + } + + /** Configuration for line-based indexing. */ + interface IndexLineConfig { + /** + * Whether to enable Chinese word segmentation. + * @example false + */ + chn: boolean; + /** + * Whether the search is case sensitive. + * @example false + */ + caseSensitive: boolean; + /** + * Token delimiters for text splitting. + * @example [","] + */ + token: string[]; + /** + * Keys to include in line indexing. + * @example ["includeField"] + */ + include_keys: string[]; + /** + * Keys to exclude from line indexing. + * @example ["excludeField"] + */ + exclude_keys: string[]; + } + + /** Response from getIndexConfig API call. */ + interface GetIndexConfigResponse { + /** + * Time to live for the index in days. + * @example 30 + */ + ttl: number; + /** + * Maximum length of text fields. + * @example 2048 + */ + max_text_len: number; + /** + * Whitelist for log reduction. + * @example ["a"] + */ + log_reduce_white_list: string[]; + /** + * Blacklist for log reduction. + * @example ["b"] + */ + log_reduce_black_list: string[]; + /** Line-based indexing configuration. */ + line: IndexLineConfig; + /** Key-based indexing configurations. */ + keys: Record; + /** + * Whether log reduction is enabled. + * @example false + */ + log_reduce: boolean; + /** + * Last modification time as Unix timestamp. + * @example 1524155379 + */ + lastModifyTime: number; + /** + * Index mode version. + * @example "v2" + */ + index_mode: string; + /** + * Storage type for the index. + * @example "pg" + */ + storage: string; + } + + // Log-related interfaces + /** A single histogram item representing log distribution in a time range. */ + interface HistogramItem { + /** + * Start time of the histogram interval as Unix timestamp. + * @example 1409529600 + */ + from: number; + /** + * End time of the histogram interval as Unix timestamp. + * @example 1409569200 + */ + to: number; + /** + * Number of logs in this time interval. + * @example 2 + */ + count: number; + /** + * Progress status of the query. + * - `Complete` - Query is complete. + * - `Incomplete` - Query is incomplete, more calls needed. + * @example "Complete" + */ + progress: string; + } + + /** Response from getHistograms API call. */ + type GetHistogramsResponse = HistogramItem[]; + + /** A single result from project logs query. */ + interface ProjectLogResult { + /** Array of log entries returned by the query. */ + key: Array>; + } + + /** Response from getProjectLogs API call. */ + type GetProjectLogsResponse = ProjectLogResult[]; + + /** Response from getLogs API call. */ + interface GetLogsResponse { + /** Log timestamp (10 digits) */ + __time__: string; + /** Log topic */ + __topic__: string; + /** Log source */ + __source__: string; + /** Log content */ + [key: string]: string; + } + + /** Content of a log entry. */ interface LogContent { + /** Log content key-value pairs. */ [key: string]: string; } + /** A single log entry. */ interface LogEntry { + /** The timestamp of the log entry. */ timestamp: number; + /** Optional nanosecond part of the timestamp. */ timestampNsPart?: number; + /** The content of the log entry. */ content: LogContent; } + /** Tags for log entries. */ interface LogTag { + /** Tag key-value pairs. */ [key: string]: string; } + /** Data for posting logs to a log store. */ interface PostLogStoreLogsData { + /** Array of log entries to post. */ logs: LogEntry[]; + /** Optional tags for the logs. */ tags?: LogTag[]; + /** Optional topic for the logs. */ topic?: string; + /** Optional source for the logs. */ source?: string; } + /** Query parameters for retrieving logs. */ interface GetLogsQuery { + /** Optional [SPL](https://help.aliyun.com/zh/sls/spl-instructions-and-functions/) query string. */ query?: string; + /** Optional topic filter. */ topic?: string; + /** Optional flag to reverse the order. */ reverse?: boolean; + /** Optional number of lines to return. */ line?: number; + /** Optional offset for pagination. */ offset?: number; + /** Optional flag to enable dedicated SQL. */ + powerSql?: boolean; + /** Additional query options. */ [key: string]: any; } + /** Query parameters for retrieving histograms. */ interface GetHistogramsQuery { + /** Optional [SPL](https://help.aliyun.com/zh/sls/spl-instructions-and-functions/) query string. */ query?: string; + /** Optional topic filter. */ topic?: string; + /** Additional histogram query options. */ [key: string]: any; } + /** Response from API calls. */ interface ApiResponse { + /** Response data. */ [key: string]: any; } } +/** The main client class for interacting with AliCloud Log services. */ declare class Client { + /** The region for the client. */ region: string; + /** Optional network type. */ net?: string; + /** Optional access key ID. */ accessKeyId?: string; + /** Optional access key secret. */ accessKeySecret?: string; + /** Optional security token. */ securityToken?: string; + /** Optional credentials provider. */ credentialsProvider?: Client.CredentialsProvider; + /** The endpoint URL. */ endpoint: string; + /** + * Creates a new Client instance. + * @param config The configuration for the client. + */ constructor(config: Client.ClientConfig); - getProject(projectName: string, options?: Client.RequestOptions): Promise; + /** + * Retrieves project information. + * @param projectName The name of the project. + * @param options Optional request options. + */ + getProject(projectName: string, options?: Client.RequestOptions): Promise; + + /** + * Retrieves logs for a project. + * @param projectName The name of the project. + * @param data Optional query parameters for project logs. + * @param options Optional request options. + */ getProjectLogs( projectName: string, data?: Client.ProjectLogsQuery, options?: Client.RequestOptions, - ): Promise; + ): Promise; + + /** + * Creates a new project. + * @param projectName The name of the project. + * @param data The data for creating the project. + * @param options Optional request options. + */ createProject( projectName: string, data: Client.ProjectData, options?: Client.RequestOptions, ): Promise; + + /** + * Deletes a project. + * @param projectName The name of the project. + * @param options Optional request options. + */ deleteProject(projectName: string, options?: Client.RequestOptions): Promise; + /** + * Lists log stores in a project. + * @param projectName The name of the project. + * @param data Optional query parameters for listing log stores. + * @param options Optional request options. + */ listLogStore( projectName: string, data?: Client.ListLogStoreQuery, options?: Client.RequestOptions, - ): Promise; + ): Promise; + + /** + * Creates a new log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param data Optional data for the log store. + * @param options Optional request options. + */ createLogStore( projectName: string, logstoreName: string, data?: Client.LogStoreData, options?: Client.RequestOptions, ): Promise; + + /** + * Deletes a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param options Optional request options. + */ deleteLogStore( projectName: string, logstoreName: string, options?: Client.RequestOptions, ): Promise; + + /** + * Updates a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param data Optional data for updating the log store. + * @param options Optional request options. + */ updateLogStore( projectName: string, logstoreName: string, data?: Client.LogStoreData, options?: Client.RequestOptions, ): Promise; + + /** + * Retrieves log store information. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param options Optional request options. + */ getLogStore( projectName: string, logstoreName: string, options?: Client.RequestOptions, - ): Promise; + ): Promise; + /** + * Retrieves index configuration. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param options Optional request options. + */ getIndexConfig( projectName: string, logstoreName: string, options?: Client.RequestOptions, - ): Promise; + ): Promise; + + /** + * Creates an index for a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param index The index configuration. + * @param options Optional request options. + */ createIndex( projectName: string, logstoreName: string, index: Client.IndexConfig, options?: Client.RequestOptions, ): Promise; + + /** + * Updates an index for a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param index The index configuration. + * @param options Optional request options. + */ updateIndex( projectName: string, logstoreName: string, index: Client.IndexConfig, options?: Client.RequestOptions, ): Promise; + + /** + * Deletes an index for a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param options Optional request options. + */ deleteIndex( projectName: string, logstoreName: string, options?: Client.RequestOptions, ): Promise; + /** + * Retrieves logs from a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param from The start date for the logs. + * @param to The end date for the logs. + * @param data Optional query parameters for retrieving logs. + * @param options Optional request options. + */ getLogs( projectName: string, logstoreName: string, @@ -171,7 +815,17 @@ declare class Client { to: Date, data?: Client.GetLogsQuery, options?: Client.RequestOptions, - ): Promise; + ): Promise; + + /** + * Retrieves histograms from a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param from The start date for the histograms. + * @param to The end date for the histograms. + * @param data Optional query parameters for retrieving histograms. + * @param options Optional request options. + */ getHistograms( projectName: string, logstoreName: string, @@ -179,7 +833,15 @@ declare class Client { to: Date, data?: Client.GetHistogramsQuery, options?: Client.RequestOptions, - ): Promise; + ): Promise; + + /** + * Posts logs to a log store. + * @param projectName The name of the project. + * @param logstoreName The name of the log store. + * @param data The data containing logs to post. + * @param options Optional request options. + */ postLogStoreLogs( projectName: string, logstoreName: string, diff --git a/types/google-publisher-tag/google-publisher-tag-tests.ts b/types/google-publisher-tag/google-publisher-tag-tests.ts index 3151333382b5b3..e254460e32a512 100644 --- a/types/google-publisher-tag/google-publisher-tag-tests.ts +++ b/types/google-publisher-tag/google-publisher-tag-tests.ts @@ -1,5 +1,5 @@ -// Tests for Google Publisher Tag 1.20250811 -// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/a3d900bc56c2ce535e539ce139d7e59bc9fe7be4 +// Tests for Google Publisher Tag 1.20251117 +// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/b4114e351762295c878195e3b243c2afdbb5b889 // Test for googletag.cmd function test_googletag_cmd() { diff --git a/types/google-publisher-tag/index.d.ts b/types/google-publisher-tag/index.d.ts index 7aa46e447ea742..fd2dc394dc2e56 100644 --- a/types/google-publisher-tag/index.d.ts +++ b/types/google-publisher-tag/index.d.ts @@ -3431,8 +3431,10 @@ declare namespace googletag { /** * Displays the rewarded ad. This method should not be called until the user * has consented to view the ad. + * + * @return Whether the rewarded ad was successfully displayed. */ - makeRewardedVisible(): void; + makeRewardedVisible(): boolean; } /** @@ -3473,8 +3475,10 @@ declare namespace googletag { * @see [Display a game manual interstitial ad](https://support.google.com/admanager/answer/14640119) */ interface GameManualInterstitialSlotReadyEvent extends Event { - /** Displays the game manual interstitial ad to the user. */ - makeGameManualInterstitialVisible(): void; + /** Displays the game manual interstitial ad to the user. + * Returns whether the ad was successfully displayed. + */ + makeGameManualInterstitialVisible(): boolean; } /** diff --git a/types/google-publisher-tag/package.json b/types/google-publisher-tag/package.json index cf6e88ee4c05a4..c7caa371ee7ca4 100644 --- a/types/google-publisher-tag/package.json +++ b/types/google-publisher-tag/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/google-publisher-tag", - "version": "1.20250811.9999", + "version": "1.20251117.9999", "nonNpm": "conflict", "nonNpmDescription": "Google Publisher Tag", "projects": [ diff --git a/types/pxr-oneline/index.d.ts b/types/pxr-oneline/index.d.ts index d274413771d211..b7f611dc24e276 100644 --- a/types/pxr-oneline/index.d.ts +++ b/types/pxr-oneline/index.d.ts @@ -94,6 +94,7 @@ declare namespace OneLine { tiktok: boolean; twitter: boolean; vimeo: boolean; + wecantrack: boolean; youtube: boolean; }; } diff --git a/types/pxr-oneline/oneline-tests.ts b/types/pxr-oneline/oneline-tests.ts index f82fe1f959c3ee..54ac502c331a15 100644 --- a/types/pxr-oneline/oneline-tests.ts +++ b/types/pxr-oneline/oneline-tests.ts @@ -31,6 +31,7 @@ interface SocialConsents { tiktok: boolean; twitter: boolean; vimeo: boolean; + wecantrack: boolean; youtube: boolean; }; } diff --git a/types/pxr-oneline/package.json b/types/pxr-oneline/package.json index 527542ad325f30..dcd3efa87cd57e 100644 --- a/types/pxr-oneline/package.json +++ b/types/pxr-oneline/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/pxr-oneline", - "version": "1.13.9999", + "version": "1.14.9999", "nonNpm": true, "nonNpmDescription": "The OneLine handles all the logic needed for a publisher to serve ads.", "projects": [