@verdocs/web-sdk 4.2.1 → 4.2.11

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-activity-box.cjs.entry.js +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +30 -57
  4. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +12 -10
  5. package/dist/cjs/verdocs-preview_10.cjs.entry.js +10 -5
  6. package/dist/cjs/verdocs-sign.cjs.entry.js +3 -9
  7. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
  9. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  10. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +33 -65
  11. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -10
  12. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +4 -4
  13. package/dist/collection/components/envelopes/verdocs-activity-box/verdocs-activity-box.js +4 -4
  14. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +13 -11
  15. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +4 -9
  16. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
  17. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +9 -4
  18. package/dist/collection/utils/utils.js +1 -1
  19. package/dist/components/verdocs-activity-box.js +1 -1
  20. package/dist/components/verdocs-auth.js +37 -75
  21. package/dist/components/verdocs-envelopes-list.js +13 -11
  22. package/dist/components/verdocs-sign.js +3 -10
  23. package/dist/components/verdocs-status-indicator2.js +2 -2
  24. package/dist/components/verdocs-template-create2.js +2 -2
  25. package/dist/components/verdocs-template-roles2.js +9 -4
  26. package/dist/components/verdocs-view2.js +4 -4
  27. package/dist/esm/loader.js +1 -1
  28. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  29. package/dist/esm/verdocs-auth.entry.js +30 -57
  30. package/dist/esm/verdocs-envelopes-list.entry.js +13 -11
  31. package/dist/esm/verdocs-preview_10.entry.js +11 -6
  32. package/dist/esm/verdocs-sign.entry.js +3 -9
  33. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  34. package/dist/esm/verdocs-view.entry.js +4 -4
  35. package/dist/esm/verdocs-web-sdk.js +1 -1
  36. package/dist/esm-es5/loader.js +1 -1
  37. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  38. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  39. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  40. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  41. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  42. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  43. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  44. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  45. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +4 -8
  46. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +0 -1
  47. package/dist/types/components/envelopes/verdocs-activity-box/verdocs-activity-box.d.ts +3 -3
  48. package/dist/types/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.d.ts +2 -2
  49. package/dist/types/components.d.ts +6 -6
  50. package/dist/types/utils/utils.d.ts +2 -2
  51. package/dist/verdocs-web-sdk/p-18363901.entry.js +1 -0
  52. package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
  53. package/dist/verdocs-web-sdk/p-4f90b641.entry.js +1 -0
  54. package/dist/verdocs-web-sdk/p-51544250.system.entry.js +1 -0
  55. package/dist/verdocs-web-sdk/p-8d0807ab.system.entry.js +1 -0
  56. package/dist/verdocs-web-sdk/p-a2a0c7b4.system.entry.js +1 -0
  57. package/dist/verdocs-web-sdk/p-a7dac539.entry.js +1 -0
  58. package/dist/verdocs-web-sdk/{p-27ab21de.system.entry.js → p-b96e571d.system.entry.js} +1 -1
  59. package/dist/verdocs-web-sdk/{p-a11d459d.system.entry.js → p-cef88396.system.entry.js} +1 -1
  60. package/dist/verdocs-web-sdk/{p-3dcdaf36.entry.js → p-cf1ae7bf.entry.js} +1 -1
  61. package/dist/verdocs-web-sdk/p-d6f6f255.entry.js +1 -0
  62. package/dist/verdocs-web-sdk/p-ee08c75b.system.entry.js +1 -0
  63. package/dist/verdocs-web-sdk/p-f0299a13.system.entry.js +1 -0
  64. package/dist/verdocs-web-sdk/p-fd2c9b30.entry.js +1 -0
  65. package/dist/verdocs-web-sdk/p-feddcfe3.entry.js +1 -0
  66. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  67. package/package.json +2 -2
  68. package/dist/custom-elements.json +0 -2086
  69. package/dist/verdocs-web-sdk/p-16beca12.entry.js +0 -1
  70. package/dist/verdocs-web-sdk/p-203d8ff0.entry.js +0 -1
  71. package/dist/verdocs-web-sdk/p-413ab8a1.system.entry.js +0 -1
  72. package/dist/verdocs-web-sdk/p-61257cb2.entry.js +0 -1
  73. package/dist/verdocs-web-sdk/p-687c07ad.entry.js +0 -1
  74. package/dist/verdocs-web-sdk/p-9bef9a21.system.entry.js +0 -1
  75. package/dist/verdocs-web-sdk/p-aedcd301.entry.js +0 -1
  76. package/dist/verdocs-web-sdk/p-b6b6f12a.system.entry.js +0 -1
  77. package/dist/verdocs-web-sdk/p-dc5ebc7c.entry.js +0 -1
  78. package/dist/verdocs-web-sdk/p-eb0c78af.system.entry.js +0 -1
  79. package/dist/verdocs-web-sdk/p-f1d41587.system.entry.js +0 -1
