@verdocs/web-sdk 2.2.2 → 2.2.6

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.
Files changed (79) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{verdocs-help-icon.cjs.entry.js → verdocs-button_2.cjs.entry.js} +20 -0
  3. package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +13 -3
  4. package/dist/cjs/verdocs-dialog_2.cjs.entry.js +50 -0
  5. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +155 -12
  6. package/dist/cjs/verdocs-view.cjs.entry.js +9 -2
  7. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  8. package/dist/collection/components/controls/verdocs-table/verdocs-table.css +8 -4
  9. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +15 -0
  10. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +30 -2
  11. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.css +21 -5
  12. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.js +4 -2
  13. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +9 -2
  14. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.css +27 -18
  15. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.js +122 -14
  16. package/dist/components/Strings.js +12 -1
  17. package/dist/components/verdocs-dialog.js +1 -36
  18. package/dist/components/verdocs-dialog2.js +40 -0
  19. package/dist/components/verdocs-settings-api-keys2.js +192 -18
  20. package/dist/components/verdocs-settings-members2.js +1 -12
  21. package/dist/components/verdocs-settings.js +8 -2
  22. package/dist/components/verdocs-table2.js +1 -1
  23. package/dist/components/verdocs-text-input2.js +14 -3
  24. package/dist/components/verdocs-view2.js +9 -2
  25. package/dist/docs.json +49 -6
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/{verdocs-help-icon.entry.js → verdocs-button_2.entry.js} +20 -1
  28. package/dist/esm/verdocs-checkbox_4.entry.js +13 -3
  29. package/dist/esm/verdocs-dialog_2.entry.js +45 -0
  30. package/dist/esm/verdocs-settings-api-keys_4.entry.js +155 -12
  31. package/dist/esm/verdocs-view.entry.js +9 -2
  32. package/dist/esm/verdocs-web-sdk.js +1 -1
  33. package/dist/esm-es5/loader.js +1 -1
  34. package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
  35. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -1
  36. package/dist/esm-es5/verdocs-dialog_2.entry.js +1 -0
  37. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  38. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  39. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  40. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +7 -0
  41. package/dist/types/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.d.ts +12 -1
  42. package/dist/types/components.d.ts +8 -0
  43. package/dist/verdocs-web-sdk/p-0fecb805.entry.js +1 -0
  44. package/dist/verdocs-web-sdk/p-13585ecc.system.entry.js +1 -0
  45. package/dist/verdocs-web-sdk/p-4821f318.system.entry.js +1 -0
  46. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  47. package/dist/verdocs-web-sdk/p-77f04115.entry.js +1 -0
  48. package/dist/verdocs-web-sdk/p-8a77db15.entry.js +1 -0
  49. package/dist/verdocs-web-sdk/p-96c4637b.system.entry.js +1 -0
  50. package/dist/verdocs-web-sdk/p-a1eb425e.system.entry.js +1 -0
  51. package/dist/verdocs-web-sdk/p-bc442f6c.system.entry.js +1 -0
  52. package/dist/verdocs-web-sdk/p-c9ac0d2f.entry.js +1 -0
  53. package/dist/verdocs-web-sdk/p-dfcbcf0b.entry.js +1 -0
  54. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/cjs/verdocs-button.cjs.entry.js +0 -26
  57. package/dist/cjs/verdocs-dialog.cjs.entry.js +0 -27
  58. package/dist/cjs/verdocs-table.cjs.entry.js +0 -27
  59. package/dist/esm/verdocs-button.entry.js +0 -22
  60. package/dist/esm/verdocs-dialog.entry.js +0 -23
  61. package/dist/esm/verdocs-table.entry.js +0 -23
  62. package/dist/esm-es5/verdocs-button.entry.js +0 -1
  63. package/dist/esm-es5/verdocs-dialog.entry.js +0 -1
  64. package/dist/esm-es5/verdocs-help-icon.entry.js +0 -1
  65. package/dist/esm-es5/verdocs-table.entry.js +0 -1
  66. package/dist/verdocs-web-sdk/p-144d4ed1.system.entry.js +0 -1
  67. package/dist/verdocs-web-sdk/p-268a29a9.system.entry.js +0 -1
  68. package/dist/verdocs-web-sdk/p-40361f22.entry.js +0 -1
  69. package/dist/verdocs-web-sdk/p-606e0405.entry.js +0 -1
  70. package/dist/verdocs-web-sdk/p-7213a107.system.entry.js +0 -1
  71. package/dist/verdocs-web-sdk/p-84f9fe5d.entry.js +0 -1
  72. package/dist/verdocs-web-sdk/p-a69359d3.entry.js +0 -1
  73. package/dist/verdocs-web-sdk/p-ab26744f.system.entry.js +0 -1
  74. package/dist/verdocs-web-sdk/p-c69b5a99.system.entry.js +0 -1
  75. package/dist/verdocs-web-sdk/p-d309ef6f.entry.js +0 -1
  76. package/dist/verdocs-web-sdk/p-d734ced3.system.entry.js +0 -1
  77. package/dist/verdocs-web-sdk/p-db4cfbfe.entry.js +0 -1
  78. package/dist/verdocs-web-sdk/p-f8a2988e.entry.js +0 -1
  79. package/dist/verdocs-web-sdk/p-fbabbcea.system.entry.js +0 -1
