@verdocs/js-sdk 1.0.8 → 1.0.12
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/.gitignore +4 -0
- package/.idea/.gitignore +8 -0
- package/.idea/inspectionProfiles/Project_Default.xml +12 -0
- package/.idea/js-sdk.iml +11 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc.js +11 -0
- package/LICENSE +21 -0
- package/README.md +8 -5
- package/__mocks__/axios.ts +3 -0
- package/dist/.npmignore +5 -0
- package/{Documents → dist/Documents}/Documents.d.ts +9 -0
- package/{Documents → dist/Documents}/Documents.js +24 -7
- package/{Documents → dist/Documents}/Stars.d.ts +0 -0
- package/{Documents → dist/Documents}/Stars.js +2 -2
- package/{Documents → dist/Documents}/Templates.d.ts +0 -0
- package/{Documents → dist/Documents}/Templates.js +22 -10
- package/{Documents → dist/Documents}/Types.d.ts +0 -0
- package/{Api → dist/Documents}/Types.js +0 -0
- package/{Documents → dist/Documents}/index.d.ts +0 -0
- package/{Documents → dist/Documents}/index.js +0 -0
- package/dist/HTTP/Transport.d.ts +51 -0
- package/dist/HTTP/Transport.js +88 -0
- package/{HTTP → dist/HTTP}/Types.d.ts +0 -0
- package/{Documents → dist/HTTP}/Types.js +0 -0
- package/{HTTP → dist/HTTP}/index.d.ts +0 -0
- package/{HTTP → dist/HTTP}/index.js +0 -0
- package/{Organizations → dist/Organizations}/ApiKeys.d.ts +0 -0
- package/{Organizations → dist/Organizations}/ApiKeys.js +16 -6
- package/{Organizations → dist/Organizations}/Groups.d.ts +0 -0
- package/{Organizations → dist/Organizations}/Groups.js +22 -8
- package/{Organizations → dist/Organizations}/Invitations.d.ts +0 -0
- package/dist/Organizations/Invitations.js +36 -0
- package/{Organizations → dist/Organizations}/Members.d.ts +0 -0
- package/dist/Organizations/Members.js +26 -0
- package/{Organizations → dist/Organizations}/Organizations.d.ts +0 -0
- package/dist/Organizations/Organizations.js +31 -0
- package/{Organizations → dist/Organizations}/Types.d.ts +0 -0
- package/{HTTP → dist/Organizations}/Types.js +0 -0
- package/{Organizations → dist/Organizations}/Webhooks.d.ts +0 -0
- package/dist/Organizations/Webhooks.js +11 -0
- package/{Organizations → dist/Organizations}/index.d.ts +0 -0
- package/{Organizations → dist/Organizations}/index.js +0 -0
- package/dist/README.md +68 -0
- package/{Search → dist/Search}/Content.d.ts +0 -0
- package/{Search → dist/Search}/Content.js +22 -10
- package/{Search → dist/Search}/Types.d.ts +0 -0
- package/{Organizations → dist/Search}/Types.js +0 -0
- package/{Search → dist/Search}/index.d.ts +0 -0
- package/{Search → dist/Search}/index.js +0 -0
- package/{Signatures.d.ts → dist/Signatures.d.ts} +0 -0
- package/dist/Signatures.js +21 -0
- package/{Tags.d.ts → dist/Tags.d.ts} +0 -0
- package/dist/Tags.js +16 -0
- package/{Templates → dist/Templates}/Documents.d.ts +0 -0
- package/{Templates → dist/Templates}/Documents.js +13 -5
- package/{Templates → dist/Templates}/Fields.d.ts +0 -0
- package/dist/Templates/Fields.js +16 -0
- package/{Templates → dist/Templates}/Pages.d.ts +0 -0
- package/dist/Templates/Pages.js +21 -0
- package/{Templates → dist/Templates}/Reminders.d.ts +0 -0
- package/dist/Templates/Reminders.js +21 -0
- package/{Templates → dist/Templates}/Roles.d.ts +0 -0
- package/dist/Templates/Roles.js +36 -0
- package/{Templates → dist/Templates}/Stars.d.ts +0 -0
- package/dist/Templates/Stars.js +11 -0
- package/{Templates → dist/Templates}/Tags.d.ts +0 -0
- package/dist/Templates/Tags.js +16 -0
- package/{Templates → dist/Templates}/Templates.d.ts +0 -0
- package/{Templates → dist/Templates}/Templates.js +33 -11
- package/{Templates → dist/Templates}/Types.d.ts +0 -0
- package/{Templates → dist/Templates}/Types.js +0 -0
- package/{Templates → dist/Templates}/index.d.ts +0 -0
- package/{Templates → dist/Templates}/index.js +0 -0
- package/{Users → dist/Users}/Auth.d.ts +6 -6
- package/{Users → dist/Users}/Auth.js +27 -13
- package/{Users → dist/Users}/Billing.d.ts +0 -0
- package/{Users → dist/Users}/Billing.js +0 -0
- package/{Api → dist/Users}/Notifications.d.ts +0 -0
- package/{Api → dist/Users}/Notifications.js +8 -4
- package/{Users → dist/Users}/Profiles.d.ts +0 -0
- package/{Users → dist/Users}/Profiles.js +41 -11
- package/{Users → dist/Users}/Types.d.ts +13 -0
- package/{Search → dist/Users}/Types.js +0 -0
- package/{Users → dist/Users}/index.d.ts +0 -0
- package/{Users → dist/Users}/index.js +0 -0
- package/{Utils → dist/Utils}/DateTime.d.ts +0 -0
- package/{Utils → dist/Utils}/DateTime.js +0 -0
- package/{Utils → dist/Utils}/index.d.ts +0 -0
- package/{Utils → dist/Utils}/index.js +0 -0
- package/{Validators.d.ts → dist/Validators.d.ts} +0 -0
- package/dist/Validators.js +11 -0
- package/{Whitelabel.d.ts → dist/Whitelabel.d.ts} +0 -0
- package/dist/Whitelabel.js +11 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/dist/package.json +64 -0
- package/docs/.nojekyll +1 -0
- package/docs/README.md +70 -0
- package/docs/enums/Templates.Types.SortOptions.md +76 -0
- package/docs/enums/Templates.Types.Template.md +153 -0
- package/docs/enums/Templates.Types.TemplatePermissions.md +109 -0
- package/docs/enums/Templates.Types.TemplateSenderTypes.md +65 -0
- package/docs/interfaces/Documents.Documents-1.IActivityEntry.md +120 -0
- package/docs/interfaces/Documents.Documents-1.IDocument.md +175 -0
- package/docs/interfaces/Documents.Documents-1.IDocumentSearchOptions.md +98 -0
- package/docs/interfaces/Documents.Documents-1.IDocumentsSearchResult.md +43 -0
- package/docs/interfaces/Documents.Documents-1.IDocumentsSearchResultEntry.md +131 -0
- package/docs/interfaces/Documents.Documents-1.IDocumentsSummary.md +67 -0
- package/docs/interfaces/Documents.Documents-1.IHistory.md +76 -0
- package/docs/interfaces/Documents.Documents-1.IRecipient.md +208 -0
- package/docs/interfaces/Documents.Types.ITemplateSummaryEntry.md +186 -0
- package/docs/interfaces/Documents.Types.ITemplatesSummary.md +43 -0
- package/docs/interfaces/Organizations.Types.IApiKey.md +60 -0
- package/docs/interfaces/Organizations.Types.IApiKeyWithSecret.md +87 -0
- package/docs/interfaces/Organizations.Types.ICreateApiKeyRequest.md +32 -0
- package/docs/interfaces/Organizations.Types.IGroup.md +101 -0
- package/docs/interfaces/Organizations.Types.IGroupDetail.md +129 -0
- package/docs/interfaces/Organizations.Types.IOrganization.md +128 -0
- package/docs/interfaces/Organizations.Types.IUpdateApiKeyRequest.md +32 -0
- package/docs/interfaces/Signatures.ISignature.md +65 -0
- package/docs/interfaces/Tags.ITags.md +43 -0
- package/docs/interfaces/Templates.Types.IDocument.md +109 -0
- package/docs/interfaces/Templates.Types.IField.md +109 -0
- package/docs/interfaces/Templates.Types.IPage.md +87 -0
- package/docs/interfaces/Templates.Types.IReminder.md +109 -0
- package/docs/interfaces/Templates.Types.IRole.md +120 -0
- package/docs/interfaces/Templates.Types.ISetting.md +98 -0
- package/docs/interfaces/Templates.Types.IStar.md +32 -0
- package/docs/interfaces/Templates.Types.ITag.md +32 -0
- package/docs/interfaces/Templates.Types.ITemplate.md +219 -0
- package/docs/interfaces/Templates.Types.ITemplateSearchParams.md +197 -0
- package/docs/interfaces/Templates.Types.ITemplateSummaryEntry.md +186 -0
- package/docs/interfaces/Templates.Types.ITemplatesSearchResult.md +43 -0
- package/docs/interfaces/Templates.Types.ITemplatesSummary.md +43 -0
- package/docs/interfaces/Templates.Types.ITimePeriod.md +32 -0
- package/docs/interfaces/Users.Types.IActiveSession.md +131 -0
- package/docs/interfaces/Users.Types.IAuthenticateAppRequest.md +32 -0
- package/docs/interfaces/Users.Types.IAuthenticateResponse.md +43 -0
- package/docs/interfaces/Users.Types.IAuthenticateUserRequest.md +32 -0
- package/docs/interfaces/Users.Types.ICreateProfileRequest.md +54 -0
- package/docs/interfaces/Users.Types.IPermission.md +36 -0
- package/docs/interfaces/Users.Types.IProfile.md +173 -0
- package/docs/interfaces/Users.Types.IRole.md +36 -0
- package/docs/interfaces/Users.Types.ISwitchProfileResponse.md +54 -0
- package/docs/interfaces/Users.Types.IUpdateProfileRequest.md +43 -0
- package/docs/interfaces/Users.Types.TokenValidationRequest.md +21 -0
- package/docs/interfaces/Users.Types.TokenValidationResponse.md +36 -0
- package/docs/interfaces/Users.Types.UpdateEmailRequest.md +21 -0
- package/docs/interfaces/Users.Types.UpdateEmailResponse.md +21 -0
- package/docs/interfaces/Users.Types.UpdatePasswordRequest.md +43 -0
- package/docs/interfaces/Users.Types.UpdatePasswordResponse.md +34 -0
- package/docs/interfaces/Validators.IValidator.md +32 -0
- package/docs/modules/Documents.Documents-1.md +137 -0
- package/docs/modules/Documents.Stars.md +31 -0
- package/docs/modules/Documents.Templates.md +61 -0
- package/docs/modules/Documents.Types.md +12 -0
- package/docs/modules/Documents.md +12 -0
- package/docs/modules/HTTP.Transport.md +150 -0
- package/docs/modules/HTTP.Types.md +21 -0
- package/docs/modules/HTTP.md +10 -0
- package/docs/modules/Organizations.ApiKeys.md +169 -0
- package/docs/modules/Organizations.Groups.md +190 -0
- package/docs/modules/Organizations.Invitations.md +166 -0
- package/docs/modules/Organizations.Members.md +121 -0
- package/docs/modules/Organizations.Organizations-1.md +119 -0
- package/docs/modules/Organizations.Types.md +17 -0
- package/docs/modules/Organizations.Webhooks.md +53 -0
- package/docs/modules/Organizations.md +20 -0
- package/docs/modules/Signatures.md +90 -0
- package/docs/modules/Tags.md +75 -0
- package/docs/modules/Templates.Documents.md +129 -0
- package/docs/modules/Templates.Fields.md +77 -0
- package/docs/modules/Templates.Pages.md +98 -0
- package/docs/modules/Templates.Reminders.md +98 -0
- package/docs/modules/Templates.Roles.md +163 -0
- package/docs/modules/Templates.Stars.md +52 -0
- package/docs/modules/Templates.Tags.md +75 -0
- package/docs/modules/Templates.Templates-1.md +139 -0
- package/docs/modules/Templates.Types.md +31 -0
- package/docs/modules/Templates.md +17 -0
- package/docs/modules/Users.Auth.md +196 -0
- package/docs/modules/Users.Billing.md +5 -0
- package/docs/modules/Users.Notifications.md +25 -0
- package/docs/modules/Users.Profiles.md +286 -0
- package/docs/modules/Users.Types.md +62 -0
- package/docs/modules/Users.md +13 -0
- package/docs/modules/Utils.DateTime.md +31 -0
- package/docs/modules/Utils.md +9 -0
- package/docs/modules/Validators.md +48 -0
- package/docs/modules/Whitelabel.md +38 -0
- package/docs/modules.md +27 -0
- package/docs-html/.nojekyll +1 -0
- package/docs-html/assets/highlight.css +85 -0
- package/docs-html/assets/icons.css +1043 -0
- package/docs-html/assets/icons.png +0 -0
- package/docs-html/assets/icons@2x.png +0 -0
- package/docs-html/assets/main.js +52 -0
- package/docs-html/assets/search.js +1 -0
- package/docs-html/assets/style.css +1384 -0
- package/docs-html/assets/widgets.png +0 -0
- package/docs-html/assets/widgets@2x.png +0 -0
- package/docs-html/enums/Templates.Types.SortOptions.html +1 -0
- package/docs-html/enums/Templates.Types.Template.html +1 -0
- package/docs-html/enums/Templates.Types.TemplatePermissions.html +1 -0
- package/docs-html/enums/Templates.Types.TemplateSenderTypes.html +1 -0
- package/docs-html/index.html +64 -0
- package/docs-html/interfaces/Documents.Documents-1.IActivityEntry.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IDocument.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IDocumentSearchOptions.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IDocumentsSearchResult.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IDocumentsSearchResultEntry.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IDocumentsSummary.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IHistory.html +1 -0
- package/docs-html/interfaces/Documents.Documents-1.IRecipient.html +1 -0
- package/docs-html/interfaces/Documents.Types.ITemplateSummaryEntry.html +1 -0
- package/docs-html/interfaces/Documents.Types.ITemplatesSummary.html +1 -0
- package/docs-html/interfaces/Organizations.Types.IApiKey.html +1 -0
- package/docs-html/interfaces/Organizations.Types.IApiKeyWithSecret.html +1 -0
- package/docs-html/interfaces/Organizations.Types.ICreateApiKeyRequest.html +1 -0
- package/docs-html/interfaces/Organizations.Types.IGroup.html +9 -0
- package/docs-html/interfaces/Organizations.Types.IGroupDetail.html +9 -0
- package/docs-html/interfaces/Organizations.Types.IOrganization.html +9 -0
- package/docs-html/interfaces/Organizations.Types.IUpdateApiKeyRequest.html +1 -0
- package/docs-html/interfaces/Signatures.ISignature.html +1 -0
- package/docs-html/interfaces/Tags.ITags.html +1 -0
- package/docs-html/interfaces/Templates.Types.IDocument.html +1 -0
- package/docs-html/interfaces/Templates.Types.IField.html +1 -0
- package/docs-html/interfaces/Templates.Types.IPage.html +1 -0
- package/docs-html/interfaces/Templates.Types.IReminder.html +1 -0
- package/docs-html/interfaces/Templates.Types.IRole.html +1 -0
- package/docs-html/interfaces/Templates.Types.ISetting.html +1 -0
- package/docs-html/interfaces/Templates.Types.IStar.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITag.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITemplate.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITemplateSearchParams.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITemplateSummaryEntry.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITemplatesSearchResult.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITemplatesSummary.html +1 -0
- package/docs-html/interfaces/Templates.Types.ITimePeriod.html +1 -0
- package/docs-html/interfaces/Users.Types.IActiveSession.html +1 -0
- package/docs-html/interfaces/Users.Types.IAuthenticateAppRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.IAuthenticateResponse.html +1 -0
- package/docs-html/interfaces/Users.Types.IAuthenticateUserRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.ICreateProfileRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.IPermission.html +5 -0
- package/docs-html/interfaces/Users.Types.IProfile.html +21 -0
- package/docs-html/interfaces/Users.Types.IRole.html +5 -0
- package/docs-html/interfaces/Users.Types.ISwitchProfileResponse.html +1 -0
- package/docs-html/interfaces/Users.Types.IUpdateProfileRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.TokenValidationRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.TokenValidationResponse.html +5 -0
- package/docs-html/interfaces/Users.Types.UpdateEmailRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.UpdateEmailResponse.html +1 -0
- package/docs-html/interfaces/Users.Types.UpdatePasswordRequest.html +1 -0
- package/docs-html/interfaces/Users.Types.UpdatePasswordResponse.html +3 -0
- package/docs-html/interfaces/Validators.IValidator.html +1 -0
- package/docs-html/modules/Documents.Documents-1.html +9 -0
- package/docs-html/modules/Documents.Stars.html +1 -0
- package/docs-html/modules/Documents.Templates.html +1 -0
- package/docs-html/modules/Documents.Types.html +1 -0
- package/docs-html/modules/Documents.html +1 -0
- package/docs-html/modules/HTTP.Transport.html +22 -0
- package/docs-html/modules/HTTP.Types.html +1 -0
- package/docs-html/modules/HTTP.html +1 -0
- package/docs-html/modules/Organizations.ApiKeys.html +29 -0
- package/docs-html/modules/Organizations.Groups.html +15 -0
- package/docs-html/modules/Organizations.Invitations.html +1 -0
- package/docs-html/modules/Organizations.Members.html +1 -0
- package/docs-html/modules/Organizations.Organizations-1.html +1 -0
- package/docs-html/modules/Organizations.Types.html +1 -0
- package/docs-html/modules/Organizations.Webhooks.html +1 -0
- package/docs-html/modules/Organizations.html +6 -0
- package/docs-html/modules/Signatures.html +1 -0
- package/docs-html/modules/Tags.html +1 -0
- package/docs-html/modules/Templates.Documents.html +17 -0
- package/docs-html/modules/Templates.Fields.html +1 -0
- package/docs-html/modules/Templates.Pages.html +1 -0
- package/docs-html/modules/Templates.Reminders.html +1 -0
- package/docs-html/modules/Templates.Roles.html +1 -0
- package/docs-html/modules/Templates.Stars.html +1 -0
- package/docs-html/modules/Templates.Tags.html +1 -0
- package/docs-html/modules/Templates.Templates-1.html +5 -0
- package/docs-html/modules/Templates.Types.html +1 -0
- package/docs-html/modules/Templates.html +1 -0
- package/docs-html/modules/Users.Auth.html +31 -0
- package/docs-html/modules/Users.Billing.html +1 -0
- package/docs-html/modules/Users.Notifications.html +1 -0
- package/docs-html/modules/Users.Profiles.html +44 -0
- package/docs-html/modules/Users.Types.html +1 -0
- package/docs-html/modules/Users.html +1 -0
- package/docs-html/modules/Utils.DateTime.html +1 -0
- package/docs-html/modules/Utils.html +1 -0
- package/docs-html/modules/Validators.html +1 -0
- package/docs-html/modules/Whitelabel.html +1 -0
- package/docs-html/modules.html +11 -0
- package/jestconfig.json +11 -0
- package/package-lock.json +3421 -0
- package/package.json +6 -3
- package/src/Documents/Documents.ts +166 -0
- package/src/Documents/Stars.ts +5 -0
- package/src/Documents/Templates.ts +17 -0
- package/src/Documents/Types.ts +24 -0
- package/src/Documents/index.ts +4 -0
- package/src/HTTP/Transport.ts +95 -0
- package/src/HTTP/Types.ts +1 -0
- package/src/HTTP/index.ts +2 -0
- package/src/Organizations/ApiKeys.ts +85 -0
- package/src/Organizations/Groups.ts +65 -0
- package/src/Organizations/Invitations.ts +36 -0
- package/src/Organizations/Members.ts +26 -0
- package/src/Organizations/Organizations.ts +32 -0
- package/src/Organizations/Types.ts +63 -0
- package/src/Organizations/Webhooks.ts +11 -0
- package/src/Organizations/index.ts +16 -0
- package/src/Search/Content.ts +45 -0
- package/src/Search/Types.ts +83 -0
- package/src/Search/index.ts +2 -0
- package/src/Signatures.ts +29 -0
- package/src/Tags.ts +22 -0
- package/src/Templates/Documents.ts +58 -0
- package/src/Templates/Fields.ts +17 -0
- package/src/Templates/Pages.ts +22 -0
- package/src/Templates/Reminders.ts +22 -0
- package/src/Templates/Roles.ts +37 -0
- package/src/Templates/Stars.ts +12 -0
- package/src/Templates/Tags.ts +17 -0
- package/src/Templates/Templates.ts +42 -0
- package/src/Templates/Types.ts +201 -0
- package/src/Templates/index.ts +9 -0
- package/src/Users/Auth.ts +114 -0
- package/src/Users/Billing.ts +3 -0
- package/src/Users/Notifications.ts +6 -0
- package/src/Users/Profiles.ts +153 -0
- package/src/Users/Types.ts +156 -0
- package/src/Users/index.ts +5 -0
- package/src/Utils/DateTime.ts +43 -0
- package/src/Utils/index.ts +1 -0
- package/src/Validators.ts +16 -0
- package/src/Whitelabel.ts +11 -0
- package/src/__tests__/Organizations/Apikeys.spec.ts +84 -0
- package/src/__tests__/Users/Auth.spec.ts +89 -0
- package/src/__tests__/Users/Profiles.spec.ts +162 -0
- package/src/index.ts +23 -0
- package/tsconfig.json +20 -0
- package/tslint.json +3 -0
- package/Api/Auth.d.ts +0 -71
- package/Api/Auth.js +0 -24
- package/Api/Documents.d.ts +0 -124
- package/Api/Documents.js +0 -47
- package/Api/Endpoint.d.ts +0 -2
- package/Api/Endpoint.js +0 -9
- package/Api/Templates.d.ts +0 -33
- package/Api/Templates.js +0 -55
- package/Api/Types.d.ts +0 -182
- package/Api/index.d.ts +0 -2
- package/Api/index.js +0 -2
- package/AuthManager.d.ts +0 -14
- package/AuthManager.js +0 -53
- package/HTTP/Endpoint.d.ts +0 -4
- package/HTTP/Endpoint.js +0 -12
- package/HTTP/Transport.d.ts +0 -3
- package/HTTP/Transport.js +0 -12
- package/Organizations/Invitations.js +0 -22
- package/Organizations/Members.js +0 -16
- package/Organizations/Organizations.js +0 -13
- package/Organizations/Webhooks.js +0 -7
- package/Signatures.js +0 -7
- package/Tags.js +0 -4
- package/Templates/Fields.js +0 -10
- package/Templates/Pages.js +0 -13
- package/Templates/Reminders.js +0 -13
- package/Templates/Roles.js +0 -22
- package/Templates/Stars.js +0 -7
- package/Templates/Tags.js +0 -10
- package/Users/Notifications.d.ts +0 -1
- package/Users/Notifications.js +0 -40
- package/Users/Types.js +0 -1
- package/Validators.js +0 -5
- package/Whitelabel.js +0 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import mockAxios from 'jest-mock-axios';
|
|
2
|
+
import {Profiles} from '../../Users';
|
|
3
|
+
import {IPermission, IProfile, IRole} from '../../Users/Types';
|
|
4
|
+
|
|
5
|
+
// TODO: Expand this test suite with more mock data and result checks
|
|
6
|
+
|
|
7
|
+
const MockProfile = {
|
|
8
|
+
id: '1234',
|
|
9
|
+
user_id: '4567',
|
|
10
|
+
organization_id: '5678',
|
|
11
|
+
first_name: 'first',
|
|
12
|
+
last_name: 'last',
|
|
13
|
+
email: 'test@test.com',
|
|
14
|
+
phone: null,
|
|
15
|
+
current: true,
|
|
16
|
+
organization: {
|
|
17
|
+
id: '5678',
|
|
18
|
+
name: 'test org',
|
|
19
|
+
address: null,
|
|
20
|
+
phone: null,
|
|
21
|
+
business_name: null,
|
|
22
|
+
is_business: false,
|
|
23
|
+
address2: null,
|
|
24
|
+
contact_email: null,
|
|
25
|
+
timezone: null,
|
|
26
|
+
envelope_responsible: false,
|
|
27
|
+
},
|
|
28
|
+
} as IProfile;
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
mockAxios.reset();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('getProfiles should return a "current" profile', () => {
|
|
35
|
+
const catchFn = jest.fn();
|
|
36
|
+
const thenFn = jest.fn();
|
|
37
|
+
|
|
38
|
+
Profiles.getProfiles().then(thenFn).catch(catchFn);
|
|
39
|
+
expect(mockAxios.get).toBeCalledWith('/profiles');
|
|
40
|
+
|
|
41
|
+
mockAxios.mockResponse({data: [MockProfile]});
|
|
42
|
+
expect(thenFn).toBeCalledWith([MockProfile]);
|
|
43
|
+
expect(catchFn).not.toBeCalled();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('getRoles should return a list of system roles', () => {
|
|
47
|
+
const catchFn = jest.fn();
|
|
48
|
+
const thenFn = jest.fn();
|
|
49
|
+
|
|
50
|
+
Profiles.getRoles().then(thenFn).catch(catchFn);
|
|
51
|
+
expect(mockAxios.get).toBeCalledWith('/roles');
|
|
52
|
+
|
|
53
|
+
const roles = [] as IRole[];
|
|
54
|
+
mockAxios.mockResponse({data: roles});
|
|
55
|
+
expect(thenFn).toBeCalledWith(roles);
|
|
56
|
+
expect(catchFn).not.toBeCalled();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('getPermissions should return a list of system permissions', () => {
|
|
60
|
+
const catchFn = jest.fn();
|
|
61
|
+
const thenFn = jest.fn();
|
|
62
|
+
|
|
63
|
+
Profiles.getPermissions().then(thenFn).catch(catchFn);
|
|
64
|
+
expect(mockAxios.get).toBeCalledWith('/permissions');
|
|
65
|
+
|
|
66
|
+
const permissions = [] as IPermission[];
|
|
67
|
+
mockAxios.mockResponse({data: permissions});
|
|
68
|
+
expect(thenFn).toBeCalledWith(permissions);
|
|
69
|
+
expect(catchFn).not.toBeCalled();
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('createProfile should return the new profile', () => {
|
|
73
|
+
const catchFn = jest.fn();
|
|
74
|
+
const thenFn = jest.fn();
|
|
75
|
+
|
|
76
|
+
const profile = {first_name: 'FIRST', last_name: 'LAST', email: 'EMAIL', organization_id: 'ORGID', user_id: 'TEST'};
|
|
77
|
+
Profiles.createProfile(profile).then(thenFn).catch(catchFn);
|
|
78
|
+
expect(mockAxios.post).toBeCalledWith('/profiles', profile);
|
|
79
|
+
|
|
80
|
+
mockAxios.mockResponse({data: profile});
|
|
81
|
+
expect(thenFn).toBeCalledWith(profile);
|
|
82
|
+
expect(catchFn).not.toBeCalled();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('getProfile should return a profile', () => {
|
|
86
|
+
const catchFn = jest.fn();
|
|
87
|
+
const thenFn = jest.fn();
|
|
88
|
+
|
|
89
|
+
const profileId = 'TEST';
|
|
90
|
+
Profiles.getProfile(profileId).then(thenFn).catch(catchFn);
|
|
91
|
+
expect(mockAxios.get).toBeCalledWith(`/profiles/${profileId}`);
|
|
92
|
+
|
|
93
|
+
mockAxios.mockResponse({data: {id: profileId}});
|
|
94
|
+
expect(thenFn).toBeCalledWith({id: profileId});
|
|
95
|
+
expect(catchFn).not.toBeCalled();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('getProfilePermissions should return a permissions array', () => {
|
|
99
|
+
const catchFn = jest.fn();
|
|
100
|
+
const thenFn = jest.fn();
|
|
101
|
+
|
|
102
|
+
const profileId = 'TEST';
|
|
103
|
+
Profiles.getProfilePermissions(profileId).then(thenFn).catch(catchFn);
|
|
104
|
+
expect(mockAxios.get).toBeCalledWith(`/profiles/${profileId}/permissions`);
|
|
105
|
+
|
|
106
|
+
mockAxios.mockResponse({data: []});
|
|
107
|
+
expect(thenFn).toBeCalledWith([]);
|
|
108
|
+
expect(catchFn).not.toBeCalled();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('getProfileGroups should return a groups array', () => {
|
|
112
|
+
const catchFn = jest.fn();
|
|
113
|
+
const thenFn = jest.fn();
|
|
114
|
+
|
|
115
|
+
const profileId = 'TEST';
|
|
116
|
+
Profiles.getProfileGroups(profileId).then(thenFn).catch(catchFn);
|
|
117
|
+
expect(mockAxios.get).toBeCalledWith(`/profiles/${profileId}/groups`);
|
|
118
|
+
|
|
119
|
+
mockAxios.mockResponse({data: []});
|
|
120
|
+
expect(thenFn).toBeCalledWith([]);
|
|
121
|
+
expect(catchFn).not.toBeCalled();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('switchProfile should return a new profile', () => {
|
|
125
|
+
const catchFn = jest.fn();
|
|
126
|
+
const thenFn = jest.fn();
|
|
127
|
+
|
|
128
|
+
const profileId = 'TEST';
|
|
129
|
+
Profiles.switchProfile(profileId).then(thenFn).catch(catchFn);
|
|
130
|
+
expect(mockAxios.post).toBeCalledWith(`/profiles/${profileId}/switch`);
|
|
131
|
+
|
|
132
|
+
mockAxios.mockResponse({data: {}});
|
|
133
|
+
expect(thenFn).toBeCalledWith({});
|
|
134
|
+
expect(catchFn).not.toBeCalled();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('updateProfile should return a new profile', () => {
|
|
138
|
+
const catchFn = jest.fn();
|
|
139
|
+
const thenFn = jest.fn();
|
|
140
|
+
|
|
141
|
+
const profileId = 'TEST';
|
|
142
|
+
const params = {first_name: 'TEST'};
|
|
143
|
+
Profiles.updateProfile(profileId, params).then(thenFn).catch(catchFn);
|
|
144
|
+
expect(mockAxios.put).toBeCalledWith(`/profiles/${profileId}`, params);
|
|
145
|
+
|
|
146
|
+
mockAxios.mockResponse({data: {}});
|
|
147
|
+
expect(thenFn).toBeCalledWith({});
|
|
148
|
+
expect(catchFn).not.toBeCalled();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('deleteProfile should return a new profile', () => {
|
|
152
|
+
const catchFn = jest.fn();
|
|
153
|
+
const thenFn = jest.fn();
|
|
154
|
+
|
|
155
|
+
const profileId = 'TEST';
|
|
156
|
+
Profiles.deleteProfile(profileId).then(thenFn).catch(catchFn);
|
|
157
|
+
expect(mockAxios.delete).toBeCalledWith(`/profiles/${profileId}`);
|
|
158
|
+
|
|
159
|
+
mockAxios.mockResponse();
|
|
160
|
+
expect(thenFn).toBeCalled();
|
|
161
|
+
expect(catchFn).not.toBeCalled();
|
|
162
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verdocs functions are organized into high-level modules that represent the main objects within Verdocs:
|
|
3
|
+
*
|
|
4
|
+
* - Documents - An individual document to be signed. Documents are created from templates.
|
|
5
|
+
* - HTTP - General support functionality for Verdocs' REST endpoints. Typically not used directly.
|
|
6
|
+
* - Organizations - An Organization is a container for user profiles, templates, documents, billing, and other related objects.
|
|
7
|
+
* - Templates - A template for a document containing a PDF file, metadata for signature fields, and other information.
|
|
8
|
+
* - Users - All operations related to authentication and user-related operations.
|
|
9
|
+
* - Utils - General support functions used by the other modules and exported for convenience.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export * as Documents from './Documents';
|
|
15
|
+
export * as Templates from './Templates';
|
|
16
|
+
export * as HTTP from './HTTP';
|
|
17
|
+
export * as Organizations from './Organizations';
|
|
18
|
+
export * as Signatures from './Signatures';
|
|
19
|
+
export * as Tags from './Tags';
|
|
20
|
+
export * as Users from './Users';
|
|
21
|
+
export * as Utils from './Utils';
|
|
22
|
+
export * as Validators from './Validators';
|
|
23
|
+
export * as Whitelabel from './Whitelabel';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"lib": ["es2017", "es7", "es6", "dom"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"moduleResolution": "node"
|
|
11
|
+
},
|
|
12
|
+
"include": ["src"],
|
|
13
|
+
"exclude": ["node_modules", "dist", "**/__tests__/*"],
|
|
14
|
+
"typedocOptions": {
|
|
15
|
+
"entryPoints": ["src/index.ts"],
|
|
16
|
+
"out": "docs",
|
|
17
|
+
"includeVersion": true,
|
|
18
|
+
"gitRevision": "main"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/tslint.json
ADDED
package/Api/Auth.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export declare type IPermission = 'org:view' | 'member:view' | 'org:update' | 'member:add' | 'member:remove' | 'admin:add' | 'admin:remove' | 'org:delete' | 'org:transfer' | 'owner:add' | 'owner:remove' | 'template:creator:create:personal' | 'template:creator:visibility' | 'template:creator:create:org' | 'template:member:read' | 'template:member:write' | 'template:member:visibility' | 'template:creator:delete' | 'template:member:delete' | 'template:creator:create:public' | 'rform:access' | 'rcommon:access' | 'org:list' | 'org:create';
|
|
2
|
-
export declare type IRole = 'owner' | 'basic_user' | 'member';
|
|
3
|
-
export declare type IPlan = 'env:essential' | 'org:standard';
|
|
4
|
-
export interface IProfile {
|
|
5
|
-
id: string;
|
|
6
|
-
user_id: string;
|
|
7
|
-
organization_id: string;
|
|
8
|
-
first_name: string;
|
|
9
|
-
last_name: string;
|
|
10
|
-
email: string;
|
|
11
|
-
phone: string | null;
|
|
12
|
-
current: boolean;
|
|
13
|
-
organization: {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
address: string | null;
|
|
17
|
-
phone: string | null;
|
|
18
|
-
business_name: string | null;
|
|
19
|
-
is_business: boolean;
|
|
20
|
-
address2: string | null;
|
|
21
|
-
contact_email: string | null;
|
|
22
|
-
timezone: string | null;
|
|
23
|
-
envelope_responsible: boolean;
|
|
24
|
-
};
|
|
25
|
-
permissions?: IPermission[];
|
|
26
|
-
roles?: IRole[];
|
|
27
|
-
plans?: IPlan[];
|
|
28
|
-
}
|
|
29
|
-
export interface IActiveSession {
|
|
30
|
-
sub: string;
|
|
31
|
-
email: string;
|
|
32
|
-
email_verified: boolean;
|
|
33
|
-
iat: number;
|
|
34
|
-
exp: number;
|
|
35
|
-
permissions: IPermission[];
|
|
36
|
-
roles: IRole[];
|
|
37
|
-
plans: IPlan[];
|
|
38
|
-
profile: IProfile;
|
|
39
|
-
profile_id: string;
|
|
40
|
-
organization_id: string;
|
|
41
|
-
}
|
|
42
|
-
export interface AuthenticateRequest {
|
|
43
|
-
username: string;
|
|
44
|
-
password: string;
|
|
45
|
-
}
|
|
46
|
-
export interface AuthenticateResponse {
|
|
47
|
-
idToken: string;
|
|
48
|
-
accessToken: string;
|
|
49
|
-
refreshToken: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Authenticate to Verdocs via user/password authentication
|
|
53
|
-
*
|
|
54
|
-
* ```typescript
|
|
55
|
-
* import {Auth, Endpoint} from '@verdocs/js-sdk';
|
|
56
|
-
*
|
|
57
|
-
* const {accessToken} = await Auth.authenticate({ username: 'test@test.com', password: 'PASSWORD' });
|
|
58
|
-
* Endpoint.setAuthToken(accessToken);
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare const authenticate: (request: AuthenticateRequest) => Promise<AuthenticateResponse>;
|
|
62
|
-
/**
|
|
63
|
-
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
64
|
-
*
|
|
65
|
-
* ```typescript
|
|
66
|
-
* import {Auth} from '@verdocs/js-sdk';
|
|
67
|
-
*
|
|
68
|
-
* const profiles = await Auth.getProfiles()
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
export declare const getProfiles: () => Promise<IProfile[]>;
|
package/Api/Auth.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Endpoint } from './Endpoint';
|
|
2
|
-
/**
|
|
3
|
-
* Authenticate to Verdocs via user/password authentication
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import {Auth, Endpoint} from '@verdocs/js-sdk';
|
|
7
|
-
*
|
|
8
|
-
* const {accessToken} = await Auth.authenticate({ username: 'test@test.com', password: 'PASSWORD' });
|
|
9
|
-
* Endpoint.setAuthToken(accessToken);
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export var authenticate = function (request) {
|
|
13
|
-
return Endpoint.post('/authentication/login', request).then(function (r) { return r.data; });
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
17
|
-
*
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import {Auth} from '@verdocs/js-sdk';
|
|
20
|
-
*
|
|
21
|
-
* const profiles = await Auth.getProfiles()
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export var getProfiles = function () { return Endpoint.post('/profiles').then(function (r) { return r.data; }); };
|
package/Api/Documents.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
export declare type IDocumentStatus = 'complete' | 'pending' | 'progress';
|
|
2
|
-
export declare type IRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted';
|
|
3
|
-
export declare type IRecipientType = 'signer' | 'cc';
|
|
4
|
-
export interface IDocumentsSearchResultEntry {
|
|
5
|
-
id: string;
|
|
6
|
-
canceled_at: string;
|
|
7
|
-
created_at: string;
|
|
8
|
-
name: string;
|
|
9
|
-
profile_id: string;
|
|
10
|
-
status: IDocumentStatus;
|
|
11
|
-
next_recipient: {
|
|
12
|
-
claimed: boolean;
|
|
13
|
-
email: string;
|
|
14
|
-
name: string;
|
|
15
|
-
profile_id: string;
|
|
16
|
-
status: IRecipientStatus;
|
|
17
|
-
type: IRecipientType;
|
|
18
|
-
};
|
|
19
|
-
template_id: string;
|
|
20
|
-
total_count: number;
|
|
21
|
-
updated_at: string;
|
|
22
|
-
}
|
|
23
|
-
export interface IDocumentsSearchResult {
|
|
24
|
-
page: number;
|
|
25
|
-
total: number;
|
|
26
|
-
result: IDocumentsSearchResultEntry[];
|
|
27
|
-
}
|
|
28
|
-
export interface IDocumentsSummary {
|
|
29
|
-
action_required: {
|
|
30
|
-
page: number;
|
|
31
|
-
total: number;
|
|
32
|
-
result: IActivityEntry[];
|
|
33
|
-
};
|
|
34
|
-
completed: {
|
|
35
|
-
page: number;
|
|
36
|
-
total: number;
|
|
37
|
-
result: IActivityEntry[];
|
|
38
|
-
};
|
|
39
|
-
waiting_others: {
|
|
40
|
-
page: number;
|
|
41
|
-
total: number;
|
|
42
|
-
result: IActivityEntry[];
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export interface IRecipient {
|
|
46
|
-
agreed: boolean;
|
|
47
|
-
claimed: boolean;
|
|
48
|
-
created_at: string;
|
|
49
|
-
delegated_to: string | null;
|
|
50
|
-
delegator: boolean;
|
|
51
|
-
email: string;
|
|
52
|
-
envelope_id: string;
|
|
53
|
-
full_name: string;
|
|
54
|
-
in_app_access_key: string;
|
|
55
|
-
key_used_to_conclude: string;
|
|
56
|
-
message: string | null;
|
|
57
|
-
phone: string;
|
|
58
|
-
profile_id: string;
|
|
59
|
-
role_name: string;
|
|
60
|
-
sequence: number;
|
|
61
|
-
status: IRecipientStatus;
|
|
62
|
-
type: IRecipientType;
|
|
63
|
-
updated_at: string;
|
|
64
|
-
}
|
|
65
|
-
export interface IDocument {
|
|
66
|
-
id: string;
|
|
67
|
-
created_at: string;
|
|
68
|
-
canceled_at: string;
|
|
69
|
-
envelope_document_id: string;
|
|
70
|
-
certificate_document_id: string | null;
|
|
71
|
-
histories: IHistory[];
|
|
72
|
-
recipients: IRecipient[];
|
|
73
|
-
name: string;
|
|
74
|
-
no_contact: boolean;
|
|
75
|
-
profile_id: string;
|
|
76
|
-
reminder_id: string | null;
|
|
77
|
-
status: IDocumentStatus;
|
|
78
|
-
template_id: string;
|
|
79
|
-
updated_at: string;
|
|
80
|
-
}
|
|
81
|
-
export interface IActivityEntry {
|
|
82
|
-
id: string;
|
|
83
|
-
name: string;
|
|
84
|
-
canceled_at: string;
|
|
85
|
-
created_at: string;
|
|
86
|
-
updated_at: string;
|
|
87
|
-
profile_id: string;
|
|
88
|
-
status: IDocumentStatus;
|
|
89
|
-
template_id: string;
|
|
90
|
-
recipient: {
|
|
91
|
-
claimed: boolean;
|
|
92
|
-
email: string;
|
|
93
|
-
name: string;
|
|
94
|
-
profile_id: string;
|
|
95
|
-
status: IRecipientStatus;
|
|
96
|
-
type: IRecipientType;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export interface IHistory {
|
|
100
|
-
created_at: string;
|
|
101
|
-
envelope_id: string;
|
|
102
|
-
event: IHistoryEvent;
|
|
103
|
-
event_detail: IEventDetail;
|
|
104
|
-
id: string;
|
|
105
|
-
role_name: string;
|
|
106
|
-
}
|
|
107
|
-
export interface IDocumentSearchOptions {
|
|
108
|
-
rows?: number;
|
|
109
|
-
page?: number;
|
|
110
|
-
sort_by?: 'updated_at' | 'created_at';
|
|
111
|
-
ascending?: boolean;
|
|
112
|
-
is_owner?: boolean;
|
|
113
|
-
is_recipient?: boolean;
|
|
114
|
-
envelope_status: IDocumentStatus[];
|
|
115
|
-
recipient_status: IDocumentStatus[];
|
|
116
|
-
}
|
|
117
|
-
export declare type IHistoryEvent = 'recipient:invited' | 'recipient:opened' | 'recipient:agreed' | 'recipient:signed' | 'recipient:submitted';
|
|
118
|
-
export declare type IEventDetail = 'in_app' | 'mail' | 'signer' | '';
|
|
119
|
-
export declare const getSummary: (page: number) => Promise<IDocumentsSummary>;
|
|
120
|
-
export declare const search: (params: any) => Promise<IDocumentsSearchResult>;
|
|
121
|
-
export declare const Documents: {
|
|
122
|
-
getSummary: (page: number) => Promise<IDocumentsSummary>;
|
|
123
|
-
search: (params: any) => Promise<IDocumentsSearchResult>;
|
|
124
|
-
};
|
package/Api/Documents.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { Endpoint } from './Endpoint';
|
|
38
|
-
export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
39
|
-
return [2 /*return*/, Endpoint.post('/documents/summary', { page: page }).then(function (r) { return r.data; })];
|
|
40
|
-
}); }); };
|
|
41
|
-
export var search = function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
42
|
-
return [2 /*return*/, Endpoint.post('/documents/search', params).then(function (r) { return r.data; })];
|
|
43
|
-
}); }); };
|
|
44
|
-
export var Documents = {
|
|
45
|
-
getSummary: getSummary,
|
|
46
|
-
search: search,
|
|
47
|
-
};
|
package/Api/Endpoint.d.ts
DELETED
package/Api/Endpoint.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
export var Endpoint = axios.create({
|
|
3
|
-
baseURL: 'https://stage-api.verdocs.com/',
|
|
4
|
-
timeout: 3000,
|
|
5
|
-
headers: { 'X-Client-ID': '1234' },
|
|
6
|
-
});
|
|
7
|
-
export var setAuthToken = function (accessToken) {
|
|
8
|
-
Endpoint.defaults.headers.Authorization = "Bearer " + accessToken;
|
|
9
|
-
};
|
package/Api/Templates.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface ITemplateSummaryEntry {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
sender: string;
|
|
5
|
-
counter: number;
|
|
6
|
-
description: string | null;
|
|
7
|
-
created_at: string;
|
|
8
|
-
updated_at: string;
|
|
9
|
-
is_personal: boolean;
|
|
10
|
-
is_public: boolean;
|
|
11
|
-
profile_id: string;
|
|
12
|
-
organization_id: string;
|
|
13
|
-
last_used_at: string | null;
|
|
14
|
-
document_name: string | null;
|
|
15
|
-
star_counter: number;
|
|
16
|
-
tag_name: string | null;
|
|
17
|
-
is_starred: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface ITemplatesSummary {
|
|
20
|
-
page: number;
|
|
21
|
-
total: number;
|
|
22
|
-
result: ITemplateSummaryEntry[];
|
|
23
|
-
}
|
|
24
|
-
export declare const getTemplates: () => Promise<any>;
|
|
25
|
-
export declare const searchTemplates: () => Promise<any>;
|
|
26
|
-
export declare const getSummary: (page: number) => Promise<ITemplatesSummary>;
|
|
27
|
-
export declare const toggleStar: (templateId: string) => Promise<ITemplateSummaryEntry>;
|
|
28
|
-
export declare const Templates: {
|
|
29
|
-
getSummary: (page: number) => Promise<ITemplatesSummary>;
|
|
30
|
-
getTemplates: () => Promise<any>;
|
|
31
|
-
searchTemplates: () => Promise<any>;
|
|
32
|
-
toggleStar: (templateId: string) => Promise<ITemplateSummaryEntry>;
|
|
33
|
-
};
|
package/Api/Templates.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { Endpoint } from './Endpoint';
|
|
38
|
-
export var getTemplates = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
39
|
-
return [2 /*return*/, Endpoint.get('/templates').then(function (r) { return r.data; })];
|
|
40
|
-
}); }); };
|
|
41
|
-
export var searchTemplates = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
42
|
-
return [2 /*return*/, Endpoint.post('/templates/search').then(function (r) { return r.data; })];
|
|
43
|
-
}); }); };
|
|
44
|
-
export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
45
|
-
return [2 /*return*/, Endpoint.post('/templates/summary', { page: page }).then(function (r) { return r.data; })];
|
|
46
|
-
}); }); };
|
|
47
|
-
export var toggleStar = function (templateId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
48
|
-
return [2 /*return*/, Endpoint.post("/templates/" + templateId + "/stars/toggle").then(function (r) { return r.data; })];
|
|
49
|
-
}); }); };
|
|
50
|
-
export var Templates = {
|
|
51
|
-
getSummary: getSummary,
|
|
52
|
-
getTemplates: getTemplates,
|
|
53
|
-
searchTemplates: searchTemplates,
|
|
54
|
-
toggleStar: toggleStar,
|
|
55
|
-
};
|