@verdocs/js-sdk 3.10.21 → 3.10.22

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.
@@ -82,7 +82,7 @@ var VerdocsEndpoint = /** @class */ (function () {
82
82
  VerdocsEndpoint.getDefault = function () {
83
83
  if (!globalThis[ENDPOINT_KEY]) {
84
84
  globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();
85
- window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY]);
85
+ window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);
86
86
  }
87
87
  return globalThis[ENDPOINT_KEY];
88
88
  };
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.22",
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';