Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ffcbc56
prepare
albertxavier100 Dec 12, 2024
47f586d
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 12, 2024
33f43d4
Migration: Update test config
albertxavier100 Dec 12, 2024
f789bb9
Migration: Clean up files
albertxavier100 Dec 12, 2024
fbd624b
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 12, 2024
9cf5621
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 12, 2024
20190d4
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 12, 2024
500b702
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 12, 2024
aada769
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 12, 2024
293f6df
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 12, 2024
9fefe1c
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 12, 2024
30c6147
Migration: rushx format
albertxavier100 Dec 12, 2024
019a758
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 12, 2024
a4c9c02
Migration: Update test config
albertxavier100 Dec 12, 2024
68e39b6
Migration: Clean up files
albertxavier100 Dec 12, 2024
b09fe8c
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 12, 2024
798017c
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 12, 2024
aefc196
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 12, 2024
2990e16
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 12, 2024
8f63c87
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 12, 2024
0f40c20
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 12, 2024
0bcd55c
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 12, 2024
f8dda04
Migration: rushx format
albertxavier100 Dec 12, 2024
d7b04dd
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 13, 2024
01ab2f2
Migration: Update test config
albertxavier100 Dec 13, 2024
e0d1250
Migration: Clean up files
albertxavier100 Dec 13, 2024
0584ad7
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 13, 2024
def32e0
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 13, 2024
a5adae0
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 13, 2024
a01b45d
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 13, 2024
efd89b3
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 13, 2024
9537529
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 13, 2024
4926f4d
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 13, 2024
e0e5bd8
Migration: rushx format
albertxavier100 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .scripts/automation_generate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
code-gen-pipeline --inputJsonPath=../test/in.json --outputJsonPath=../test/out.json --use=@autorest/typescript@^6.0.12 --typespecEmitter=@azure-tools/typespec-ts --local
1 change: 1 addition & 0 deletions .scripts/automation_generate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
code-gen-pipeline --inputJsonPath=../test/in.json --outputJsonPath=../test/out.json --use=@autorest/typescript@^6.0.12 --typespecEmitter=@azure-tools/typespec-ts --local
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"vitest.vitestPackagePath": "common/tools/dev-tool/node_modules/vitest/package.json",
"vitest.experimentalStaticAstCollect": true,
"vitest.configSearchPatternExclude": "{**/node_modules/**,**/.*/**,**/*.d.ts,eng/**,samples/**}",
"vitest.nodeEnv": {}
"vitest.nodeEnv": {},
"workbench.colorCustomizations": {}
}
40 changes: 40 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default leafCommand(commandInfo, async ({ "package-name": packageName, br
await applyCodemods(projectFolder);

log.info("Formatting files");
await run(["rushx", "format"], { cwd: projectFolder });
await run(["rushx", "format"], { cwd: projectFolder, shell: true });
await commitChanges(projectFolder, "rushx format");

log.info(
Expand Down Expand Up @@ -328,6 +328,7 @@ async function addNewPackages(packageJson: any): Promise<void> {
latestVersion = (
await run(["npm", "view", newPackage, "version"], {
captureOutput: true,
shell: true,
})
).output;
}
Expand Down
21 changes: 21 additions & 0 deletions sdk/durabletask/arm-durabletask/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
102 changes: 102 additions & 0 deletions sdk/durabletask/arm-durabletask/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Azure DurableTask client library for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DurableTask client.



Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/durabletask/arm-durabletask)
- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-durabletask)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-durabletask?view=azure-node-preview)

## Getting started

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.

### Prerequisites

- An [Azure subscription][azure_sub].

### Install the `@azure/arm-durabletask` package

Install the Azure DurableTask client library for JavaScript with `npm`:

```bash
npm install @azure/arm-durabletask
```

### Create and authenticate a `DurableTaskClient`

To create a client object to access the Azure DurableTask API, you will need the `endpoint` of your Azure DurableTask resource and a `credential`. The Azure DurableTask client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure DurableTask resource in the [Azure Portal][azure_portal].

You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).

To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:

```bash
npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure DurableTask** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).

For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

```javascript
const { DurableTaskClient } = require("@azure/arm-durabletask");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.

const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DurableTaskClient(new DefaultAzureCredential(), subscriptionId);

// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new DurableTaskClient(credential, subscriptionId);
```


### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts

### DurableTaskClient

`DurableTaskClient` is the primary interface for developers using the Azure DurableTask client library. Explore the methods on this client object to understand the different features of the Azure DurableTask service that you can access.

## Troubleshooting

### Logging

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).


## Contributing

If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.

## Related projects

- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)

[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential
31 changes: 31 additions & 0 deletions sdk/durabletask/arm-durabletask/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "dist/arm-durabletask.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
17 changes: 17 additions & 0 deletions sdk/durabletask/arm-durabletask/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";

export default [
...azsdkEslint.configs.recommended,
{
rules: {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn",
},
},
];
109 changes: 109 additions & 0 deletions sdk/durabletask/arm-durabletask/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"name": "@azure/arm-durabletask",
"version": "1.0.0-beta.1",
"description": "A generated SDK for DurableTaskClient.",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"autoPublish": false,
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"type": "module",
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"files": [
"dist/",
"README.md",
"LICENSE"
],
"sdk-type": "mgmt",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/durabletask/arm-durabletask/README.md",
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"//metadata": {
"constantPaths": [
{
"path": "src/api/durableTaskContext.ts",
"prefix": "userAgentInfo"
}
]
},
"dependencies": {
"@azure-rest/core-client": "^2.3.1",
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.6.0",
"@azure/core-lro": "^3.1.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/core-util": "^1.9.2",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.2.1",
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"@vitest/browser": "^2.1.8",
"@vitest/coverage-istanbul": "^2.1.8",
"dotenv": "^16.0.0",
"eslint": "^9.9.0",
"playwright": "^1.49.1",
"typescript": "~5.6.2",
"vitest": "^2.1.8"
},
"scripts": {
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"build:samples": "echo skipped",
"build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"generate:client": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"lint": "eslint package.json api-extractor.json src test",
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"pack": "npm pack 2>&1",
"test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "echo skipped"
},
"browser": "./dist/browser/index.js"
}
1 change: 1 addition & 0 deletions sdk/durabletask/arm-durabletask/sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Feel free to add your own environment variables.
Loading
Loading