@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,31 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var getOrganizations = function () {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.get('/organizations')
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var createOrganization = function () {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.post('/organizations')
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var validateOrganization = function () {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.get('/organizations/is_valid')
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
17
|
+
export var deleteOrganization = function (organizationId) {
|
|
18
|
+
return getEndpoint()
|
|
19
|
+
.delete("/organizations/" + organizationId)
|
|
20
|
+
.then(function (r) { return r.data; });
|
|
21
|
+
};
|
|
22
|
+
export var getOrganization = function (organizationId) {
|
|
23
|
+
return getEndpoint()
|
|
24
|
+
.get("/organizations/" + organizationId)
|
|
25
|
+
.then(function (r) { return r.data; });
|
|
26
|
+
};
|
|
27
|
+
export var updateOrganization = function (organizationId, params) {
|
|
28
|
+
return getEndpoint()
|
|
29
|
+
.patch("/organizations/" + organizationId, params)
|
|
30
|
+
.then(function (r) { return r.data; });
|
|
31
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var getWebhook = function (organizationId) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.get("/organizations/" + organizationId + "/webhook")
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var updateWebhook = function (organizationId, params) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.post("/organizations/" + organizationId + "/webhook", params)
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
File without changes
|
|
File without changes
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Verdocs JS SDK
|
|
2
|
+
|
|
3
|
+
> Verdocs SDK for Javascript / Typescript
|
|
4
|
+
|
|
5
|
+
This SDK provides convenience wrappers for both Browser-based and NodeJS applications to call the Verdocs API, with strong typing and
|
|
6
|
+
documentation to help you get started quickly developing for the Verdocs platform.
|
|
7
|
+
|
|
8
|
+
## Getting Started
|
|
9
|
+
|
|
10
|
+
First add this module to your project:
|
|
11
|
+
|
|
12
|
+
npm install --save @verdocs/js-sdk
|
|
13
|
+
|
|
14
|
+
or:
|
|
15
|
+
|
|
16
|
+
yarn add @verdocs/js-sdk
|
|
17
|
+
|
|
18
|
+
This package is namespaced into packages that organize API calls into functional groups. A top-level `export *` is provided for simplicity,
|
|
19
|
+
but to enable Tree Shaking to do its job, it is recommended that you only import the package required for a given task. For example, to
|
|
20
|
+
perform a simple authentication request:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import {Auth} from '@verdocs/js-sdk/Auth';
|
|
24
|
+
import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
25
|
+
|
|
26
|
+
const {accessToken} = await Auth.authenticateUser({username: 'MY_USERNAME', password: 'MY_PASSWORD'});
|
|
27
|
+
Transport.setAuthToken(accessToken);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Once you are authenticated, you can use the rest of the controls and embeds within an app. For instance, to provide a simple PDF
|
|
31
|
+
viewer for a document stored within Verdocs:
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Verdocs functions are organized into high-level modules that represent the main objects within the platform:
|
|
36
|
+
|
|
37
|
+
- Documents - An individual document to be signed. Documents are created from templates.
|
|
38
|
+
- HTTP - General support functionality for Verdocs' REST endpoints. Typically not used directly.
|
|
39
|
+
- Organizations - An Organization is a container for user profiles, templates, documents, billing, and other related objects.
|
|
40
|
+
- Templates - A template for a document containing a PDF file, metadata for signature fields, and other information.
|
|
41
|
+
- Users - All operations related to authentication and user-related operations.
|
|
42
|
+
- Utils - General support functions used by the other modules and exported for convenience.
|
|
43
|
+
|
|
44
|
+
Please see the [API Docs](https://github.com/Verdocs/js-sdk/tree/main/docs) for details on the functions provided by each module.
|
|
45
|
+
|
|
46
|
+
## Contributing
|
|
47
|
+
|
|
48
|
+
To avoid the presence of the `dist/` distribution directory appearing in package imports, when this project is built, this `README.md`
|
|
49
|
+
and other support files are copied there. Be sure to run `npm version patch` from THIS directory, but the publish command from within
|
|
50
|
+
the `dist` folder.
|
|
51
|
+
|
|
52
|
+
## HTTP Transport
|
|
53
|
+
|
|
54
|
+
The underlying transport uses `axios`, a cross-environment (NodeJS vs. Browser) HTTP transport layer. When this SDK is included in a
|
|
55
|
+
project, a `Transport` singleton Axios Instance will be created to support the API calls to Verdocs servers. This endpoint's operation
|
|
56
|
+
may be configured by importing it. Please see the [Axios Documentation](https://github.com/axios/axios) for more information on the
|
|
57
|
+
options available. For example, to override the default API call timeout of 3s:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import {Transport} from '@verdocs/js-sdk/Auth/HTTP';
|
|
61
|
+
|
|
62
|
+
Transport.setTimeout(5000);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Contributing
|
|
66
|
+
|
|
67
|
+
This repository is actively maintained and supported by [Verdocs](https://verdocs.com/). We welcome community contributions and
|
|
68
|
+
suggestions! Please file a pull request with any change requests and we will review them as soon as possible.
|
|
File without changes
|
|
@@ -34,7 +34,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import {
|
|
37
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
38
38
|
/**
|
|
39
39
|
* Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
|
|
40
40
|
* type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
|
|
@@ -45,9 +45,13 @@ import { Endpoint } from '../HTTP/Transport';
|
|
|
45
45
|
* const {recent, saved} = await Content.getSearchHistory();
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
export var getSearchHistory = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
-
return
|
|
50
|
-
|
|
48
|
+
export var getSearchHistory = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
return [2 /*return*/, getEndpoint()
|
|
51
|
+
.get('/search/history')
|
|
52
|
+
.then(function (r) { return r.data; })];
|
|
53
|
+
});
|
|
54
|
+
}); };
|
|
51
55
|
/**
|
|
52
56
|
* Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.
|
|
53
57
|
*
|
|
@@ -57,9 +61,13 @@ export var getSearchHistory = function () { return __awaiter(void 0, void 0, voi
|
|
|
57
61
|
* const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});
|
|
58
62
|
* ```
|
|
59
63
|
*/
|
|
60
|
-
export var saveSearch = function (name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
-
return
|
|
62
|
-
|
|
64
|
+
export var saveSearch = function (name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
return [2 /*return*/, getEndpoint()
|
|
67
|
+
.post('/search/saved', { name: name, params: params })
|
|
68
|
+
.then(function (r) { return r.data; })];
|
|
69
|
+
});
|
|
70
|
+
}); };
|
|
63
71
|
/**
|
|
64
72
|
* Search for documents matching various criteria.
|
|
65
73
|
*
|
|
@@ -69,6 +77,10 @@ export var saveSearch = function (name, params) { return __awaiter(void 0, void
|
|
|
69
77
|
* const {result, page, total} = await Documents.search({ ... });
|
|
70
78
|
* ```
|
|
71
79
|
*/
|
|
72
|
-
export var searchContent = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
-
return
|
|
74
|
-
|
|
80
|
+
export var searchContent = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, getEndpoint()
|
|
83
|
+
.post('/search/content')
|
|
84
|
+
.then(function (r) { return r.data; })];
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getEndpoint } from './HTTP/Transport';
|
|
2
|
+
export var createSignature = function (params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post('/signatures', params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var getSignatures = function () {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get('/signatures')
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var getSignature = function (signatureId) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.get("/signatures/" + signatureId)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
17
|
+
export var deleteSignature = function (signatureId) {
|
|
18
|
+
return getEndpoint()
|
|
19
|
+
.delete("/signatures/" + signatureId)
|
|
20
|
+
.then(function (r) { return r.data; });
|
|
21
|
+
};
|
|
File without changes
|
package/dist/Tags.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpoint } from './HTTP/Transport';
|
|
2
|
+
export var createTag = function (params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post('/tags', params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var getTag = function (tagName) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get("/tags/" + tagName)
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var searchTag = function (params) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.get('/tags', params)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
/**
|
|
3
3
|
* Get all the Documents associated to a particular Template.
|
|
4
4
|
*
|
|
@@ -9,7 +9,9 @@ import { Endpoint } from '../HTTP/Transport';
|
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
export var getDocuments = function (templateId) {
|
|
12
|
-
return
|
|
12
|
+
return getEndpoint()
|
|
13
|
+
.get("/templates/" + templateId + "/documents/")
|
|
14
|
+
.then(function (r) { return r.data; });
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* Create a Document for a particular Template.
|
|
@@ -21,7 +23,9 @@ export var getDocuments = function (templateId) {
|
|
|
21
23
|
* ```
|
|
22
24
|
*/
|
|
23
25
|
export var createDocument = function (templateId, params) {
|
|
24
|
-
return
|
|
26
|
+
return getEndpoint()
|
|
27
|
+
.post("/templates/" + templateId + "/documents/", params)
|
|
28
|
+
.then(function (r) { return r.data; });
|
|
25
29
|
};
|
|
26
30
|
/**
|
|
27
31
|
* Get a specific Document.
|
|
@@ -33,7 +37,9 @@ export var createDocument = function (templateId, params) {
|
|
|
33
37
|
* ```
|
|
34
38
|
*/
|
|
35
39
|
export var getDocument = function (templateId, documentId) {
|
|
36
|
-
return
|
|
40
|
+
return getEndpoint()
|
|
41
|
+
.get("/templates/" + templateId + "/documents/" + documentId)
|
|
42
|
+
.then(function (r) { return r.data; });
|
|
37
43
|
};
|
|
38
44
|
/**
|
|
39
45
|
* Delete a specific Document.
|
|
@@ -45,5 +51,7 @@ export var getDocument = function (templateId, documentId) {
|
|
|
45
51
|
* ```
|
|
46
52
|
*/
|
|
47
53
|
export var deleteDocument = function (templateId, documentId) {
|
|
48
|
-
return
|
|
54
|
+
return getEndpoint()
|
|
55
|
+
.delete("/templates/" + templateId + "/documents/" + documentId)
|
|
56
|
+
.then(function (r) { return r.data; });
|
|
49
57
|
};
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var createField = function (templateId, params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post("/templates/" + templateId + "/pages/", params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var editField = function (templateId, fieldName, params) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.put("/templates/" + templateId + "/pages/" + fieldName, params)
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var deleteField = function (templateId, fieldName) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.delete("/templates/" + templateId + "/pages/" + fieldName)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var createPage = function (templateId, params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post("/templates/" + templateId + "/pages/", params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var editPage = function (templateId, sequence) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.put("/templates/" + templateId + "/pages/" + sequence)
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var getPage = function (templateId, sequence) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.get("/templates/" + templateId + "/pages/" + sequence)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
17
|
+
export var deletePage = function (templateId, sequence) {
|
|
18
|
+
return getEndpoint()
|
|
19
|
+
.delete("/templates/" + templateId + "/pages/" + sequence)
|
|
20
|
+
.then(function (r) { return r.data; });
|
|
21
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var createReminder = function (templateId, params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post("/templates/" + templateId + "/reminder/", params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var getReminder = function (templateId, reminderId) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get("/templates/" + templateId + "/reminder/" + reminderId)
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var editReminder = function (templateId, reminderId) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.put("/templates/" + templateId + "/reminder/" + reminderId)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
17
|
+
export var deleteReminder = function (templateId, reminderId) {
|
|
18
|
+
return getEndpoint()
|
|
19
|
+
.delete("/templates/" + templateId + "/reminder/" + reminderId)
|
|
20
|
+
.then(function (r) { return r.data; });
|
|
21
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var createRole = function (templateId, params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post("/templates/" + templateId + "/roles/", params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var getRoles = function (templateId) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get("/templates/" + templateId + "/roles/")
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var getRole = function (templateId, roleName) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.get("/templates/" + templateId + "/roles/" + roleName)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
17
|
+
export var editRole = function (templateId, roleName, params) {
|
|
18
|
+
return getEndpoint()
|
|
19
|
+
.put("/templates/" + templateId + "/roles/" + roleName, params)
|
|
20
|
+
.then(function (r) { return r.data; });
|
|
21
|
+
};
|
|
22
|
+
export var deleteRole = function (templateId, roleName) {
|
|
23
|
+
return getEndpoint()
|
|
24
|
+
.delete("/templates/" + templateId + "/roles/" + roleName)
|
|
25
|
+
.then(function (r) { return r.data; });
|
|
26
|
+
};
|
|
27
|
+
export var getRoleFields = function (templateId, roleName) {
|
|
28
|
+
return getEndpoint()
|
|
29
|
+
.get("/templates/" + templateId + "/roles/" + roleName + "/fields")
|
|
30
|
+
.then(function (r) { return r.data; });
|
|
31
|
+
};
|
|
32
|
+
export var deleteSequence = function (templateId) {
|
|
33
|
+
return getEndpoint()
|
|
34
|
+
.delete("/templates/" + templateId + "/roles/")
|
|
35
|
+
.then(function (r) { return r.data; });
|
|
36
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var getStars = function (templateId) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.get("/templates/" + templateId + "/stars/")
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var toggleStar = function (templateId) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get("/templates/" + templateId + "/stars/toggle")
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
|
+
export var createTag = function (templateId, params) {
|
|
3
|
+
return getEndpoint()
|
|
4
|
+
.post("/templates/" + templateId + "/tags/", params)
|
|
5
|
+
.then(function (r) { return r.data; });
|
|
6
|
+
};
|
|
7
|
+
export var getTags = function (templateId) {
|
|
8
|
+
return getEndpoint()
|
|
9
|
+
.get("/templates/" + templateId + "/tags/")
|
|
10
|
+
.then(function (r) { return r.data; });
|
|
11
|
+
};
|
|
12
|
+
export var deleteTag = function (templateId, tagName) {
|
|
13
|
+
return getEndpoint()
|
|
14
|
+
.post("/templates/" + templateId + "/tags/" + tagName)
|
|
15
|
+
.then(function (r) { return r.data; });
|
|
16
|
+
};
|
|
File without changes
|
|
@@ -34,12 +34,26 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import {
|
|
38
|
-
export var getTemplates = function () {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
38
|
+
export var getTemplates = function () {
|
|
39
|
+
return getEndpoint()
|
|
40
|
+
.get('/templates/')
|
|
41
|
+
.then(function (r) { return r.data; });
|
|
42
|
+
};
|
|
43
|
+
export var getTemplate = function (templateId) {
|
|
44
|
+
return getEndpoint()
|
|
45
|
+
.get("/templates/" + templateId)
|
|
46
|
+
.then(function (r) { return r.data; });
|
|
47
|
+
};
|
|
48
|
+
export var createTemplate = function (params) {
|
|
49
|
+
return getEndpoint()
|
|
50
|
+
.post('/templates/', params)
|
|
51
|
+
.then(function (r) { return r.data; });
|
|
52
|
+
};
|
|
41
53
|
export var editTemplate = function (templateId, params) {
|
|
42
|
-
return
|
|
54
|
+
return getEndpoint()
|
|
55
|
+
.put("/templates/" + templateId, params)
|
|
56
|
+
.then(function (r) { return r.data; });
|
|
43
57
|
};
|
|
44
58
|
/**
|
|
45
59
|
* Search for templates matching various criteria.
|
|
@@ -50,9 +64,17 @@ export var editTemplate = function (templateId, params) {
|
|
|
50
64
|
* const {result, page, total} = await Templates.search({ ... });
|
|
51
65
|
* ```
|
|
52
66
|
*/
|
|
53
|
-
export var searchTemplate = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
67
|
+
export var searchTemplate = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
return [2 /*return*/, getEndpoint()
|
|
70
|
+
.post('/templates/search', params)
|
|
71
|
+
.then(function (r) { return r.data; })];
|
|
72
|
+
});
|
|
73
|
+
}); };
|
|
74
|
+
export var getSummary = function (page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
return [2 /*return*/, getEndpoint()
|
|
77
|
+
.post('/templates/summary', { page: page })
|
|
78
|
+
.then(function (r) { return r.data; })];
|
|
79
|
+
});
|
|
80
|
+
}); };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,10 +4,10 @@ import { IAuthenticateAppRequest, IAuthenticateResponse, IAuthenticateUserReques
|
|
|
4
4
|
*
|
|
5
5
|
* ```typescript
|
|
6
6
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
7
|
-
* import {
|
|
7
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
8
8
|
*
|
|
9
9
|
* const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });
|
|
10
|
-
*
|
|
10
|
+
* Transport.setAuthToken(accessToken);
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const authenticateUser: (params: IAuthenticateUserRequest) => Promise<IAuthenticateResponse>;
|
|
@@ -20,10 +20,10 @@ export declare const authenticateUser: (params: IAuthenticateUserRequest) => Pro
|
|
|
20
20
|
*
|
|
21
21
|
* ```typescript
|
|
22
22
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
23
|
-
* import {
|
|
23
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
24
24
|
*
|
|
25
25
|
* const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });
|
|
26
|
-
*
|
|
26
|
+
* Transport.setAuthToken(accessToken);
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare const authenticateApp: (params: IAuthenticateAppRequest) => Promise<IAuthenticateResponse>;
|
|
@@ -47,10 +47,10 @@ export declare const validateToken: (params: TokenValidationRequest) => Promise<
|
|
|
47
47
|
*
|
|
48
48
|
* ```typescript
|
|
49
49
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
50
|
-
* import {
|
|
50
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
51
51
|
*
|
|
52
52
|
* const {accessToken} = await Auth.refreshTokens();
|
|
53
|
-
*
|
|
53
|
+
* Transport.setAuthToken(accessToken);
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export declare const refreshTokens: () => Promise<IAuthenticateResponse>;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEndpoint } from '../HTTP/Transport';
|
|
2
2
|
/**
|
|
3
3
|
* Authenticate to Verdocs via user/password authentication
|
|
4
4
|
*
|
|
5
5
|
* ```typescript
|
|
6
6
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
7
|
-
* import {
|
|
7
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
8
8
|
*
|
|
9
9
|
* const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });
|
|
10
|
-
*
|
|
10
|
+
* Transport.setAuthToken(accessToken);
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export var authenticateUser = function (params) {
|
|
14
|
-
return
|
|
14
|
+
return getEndpoint()
|
|
15
|
+
.post('/authentication/login', params)
|
|
16
|
+
.then(function (r) { return r.data; });
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* Authenticate to Verdocs via client ID / Secret authentication. **NOTE: This is only suitable for
|
|
@@ -22,14 +24,16 @@ export var authenticateUser = function (params) {
|
|
|
22
24
|
*
|
|
23
25
|
* ```typescript
|
|
24
26
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
25
|
-
* import {
|
|
27
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
26
28
|
*
|
|
27
29
|
* const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });
|
|
28
|
-
*
|
|
30
|
+
* Transport.setAuthToken(accessToken);
|
|
29
31
|
* ```
|
|
30
32
|
*/
|
|
31
33
|
export var authenticateApp = function (params) {
|
|
32
|
-
return
|
|
34
|
+
return getEndpoint()
|
|
35
|
+
.post('/authentication/login_client', {}, { headers: params })
|
|
36
|
+
.then(function (r) { return r.data; });
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
35
39
|
* Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,
|
|
@@ -46,20 +50,26 @@ export var authenticateApp = function (params) {
|
|
|
46
50
|
* ```
|
|
47
51
|
*/
|
|
48
52
|
export var validateToken = function (params) {
|
|
49
|
-
return
|
|
53
|
+
return getEndpoint()
|
|
54
|
+
.post('/token/isValid', params)
|
|
55
|
+
.then(function (r) { return r.data; });
|
|
50
56
|
};
|
|
51
57
|
/**
|
|
52
58
|
* If called before the session expires, this will refresh the caller's session and tokens.
|
|
53
59
|
*
|
|
54
60
|
* ```typescript
|
|
55
61
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
56
|
-
* import {
|
|
62
|
+
* import {Transport} from '@verdocs/js-sdk/HTTP';
|
|
57
63
|
*
|
|
58
64
|
* const {accessToken} = await Auth.refreshTokens();
|
|
59
|
-
*
|
|
65
|
+
* Transport.setAuthToken(accessToken);
|
|
60
66
|
* ```
|
|
61
67
|
*/
|
|
62
|
-
export var refreshTokens = function () {
|
|
68
|
+
export var refreshTokens = function () {
|
|
69
|
+
return getEndpoint()
|
|
70
|
+
.get('/token')
|
|
71
|
+
.then(function (r) { return r.data; });
|
|
72
|
+
};
|
|
63
73
|
/**
|
|
64
74
|
* Update the caller's password. To help prevent CSRF attack vectors, the user's old password and email address are required.
|
|
65
75
|
*
|
|
@@ -73,7 +83,9 @@ export var refreshTokens = function () { return Endpoint.get('/token').then(func
|
|
|
73
83
|
* ```
|
|
74
84
|
*/
|
|
75
85
|
export var updatePassword = function (params) {
|
|
76
|
-
return
|
|
86
|
+
return getEndpoint()
|
|
87
|
+
.put('/user/update_password', params)
|
|
88
|
+
.then(function (r) { return r.data; });
|
|
77
89
|
};
|
|
78
90
|
/**
|
|
79
91
|
* Update the caller's email address.
|
|
@@ -85,5 +97,7 @@ export var updatePassword = function (params) {
|
|
|
85
97
|
* ```
|
|
86
98
|
*/
|
|
87
99
|
export var updateEmail = function (params) {
|
|
88
|
-
return
|
|
100
|
+
return getEndpoint()
|
|
101
|
+
.put('/user/update_email', params)
|
|
102
|
+
.then(function (r) { return r.data; });
|
|
89
103
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|