@@ -0,0 +1,40 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const verdocsDialogCss = "verdocs-dialog{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-dialog .background-overlay{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:absolute;-ms-flex-align:center;align-items:center;background:#0000007f;-ms-flex-pack:center;justify-content:center}verdocs-dialog .dialog{width:420px;display:-ms-flexbox;display:flex;max-width:100%;overflow:hidden;border-radius:4px;-ms-flex-direction:column;flex-direction:column;background:#ffffff;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-dialog .heading{display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;padding:8px 16px;-ms-flex-direction:row;flex-direction:row;color:#ffffff;background:#46497d}verdocs-dialog .content{padding:16px}verdocs-dialog .content p{margin:0 0 1em 0}verdocs-dialog .buttons{gap:14px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}";
4
+
5
+ const VerdocsDialog = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.exit = createEvent(this, "exit", 7);
10
+ }
11
+ // We need a separate event handler for clicking the background because it can receive events "through" other child components
12
+ handleDismiss(e) {
13
+ var _a;
14
+ console.log('e', e.target.className);
15
+ if (e.target.className === 'background-overlay') {
16
+ e.preventDefault();
17
+ (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
18
+ }
19
+ }
20
+ render() {
21
+ return (h(Host, null, h("div", { class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { class: "dialog" }, h("slot", { name: "title" }, h("div", { class: "heading" }, "Please Confirm")), h("slot", null, h("div", { class: "content" }))))));
22
+ }
23
+ static get style() { return verdocsDialogCss; }
24
+ }, [4, "verdocs-dialog"]);
25
+ function defineCustomElement() {
26
+ if (typeof customElements === "undefined") {
27
+ return;
28
+ }
29
+ const components = ["verdocs-dialog"];
30
+ components.forEach(tagName => { switch (tagName) {
31
+ case "verdocs-dialog":
32
+ if (!customElements.get(tagName)) {
33
+ customElements.define(tagName, VerdocsDialog);
34
+ }
35
+ break;
36
+ } });
37
+ }
38
+ defineCustomElement();
39
+
40
+ export { VerdocsDialog as V, defineCustomElement as d };
@@ -1,11 +1,15 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import './Types.js';
3
+ import { g as getMembers, c as capitalize } from './Strings.js';
3
4
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
4
- import { c as capitalize } from './Strings.js';
5
5
  import { V as VerdocsToast } from './Toast.js';
6
6
  import { S as SDKError } from './errors.js';
7
- import { d as defineCustomElement$2 } from './verdocs-button2.js';
8
- import { d as defineCustomElement$1 } from './verdocs-table2.js';
7
+ import { d as defineCustomElement$6 } from './verdocs-button2.js';
8
+ import { d as defineCustomElement$5 } from './verdocs-dialog2.js';
9
+ import { d as defineCustomElement$4 } from './verdocs-help-icon2.js';
10
+ import { d as defineCustomElement$3 } from './verdocs-select-input2.js';
11
+ import { d as defineCustomElement$2 } from './verdocs-table2.js';
12
+ import { d as defineCustomElement$1 } from './verdocs-text-input2.js';
9
13
 
10
14
  /**
11
15
  * API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)
@@ -33,9 +37,56 @@ var getKeys = function (endpoint, organizationId) {
33
37
  .get("/organizations/".concat(organizationId, "/api_key"))
34
38
  .then(function (r) { return r.data; });
35
39
  };
40
+ /**
41
+ * Create an API key.
42
+ *
43
+ * ```typescript
44
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
45
+ *
46
+ * await ApiKeys.createKey(ORGID, {name: NEWNAME});
47
+ * ```
48
+ */
49
+ var createKey = function (endpoint, organizationId, params) {
50
+ return endpoint.api //
51
+ .post("/organizations/".concat(organizationId, "/api_key"), params)
52
+ .then(function (r) { return r.data; });
53
+ };
54
+ /**
55
+ * Rotate the secret for an API key. The caller must have admin access to the organization.
56
+ *
57
+ * ```typescript
58
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
59
+ *
60
+ * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
61
+ * ```
62
+ */
63
+ var rotateKey = function (endpoint, organizationId, clientId) {
64
+ return endpoint.api //
65
+ .put("/organizations/".concat(organizationId, "/api_key/").concat(clientId, "/rotate"))
66
+ .then(function (r) { return r.data; });
67
+ };
68
+ /**
69
+ * Delete an API key.
70
+ *
71
+ * ```typescript
72
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
73
+ *
74
+ * await ApiKeys.deleteKey(ORGID, CLIENTID);
75
+ * ```
76
+ */
77
+ var deleteKey = function (endpoint, organizationId, clientId) {
78
+ return endpoint.api //
79
+ .delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId))
80
+ .then(function (r) { return r.data; });
81
+ };
36
82
 
