Skip to content

Commit 7dc9cd7

Browse files
Merge pull request #6 from docusign/sdk-update-typescript-1.0.0-beta.5
Update typescript SDK
2 parents 8bb0f11 + 1c78fa6 commit 7dc9cd7

File tree

83 files changed

+1842
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1842
-115
lines changed

.devcontainer/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal
77
rmdir samples || true
88
mkdir samples
99

10-
npm install
11-
npm install -g ts-node
10+
npm install --ignore-scripts
11+
npm install -g ts-node --ignore-scripts
1212
npm link
1313
npm link @docusign/iam-sdk
1414
TS_CONFIG_CONTENT=$(cat <<EOL

README.md

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ methods to interact with the following Docusign APIs:
2020
* [Maestro API](https://developers.docusign.com/docs/maestro-api/)
2121
* [Navigator API](https://developers.docusign.com/docs/navigator-api/)
2222
* [Connected Fields API](https://developers.docusign.com/docs/connected-fields-api/)
23+
* [Workspaces API](https://developers.docusign.com/docs/workspaces-api/)
2324

2425
This repo contains the source-code for this SDK. You only need to use the code
2526
in this repo if you want to customize the SDK for your own needs. To use the
@@ -40,6 +41,7 @@ Developer Center](https://developers.docusign.com/).
4041
* [Authentication](#authentication)
4142
* [Available Resources and Operations](#available-resources-and-operations)
4243
* [Standalone functions](#standalone-functions)
44+
* [File uploads](#file-uploads)
4345
* [Retries](#retries)
4446
* [Error Handling](#error-handling)
4547
* [Server Selection](#server-selection)
@@ -77,10 +79,7 @@ bun add @docusign/iam-sdk
7779
### Yarn
7880

7981
```bash
80-
yarn add @docusign/iam-sdk zod
81-
82-
# Note that Yarn does not install peer dependencies automatically. You will need
83-
# to install zod as shown above.
82+
yarn add @docusign/iam-sdk
8483
```
8584

8685
> [!NOTE]
@@ -187,17 +186,10 @@ run();
187186
* [getTokenFromRefreshToken](docs/sdks/auth/README.md#gettokenfromrefreshtoken) - Obtains an access token from the Docusign API using an authorization code.
188187
* [getUserInfo](docs/sdks/auth/README.md#getuserinfo) - Get user information
189188

190-
### [connectedFields](docs/sdks/connectedfields/README.md)
191-
192-
193189
#### [connectedFields.tabInfo](docs/sdks/tabinfo/README.md)
194190

195191
* [getConnectedFieldsTabGroups](docs/sdks/tabinfo/README.md#getconnectedfieldstabgroups) - Returns all tabs associated with the given account
196192

197-
198-
### [maestro](docs/sdks/maestro/README.md)
199-
200-
201193
#### [maestro.workflowInstanceManagement](docs/sdks/workflowinstancemanagement/README.md)
202194

203195
* [getWorkflowInstancesList](docs/sdks/workflowinstancemanagement/README.md#getworkflowinstanceslist) - Retrieve All Workflow Instances
@@ -212,22 +204,17 @@ run();
212204
* [pauseNewWorkflowInstances](docs/sdks/workflows/README.md#pausenewworkflowinstances) - Pause an Active Workflow
213205
* [resumePausedWorkflow](docs/sdks/workflows/README.md#resumepausedworkflow) - Resume a Paused Workflow
214206

215-
### [navigator](docs/sdks/navigator/README.md)
216-
217-
218207
#### [navigator.agreements](docs/sdks/agreements/README.md)
219208

220209
* [getAgreementsList](docs/sdks/agreements/README.md#getagreementslist) - Retrieve a list of agreements
221210
* [getAgreement](docs/sdks/agreements/README.md#getagreement) - Retrieve detailed information about a specific agreement
222211
* [deleteAgreement](docs/sdks/agreements/README.md#deleteagreement) - Delete a specific agreement
223212
* [createAgreementSummary](docs/sdks/agreements/README.md#createagreementsummary) - Create an AI-generated summary of an agreement document
224213

225-
### [workspaces](docs/sdks/workspaces1/README.md)
226-
227-
228214
#### [workspaces.workspaceDocuments](docs/sdks/workspacedocuments/README.md)
229215

230216
* [getWorkspaceDocuments](docs/sdks/workspacedocuments/README.md#getworkspacedocuments) - Get documents in the workspace accessible to the calling user
217+
* [addWorkspaceDocument](docs/sdks/workspacedocuments/README.md#addworkspacedocument) - Add a document to a workspace via file contents upload
231218
* [getWorkspaceDocument](docs/sdks/workspacedocuments/README.md#getworkspacedocument) - Get information about the document
232219
* [deleteWorkspaceDocument](docs/sdks/workspacedocuments/README.md#deleteworkspacedocument) - Deletes a document in the workspace
233220
* [getWorkspaceDocumentContents](docs/sdks/workspacedocuments/README.md#getworkspacedocumentcontents) - Get the file contents of the document
@@ -248,6 +235,7 @@ run();
248235
* [getWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#getworkspaceuploadrequest) - Gets details for a specific upload request
249236
* [updateWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#updateworkspaceuploadrequest) - Updates a specific upload request
250237
* [deleteWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#deleteworkspaceuploadrequest) - Deletes a specific upload request
238+
* [addWorkspaceUploadRequestDocument](docs/sdks/workspaceuploadrequest/README.md#addworkspaceuploadrequestdocument) - Add a document to an upload request via file upload
251239
* [completeWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#completeworkspaceuploadrequest) - Complete an upload request
252240

253241
#### [workspaces.workspaceUsers](docs/sdks/workspaceusers/README.md)
@@ -294,6 +282,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
294282
- [`navigatorAgreementsDeleteAgreement`](docs/sdks/agreements/README.md#deleteagreement) - Delete a specific agreement
295283
- [`navigatorAgreementsGetAgreement`](docs/sdks/agreements/README.md#getagreement) - Retrieve detailed information about a specific agreement
296284
- [`navigatorAgreementsGetAgreementsList`](docs/sdks/agreements/README.md#getagreementslist) - Retrieve a list of agreements
285+
- [`workspacesWorkspaceDocumentsAddWorkspaceDocument`](docs/sdks/workspacedocuments/README.md#addworkspacedocument) - Add a document to a workspace via file contents upload
297286
- [`workspacesWorkspaceDocumentsDeleteWorkspaceDocument`](docs/sdks/workspacedocuments/README.md#deleteworkspacedocument) - Deletes a document in the workspace
298287
- [`workspacesWorkspaceDocumentsGetWorkspaceDocument`](docs/sdks/workspacedocuments/README.md#getworkspacedocument) - Get information about the document
299288
- [`workspacesWorkspaceDocumentsGetWorkspaceDocumentContents`](docs/sdks/workspacedocuments/README.md#getworkspacedocumentcontents) - Get the file contents of the document
@@ -304,6 +293,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
304293
- [`workspacesWorkspacesGetWorkspaceAssignableRoles`](docs/sdks/workspaces2/README.md#getworkspaceassignableroles) - Returns the roles the caller can assign to workspace users
305294
- [`workspacesWorkspacesGetWorkspaceEnvelopes`](docs/sdks/workspaces2/README.md#getworkspaceenvelopes) - Returns the envelopes associated with the given workspace
306295
- [`workspacesWorkspacesGetWorkspaces`](docs/sdks/workspaces2/README.md#getworkspaces) - Gets workspaces available to the calling user
296+
- [`workspacesWorkspaceUploadRequestAddWorkspaceUploadRequestDocument`](docs/sdks/workspaceuploadrequest/README.md#addworkspaceuploadrequestdocument) - Add a document to an upload request via file upload
307297
- [`workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#completeworkspaceuploadrequest) - Complete an upload request
308298
- [`workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#createworkspaceuploadrequest) - Creates a new upload request within a workspace
309299
- [`workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#deleteworkspaceuploadrequest) - Deletes a specific upload request
@@ -319,6 +309,42 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
319309
</details>
320310
<!-- End Standalone functions [standalone-funcs] -->
321311

312+
<!-- Start File uploads [file-upload] -->
313+
## File uploads
314+
315+
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
316+
317+
> [!TIP]
318+
>
319+
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
320+
>
321+
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
322+
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
323+
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
324+
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
325+
326+
```typescript
327+
import { IamClient } from "@docusign/iam-sdk";
328+
329+
const iamClient = new IamClient({
330+
accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "",
331+
});
332+
333+
async function run() {
334+
const result = await iamClient.workspaces.workspaceDocuments
335+
.addWorkspaceDocument({
336+
accountId: "5eddb8e1-d00e-47c4-9ed6-3b1c8915ae0d",
337+
workspaceId: "7f9e0991-b6d1-4de8-bfa5-7724e59a3087",
338+
});
339+
340+
console.log(result);
341+
}
342+
343+
run();
344+
345+
```
346+
<!-- End File uploads [file-upload] -->
347+
322348
<!-- Start Retries [retries] -->
323349
## Retries
324350

@@ -458,9 +484,9 @@ run();
458484

459485

460486
**Inherit from [`IamClientError`](./src/models/errors/iamclienterror.ts)**:
461-
* [`ErrorDetails`](./src/models/errors/errordetails.ts): The error response object for the Workspaces API. Applicable to 21 of 39 methods.*
462-
* [`ErrorT`](./src/models/errors/errort.ts): Bad Request - The request could not be understood or was missing required parameters. Applicable to 11 of 39 methods.*
463-
* [`OAuthErrorResponse`](./src/models/errors/oautherrorresponse.ts): Status code `400`. Applicable to 5 of 39 methods.*
487+
* [`ErrorDetails`](./src/models/errors/errordetails.ts): The error response object for the Workspaces API. Applicable to 23 of 41 methods.*
488+
* [`ErrorT`](./src/models/errors/errort.ts): Bad Request - The request could not be understood or was missing required parameters. Applicable to 11 of 41 methods.*
489+
* [`OAuthErrorResponse`](./src/models/errors/oautherrorresponse.ts): Status code `400`. Applicable to 5 of 41 methods.*
464490
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
465491

466492
</details>
@@ -600,7 +626,7 @@ httpClient.addHook("requestError", (error, request) => {
600626
console.groupEnd();
601627
});
602628

603-
const sdk = new IamClient({ httpClient });
629+
const sdk = new IamClient({ httpClient: httpClient });
604630
```
605631
<!-- End Custom HTTP Client [http-client] -->
606632

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,14 @@ Based on:
5858
### Generated
5959
- [typescript v1.0.0-beta.4] .
6060
### Releases
61-
- [NPM v1.0.0-beta.4] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.4 - .
61+
- [NPM v1.0.0-beta.4] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.4 - .
62+
63+
## 2025-10-09 05:44:06
64+
### Changes
65+
Based on:
66+
- OpenAPI Doc
67+
- Speakeasy CLI 1.636.2 (2.723.8) https://github.com/speakeasy-api/speakeasy
68+
### Generated
69+
- [typescript v1.0.0-beta.5] .
70+
### Releases
71+
- [NPM v1.0.0-beta.5] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.5 - .

RUNTIMES.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
44

5-
* [Web Fetch API][web-fetch]
6-
* [Web Streams API][web-streams] and in particular `ReadableStream`
7-
* [Async iterables][async-iter] using `Symbol.asyncIterator`
5+
- [Web Fetch API][web-fetch]
6+
- [Web Streams API][web-streams] and in particular `ReadableStream`
7+
- [Async iterables][async-iter] using `Symbol.asyncIterator`
88

99
[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
1010
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
@@ -25,7 +25,7 @@ Runtime environments that are explicitly supported are:
2525

2626
The following `tsconfig.json` options are recommended for projects using this
2727
SDK in order to get static type support for features like async iterables,
28-
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
28+
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
2929
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
3030
so on):
3131

@@ -38,11 +38,11 @@ so on):
3838
{
3939
"compilerOptions": {
4040
"target": "es2020", // or higher
41-
"lib": ["es2020", "dom", "dom.iterable"],
41+
"lib": ["es2020", "dom", "dom.iterable"]
4242
}
4343
}
4444
```
4545

4646
While `target` can be set to older ECMAScript versions, it may result in extra,
4747
unnecessary compatibility code being generated if you are not targeting old
48-
runtimes.
48+
runtimes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# AddWorkspaceDocumentRequest
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { AddWorkspaceDocumentRequest } from "@docusign/iam-sdk/models/components";
7+
8+
// No examples available for this model
9+
```
10+
11+
## Fields
12+
13+
| Field | Type | Required | Description |
14+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15+
| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.AddWorkspaceDocumentRequestFile](../../models/components/addworkspacedocumentrequestfile.md) | :heavy_minus_sign: | The file within the multipart/form-data |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AddWorkspaceDocumentRequestFile
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { AddWorkspaceDocumentRequestFile } from "@docusign/iam-sdk/models/components";
7+
8+
// No examples available for this model
9+
```
10+
11+
## Fields
12+
13+
| Field | Type | Required | Description |
14+
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
15+
| `fileName` | *string* | :heavy_check_mark: | N/A |
16+
| `content` | *ReadableStream<Uint8Array>* | :heavy_check_mark: | N/A |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# AddWorkspaceUploadRequestDocumentRequest
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { AddWorkspaceUploadRequestDocumentRequest } from "@docusign/iam-sdk/models/components";
7+
8+
// No examples available for this model
9+
```
10+
11+
## Fields
12+
13+
| Field | Type | Required | Description |
14+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
15+
| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [components.AddWorkspaceUploadRequestDocumentRequestFile](../../models/components/addworkspaceuploadrequestdocumentrequestfile.md) | :heavy_minus_sign: | The file within the multipart/form-data |

0 commit comments

Comments
 (0)