@docusign/cli 1.1.0-rc → 1.3.0-rc
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/README.md +13 -0
- package/dist/index.mjs +478 -241
- package/dist/templates/ai-skills/.claude/skills/ds-agm-autopilot/SKILL.md +13 -2
- package/dist/templates/ai-skills/.claude/skills/ds-agreement-manager-workflow/SKILL.md +11 -0
- package/dist/templates/ai-skills/.claude/skills/ds-package-autopilot/SKILL.md +514 -0
- package/dist/templates/ai-skills/.cursor/rules/docusign.mdc +2 -1
- package/dist/templates/ai-skills/.gemini/instructions.md +2 -1
- package/dist/templates/ai-skills/.github/instructions/docusign.instructions.md +18 -0
- package/dist/templates/ai-skills/aiSkills.spec.ts +57 -0
- package/dist/templates/integration/README.md +40 -0
- package/dist/templates/package/README.md +107 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
const SKILLS_DIR = path.join(__dirname, '.claude', 'skills');
|
|
5
|
+
const read = (...parts: string[]): string => fs.readFileSync(path.join(__dirname, ...parts), 'utf8');
|
|
6
|
+
|
|
7
|
+
const frontmatter = (text: string): Record<string, string> => {
|
|
8
|
+
const match = /^---\n([\s\S]*?)\n---/.exec(text);
|
|
9
|
+
if (!match) return {};
|
|
10
|
+
return Object.fromEntries(
|
|
11
|
+
match[1]
|
|
12
|
+
.split('\n')
|
|
13
|
+
.map(line => /^([a-z-]+):\s*(.*)$/.exec(line))
|
|
14
|
+
.filter((m): m is RegExpExecArray => m !== null)
|
|
15
|
+
.map(m => [m[1], m[2]]),
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe('AI skill templates', () => {
|
|
20
|
+
const skillDirs = fs.readdirSync(SKILLS_DIR, { withFileTypes: true }).filter(entry => entry.isDirectory());
|
|
21
|
+
|
|
22
|
+
it.each(skillDirs.map(dir => [dir.name]))('%s should name itself after its folder and describe when to use it', name => {
|
|
23
|
+
const meta = frontmatter(read('.claude', 'skills', name, 'SKILL.md'));
|
|
24
|
+
|
|
25
|
+
expect(meta.name).toBe(name);
|
|
26
|
+
expect(meta.description?.length).toBeGreaterThan(40);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('ds-package-autopilot', () => {
|
|
30
|
+
const skill = read('.claude', 'skills', 'ds-package-autopilot', 'SKILL.md');
|
|
31
|
+
|
|
32
|
+
it('should be listed for every assistant that lists skills', () => {
|
|
33
|
+
expect(read('.cursor', 'rules', 'docusign.mdc')).toContain('.claude/skills/ds-package-autopilot/SKILL.md');
|
|
34
|
+
expect(read('.gemini', 'instructions.md')).toContain('.claude/skills/ds-package-autopilot/SKILL.md');
|
|
35
|
+
expect(read('.github', 'instructions', 'docusign.instructions.md')).toContain('ds-package-autopilot');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should cover the whole lifecycle a user can ask for', () => {
|
|
39
|
+
['ds pkg create', 'ds pkg add', 'ds pkg export', 'ds pkg install --file', 'ds pkg install --resume', 'ds pkg view-details'].forEach(command =>
|
|
40
|
+
expect(skill).toContain(command),
|
|
41
|
+
);
|
|
42
|
+
['REQUIREMENT_MAPPING', 'BULK_PUBLISH_CONSENT', '--draft-workflows', '--prefix', 'requirements.json'].forEach(term =>
|
|
43
|
+
expect(skill).toContain(term),
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should name the four restricted scopes an app needs', () => {
|
|
48
|
+
['act_read', 'act_write', 'transaction_management_api', 'proof_create_transaction'].forEach(scope => expect(skill).toContain(scope));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should carry no secret: no token, no link code, no real account or package id', () => {
|
|
52
|
+
expect(skill).not.toMatch(/eyJ[A-Za-z0-9_-]{20,}/);
|
|
53
|
+
expect(skill).not.toMatch(/[?&](code|state|hash|mtsec|sig)=[A-Za-z0-9+/=_-]{12,}/);
|
|
54
|
+
expect(skill).not.toMatch(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Integration
|
|
2
|
+
|
|
3
|
+
Tools for your integration keys (IKs).
|
|
4
|
+
|
|
5
|
+
## Directory structure
|
|
6
|
+
|
|
7
|
+
- **logs/**: CSV files written by `ds integration logs`
|
|
8
|
+
|
|
9
|
+
## Download the API logs of an integration key
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
ds integration logs --ik <integration-key> # last hour
|
|
13
|
+
ds integration logs --ik <integration-key> --limit 7d # last 7 days
|
|
14
|
+
ds ik logs --ik <integration-key> --limit 30d # 'ik' is short for 'integration'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Option | Default | What it does |
|
|
18
|
+
| ------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `--ik` | required | The integration key (client ID). A GUID, or a GUID with up to six letters and a `-` or `_` in front. Case does not matter. |
|
|
20
|
+
| `--limit` | `1h` | How far back to read, from now: `10m`, `1h`, `6h`, `12h`, `1d`, `7d`, `15d` or `30d`. The longest window is 30 days. |
|
|
21
|
+
| `--max-rows` | `1000000` | Stop before the download if the window holds more rows than this. Each row is roughly 0.6 to 0.9 KB, so the default is a file of about 0.6 to 0.9 GB. |
|
|
22
|
+
|
|
23
|
+
The file is `logs/<integration-key>_<limit>_<time>.csv`, with one header row and one row per request.
|
|
24
|
+
|
|
25
|
+
- Logs come from the environment you are logged in to, for the account you are logged in to. An integration key that
|
|
26
|
+
does not belong to this account returns no rows.
|
|
27
|
+
- While it downloads, the command prints a progress line after every 25,000 rows, for example
|
|
28
|
+
`Fetched 25,000 of 1,000,000 rows (2.5%) in 11s, 2,273 rows/s, about 7m 9s left`. The estimate is the average speed so far,
|
|
29
|
+
so treat it as a rough guide. The same lines go to the debug log in `~/.docusign/logs`.
|
|
30
|
+
- The command counts the rows first. If there are more than `--max-rows` (1,000,000 by default), it stops before it
|
|
31
|
+
downloads anything. Use a shorter `--limit`, or raise `--max-rows`.
|
|
32
|
+
- A file that ends in `.csv.partial` is an export that stopped early. The rows it holds are real, but the pull is not
|
|
33
|
+
complete. Run the command again.
|
|
34
|
+
|
|
35
|
+
## Columns
|
|
36
|
+
|
|
37
|
+
The columns are the fields the log dataset returns, in the order it returns them, with one row per request, oldest
|
|
38
|
+
first. A field added to the dataset shows up as a new column without a CLI update.
|
|
39
|
+
|
|
40
|
+
A text cell that starts with `=`, `+`, `-` or `@` begins with an extra `'`, so a spreadsheet does not run it as a formula.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Package Feature
|
|
2
|
+
|
|
3
|
+
This directory contains files for managing DocuSign packages in this project.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
- **files/**: Package content files to include in your packages
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
### Create a package
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ds package create --name=my-package
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Add components to a package
|
|
18
|
+
|
|
19
|
+
Each component is given as `<id>:<name>`. Quote names that contain spaces.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
ds package add --name=my-package --esign-templates "555:NDA" "775:MSA"
|
|
23
|
+
ds package add --name=my-package --workflow "111:Invoice approval" --webform "9f2:Intake form"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Flag | Component type |
|
|
27
|
+
| ------------------- | ------------------- |
|
|
28
|
+
| `--esign-templates` | eSignature template |
|
|
29
|
+
| `--templates` | Document template |
|
|
30
|
+
| `--workflow` | Maestro workflow |
|
|
31
|
+
| `--webform` | Web form |
|
|
32
|
+
|
|
33
|
+
List several components after one flag or repeat the flag; different types can be combined in one call. Use `--id=<packageId>` instead of `--name` to pick one package when names are shared.
|
|
34
|
+
|
|
35
|
+
### Remove components
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ds package remove --name=my-package --esign-templates "775:MSA"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To change a component, remove it and add it again.
|
|
42
|
+
|
|
43
|
+
### See what a package contains and where it stands
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
ds package view-details --name=my-package
|
|
47
|
+
ds package status --name=my-package
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`status` reports Processing while an import, export or publish is running, Installed once the package has been installed, otherwise the package's own status (Draft, Published, Archived or Review).
|
|
51
|
+
|
|
52
|
+
### Export a package
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
ds package export --name=my-package
|
|
56
|
+
ds package export --name=my-package --output=./backups/my-package.zip
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The zip is saved in this project's `package/files` folder as `<package name>-<first 8 characters of the id>.zip`, unless you pass `--output`. Exporting publishes the package first, and a Published package cannot take new components. The CLI refuses to export a package with no components, since the zip would be empty.
|
|
60
|
+
|
|
61
|
+
### Install a package in another account
|
|
62
|
+
|
|
63
|
+
A private package cannot be installed by id from another account. Export it, log in to the target account, and install the zip.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
ds package export --name=my-package # in the source account
|
|
67
|
+
ds auth login # choose the target account
|
|
68
|
+
ds package install --file my-package-1a2b3c4d.zip --prefix "copy-"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
A bare file name is also looked up in this project's `package/files` folder. `--prefix` puts text in front of the name of every component the install creates; use it for test installs, because the CLI cannot remove installed components.
|
|
72
|
+
|
|
73
|
+
You can also install a package that is already on the server, from your account or a public one:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
ds package install --name=my-package
|
|
77
|
+
ds package install --id=<packageId> --source public
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The install runs on the server and the CLI follows it. It can stop twice to ask for something:
|
|
81
|
+
|
|
82
|
+
- **Connections.** An app in the package needs a connection in this account. Pick one you already have, or connect a new one: the CLI opens the app's sign-in page and waits until the connection is active.
|
|
83
|
+
- **Consent.** Workflows must be consented to before they are published. The CLI opens the consent page. Use `--draft-workflows` to create the workflows as drafts and skip this step.
|
|
84
|
+
|
|
85
|
+
| Flag | What it does |
|
|
86
|
+
| -------------------- | ------------------------------------------------------------------------- |
|
|
87
|
+
| `--file <zip>` | Install from a zip file |
|
|
88
|
+
| `--prefix <text>` | Put `<text>` in front of the name of every component the install creates |
|
|
89
|
+
| `--update` | Overwrite components that already exist in this account |
|
|
90
|
+
| `--draft-workflows` | Create workflows as drafts instead of publishing them |
|
|
91
|
+
| `--connection a=c` | Use connection `c` for app `a`, so the install does not stop to ask |
|
|
92
|
+
| `--no-browser` | Print links instead of opening them |
|
|
93
|
+
| `-y` | Do not ask for confirmation (needed without a terminal) |
|
|
94
|
+
| `--resume [--event]` | Continue an install that stopped, for example because the terminal closed |
|
|
95
|
+
| `--cancel [--event]` | Stop an install that is waiting for you; what it already created stays |
|
|
96
|
+
|
|
97
|
+
If the terminal closes, the install keeps running. Run `ds package install --resume` to pick it up again. Run `ds package install -h` for exit codes, what to do when an install fails, and how it behaves without a terminal.
|
|
98
|
+
|
|
99
|
+
### Get help
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
ds package -h
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## About Packages
|
|
106
|
+
|
|
107
|
+
Packages allow you to bundle and distribute your DocuSign configurations and assets. Each package has a unique ID assigned by the server. Names do not need to be unique — use descriptive names to identify packages by purpose.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusign/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-rc",
|
|
4
4
|
"author": "Docusign",
|
|
5
5
|
"description": "The Docusign CLI simplifies the implementation of Docusign Agreement Manager. With this CLI, you can bulk configure Agreement Manager with custom fields and types, map fields to types, provide AI training sets for custom extractions, programmatically test extraction accuracy, and export/import your setup across accounts. This offering is currently in beta.",
|
|
6
6
|
"main": "dist/index.mjs",
|