@@ -3,46 +3,6 @@ import { h } from "@stencil/core";
3
3
  import { VerdocsToast } from "../../../utils/Toast";
4
4
  import { SDKError } from "../../../utils/errors";
5
5
  const RECHECK_INTERVAL = 5000;
6
- const Industries = [
7
- { value: '', label: '' },
8
- { value: 'Accounting & Tax', label: 'Accounting & Tax' },
9
- { value: 'Business Services / Consulting', label: 'Business Services / Consulting' },
10
- { value: 'Construction', label: 'Construction' },
11
- { value: 'Education', label: 'Education' },
12
- { value: 'Financial Services', label: 'Financial Services' },
13
- { value: 'Government', label: 'Government' },
14
- { value: 'Healthcare - Health Plans & Payers', label: 'Healthcare - Health Plans & Payers' },
15
- { value: 'Healthcare - Providers', label: 'Healthcare - Providers' },
16
- { value: 'Insurance', label: 'Insurance' },
17
- { value: 'Legal', label: 'Legal' },
18
- { value: 'Life Sciences', label: 'Life Sciences' },
19
- { value: 'Manufacturing', label: 'Manufacturing' },
20
- { value: 'Mortgage', label: 'Mortgage' },
21
- { value: 'Not For Profit', label: 'Not For Profit' },
22
- { value: 'Real Estate - Commercial', label: 'Real Estate - Commercial' },
23
- { value: 'Real Estate - Residential', label: 'Real Estate - Residential' },
24
- { value: 'Retail', label: 'Retail' },
25
- { value: 'Technology', label: 'Technology' },
26
- { value: 'Other', label: 'Other' },
27
- ];
28
- const Reasons = [
29
- { value: '', label: '' },
30
- { value: 'I want to send a document for signature.', label: 'I want to send a document for signature.' },
31
- { value: 'I just need to sign a document today.', label: 'I just need to sign a document today.' },
32
- { value: "I'm evaluating it for my business.", label: "I'm evaluating it for my business." },
33
- { value: "I'm evaluating it for my personal use.", label: "I'm evaluating it for my personal use." },
34
- { value: "I'm a developer building an integration.", label: "I'm a developer building an integration." },
35
- ];
36
- const CompanySizes = [
37
- { value: '', label: '' },
38
- { value: 'Solo', label: 'Solo' },
39
- { value: '2-10', label: '2-10' },
40
- { value: '11-50', label: '11-50' },
41
- { value: '51-200', label: '51-200' },
42
- { value: '201-500', label: '201-500' },
43
- { value: '501-1000', label: '501-1000' },
44
- { value: '1000+', label: '1000+' },
45
- ];
46
6
  /**
47
7
  * Display an authentication dialog that allows the user to login or sign up. If the user is already authenticated
48
8
  * with a valid session, this component will hide itself and fire the success callback immediately. It is up to the
@@ -68,19 +28,14 @@ export class VerdocsAuth {
68
28
  this.logo = 'https://app.verdocs.com/assets/blue-logo.svg';
69
29
  this.isAuthenticated = false;
70
30
  this.displayMode = 'login';
71
- this.orgname = '';
72
- this.first = '';
73
- this.last = '';
31
+ this.org_name = '';
32
+ this.first_name = '';
33
+ this.last_name = '';
74
34
  this.username = '';
75
- this.phone = '';
76
35
  this.password = '';
77
36
  this.submitting = false;
78
37
  this.activeSession = null;
79
38
  this.accountType = 'org';
80
- this.howHear = '';
81
- this.industry = '';
82
- this.companySize = '';
83
- this.reason = '';
84
39
  this.signupStep = 1;
85
40
  this.resendDisabled = false;
86
41
  this.checkingOrg = false;
@@ -122,20 +77,38 @@ export class VerdocsAuth {
122
77
  this.resendDisabledTimer = null;
123
78
  }
124
79
  }
80
+ isPasswordComplex(password) {
81
+ const isUppercase = (ch) => /[A-Z]/.test(ch);
82
+ const isLowercase = (ch) => /[a-z]/.test(ch);
83
+ const isSpecialChar = (ch) => /[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(ch);
84
+ let countOfUpperCase = 0, countOfLowerCase = 0, countOfSpecialChar = 0;
85
+ for (let i = 0; i < password.length; i++) {
86
+ let ch = password.charAt(i);
87
+ if (isUppercase(ch))
88
+ countOfUpperCase++;
89
+ else if (isLowercase(ch))
90
+ countOfLowerCase++;
91
+ else if (isSpecialChar(ch))
92
+ countOfSpecialChar++;
93
+ }
94
+ return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;
95
+ }
125
96
  handleSignup() {
126
97
  this.submitting = true;
127
98
  this.accessTokenForVerification = null;
99
+ if (!this.isPasswordComplex(this.password)) {
100
+ window.alert('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.');
101
+ return;
102
+ }
128
103
  createProfile(this.endpoint, {
129
104
  email: this.username,
130
105
  password: this.password,
131
- firstName: this.first,
132
- lastName: this.last,
133
- orgName: this.orgname,
106
+ first_name: this.first_name,
107
+ last_name: this.last_name,
108
+ org_name: this.org_name,
134
109
  })
135
110
  .then(r => {
136
- console.log('Result', r);
137
- console.log('[AUTH] Created profile', r.profile);
138
- console.log('[AUTH] Created organization', r.organization);
111
+ console.log('Profile creation result', r);
139
112
  this.loginAndCheckVerification();
140
113
  })
141
114
  .catch(e => {
@@ -171,7 +144,7 @@ export class VerdocsAuth {
171
144
  console.log('[AUTH] Logged in, pending email address verification');
172
145
  this.displayMode = 'verify';
173
146
  this.accessTokenForVerification = r.access_token;
174
- this.recheckTimer = setTimeout(() => this.loginAndCheckVerification(), RECHECK_INTERVAL);
147
+ this.recheckTimer = setTimeout(this.loginAndCheckVerification, RECHECK_INTERVAL);
175
148
  }
176
149
  })
177
150
  .catch(e => {
@@ -232,8 +205,8 @@ export class VerdocsAuth {
232
205
  return (h("verdocs-button", { label: "Sign Out", disabled: this.submitting, onClick: () => this.handleLogout(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }));
233
206
  }
234
207
  if (this.displayMode === 'signup') {
235
- const step1Invalid = this.submitting || !this.first || !this.last || !this.username || !this.password || !this.orgname;
236
- return (h("div", { class: "form" }, h("a", { href: "https://verdocs.com/en/" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), h("h3", null, "Sign up for a trial account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.signupStep === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first, onInput: (e) => (this.first = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last, onInput: (e) => (this.last = e.target.value), disabled: this.submitting })), h("verdocs-text-input", { label: "Email", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Phone #", autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.orgname, onInput: (e) => (this.orgname = e.target.value), disabled: this.submitting, style: { flex: '1' } }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Invalid, onClick: () => (this.signupStep = 2), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 2 && (h("form", { onSubmit: () => this.handleSignup() }, h("verdocs-text-input", { label: "How did you hear about Verdocs?", value: this.howHear, onInput: (e) => (this.howHear = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Your Industry", options: Industries, value: this.industry, onInput: (e) => (this.industry = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Company Size", options: CompanySizes, value: this.companySize, onInput: (e) => (this.companySize = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Purpose", options: Reasons, value: this.reason, onInput: (e) => (this.reason = e.target.value), disabled: this.submitting }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Create Account", disabled: this.submitting, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.submitting, onClick: () => {
208
+ const step1Invalid = this.submitting || !this.first_name || !this.last_name || !this.username || !this.password || !this.org_name;
209
+ return (h("div", { class: "form" }, h("a", { href: "https://verdocs.com/en/" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), h("h3", null, "Sign up for a free account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.signupStep === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first_name, onInput: (e) => (this.first_name = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last_name, onInput: (e) => (this.last_name = e.target.value), disabled: this.submitting })), h("verdocs-text-input", { label: "Email Address", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.org_name, onInput: (e) => (this.org_name = e.target.value), disabled: this.submitting, style: { flex: '1' } }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Invalid, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.submitting, onClick: () => {
237
210
  this.signupStep = 2;
238
211
  }, style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }), h("verdocs-button", { label: "Go to Dashboard", disabled: true, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))))));
239
212
  }
@@ -330,19 +303,14 @@ export class VerdocsAuth {
330
303
  return {
331
304
  "isAuthenticated": {},
332
305
  "displayMode": {},
333
- "orgname": {},
334
- "first": {},
335
- "last": {},
306
+ "org_name": {},
307
+ "first_name": {},
308
+ "last_name": {},
336
309
  "username": {},
337
- "phone": {},
338
310
  "password": {},
339
311
  "submitting": {},
340
312
  "activeSession": {},
341
313
  "accountType": {},
342
- "howHear": {},
343
- "industry": {},
344
- "companySize": {},
345
- "reason": {},
346
314
  "signupStep": {},
347
315
  "resendDisabled": {},
348
316
  "checkingOrg": {}
@@ -47,7 +47,6 @@ export class VerdocsSign {
47
47
  this.roleNames = [];
48
48
  this.sortedRecipients = [];
49
49
  this.recipient = null;
50
- this.signerToken = null;
51
50
  this.hasSignature = false;
52
51
  this.nextButtonLabel = 'Start';
53
52
  this.nextSubmits = false;
@@ -81,16 +80,11 @@ export class VerdocsSign {
81
80
  }
82
81
  try {
83
82
  console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);
84
- const { session, recipient, signerToken } = await getSigningSession(this.endpoint, {
85
- envelopeId: this.envelopeId,
86
- roleId: this.roleId,
87
- inviteCode: this.inviteCode,
88
- });
89
- console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);
83
+ const { envelope, recipient, access_token } = await getSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);
84
+ console.log(`[SIGN] Loaded signing session`, envelope, recipient, access_token);
90
85
  this.recipient = recipient;
91
86
  console.log('[SIGN] We are recipient', this.recipient);
92
- this.signerToken = signerToken;
93
- this.endpoint.setToken(signerToken);
87
+ this.endpoint.setToken(access_token);
94
88
  if (this.agreed) {
95
89
  this.nextButtonLabel = 'Next';
96
90
  }
@@ -630,7 +624,6 @@ export class VerdocsSign {
630
624
  "roleNames": {},
631
625
  "sortedRecipients": {},
632
626
  "recipient": {},
633
- "signerToken": {},
634
627
  "hasSignature": {},
635
628
  "nextButtonLabel": {},
636
629
  "nextSubmits": {},
@@ -1,4 +1,4 @@
1
- import { cancelEnvelope, getDocumentDownloadLink, integerSequence, throttledGetEnvelope, userCanCancelEnvelope, VerdocsEndpoint } from "@verdocs/js-sdk";
1
+ import { cancelEnvelope, getDocumentDownloadLink, getEnvelope, integerSequence, userCanCancelEnvelope, VerdocsEndpoint } from "@verdocs/js-sdk";
2
2
  import { h, Host, Fragment } from "@stencil/core";
3
3
  import { saveEnvelopesAsZip } from "../../../utils/utils";
4
4
  import { SDKError } from "../../../utils/errors";
@@ -41,12 +41,12 @@ export class VerdocsView {
41
41
  var _a, _b, _c;
42
42
  console.log('[VIEW] Loading envelope...');
43
43
  try {
44
- this.envelope = await throttledGetEnvelope(this.endpoint, this.envelopeId);
44
+ this.envelope = await getEnvelope(this.endpoint, this.envelopeId);
45
45
  console.log('[VIEW] Loaded envelope', this.envelope);
46
46
  this.roleNames = this.envelope.recipients.map(r => r.role_name);
47
47
  setTimeout(async () => {
48
48
  console.log('[VIEW] Reloading envelope...');
49
- this.envelope = await throttledGetEnvelope(this.endpoint, this.envelopeId);
49
+ this.envelope = await getEnvelope(this.endpoint, this.envelopeId);
50
50
  console.log('[VIEW] Reloaded envelope', this.envelope);
51
51
  }, 2000);
52
52
  }
@@ -69,7 +69,7 @@ export class VerdocsView {
69
69
  .then(r => {
70
70
  this.canceling = false;
71
71
  console.log('[VIEW] Envelope canceled', r);
72
- return throttledGetEnvelope(this.endpoint, this.envelopeId);
72
+ return getEnvelope(this.endpoint, this.envelopeId);
73
73
  })
74
74
  .then(env => {
75
75
  console.log('[VIEW] Loaded new envelope details', env);
@@ -68,7 +68,7 @@ export class VerdocsActivityBox {
68
68
  return (h(Host, null, this.title && (h("div", { class: "box-title" }, this.title, " ", h("span", { class: "count" }, "(", this.count, ")"), h("div", { class: "spacer" }), h("verdocs-button", { label: "View All", size: "small", onClick: () => { var _a; return (_a = this.viewAll) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, view: this.view }); } }))), this.count > 0 ? (this.entries.slice(0, Math.max(this.items, 1)).map(entry => (h("div", { class: "activity-entry", onClick: () => {
69
69
  var _a;
70
70
  (_a = this.viewEnvelope) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, entry });
71
- } }, h("div", { class: "title" }, entry.name, h("br", null), " ", h("strong", null, entry.recipient.name)), h("div", { class: "time-ago" }, formatShortTimeAgo(entry.updated_at)))))) : (h("img", { src: EmptyImage, alt: "No documents to show", style: { width: '190px', margin: '0 auto' } }))));
71
+ } }, h("div", { class: "title" }, entry.name), h("div", { class: "time-ago" }, formatShortTimeAgo(entry.updated_at)))))) : (h("img", { src: EmptyImage, alt: "No documents to show", style: { width: '190px', margin: '0 auto' } }))));
72
72
  }
73
73
  static get is() { return "verdocs-activity-box"; }
74
74
  static get originalStyleUrls() {
@@ -202,15 +202,15 @@ export class VerdocsActivityBox {
202
202
  "text": "Event fired when the user clicks an activity entry. Typically the host application will use this to navigate\nto the envelope detail view."
203
203
  },
204
204
  "complexType": {
205
- "original": "{endpoint: VerdocsEndpoint; entry: IActivityEntry}",
206
- "resolved": "{ endpoint: VerdocsEndpoint; entry: IActivityEntry; }",
205
+ "original": "{endpoint: VerdocsEndpoint; entry: IEnvelope}",
206
+ "resolved": "{ endpoint: VerdocsEndpoint; entry: IEnvelope; }",
207
207
  "references": {
208
208
  "VerdocsEndpoint": {
209
209
  "location": "import",
210
210
  "path": "@verdocs/js-sdk",
211
211
  "id": ""
212
212
  },
213
- "IActivityEntry": {
213
+ "IEnvelope": {
214
214
  "location": "import",
215
215
  "path": "@verdocs/js-sdk",
216
216
  "id": ""
@@ -1,6 +1,6 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { userCanCancelEnvelope, userCanAct, cancelEnvelope, integerSequence } from "@verdocs/js-sdk";
3
- import { VerdocsEndpoint, listEnvelopes, getRecipientsWithActions } from "@verdocs/js-sdk";
3
+ import { VerdocsEndpoint, getEnvelopes, getRecipientsWithActions } from "@verdocs/js-sdk";
4
4
  import { saveEnvelopesAsZip } from "../../../utils/utils";
5
5
  import { VerdocsToast } from "../../../utils/Toast";
6
6
  import { SDKError } from "../../../utils/errors";
@@ -105,7 +105,8 @@ export class VerdocsEnvelopesList {
105
105
  case 'sent':
106
106
  queryParams = {
107
107
  ...queryParams,
108
- is_owner: true,
108
+ // FIXME
109
+ // is_owner: true,
109
110
  // sort: 'updated_at',
110
111
  };
111
112
  break;
@@ -121,7 +122,8 @@ export class VerdocsEnvelopesList {
121
122
  case 'waiting':
122
123
  queryParams = {
123
124
  ...queryParams,
124
- is_owner: true,
125
+ // FIXME
126
+ // is_owner: true,
125
127
  // sort: 'updated_at',
126
128
  // direction: 'desc',
127
129
  status: ['pending', 'in progress'],
@@ -161,9 +163,9 @@ export class VerdocsEnvelopesList {
161
163
  // if (this.containing.trim()) {
162
164
  // queryParams.field_value = this.containing.trim();
163
165
  // }
164
- const response = await listEnvelopes(this.endpoint, queryParams);
166
+ const response = await getEnvelopes(this.endpoint, queryParams);
165
167
  this.envelopes = response.envelopes;
166
- this.count = response.total;
168
+ this.count = response.count;
167
169
  this.loading = false;
168
170
  }
169
171
  catch (e) {
@@ -189,18 +191,18 @@ export class VerdocsEnvelopesList {
189
191
  });
190
192
  }
191
193
  render() {
192
- return (h(Host, { key: 'fa39f66d3d2c557bf70bdf51b8232920da5f17c3' }, h("div", { key: '88681a60242e65fc5f60546dcedc0b90bb2866ab', class: "header" }, h("div", { key: '7e881cff0962a3867776aefb92b8045571fd3537', class: "filter" }, h("verdocs-text-input", { key: 'a8387f075c6c6f107d46c2879bd2bd557af97838', id: "verdocs-filter-name", value: this.match, clearable: true, autocomplete: "off", placeholder: "Filter by Name, Recipient, or Field...", onFocusout: (e) => {
194
+ return (h(Host, { key: 'd4376bc5804b00acaf916e9c8b2a7ada6136d815' }, h("div", { key: 'cc459ff3e86b3ff69f44c0183760cffdcc66ce05', class: "header" }, h("div", { key: '0fe7ea1fd4c72069c7769125c1d85f97ccca4c68', class: "filter" }, h("verdocs-text-input", { key: 'acf0938c03d4cd334c1aa55e7175e1ee32b7b839', id: "verdocs-filter-name", value: this.match, clearable: true, autocomplete: "off", placeholder: "Filter by Name, Recipient, or Field...", onFocusout: (e) => {
193
195
  var _a;
194
196
  // We don't locally filter envelopes because there are too many fields to match against efficiently.
195
197
  this.match = e.target.value.trim();
196
198
  (_a = this.changeMatch) === null || _a === void 0 ? void 0 : _a.emit(this.match);
197
- } })), h("verdocs-quick-filter", { key: '70f3794df71c00ab7cd76558ae2661caddd54b53', label: "View", value: this.view, options: ViewFilters, onOptionSelected: e => {
199
+ } })), h("verdocs-quick-filter", { key: '3eb1c2303641b9d40d062be7f3cd284d85a964f8', label: "View", value: this.view, options: ViewFilters, onOptionSelected: e => {
198
200
  this.view = e.detail.value;
199
- } }), this.view === 'all' && (h("verdocs-quick-filter", { key: '02145f9b41a95655c7456520352ab7395c02a518', label: "Status", value: this.status, options: StatusFilters, onOptionSelected: e => {
201
+ } }), this.view === 'all' && (h("verdocs-quick-filter", { key: 'eb998a048a18e45f0dc7285ccaebde3e68144197', label: "Status", value: this.status, options: StatusFilters, onOptionSelected: e => {
200
202
  this.status = e.detail.value;
201
- } })), this.view === 'all' && (h("verdocs-quick-filter", { key: '271a35272e0ea4e5c079e30a4f61fafca207097f', label: "Sort By", value: this.sort, options: SortFilters, onOptionSelected: e => {
203
+ } })), this.view === 'all' && (h("verdocs-quick-filter", { key: 'cd05ac9a66127ccd23bbadb16e5bfa154b2e97c2', label: "Sort By", value: this.sort, options: SortFilters, onOptionSelected: e => {
202
204
  this.sort = e.detail.value;
203
- } })), this.loading && h("verdocs-spinner", { key: '4a885f1f7c7513a3941847313a4e41616b3c841c', mode: "dark", size: 24 }), h("div", { key: '055587fbd6bc0e9aa9c38dc5c067d5d0bd6923a4', style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { key: 'feb763f42c31aebfcd2b74761431212206691b28', label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
205
+ } })), this.loading && h("verdocs-spinner", { key: '7531bf499f830af651c3b9507ca9bd9dbcbec236', mode: "dark", size: 24 }), h("div", { key: '43abd416e136338f3c6189e086a461e0f9ba160b', style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { key: 'c54021bbf6ea0bddf03b51f31444c693e25f6a1a', label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
204
206
  var _a;
205
207
  const recipientsWithActions = getRecipientsWithActions(envelope);
206
208
  const userCanCancel = userCanCancelEnvelope(this.endpoint.profile, envelope);
@@ -241,7 +243,7 @@ export class VerdocsEnvelopesList {
241
243
  break;
242
244
  }
243
245
  } }))));
244
- }), !this.initiallyLoaded && (h("div", { key: '19835ba9dbe9c56ef8c45c08f38c537a7c70bebd', style: { width: '100%' } }, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "envelope-placeholder" }))))), this.initiallyLoaded && !this.envelopes.length && h("div", { key: '5844f2a1576d7c574865c01b3e7af99eb82b4303', class: "empty-text" }, "No matching envelopes found. Please adjust your filters and try again."), this.initiallyLoaded && this.envelopes.length && this.showPagination ? (h("div", { style: { marginTop: '20px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: this.rowsPerPage, itemCount: this.count, onSelectPage: e => {
246
+ }), !this.initiallyLoaded && (h("div", { key: '7d72106e9315ef78e1e310da22744126599b8017', style: { width: '100%' } }, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "envelope-placeholder" }))))), this.initiallyLoaded && !this.envelopes.length && h("div", { key: 'b2228f90e7414cace475ab71854a690112b696b3', class: "empty-text" }, "No matching envelopes found. Please adjust your filters and try again."), this.initiallyLoaded && this.envelopes.length && this.showPagination ? (h("div", { style: { marginTop: '20px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: this.rowsPerPage, itemCount: this.count, onSelectPage: e => {
245
247
  this.selectedPage = e.detail.selectedPage;
246
248
  } }))) : (h("div", null))));
247
249
  }
@@ -238,11 +238,11 @@ export class VerdocsStatusIndicator {
238
238
  }
239
239
  const icon = this.getStatusIcon(status);
240
240
  const statusMessage = this.getStatusMessage(status);
241
- return (h(Host, { key: 'cf2d831b91cdbe3ed6e5f169f77ebba96e8116ae', ref: el => (this.summaryComponent = el), class: `${this.theme} ${this.size} ${this.envelope ? 'has-document' : ''}`, "aria-label": "Click to View Details", onClick: e => {
241
+ return (h(Host, { key: 'fcc8a478464db1633c71b87cc0b3ed19026c20c8', ref: el => (this.summaryComponent = el), class: `${this.theme} ${this.size} ${this.envelope ? 'has-document' : ''}`, "aria-label": "Click to View Details", onClick: e => {
242
242
  e.stopPropagation();
243
243
  e.preventDefault();
244
244
  this.envelope && this.toggleDropdown();
245
- }, onBlur: e => this.envelope && this.handleHideDropdown(e) }, h("span", { key: '0e9b3ce331057662375bd08c2942016acf3bf473', class: "icon", innerHTML: icon }), h("span", { key: '697e060a2afb5de22e5ced2d6041d558b0e108a3', class: "content" }, statusMessage), h("div", { key: 'a816a2d991246f1b49a774f1e0aa3f64a691e8d9', class: "detail-panel", ref: el => (this.detailPanel = el) }, h("div", { key: 'b5df9ec7a7ff70ab929789d8d77d8430337f5b94', id: `${this.containerId}` }), this.recipientStatusIcons.map(icon => (h("span", { innerHTML: icon.icon, style: { position: 'absolute', top: `${icon.y}px`, left: `${icon.x}px` } }))))));
245
+ }, onBlur: e => this.envelope && this.handleHideDropdown(e) }, h("span", { key: 'c025fd8df675cbbf5709a4fe5657052514100533', class: "icon", innerHTML: icon }), h("span", { key: '7cdb668dce2dd652f472350fb045acff590a8ed6', class: "content" }, statusMessage), h("div", { key: 'a10adafb40c56cad07bf0944671620c1425c6e84', class: "detail-panel", ref: el => (this.detailPanel = el) }, h("div", { key: 'c05c0f501964b5ee5050d6314e52d539738993fe', id: `${this.containerId}` }), this.recipientStatusIcons.map(icon => (h("span", { innerHTML: icon.icon, style: { position: 'absolute', top: `${icon.y}px`, left: `${icon.x}px` } }))))));
246
246
  }
247
247
  static get is() { return "verdocs-status-indicator"; }
248
248
  static get originalStyleUrls() {
@@ -325,18 +325,13 @@ export class VerdocsStatusIndicator {
325
325
  "type": "unknown",
326
326
  "mutable": false,
327
327
  "complexType": {
328
- "original": "IEnvelope | IEnvelopeSummary",
329
- "resolved": "IEnvelope | IEnvelopeSummary",
328
+ "original": "IEnvelope",
329
+ "resolved": "IEnvelope",
330
330
  "references": {
331
331
  "IEnvelope": {
332
332
  "location": "import",
333
333
  "path": "@verdocs/js-sdk",
334
334
  "id": ""
335
- },
336
- "IEnvelopeSummary": {
337
- "location": "import",
338
- "path": "@verdocs/js-sdk",
339
- "id": ""
340
335
  }
341
336
  }
342
337
  },
@@ -1,4 +1,4 @@
1
- import { createTemplatev2, VerdocsEndpoint } from "@verdocs/js-sdk";
1
+ import { createTemplate, VerdocsEndpoint } from "@verdocs/js-sdk";
2
2
  import { h, Host } from "@stencil/core";
3
3
  import { getTemplateStore } from "../../../utils/TemplateStore";
4
4
  import { SDKError } from "../../../utils/errors";
@@ -46,7 +46,7 @@ export class VerdocsTemplateCreate {
46
46
  this.creating = true;
47
47
  this.progressLabel = 'Uploading...';
48
48
  try {
49
- const template = await createTemplatev2(this.endpoint, { name: this.file.name, documents: [this.file] }, percent => {
49
+ const template = await createTemplate(this.endpoint, { name: this.file.name, documents: [this.file] }, percent => {
50
50
  if (percent >= 99) {
51
51
  this.progressLabel = 'Processing...';
52
52
  this.progressPercent = 100;
@@ -171,10 +171,15 @@ export class VerdocsTemplateRoles {
171
171
  this.getSequenceNumbers().forEach((originalSequence, newSequenceIndex) => {
172
172
  this.getRolesAtSequence(originalSequence).forEach((role, newOrderIndex) => {
173
173
  if (!renumbered.includes(role.name)) {
174
- role.sequence = newSequenceIndex + 1;
175
- role.order = newOrderIndex + 1;
176
- renumbered.push(role.name);
177
- renumberRequests.push(updateTemplateRole(this.endpoint, this.templateId, role.name, { sequence: role.sequence, order: role.order }));
174
+ if (role.sequence !== newSequenceIndex + 1 || role.order !== newOrderIndex + 1) {
175
+ role.sequence = newSequenceIndex + 1;
176
+ role.order = newOrderIndex + 1;
177
+ renumbered.push(role.name);
178
+ renumberRequests.push(updateTemplateRole(this.endpoint, this.templateId, role.name, {
179
+ sequence: role.sequence,
180
+ order: role.order,
181
+ }));
182
+ }
178
183
  }
179
184
  });
180
185
  });
@@ -1,6 +1,6 @@
1
1
  import jszip from "jszip";
2
2
  import { format } from "date-fns";
3
- import { downloadBlob, getEnvelopeFile, getFieldAttachment, rescale, } from "@verdocs/js-sdk";
3
+ import { downloadBlob, getEnvelopeFile, getFieldAttachment, rescale } from "@verdocs/js-sdk";
4
4
  import { FORMAT_DATE } from "./Types";
5
5
  export const defaultWidth = (type) => {
6
6
  // checkbox was a legacy field type
@@ -73,7 +73,7 @@ const VerdocsActivityBox$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsActiv
73
73
  return (h(Host, null, this.title && (h("div", { class: "box-title" }, this.title, " ", h("span", { class: "count" }, "(", this.count, ")"), h("div", { class: "spacer" }), h("verdocs-button", { label: "View All", size: "small", onClick: () => { var _a; return (_a = this.viewAll) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, view: this.view }); } }))), this.count > 0 ? (this.entries.slice(0, Math.max(this.items, 1)).map(entry => (h("div", { class: "activity-entry", onClick: () => {
74
74
  var _a;
75
75
  (_a = this.viewEnvelope) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, entry });
76
- } }, h("div", { class: "title" }, entry.name, h("br", null), " ", h("strong", null, entry.recipient.name)), h("div", { class: "time-ago" }, formatShortTimeAgo(entry.updated_at)))))) : (h("img", { src: EmptyImage, alt: "No documents to show", style: { width: '190px', margin: '0 auto' } }))));
76
+ } }, h("div", { class: "title" }, entry.name), h("div", { class: "time-ago" }, formatShortTimeAgo(entry.updated_at)))))) : (h("img", { src: EmptyImage, alt: "No documents to show", style: { width: '190px', margin: '0 auto' } }))));
77
77
  }
78
78
  static get watchers() { return {
79
79
  "items": ["handleItemsUpdated"],