@verdocs/js-sdk 3.10.21 → 3.10.23

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.
@@ -25,10 +25,3 @@ export declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId
25
25
  * Update an organization.
26
26
  */
27
27
  export declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: any) => Promise<IOrganization>;
28
- /**
29
- * Check if an organization name is available. Typically used during the sign-up process. This endpoint is rate-limited
30
- * to prevent abuse. Developers experiencing problems with testing new applications should contact support.
31
- */
32
- export declare const isOrgAvailable: (endpoint: VerdocsEndpoint, name: string) => Promise<{
33
- result: 'TAKEN' | 'AVAILABLE';
34
- }>;
@@ -43,12 +43,3 @@ export var updateOrganization = function (endpoint, organizationId, params) {
43
43
  .patch("/organizations/".concat(organizationId), params)
44
44
  .then(function (r) { return r.data; });
45
45
  };
46
- /**
47
- * Check if an organization name is available. Typically used during the sign-up process. This endpoint is rate-limited
48
- * to prevent abuse. Developers experiencing problems with testing new applications should contact support.
49
- */
50
- export var isOrgAvailable = function (endpoint, name) {
51
- return endpoint.api //
52
- .post('/organizations/check-availability', { name: name }, { baseURL: endpoint.getBaseURLv2() })
53
- .then(function (r) { return r.data; });
54
- };
@@ -4,7 +4,6 @@ export type TEnvironment = 'verdocs' | 'verdocs-stage';
4
4
  export type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;
