shred-api-client 1.1.6 → 1.1.8
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Context from "../src/model/Context";
|
|
2
|
+
import { Prompt, PromptAPISchema } from "../src/model/Prompt.schema";
|
|
3
|
+
declare class PromptAPI implements PromptAPISchema {
|
|
4
|
+
private clientHTTP;
|
|
5
|
+
constructor();
|
|
6
|
+
getPrompt(context: Context): Promise<Prompt>;
|
|
7
|
+
}
|
|
8
|
+
export default PromptAPI;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const HTTPClient_1 = __importDefault(require("../util/HTTPClient"));
|
|
7
|
+
const Prompt_schema_1 = require("../src/model/Prompt.schema");
|
|
8
|
+
class PromptAPI {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.clientHTTP = new HTTPClient_1.default();
|
|
11
|
+
}
|
|
12
|
+
async getPrompt(context) {
|
|
13
|
+
const endpointInfo = Prompt_schema_1.PromptEndpoints.GetPrompt;
|
|
14
|
+
const data = await this.clientHTTP.makeRequest(endpointInfo.uri, endpointInfo.method, context);
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = PromptAPI;
|
package/dist/model/Api.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { PromptAPISchema } from "./Prompt.schema";
|
|
1
2
|
import { SubscriptionAPISchema } from "./Subscription.schema";
|
|
2
3
|
import { UserAPISchema } from "./User.schema";
|
|
3
4
|
export declare class ShredAPI {
|
|
4
5
|
user: UserAPISchema;
|
|
5
6
|
subscription: SubscriptionAPISchema;
|
|
7
|
+
prompt: PromptAPISchema;
|
|
6
8
|
constructor();
|
|
7
9
|
}
|
package/dist/model/Api.js
CHANGED
|
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ShredAPI = void 0;
|
|
7
|
+
const Prompt_api_1 = __importDefault(require("../src/api/Prompt.api"));
|
|
7
8
|
const Subscription_api_1 = __importDefault(require("../api/Subscription.api"));
|
|
8
9
|
const User_api_1 = __importDefault(require("../api/User.api"));
|
|
9
10
|
class ShredAPI {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.user = new User_api_1.default();
|
|
13
|
+
this.prompt = new Prompt_api_1.default();
|
|
12
14
|
this.subscription = new Subscription_api_1.default();
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Context from "./Context";
|
|
2
|
+
interface PromptAPISchema {
|
|
3
|
+
getPrompt: (c: Context) => Promise<Prompt>;
|
|
4
|
+
}
|
|
5
|
+
declare const PromptEndpoints: {
|
|
6
|
+
GetPrompt: {
|
|
7
|
+
uri: string;
|
|
8
|
+
method: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type Script = {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
16
|
+
type Category = {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
pictureUrl: string;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
active: boolean;
|
|
22
|
+
scripts: Script[];
|
|
23
|
+
};
|
|
24
|
+
type Prompt = {
|
|
25
|
+
id: string;
|
|
26
|
+
tenantId: string;
|
|
27
|
+
categories: Category[];
|
|
28
|
+
};
|
|
29
|
+
export { PromptAPISchema, Prompt, PromptEndpoints };
|
package/dist/namespace.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Product as TProduct, Subscription as TSubscription } from "./model/Subscription.schema";
|
|
2
2
|
import { User as TUser } from "./model/User.schema";
|
|
3
|
+
import { Prompt as TPrompt } from "./model/Prompt.schema";
|
|
3
4
|
export declare namespace Shred {
|
|
4
5
|
type Product = TProduct;
|
|
5
6
|
type Subscription = TSubscription;
|
|
7
|
+
type Prompt = TPrompt;
|
|
6
8
|
type User = TUser;
|
|
7
9
|
}
|