shred-api-client 1.1.16 → 1.1.18
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.
|
@@ -19,6 +19,11 @@ declare const UserEndpoints: {
|
|
|
19
19
|
method: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
declare enum Role {
|
|
23
|
+
USER = "User",
|
|
24
|
+
EDITOR = "Editor",
|
|
25
|
+
QA = "QA"
|
|
26
|
+
}
|
|
22
27
|
type Preferences = {
|
|
23
28
|
primaryColor?: string;
|
|
24
29
|
secondaryColor?: string;
|
|
@@ -41,5 +46,8 @@ type User = {
|
|
|
41
46
|
subscription?: Subscription;
|
|
42
47
|
invitationCode?: string;
|
|
43
48
|
tenant?: Tenant;
|
|
49
|
+
role?: Role;
|
|
50
|
+
bindedAccounts?: string[];
|
|
51
|
+
isEnabled?: boolean;
|
|
44
52
|
};
|
|
45
|
-
export { User, UserAPISchema, UserEndpoints };
|
|
53
|
+
export { User, UserAPISchema, UserEndpoints, Role };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserEndpoints = void 0;
|
|
3
|
+
exports.Role = exports.UserEndpoints = void 0;
|
|
4
4
|
const UserEndpoints = {
|
|
5
5
|
GetUserInfo: {
|
|
6
6
|
uri: "/api/user/info",
|
|
@@ -16,3 +16,9 @@ const UserEndpoints = {
|
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
exports.UserEndpoints = UserEndpoints;
|
|
19
|
+
var Role;
|
|
20
|
+
(function (Role) {
|
|
21
|
+
Role["USER"] = "User";
|
|
22
|
+
Role["EDITOR"] = "Editor";
|
|
23
|
+
Role["QA"] = "QA";
|
|
24
|
+
})(Role || (exports.Role = Role = {}));
|
package/dist/namespace.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Product as TProduct, Subscription as TSubscription } from "./model/Subscription.schema";
|
|
2
|
-
import { User as TUser } from "./model/User.schema";
|
|
2
|
+
import { User as TUser, Role as TRole } from "./model/User.schema";
|
|
3
3
|
import { Prompt as TPrompt, Script as TScript, Category as TCategory } from "./model/Prompt.schema";
|
|
4
4
|
export declare namespace Shred {
|
|
5
5
|
type Product = TProduct;
|
|
6
6
|
type Subscription = TSubscription;
|
|
7
7
|
type User = TUser;
|
|
8
|
+
type Role = TRole;
|
|
8
9
|
namespace PromptTypes {
|
|
9
10
|
type Prompt = TPrompt;
|
|
10
11
|
type Script = TScript;
|
package/dist/util/HTTPClient.js
CHANGED
|
@@ -23,13 +23,15 @@ class HTTPClient {
|
|
|
23
23
|
url: host + uri,
|
|
24
24
|
headers: {
|
|
25
25
|
Authorization: (context === null || context === void 0 ? void 0 : context.token) && `Bearer ${context.token}`,
|
|
26
|
-
"X-Request-ID": (context === null || context === void 0 ? void 0 : context.requestId) && context.requestId,
|
|
26
|
+
"X-Request-ID": ((context === null || context === void 0 ? void 0 : context.requestId) && context.requestId) || "",
|
|
27
27
|
"Content-Type": useLegacyApi
|
|
28
28
|
? "application/x-www-form-urlencoded"
|
|
29
29
|
: "application/json",
|
|
30
30
|
},
|
|
31
|
-
data,
|
|
32
31
|
};
|
|
32
|
+
if (method !== "GET" && data) {
|
|
33
|
+
config.data = data;
|
|
34
|
+
}
|
|
33
35
|
try {
|
|
34
36
|
const response = await (0, axios_1.default)(config);
|
|
35
37
|
return response.data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shred-api-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"description": "API Client for Shred",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"author": "Marcus Cartágenes",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"axios": "
|
|
18
|
+
"axios": "1.7.2",
|
|
19
19
|
"winston": "^3.13.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|