5
5
  export interface VerdocsEndpointOptions {
6
6
  baseURL?: string;
7
- baseURLv2?: string;
8
7
  timeout?: number;
9
8
  environment?: TEnvironment;
10
9
  sessionType?: TSessionType;
@@ -35,7 +34,6 @@ export declare class VerdocsEndpoint {
35
34
  private environment;
36
35
  private sessionType;
37
36
  private baseURL;
38
- private baseURLv2;
39
37
  private clientID;
40
38
  private timeout;
41
39
  private token;
@@ -72,11 +70,6 @@ export declare class VerdocsEndpoint {
72
70
  * Get the current base URL. This should rarely be anything other than 'https://api.verdocs.com'.
73
71
  */
74
72
  getBaseURL(): string;
75
- /**
76
- * Get the current base URL for the v2 APIs.
77
- * This should rarely be anything other than 'https://api-v2.verdocs.com'.
78
- */
79
- getBaseURLv2(): string;
80
73
  /**
81
74
  * Get the current client ID, if set.
82
75
  */
@@ -128,17 +121,6 @@ export declare class VerdocsEndpoint {
128
121
  * ```
129
122
  */
130
123
  setBaseURL(url: string): VerdocsEndpoint;
131
- /**
132
- * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.
133
- *
134
- * ```typescript
135
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
136
- *
137
- * const endpoint = new VerdocsEndpoint();
138
- * endpoint.setBaseURL('https://api.verdocs.com');
139
- * ```
140
- */
141
- setBaseURLv2(url: string): VerdocsEndpoint;
142
124
  /**
143
125
  * Set the Client ID for Verdocs API calls.
144
126
  *
@@ -47,7 +47,6 @@ var VerdocsEndpoint = /** @class */ (function () {
47
47
  this.baseURL = (window.location.origin === 'https://beta.verdocs.com'
48
48
  ? 'https://stage-api.verdocs.com'
49
49
  : 'https://api.verdocs.com');
50
- this.baseURLv2 = 'https://api-v2.verdocs.com';
51
50
  this.clientID = 'not-set';
52
51
  this.timeout = 60000;
53
52
  this.token = null;
@@ -61,7 +60,6 @@ var VerdocsEndpoint = /** @class */ (function () {
61
60
  */
62
61
  this.session = null;
63
62
  this.baseURL = (options === null || options === void 0 ? void 0 : options.baseURL) || 'https://api.verdocs.com';
64
- this.baseURLv2 = (options === null || options === void 0 ? void 0 : options.baseURLv2) || 'https://api-v2.verdocs.com';
65
63
  this.timeout = (options === null || options === void 0 ? void 0 : options.timeout) || 60000;
66
64
  this.environment = (options === null || options === void 0 ? void 0 : options.environment) || 'verdocs';
67
65
  this.sessionType = (options === null || options === void 0 ? void 0 : options.sessionType) || 'user';
@@ -82,7 +80,7 @@ var VerdocsEndpoint = /** @class */ (function () {
82
80
  VerdocsEndpoint.getDefault = function () {
83
81
  if (!globalThis[ENDPOINT_KEY]) {
84
82
  globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
85
- window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY]);
83
+ window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);
86
84
  }
87
85
  return globalThis[ENDPOINT_KEY];
88
86
  };
@@ -104,13 +102,6 @@ var VerdocsEndpoint = /** @class */ (function () {
104
102
  VerdocsEndpoint.prototype.getBaseURL = function () {
105
103
  return this.baseURL;
106
104
  };
107
- /**
108
- * Get the current base URL for the v2 APIs.
109
- * This should rarely be anything other than 'https://api-v2.verdocs.com'.
110
- */
111
- VerdocsEndpoint.prototype.getBaseURLv2 = function () {
112
- return this.baseURLv2;
113
- };
114
105
  /**
115
106
  * Get the current client ID, if set.
116
107
  */
@@ -178,21 +169,6 @@ var VerdocsEndpoint = /** @class */ (function () {
178
169
  this.api.defaults.baseURL = url;
179
170
  return this;
180
171
  };
181
- /**
182
- * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.
183
- *
184
- * ```typescript
185
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
186
- *
187
- * const endpoint = new VerdocsEndpoint();
188
- * endpoint.setBaseURL('https://api.verdocs.com');
189
- * ```
190
- */
191
- VerdocsEndpoint.prototype.setBaseURLv2 = function (url) {
192
- this.baseURLv2 = url;
193
- // NOTE: We do not set this on the Axios instance because v1 is still the standard.
194
- return this;
195
- };
196
172
  /**
197
173
  * Set the Client ID for Verdocs API calls.
198
174
  *
package/index.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * - Envelopes - An individual document to be signed. Documents are created from templates.
5
5
  * - Organizations - An Organization is a container for user profiles, templates, documents, billing, and other related objects.
6
- * - Search - Various methods used to retrieve lists of documents and templtes.
7
6
  * - Templates - A template for a document containing a PDF file, metadata for signature fields, and other information.
8
7
  * - Users - All operations related to authentication and user-related operations.
9
8
  * - Utils - General support functions used by the other modules and exported for convenience.
@@ -12,7 +11,6 @@
12
11
  */
13
12
  export * as Envelopes from './Envelopes';
14
13
  export * as Organizations from './Organizations';
15
- export * as Search from './Search';
16
14
  export * as Sessions from './Sessions';
17
15
  export * as Templates from './Templates';
18
16
  export * as Users from './Users';
package/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * - Envelopes - An individual document to be signed. Documents are created from templates.
5
5
  * - Organizations - An Organization is a container for user profiles, templates, documents, billing, and other related objects.
6
- * - Search - Various methods used to retrieve lists of documents and templtes.
7
6
  * - Templates - A template for a document containing a PDF file, metadata for signature fields, and other information.
8
7
  * - Users - All operations related to authentication and user-related operations.
9
8
  * - Utils - General support functions used by the other modules and exported for convenience.
@@ -12,7 +11,6 @@
12
11
  */
13
12
  export * as Envelopes from './Envelopes';
14
13
  export * as Organizations from './Organizations';
15
- export * as Search from './Search';
16
14
  export * as Sessions from './Sessions';
17
15
  export * as Templates from './Templates';
18
16
  export * as Users from './Users';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.10.21",
3
+ "version": "3.10.23",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",
@@ -57,6 +57,7 @@
57
57
  "@types/jest": "^29.5.10",
58
58
  "axios-mock-adapter": "^1.22.0",
59
59
  "jest": "^29.5.0",
60
+ "jest-environment-jsdom": "^29.7.0",
60
61
  "prettier": "^3.1.0",
61
62
  "ts-jest": "^29.1.1",
62
63
  "tslint": "^6.1.3",
@@ -1,40 +0,0 @@
1
- /**
2
- * Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended
3
- * to locate items across all content types. More specific retrievals may be performed using the various "list" endpoints within
4
- * each collection (e.g. {@link Envelopes.Envelopes.searchEnvelopes} or {@link Templates.Templates.searchTemplates}).
5
- *
6
- * @module
7
- */
8
- import { ISavedSearch, ISearchHistory, ISearchParams, ISearchResult } from './Types';
9
- import { VerdocsEndpoint } from '../VerdocsEndpoint';
10
- /**
11
- * Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
12
- * type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
13
- *
14
- * ```typescript
15
- * import {Content} from '@verdocs/js-sdk/Search';
16
- *
17
- * const {recent, saved} = await Content.getSearchHistory();
18
- * ```
19
- */
20
- export declare const getSearchHistory: (endpoint: VerdocsEndpoint) => Promise<ISearchHistory>;
21
- /**
22
- * Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.
23
- *
24
- * ```typescript
25
- * import {Content} from '@verdocs/js-sdk/Search';
26
- *
27
- * const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});
28
- * ```
29
- */
30
- export declare const saveSearch: (endpoint: VerdocsEndpoint, name: string, params: ISearchParams) => Promise<ISavedSearch>;
31
- /**
32
- * Search for documents matching various criteria.
33
- *
34
- * ```typescript
35
- * import {Content} from '@verdocs/js-sdk/Search';
36
- *
37
- * const {result, page, total} = await Documents.search({ ... });
38
- * ```
39
- */
40
- export declare const searchContent: (endpoint: VerdocsEndpoint, params: ISearchParams) => Promise<ISearchResult>;
package/Search/Content.js DELETED
@@ -1,92 +0,0 @@
1
- /**
2
- * Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended
3
- * to locate items across all content types. More specific retrievals may be performed using the various "list" endpoints within
4
- * each collection (e.g. {@link Envelopes.Envelopes.searchEnvelopes} or {@link Templates.Templates.searchTemplates}).
5
- *
6
- * @module
7
- */
8
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- var __generator = (this && this.__generator) || function (thisArg, body) {
18
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
19
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
- function verb(n) { return function (v) { return step([n, v]); }; }
21
- function step(op) {
22
- if (f) throw new TypeError("Generator is already executing.");
23
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
24
- 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;
25
- if (y = 0, t) op = [op[0] & 2, t.value];
26
- switch (op[0]) {
27
- case 0: case 1: t = op; break;
28
- case 4: _.label++; return { value: op[1], done: false };
29
- case 5: _.label++; y = op[1]; op = [0]; continue;
30
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
- default:
32
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
- if (t[2]) _.ops.pop();
37
- _.trys.pop(); continue;
38
- }
39
- op = body.call(thisArg, _);
40
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
- }
43
- };
44
- /**
45
- * Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
46
- * type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
47
- *
48
- * ```typescript
49
- * import {Content} from '@verdocs/js-sdk/Search';
50
- *
51
- * const {recent, saved} = await Content.getSearchHistory();
52
- * ```
53
- */
54
- export var getSearchHistory = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {
55
- return __generator(this, function (_a) {
56
- return [2 /*return*/, endpoint.api //
57
- .get('/search/history')
58
- .then(function (r) { return r.data; })];
59
- });
60
- }); };
61
- /**
62
- * Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.
63
- *
64
- * ```typescript
65
- * import {Content} from '@verdocs/js-sdk/Search';
66
- *
67
- * const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});
68
- * ```
69
- */
70
- export var saveSearch = function (endpoint, name, params) { return __awaiter(void 0, void 0, void 0, function () {
71
- return __generator(this, function (_a) {
72
- return [2 /*return*/, endpoint.api //
73
- .post('/search/saved', { name: name, params: params })
74
- .then(function (r) { return r.data; })];
75
- });
76
- }); };
77
- /**
78
- * Search for documents matching various criteria.
79
- *
80
- * ```typescript
81
- * import {Content} from '@verdocs/js-sdk/Search';
82
- *
83
- * const {result, page, total} = await Documents.search({ ... });
84
- * ```
85
- */
86
- export var searchContent = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {
87
- return __generator(this, function (_a) {
88
- return [2 /*return*/, endpoint.api //
89
- .post('/search/content', params)
90
- .then(function (r) { return r.data; })];
91
- });
92
- }); };
package/Search/Types.d.ts DELETED
@@ -1,124 +0,0 @@
1
- import { TTemplateSender } from '../Templates/Types';
2
- import { TEnvelopeStatus } from '../Envelopes/Types';
3
- export type TMimeType = 'application/pdf' | string;
4
- /**
5
- * An individual hit in a document search result. Note that this schema does not precisely match IDocument because fields
6
- * are optimized for search performance.
7
- */
8
- export interface IEnvelopeHit {
9
- type: 'envelope';
10
- id: string;
11
- template_id: string;
12
- name: string;
13
- profile_id: string;
14
- organization_id: string;
15
- organization_name: string;
16
- status: TEnvelopeStatus;
17
- recipient_emails: string[];
18
- recipient_names: string[];
19
- updated_at: string;
20
- canceled_at: string;
21
- file_mime: TMimeType;
22
- file_name: string;
23
- file_page_count: number;
24
- file_url: string;
25
- certificate_mime: TMimeType;
26
- certificate_name: string;
27
- certificate_page_count: number;
28
- certificate_url: string;
29
- }
30
- /**
31
- * An individual hit in a template search result. Note that this schema does not precisely match ITemplate because fields
32
- * are optimized for search performance.
33
- */
34
- export interface ITemplateHit {
35
- type: 'template';
36
- id: string;
37
- name: string;
38
- description: string;
39
- profile_id: string;
40
- organization_id: string;
41
- organization_name: string;
42
- page_count: number;
43
- is_personal: boolean;
44
- is_public: boolean;
45
- sender: TTemplateSender;
46
- counter: number;
47
- star_counter: number;
48
- mime: TMimeType;
49
- file_name: string;
50
- file_url: string;
51
- thumbnail_url: string;
52
- last_used_at: string;
53
- updated_at: string;
54
- tags: [];
55
- }
56
- /**
57
- * An individual hit in an organization search result. Note that this schema does not precisely match IOrganization because fields
58
- * are optimized for search performance.
59
- */
60
- export interface IOrganizationHit {
61
- type: 'organization';
62
- id: string;
63
- name: string;
64
- slug: string;
65
- }
66
- export interface IFacetResultEntry {
67
- count: number;
68
- highlighted: string;
69
- value: string;
70
- }
71
- export interface IFacetResult {
72
- field_name: string;
73
- stats: any;
74
- counts: IFacetResultEntry[];
75
- }
76
- export interface IHit<T> {
77
- document: T;
78
- highlights: any[];
79
- text_match: number;
80
- }
81
- export interface ISearchRequestParams {
82
- collection_name: string;
83
- per_page: number;
84
- q: string;
85
- }
86
- export interface ISearchResultCollection<T> {
87
- facet_counts: IFacetResult[];
88
- page: number;
89
- found: number;
90
- out_of: number;
91
- hits: IHit<T>[];
92
- request_params: ISearchRequestParams;
93
- search_time_ms: number;
94
- }
95
- export interface ISearchResult {
96
- documents: ISearchResultCollection<IEnvelopeHit>;
97
- myTemplates: ISearchResultCollection<ITemplateHit>;
98
- publicTemplates: ISearchResultCollection<ITemplateHit>;
99
- organizations: ISearchResultCollection<IOrganizationHit>;
100
- }
101
- export interface ISearchParams {
102
- q: string;
103
- }
104
- export interface IRecentSearch {
105
- id: string;
106
- created_at: string;
107
- updated_at: string;
108
- profile_id: string;
109
- organization_id: string;
110
- params: ISearchParams;
111
- }
112
- export interface ISavedSearch {
113
- id: string;
114
- created_at: string;
115
- updated_at: string;
116
- profile_id: string;
117
- organization_id: string;
118
- name: string;
119
- params: ISearchParams;
120
- }
121
- export interface ISearchHistory {
122
- recent: IRecentSearch[];
123
- saved: ISavedSearch[];
124
- }
package/Search/Types.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/Search/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * as Content from './Content';
2
- export * as Types from './Types';
package/Search/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * as Content from './Content';
2
- export * as Types from './Types';