@azure-rest/ai-content-safety 1.0.2-alpha.20250923.1 → 1.0.3-alpha.20250924.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/CHANGELOG.md +1 -1
- package/dist/browser/contentSafetyClient.js +1 -1
- package/dist/browser/contentSafetyClient.js.map +1 -1
- package/dist/commonjs/contentSafetyClient.js +1 -1
- package/dist/commonjs/contentSafetyClient.js.map +1 -1
- package/dist/esm/contentSafetyClient.js +1 -1
- package/dist/esm/contentSafetyClient.js.map +1 -1
- package/dist/react-native/contentSafetyClient.js +1 -1
- package/dist/react-native/contentSafetyClient.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,7 +11,7 @@ import { logger } from "./logger.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createClient(endpointParam, credentials, { apiVersion = "2023-10-01", ...options } = {}) {
|
|
13
13
|
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;
|
|
14
|
-
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
14
|
+
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;
|
|
15
15
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
16
16
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
17
17
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,EAAE,UAAU,GAAG,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AAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
1
|
+
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,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,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ContentSafetyClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -14,7 +14,7 @@ const logger_js_1 = require("./logger.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function createClient(endpointParam, credentials, { apiVersion = "2023-10-01", ...options } = {}) {
|
|
16
16
|
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;
|
|
17
|
-
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
17
|
+
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;
|
|
18
18
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
19
19
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
20
20
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqBlC,+BA4CC;AA9DD,yDAAoD;AACpD,2CAAqC;AAUrC;;;;;;GAMG;AACH,SAAwB,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,EAAE,UAAU,GAAG,YAAY,EAAE,GAAG,OAA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AG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
1
|
+
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqBlC,+BA4CC;AA9DD,yDAAoD;AACpD,2CAAqC;AAUrC;;;;;;GAMG;AACH,SAAwB,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,EAAE,UAAU,GAAG,YAAY,EAAE,GAAG,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,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ContentSafetyClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { logger } from "./logger.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createClient(endpointParam, credentials, { apiVersion = "2023-10-01", ...options } = {}) {
|
|
13
13
|
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;
|
|
14
|
-
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
14
|
+
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;
|
|
15
15
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
16
16
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
17
17
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,EAAE,UAAU,GAAG,YAAY,EAAE,GAAG,OAAO,KAAi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GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
1
|
+
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACr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E,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ContentSafetyClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { logger } from "./logger.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createClient(endpointParam, credentials, { apiVersion = "2023-10-01", ...options } = {}) {
|
|
13
13
|
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;
|
|
14
|
-
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
14
|
+
const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;
|
|
15
15
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
16
16
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
17
17
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,EA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G,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.
|
|
1
|
+
{"version":3,"file":"contentSafetyClient.js","sourceRoot":"","sources":["../../src/contentSafetyClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;GAMG;AACH,MA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AAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { ContentSafetyClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ContentSafetyClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ContentSafetyClient`\n * @param endpointParam - Supported Cognitive Services endpoints (protocol and hostname, for example:\n * https://<resource-name>.cognitiveservices.azure.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2023-10-01\", ...options }: ContentSafetyClientOptions = {},\n): ContentSafetyClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}/contentsafety`;\n const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ContentSafetyClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/ai-content-safety",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.3-alpha.20250924.2",
|
|
6
6
|
"description": "ContentSafety Service",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"typescript": "~5.8.3",
|
|
54
54
|
"vitest": "^3.2.3",
|
|
55
55
|
"@azure-tools/test-credential": "^2.1.2",
|
|
56
|
+
"@azure-tools/test-recorder": "^4.1.1",
|
|
56
57
|
"@azure-tools/test-utils-vitest": "^2.0.1",
|
|
57
58
|
"@azure/core-util": "^1.13.1",
|
|
58
|
-
"@azure-tools/test-recorder": "^4.1.1",
|
|
59
59
|
"@azure/dev-tool": "^1.0.0",
|
|
60
60
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
61
61
|
},
|