37
- const verdocsSettingsApiKeysCss = "verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .col.col-actions{-ms-flex-align:center;align-items:center;text-align:center}verdocs-settings-api-keys .col.col-actions svg{cursor:pointer;width:24px;height:24px;fill:#777777}verdocs-settings-api-keys .col.col-actions svg:hover{fill:red}";
83
+ const verdocsSettingsApiKeysCss = "verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}";
38
84
 
85
+ const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
86
+ const TagIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>`;
87
+ const UserIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>`;
88
+ const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
89
+ const ArrowPathIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`;
39
90
  const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
40
91
  constructor() {
41
92
  super();
@@ -46,6 +97,13 @@ const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HT
46
97
  this.memberRemoved = createEvent(this, "memberRemoved", 7);
47
98
  this.endpoint = VerdocsEndpoint.getDefault();
48
99
  this.keys = [];
100
+ this.creatingKey = false;
101
+ this.createdKey = null;
102
+ this.deletingKey = null;
103
+ this.rotatingKey = null;
104
+ this.newApiKeyName = '';
105
+ this.newApiKeyProfileId = '';
106
+ this.members = [];
49
107
  }
50
108
  componentWillLoad() {
51
109
  this.endpoint.loadSession();
@@ -55,36 +113,132 @@ const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HT
55
113
  }
56
114
  }
57
115
  async componentDidLoad() {
58
- var _a, _b, _c;
59
- try {
60
- this.keys = await getKeys(this.endpoint, this.endpoint.session.organization_id);
61
- }
62
- catch (e) {
116
+ this.newApiKeyProfileId = this.endpoint.session.profile_id;
117
+ getMembers(this.endpoint, this.endpoint.session.organization_id)
118
+ .then(mem => {
119
+ this.members = mem;
120
+ })
121
+ .catch((e) => {
122
+ var _a, _b, _c;
123
+ console.log('[SETTINGS] Error loading organization members', e);
63
124
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
64
- VerdocsToast('Unable to load members. Please try again later');
65
- }
125
+ VerdocsToast('Unable to load API keys. Please try again later', { style: 'error' });
126
+ });
127
+ this.loadKeys();
128
+ }
129
+ loadKeys() {
130
+ getKeys(this.endpoint, this.endpoint.session.organization_id)
131
+ .then(r => {
132
+ this.keys = r;
133
+ })
134
+ .catch(e => {
135
+ var _a, _b, _c;
136
+ console.log('[SETTINGS] Unable to load API keys', e);
137
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
138
+ VerdocsToast('Unable to load API keys. Please try again later', { style: 'error' });
139
+ });
140
+ }
141
+ async handleDeleteKey() {
142
+ deleteKey(this.endpoint, this.deletingKey.organization_id, this.deletingKey.client_id)
143
+ .then(() => {
144
+ this.deletingKey = null;
145
+ VerdocsToast('API key deleted', { style: 'success' });
146
+ this.loadKeys();
147
+ })
148
+ .catch(e => {
149
+ var _a, _b, _c;
150
+ this.deletingKey = null;
151
+ console.log('[SETTINGS] Unable to delete API key', e);
152
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
153
+ VerdocsToast('Unable to delete API key. Please try again later', { style: 'error' });
154
+ });
155
+ }
156
+ async handleRotateKey() {
157
+ rotateKey(this.endpoint, this.rotatingKey.organization_id, this.rotatingKey.client_id)
158
+ .then(r => {
159
+ this.rotatingKey = null;
160
+ VerdocsToast('API key rotated', { style: 'success' });
161
+ this.loadKeys();
162
+ this.createdKey = r;
163
+ })
164
+ .catch(e => {
165
+ var _a, _b, _c;
166
+ this.rotatingKey = null;
167
+ console.log('[SETTINGS] Unable to rotate API key', e);
168
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
169
+ VerdocsToast('Unable to rotate API key. Please try again later', { style: 'error' });
170
+ });
171
+ }
172
+ async handleCreateKey() {
173
+ createKey(this.endpoint, this.endpoint.session.organization_id, { name: this.newApiKeyName, profile_id: this.newApiKeyProfileId })
174
+ .then(r => {
175
+ this.creatingKey = false;
176
+ this.createdKey = r;
177
+ VerdocsToast('API key created', { style: 'success' });
178
+ this.loadKeys();
179
+ })
180
+ .catch(e => {
181
+ var _a, _b, _c;
182
+ this.creatingKey = false;
183
+ console.log('[SETTINGS] Unable to create API key', e);
184
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
185
+ VerdocsToast('Unable to create API key. Please try again later', { style: 'error' });
186
+ });
66
187
  }
67
188
  render() {
189
+ var _a, _b, _c, _d, _e, _f, _g;
190
+ const profileOptions = this.members.map(member => ({ label: `${member.first_name} ${member.last_name}`, value: member.id }));
68
191
  if (!this.endpoint.session) {
69
192
  console.log('[SETTINGS] Must be authenticated');
70
193
  return h(Host, { class: "authentication-required" }, "Must be authenticated");
71
194
  }
72
195
  return (h(Host, null, h("h1", null, "API Keys"), h("verdocs-table", { data: this.keys, columns: [
73
- { id: 'name', header: 'Name' },
74
- { id: 'client_id', header: 'Client ID' },
75
- { id: 'profile_id', header: 'Acts as', renderCell: (_, row) => { var _a, _b; return `${capitalize((_a = row.profile) === null || _a === void 0 ? void 0 : _a.first_name)} ${capitalize((_b = row.profile) === null || _b === void 0 ? void 0 : _b.last_name)}`; } },
76
- ] }), h("verdocs-button", { label: "Add API Key", size: "normal", disabled: true })));
196
+ {
197
+ id: 'name',
198
+ header: 'Name',
199
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: ClockIcon }), h("div", null, row.name))),
200
+ },
201
+ {
202
+ id: 'client_id',
203
+ header: 'Client ID',
204
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TagIcon }), h("div", null, row.client_id))),
205
+ },
206
+ {
207
+ id: 'profile_id',
208
+ header: 'Acts as',
209
+ renderCell: (_, row) => {
210
+ var _a, _b;
211
+ return (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, capitalize((_a = row.profile) === null || _a === void 0 ? void 0 : _a.first_name), " ", capitalize((_b = row.profile) === null || _b === void 0 ? void 0 : _b.last_name))));
212
+ },
213
+ },
214
+ {
215
+ id: 'actions',
216
+ header: 'Actions',
217
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TrashIcon, onClick: () => (this.deletingKey = row) }), h("div", { innerHTML: ArrowPathIcon, onClick: () => (this.rotatingKey = row) }))),
218
+ },
219
+ ] }), h("verdocs-button", { label: "Add API Key", size: "normal", onClick: () => (this.creatingKey = true) }), this.deletingKey && (h("verdocs-dialog", { onExit: () => (this.deletingKey = null) }, h("div", { slot: "title", class: "heading" }, "Delete API key \"", this.deletingKey.name, "\"?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to delete this key? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.deletingKey = null) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleDeleteKey() }))))), this.rotatingKey && (h("verdocs-dialog", { onExit: () => (this.rotatingKey = null) }, h("div", { slot: "title", class: "heading" }, "Rotate API key \"", this.rotatingKey.name, "\"?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to rotate this key? A new client secret will be generated, and the old value will become unusable. This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.rotatingKey = null) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleRotateKey() }))))), this.creatingKey && (h("verdocs-dialog", { onExit: () => (this.creatingKey = false) }, h("div", { slot: "title", class: "heading" }, "Create API Key"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", placeholder: "API key name...", id: "verdocs-api-key-name", value: this.newApiKeyName, autocomplete: "off", required: true, onInput: (e) => (this.newApiKeyName = e.target.value), onFocusout: (e) => {
220
+ this.newApiKeyName = e.target.value.trim();
221
+ } }), h("p", null, "API keys must be associated with a profile. Actions performed via API calls using this key will \"act as\" this profile."), h("verdocs-select-input", { options: profileOptions, label: "Act as Profile", onInput: (e) => {
222
+ this.newApiKeyProfileId = e.target.value;
223
+ } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: `${(_c = (_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.first_name} ${(_e = (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.last_name}` }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_f = this.createdKey) === null || _f === void 0 ? void 0 : _f.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_g = this.createdKey) === null || _g === void 0 ? void 0 : _g.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
77
224
  }
78
225
  static get style() { return verdocsSettingsApiKeysCss; }
79
226
  }, [0, "verdocs-settings-api-keys", {
80
227
  "endpoint": [16],
81
- "keys": [32]
228
+ "keys": [32],
229
+ "creatingKey": [32],
230
+ "createdKey": [32],
231
+ "deletingKey": [32],
232
+ "rotatingKey": [32],
233
+ "newApiKeyName": [32],
234
+ "newApiKeyProfileId": [32],
235
+ "members": [32]
82
236
  }]);
83
237
  function defineCustomElement() {
84
238
  if (typeof customElements === "undefined") {
85
239
  return;
86
240
  }
87
- const components = ["verdocs-settings-api-keys", "verdocs-button", "verdocs-table"];
241
+ const components = ["verdocs-settings-api-keys", "verdocs-button", "verdocs-dialog", "verdocs-help-icon", "verdocs-select-input", "verdocs-table", "verdocs-text-input"];
88
242
  components.forEach(tagName => { switch (tagName) {
89
243
  case "verdocs-settings-api-keys":
90
244
  if (!customElements.get(tagName)) {
@@ -93,10 +247,30 @@ function defineCustomElement() {
93
247
  break;
94
248
  case "verdocs-button":
95
249
  if (!customElements.get(tagName)) {
96
- defineCustomElement$2();
250
+ defineCustomElement$6();
251
+ }
252
+ break;
253
+ case "verdocs-dialog":
254
+ if (!customElements.get(tagName)) {
255
+ defineCustomElement$5();
256
+ }
257
+ break;
258
+ case "verdocs-help-icon":
259
+ if (!customElements.get(tagName)) {
260
+ defineCustomElement$4();
261
+ }
262
+ break;
263
+ case "verdocs-select-input":
264
+ if (!customElements.get(tagName)) {
265
+ defineCustomElement$3();
97
266
  }
98
267
  break;
99
268
  case "verdocs-table":
269
+ if (!customElements.get(tagName)) {
270
+ defineCustomElement$2();
271
+ }
272
+ break;
273
+ case "verdocs-text-input":
100
274
  if (!customElements.get(tagName)) {
101
275
  defineCustomElement$1();
102
276
  }
@@ -1,23 +1,12 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { g as getMembers, c as capitalize } from './Strings.js';
2
3
  import './Types.js';
3
4
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
4
- import { c as capitalize } from './Strings.js';
5
5
  import { V as VerdocsToast } from './Toast.js';
6
6
  import { S as SDKError } from './errors.js';
7
7
  import { d as defineCustomElement$2 } from './verdocs-button2.js';
8
8
  import { d as defineCustomElement$1 } from './verdocs-table2.js';
9
9
 
10
- /**
11
- * An Organization Member (aka Profile) is an individual user with access to an organization.
12
- *
13
- * @module
14
- */
15
- var getMembers = function (endpoint, organizationId) {
16
- return endpoint.api //
17
- .get("/organizations/".concat(organizationId, "/profiles"))
18
- .then(function (r) { return r.data; });
19
- };
20
-
21
10
  const verdocsSettingsMembersCss = "verdocs-settings-members{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-members .col.col-actions{-ms-flex-align:center;align-items:center;text-align:center}verdocs-settings-members .col.col-actions svg{cursor:pointer;width:24px;height:24px;fill:#777777}verdocs-settings-members .col.col-actions svg:hover{fill:red}";
22
11
 
23
12
  const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
@@ -2,7 +2,8 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import './Types.js';
3
3
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
4
4
  import { S as SDKError } from './errors.js';
5
- import { d as defineCustomElement$b } from './verdocs-button2.js';
5
+ import { d as defineCustomElement$c } from './verdocs-button2.js';
6
+ import { d as defineCustomElement$b } from './verdocs-dialog2.js';
6
7
  import { d as defineCustomElement$a } from './verdocs-help-icon2.js';
7
8
  import { d as defineCustomElement$9 } from './verdocs-loader2.js';
8
9
  import { d as defineCustomElement$8 } from './verdocs-select-input2.js';
@@ -52,7 +53,7 @@ function defineCustomElement$1() {
52
53
  if (typeof customElements === "undefined") {
53
54
  return;
54
55
  }
55
- const components = ["verdocs-settings", "verdocs-button", "verdocs-help-icon", "verdocs-loader", "verdocs-select-input", "verdocs-settings-api-keys", "verdocs-settings-members", "verdocs-settings-organization", "verdocs-settings-profile", "verdocs-table", "verdocs-text-input"];
56
+ const components = ["verdocs-settings", "verdocs-button", "verdocs-dialog", "verdocs-help-icon", "verdocs-loader", "verdocs-select-input", "verdocs-settings-api-keys", "verdocs-settings-members", "verdocs-settings-organization", "verdocs-settings-profile", "verdocs-table", "verdocs-text-input"];
56
57
  components.forEach(tagName => { switch (tagName) {
57
58
  case "verdocs-settings":
58
59
  if (!customElements.get(tagName)) {
@@ -60,6 +61,11 @@ function defineCustomElement$1() {
60
61
  }
61
62
  break;
62
63
  case "verdocs-button":
64
+ if (!customElements.get(tagName)) {
65
+ defineCustomElement$c();
66
+ }
67
+ break;
68
+ case "verdocs-dialog":
63
69
  if (!customElements.get(tagName)) {
64
70
  defineCustomElement$b();
65
71
  }
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const verdocsTableCss = "verdocs-table{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block;width:100%}verdocs-table .table-wrapper{margin:10px 0;padding:0}verdocs-table .table{width:100%;border:none}verdocs-table .header-col{text-align:left;padding:3px 8px;font-weight:700;color:#555555}verdocs-table .data-col{padding:3px 8px;font-weight:400}";
3
+ const verdocsTableCss = "verdocs-table{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block;width:100%}verdocs-table .table-wrapper{margin:10px 0;padding:0}verdocs-table .table{width:100%;border:none}verdocs-table .row.data-row{border:1px solid #cccccc;background-color:#ffffff}verdocs-table .header-col{text-align:left;padding:8px 16px;font-weight:600;color:#5c6575}verdocs-table .data-col{padding:8px 16px;font-weight:400}";
4
4
 
5
5
  const VerdocsTable = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -1,9 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { V as VerdocsToast } from './Toast.js';
2
3
  import { d as defineCustomElement$1 } from './verdocs-help-icon2.js';
3
4
 
4
- const verdocsTextInputCss = "verdocs-text-input{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-text-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 12px;outline:none}verdocs-text-input .input-element:disabled{border:1px solid #aeb4bf;background:#f5f5fa}verdocs-text-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:focus{outline:1px solid #7d88ff}verdocs-text-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}verdocs-text-input .required{color:red;margin-left:2px;display:inline-block}verdocs-text-input [data-lastpass-icon-root]{display:none !important}verdocs-text-input .input-container{position:relative}verdocs-text-input .clear{top:7px;right:5px;width:18px;height:18px;fill:#cccccc;position:absolute}verdocs-text-input .clear:hover{fill:#720101;cursor:pointer}";
5
+ const verdocsTextInputCss = "verdocs-text-input{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-text-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 12px;outline:none}verdocs-text-input .input-element:disabled{border:1px solid #aeb4bf;background:#f5f5fa}verdocs-text-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:focus{outline:1px solid #7d88ff}verdocs-text-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}verdocs-text-input .required{color:red;margin-left:2px;display:inline-block}verdocs-text-input [data-lastpass-icon-root]{display:none !important}verdocs-text-input .input-container{position:relative}verdocs-text-input .clear{top:7px;right:5px;width:18px;height:18px;fill:#cccccc;position:absolute}verdocs-text-input .clear:hover{fill:#720101;cursor:pointer}verdocs-text-input .copy{top:7px;right:5px;width:18px;height:18px;fill:#cccccc;position:absolute}verdocs-text-input .copy:hover{fill:#654dcb;cursor:pointer}verdocs-text-input.clearable .input-element,verdocs-text-input.copyable .input-element{padding-right:32px}";
5
6
 
6
7
  const ClearIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.881 122.88"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M61.44,0c33.933,0,61.441,27.507,61.441,61.439 c0,33.933-27.508,61.44-61.441,61.44C27.508,122.88,0,95.372,0,61.439C0,27.507,27.508,0,61.44,0L61.44,0z M81.719,36.226 c1.363-1.363,3.572-1.363,4.936,0c1.363,1.363,1.363,3.573,0,4.936L66.375,61.439l20.279,20.278c1.363,1.363,1.363,3.573,0,4.937 c-1.363,1.362-3.572,1.362-4.936,0L61.44,66.376L41.162,86.654c-1.362,1.362-3.573,1.362-4.936,0c-1.363-1.363-1.363-3.573,0-4.937 l20.278-20.278L36.226,41.162c-1.363-1.363-1.363-3.573,0-4.936c1.363-1.363,3.573-1.363,4.936,0L61.44,56.504L81.719,36.226 L81.719,36.226z"/></g></svg>`;
8
+ const CopyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M15.988 3.012A2.25 2.25 0 0118 5.25v6.5A2.25 2.25 0 0115.75 14H13.5V7A2.5 2.5 0 0011 4.5H8.128a2.252 2.252 0 011.884-1.488A2.25 2.25 0 0112.25 1h1.5a2.25 2.25 0 012.238 2.012zM11.5 3.25a.75.75 0 01.75-.75h1.5a.75.75 0 01.75.75v.25h-3v-.25z" clip-rule="evenodd" /><path fill-rule="evenodd" d="M2 7a1 1 0 011-1h8a1 1 0 011 1v10a1 1 0 01-1 1H3a1 1 0 01-1-1V7zm2 3.25a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5h-4.5a.75.75 0 01-.75-.75zm0 3.5a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5h-4.5a.75.75 0 01-.75-.75z" clip-rule="evenodd" /></svg>`;
7
9
  const VerdocsTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
10
  constructor() {
9
11
  super();
@@ -14,12 +16,20 @@ const VerdocsTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
14
16
  this.autocomplete = '';
15
17
  this.helpText = '';
16
18
  this.clearable = false;
19
+ this.copyable = false;
17
20
  this.type = 'text';
18
21
  this.disabled = false;
19
22
  this.required = false;
20
23
  }
24
+ copyToClipboard() {
25
+ this.inputEl.select();
26
+ navigator.clipboard
27
+ .writeText(this.value)
28
+ .then(() => VerdocsToast('Copied!'))
29
+ .catch(e => console.log('Error copying to clipboard', e));
30
+ }
21
31
  render() {
22
- return (h(Host, { class: "input-field" }, h("label", null, this.label && (h("div", { class: "input-label" }, this.label + ':', this.required && h("span", { class: "required" }, "*"))), h("div", { class: "input-container" }, h("input", { type: this.type, value: this.value, required: this.required, class: "input-element", "data-lpignore": "true", disabled: this.disabled, placeholder: this.placeholder, autoComplete: this.autocomplete, ref: el => (this.inputEl = el), onInput: (e) => (this.value = e.target.value) }), this.clearable && this.value && (h("span", { innerHTML: ClearIcon, class: "clear", onClick: () => {
32
+ return (h(Host, { class: `input-field ${this.clearable ? 'clearable' : ''} ${this.copyable ? 'copyable' : ''}` }, h("label", null, this.label && (h("div", { class: "input-label" }, this.label + ':', this.required && h("span", { class: "required" }, "*"))), h("div", { class: "input-container" }, h("input", { type: this.type, value: this.value, required: this.required, class: "input-element", "data-lpignore": "true", disabled: this.disabled, placeholder: this.placeholder, autoComplete: this.autocomplete, ref: el => (this.inputEl = el), onInput: (e) => (this.value = e.target.value) }), this.clearable && this.value && (h("span", { innerHTML: ClearIcon, class: "clear", onClick: () => {
23
33
  // We need to allow the onInput event to fire first in case
24
34
  // the user was focused on this field before clicking clear.
25
35
  setTimeout(() => {
@@ -33,7 +43,7 @@ const VerdocsTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
33
43
  (_b = this.inputEl) === null || _b === void 0 ? void 0 : _b.blur();
34
44
  }, 50);
35
45
  }, 50);
36
- } }))), this.helpText && h("verdocs-help-icon", { text: this.helpText }))));
46
+ } })), !this.clearable && this.copyable && this.value && h("span", { innerHTML: CopyIcon, class: "copy", onClick: () => this.copyToClipboard() })), this.helpText && h("verdocs-help-icon", { text: this.helpText }))));
37
47
  }
38
48
  get hostEl() { return this; }
39
49
  static get style() { return verdocsTextInputCss; }
@@ -44,6 +54,7 @@ const VerdocsTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
44
54
  "autocomplete": [1],
45
55
  "helpText": [1, "help-text"],
46
56
  "clearable": [4],
57
+ "copyable": [4],
47
58
  "type": [1],
48
59
  "disabled": [4],
49
60
  "required": [4]
@@ -58,7 +58,13 @@ const VerdocsView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
58
58
  console.log('[VIEW] Loading envelope...');
59
59
  try {
60
60
  this.envelope = await throttledGetEnvelope(this.endpoint, this.envelopeId);
61
+ console.log('[VIEW] Loaded envelope', this.envelope);
61
62
  this.roleNames = this.envelope.recipients.map(r => r.role_name);
63
+ setTimeout(async () => {
64
+ console.log('[VIEW] Reloading envelope...');
65
+ this.envelope = await throttledGetEnvelope(this.endpoint, this.envelopeId);
66
+ console.log('[VIEW] Reloaded envelope', this.envelope);
67
+ }, 2000);
62
68
  }
63
69
  catch (e) {
64
70
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
@@ -142,11 +148,12 @@ const VerdocsView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
142
148
  }
143
149
  // Add download options to the menu
144
150
  const hasAttachments = this.envelope.documents.length > 0;
145
- const hasCertificate = !!this.envelope.certificate;
151
+ const normalDocCount = this.envelope.documents.filter(doc => doc.type === 'attachment').length;
152
+ const hasCertificate = this.envelope.documents.find(doc => doc.type === 'certificate') !== undefined;
146
153
  if (hasAttachments || hasCertificate) {
147
154
  menuOptions.push({ label: '' });
148
155
  if (hasAttachments) {
149
- menuOptions.push({ id: 'download-attachments', label: 'Download Documents(s)' });
156
+ menuOptions.push({ id: 'download-attachments', label: normalDocCount > 1 ? 'Download Documents' : 'Download Document' });
150
157
  }
151
158
  if (hasCertificate) {
152
159
  menuOptions.push({ id: 'download-certificate', label: 'Download Certificate' });
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-09-22T20:15:57",
2
+ "timestamp": "2023-09-26T00:04:40",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.20.0",
@@ -1261,9 +1261,15 @@
1261
1261
  "styles": [],
1262
1262
  "slots": [],
1263
1263
  "parts": [],
1264
- "dependents": [],
1264
+ "dependents": [
1265
+ "verdocs-settings-api-keys"
1266
+ ],
1265
1267
  "dependencies": [],
1266
- "dependencyGraph": {}
1268
+ "dependencyGraph": {
1269
+ "verdocs-settings-api-keys": [
1270
+ "verdocs-dialog"
1271
+ ]
1272
+ }
1267
1273
  },
1268
1274
  {
1269
1275
  "filePath": "./src/components/controls/verdocs-dropdown/verdocs-dropdown.tsx",
@@ -6655,6 +6661,7 @@
6655
6661
  "parts": [],
6656
6662
  "dependents": [
6657
6663
  "verdocs-auth",
6664
+ "verdocs-settings-api-keys",
6658
6665
  "verdocs-settings-organization",
6659
6666
  "verdocs-template-field-properties",
6660
6667
  "verdocs-template-fields",
@@ -6665,6 +6672,9 @@
6665
6672
  "verdocs-auth": [
6666
6673
  "verdocs-select-input"
6667
6674
  ],
6675
+ "verdocs-settings-api-keys": [
6676
+ "verdocs-select-input"
6677
+ ],
6668
6678
  "verdocs-settings-organization": [
6669
6679
  "verdocs-select-input"
6670
6680
  ],
@@ -6867,7 +6877,10 @@
6867
6877
  ],
6868
6878
  "verdocs-settings-api-keys": [
6869
6879
  "verdocs-table",
6870
- "verdocs-button"
6880
+ "verdocs-button",
6881
+ "verdocs-dialog",
6882
+ "verdocs-text-input",
6883
+ "verdocs-select-input"
6871
6884
  ]
6872
6885
  }
6873
6886
  },
@@ -6944,12 +6957,21 @@
6944
6957
  ],
6945
6958
  "dependencies": [
6946
6959
  "verdocs-table",
6947
- "verdocs-button"
6960
+ "verdocs-button",
6961
+ "verdocs-dialog",
6962
+ "verdocs-text-input",
6963
+ "verdocs-select-input"
6948
6964
  ],
6949
6965
  "dependencyGraph": {
6950
6966
  "verdocs-settings-api-keys": [
6951
6967
  "verdocs-table",
6952
- "verdocs-button"
6968
+ "verdocs-button",
6969
+ "verdocs-dialog",
6970
+ "verdocs-text-input",
6971
+ "verdocs-select-input"
6972
+ ],
6973
+ "verdocs-text-input": [
6974
+ "verdocs-help-icon"
6953
6975
  ],
6954
6976
  "verdocs-settings": [
6955
6977
  "verdocs-settings-api-keys"
@@ -9496,6 +9518,23 @@
9496
9518
  "optional": false,
9497
9519
  "required": false
9498
9520
  },
9521
+ {
9522
+ "name": "copyable",
9523
+ "type": "boolean",
9524
+ "mutable": false,
9525
+ "attr": "copyable",
9526
+ "reflectToAttr": false,
9527
+ "docs": "If set, a copy-to-clipboard button will be displayed. NOTE: A field may not be\nboth clearable and copyable. If both properties are set to true, copyable will\nbe ignored.",
9528
+ "docsTags": [],
9529
+ "default": "false",
9530
+ "values": [
9531
+ {
9532
+ "type": "boolean"
9533
+ }
9534
+ ],
9535
+ "optional": false,
9536
+ "required": false
9537
+ },
9499
9538
  {
9500
9539
  "name": "disabled",
9501
9540
  "type": "boolean",
@@ -9651,6 +9690,7 @@
9651
9690
  "verdocs-auth",
9652
9691
  "verdocs-envelopes-list",
9653
9692
  "verdocs-initial-dialog",
9693
+ "verdocs-settings-api-keys",
9654
9694
  "verdocs-settings-organization",
9655
9695
  "verdocs-settings-profile",
9656
9696
  "verdocs-signature-dialog",
@@ -9676,6 +9716,9 @@
9676
9716
  "verdocs-initial-dialog": [
9677
9717
  "verdocs-text-input"
9678
9718
  ],
9719
+ "verdocs-settings-api-keys": [
9720
+ "verdocs-text-input"
9721
+ ],
9679
9722
  "verdocs-settings-organization": [
9680
9723
  "verdocs-text-input"
9681
9724
  ],