shred-api-client 2.0.0 → 2.0.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/api/Note.api.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Environment from "../model/Env";
|
|
2
|
+
import Context from "../model/Context";
|
|
3
|
+
import * as Note from "../model/note";
|
|
4
|
+
declare class NoteAPI implements Note.IAPI {
|
|
5
|
+
private env;
|
|
6
|
+
private clientHTTP;
|
|
7
|
+
constructor(env: Environment);
|
|
8
|
+
list(c: Context, userId: string): Promise<Note.Entity[]>;
|
|
9
|
+
add(c: Context, note: Partial<Note.Entity>): Promise<Note.Entity>;
|
|
10
|
+
update(c: Context, id: string, toUpdate: Partial<Note.Entity>): Promise<Note.Entity>;
|
|
11
|
+
delete(c: Context, id: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
export default NoteAPI;
|
package/dist/api/Note.api.js
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const HTTPClient_1 = __importDefault(require("../util/HTTPClient"));
|
|
30
|
+
const Note = __importStar(require("../model/note"));
|
|
31
|
+
class NoteAPI {
|
|
32
|
+
constructor(env) {
|
|
33
|
+
this.env = env;
|
|
34
|
+
this.clientHTTP = new HTTPClient_1.default();
|
|
35
|
+
}
|
|
36
|
+
async list(c, userId) {
|
|
37
|
+
const endpointData = Note.Endpoints.GetNotes;
|
|
38
|
+
const endpoint = endpointData.uri.replace(":userId", userId);
|
|
39
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, null, c);
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
async add(c, note) {
|
|
43
|
+
const endpointData = Note.Endpoints.AddNote;
|
|
44
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, note, c);
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
async update(c, id, toUpdate) {
|
|
48
|
+
const endpointData = Note.Endpoints.UpdateNote;
|
|
49
|
+
const endpoint = endpointData.uri.replace(":id", id);
|
|
50
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, toUpdate, c);
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
async delete(c, id) {
|
|
54
|
+
const endpointData = Note.Endpoints.DeleteNote;
|
|
55
|
+
const endpoint = endpointData.uri.replace(":id", id);
|
|
56
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, null, c);
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = NoteAPI;
|
package/dist/model/Api.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import * as Project from "./../model/project";
|
|
|
9
9
|
import * as Goal from "./../model/goal";
|
|
10
10
|
import * as Notification from "./../model/notification";
|
|
11
11
|
import * as AppConfig from "./../model/app-config";
|
|
12
|
+
import * as Note from "./../model/note";
|
|
12
13
|
export declare class ShredAPI {
|
|
13
14
|
user: User.IAPI;
|
|
14
15
|
goal: Goal.IAPI;
|
|
@@ -20,5 +21,6 @@ export declare class ShredAPI {
|
|
|
20
21
|
app: AppConfig.IAPI;
|
|
21
22
|
project: Project.IAPI;
|
|
22
23
|
track: Track.IAPI;
|
|
24
|
+
note: Note.IAPI;
|
|
23
25
|
constructor(env: Environment);
|
|
24
26
|
}
|
package/dist/model/Api.js
CHANGED
|
@@ -14,6 +14,7 @@ const Email_api_1 = __importDefault(require("../api/Email.api"));
|
|
|
14
14
|
const Project_api_1 = __importDefault(require("../api/Project.api"));
|
|
15
15
|
const Goal_api_1 = __importDefault(require("../api/Goal.api"));
|
|
16
16
|
const AppConfig_api_1 = __importDefault(require("../api/AppConfig.api"));
|
|
17
|
+
const Note_api_1 = __importDefault(require("../api/Note.api"));
|
|
17
18
|
class ShredAPI {
|
|
18
19
|
constructor(env) {
|
|
19
20
|
this.user = new User_api_1.default(env);
|
|
@@ -26,6 +27,7 @@ class ShredAPI {
|
|
|
26
27
|
this.project = new Project_api_1.default(env);
|
|
27
28
|
this.app = new AppConfig_api_1.default(env);
|
|
28
29
|
this.track = new Track_api_1.default(env);
|
|
30
|
+
this.note = new Note_api_1.default(env);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
exports.ShredAPI = ShredAPI;
|
|
@@ -3,7 +3,7 @@ import { Note } from "./Note.schema";
|
|
|
3
3
|
export interface IAPI {
|
|
4
4
|
list: (c: Context, userId: string) => Promise<Note[]>;
|
|
5
5
|
add: (c: Context, note: Note) => Promise<Note>;
|
|
6
|
-
update: (c: Context, script: Partial<Note>) => Promise<Note>;
|
|
6
|
+
update: (c: Context, id: string, script: Partial<Note>) => Promise<Note>;
|
|
7
7
|
delete: (c: Context, id: string) => Promise<boolean>;
|
|
8
8
|
}
|
|
9
9
|
export declare const Endpoints: {
|
package/dist/model/note/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.NoteHistorySchema = exports.NoteSchema = void 0;
|
|
4
18
|
var Note_schema_1 = require("./Note.schema");
|
|
5
19
|
Object.defineProperty(exports, "NoteSchema", { enumerable: true, get: function () { return Note_schema_1.NoteSchema; } });
|
|
6
20
|
Object.defineProperty(exports, "NoteHistorySchema", { enumerable: true, get: function () { return Note_schema_1.NoteHistorySchema; } });
|
|
21
|
+
__exportStar(require("./Note.api"), exports);
|