docpouch-client 0.8.0 → 0.8.1

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { I_UserEntry, I_UserLogin, I_UserCreation, I_UserUpdate, I_UserDisplay, I_DocumentEntry, I_DataStructure, I_LoginResponse } from "./types.js";
1
+ import type { I_UserEntry, I_UserLogin, I_UserCreation, I_UserUpdate, I_UserDisplay, I_DocumentEntry, I_DataStructure, I_LoginResponse, I_DocumentQuery } from "./types.js";
2
2
  export default class Index {
3
3
  baseUrl: string;
4
4
  private token;
@@ -11,7 +11,7 @@ export default class Index {
11
11
  removeUser(userID: string): Promise<void>;
12
12
  createDocument(document: I_DocumentEntry): Promise<I_DocumentEntry>;
13
13
  listDocuments(): Promise<I_DocumentEntry[]>;
14
- fetchDocument(documentID: string): Promise<I_DocumentEntry>;
14
+ fetchDocument(queryObject: I_DocumentQuery): Promise<I_DocumentEntry[]>;
15
15
  updateDocument(documentID: string, documentData: I_DocumentEntry): Promise<void>;
16
16
  removeDocument(documentID: string): Promise<void>;
17
17
  createStructure(structure: I_DataStructure): Promise<I_DataStructure>;
package/dist/index.js CHANGED
@@ -54,8 +54,8 @@ class Index {
54
54
  async listDocuments() {
55
55
  return await this.request('/docs/list', 'GET');
56
56
  }
57
- async fetchDocument(documentID) {
58
- return await this.request(`/docs/fetch/${documentID}`, 'GET');
57
+ async fetchDocument(queryObject) {
58
+ return await this.request(`/docs/fetch/`, 'GET');
59
59
  }
60
60
  async updateDocument(documentID, documentData) {
61
61
  await this.request(`/docs/update/${documentID}`, 'PATCH', documentData);
package/dist/types.d.ts CHANGED
@@ -39,6 +39,13 @@ export interface I_DocumentCreation {
39
39
  export interface I_DocumentCreationOwned extends I_DocumentCreation {
40
40
  owner: string;
41
41
  }
42
+ export interface I_DocumentQuery {
43
+ _id?: string;
44
+ owner?: string;
45
+ title?: string;
46
+ type?: number;
47
+ subType?: number;
48
+ }
42
49
  export interface I_DataStructure {
43
50
  _id?: string | undefined;
44
51
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docpouch-client",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
- import type {
1
+ import type {
2
2
  I_UserEntry,
3
3
  I_UserLogin,
4
4
  I_UserCreation,
5
5
  I_UserUpdate,
6
- I_UserDisplay,
6
+ I_UserDisplay,
7
7
  I_DocumentEntry,
8
- I_DataStructure,
9
- I_LoginResponse
8
+ I_DataStructure,
9
+ I_LoginResponse, I_DocumentQuery
10
10
  } from "./types.js";
11
11
 
12
12
  export default class Index {
@@ -79,8 +79,8 @@ export default class Index {
79
79
  return await this.request<I_DocumentEntry[]>('/docs/list', 'GET');
80
80
  }
81
81
 
82
- async fetchDocument(documentID: string): Promise<I_DocumentEntry> {
83
- return await this.request<I_DocumentEntry>(`/docs/fetch/${documentID}`, 'GET');
82
+ async fetchDocument(queryObject: I_DocumentQuery): Promise<I_DocumentEntry[]> {
83
+ return await this.request<I_DocumentEntry[]>(`/docs/fetch/`, 'GET');
84
84
  }
85
85
 
86
86
  async updateDocument(documentID: string, documentData: I_DocumentEntry): Promise<void> {
package/src/types.ts CHANGED
@@ -52,6 +52,14 @@ export interface I_DocumentCreationOwned extends I_DocumentCreation {
52
52
  owner: string;
53
53
  }
54
54
 
55
+ export interface I_DocumentQuery {
56
+ _id?: string;
57
+ owner?: string;
58
+ title?: string;
59
+ type?: number;
60
+ subType?: number;
61
+ }
62
+
55
63
  // Structure related types
56
64
  export interface I_DataStructure {
57
65
  _id?: string | undefined;
package/tsconfig.json CHANGED
@@ -14,5 +14,5 @@
14
14
  "emitDeclarationOnly": false,
15
15
  },
16
16
  "include": ["**/*.ts", "**/*.tsx"],
17
- "exclude": ["node_modules", "**/*.test.ts", "**/*.types.ts"]
17
+ "exclude": ["node_modules", "**/*.test.ts", "**/*.types.ts", "./dist/**/*"]
18
18
  }