jourycms-sdk 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/base.app-container.d.ts +7 -0
- package/dist/base.app-container.d.ts.map +1 -0
- package/dist/base.app-container.js +10 -0
- package/dist/base.client.d.ts +10 -0
- package/dist/base.client.d.ts.map +1 -0
- package/dist/base.client.js +16 -0
- package/dist/base.service-container.d.ts +8 -0
- package/dist/base.service-container.d.ts.map +1 -0
- package/dist/base.service-container.js +12 -0
- package/dist/containers/auth/clients/api-keys.client.d.ts +13 -0
- package/dist/containers/auth/clients/api-keys.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/api-keys.client.js +48 -0
- package/dist/containers/auth/clients/auth.client.d.ts +12 -0
- package/dist/containers/auth/clients/auth.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/auth.client.js +39 -0
- package/dist/containers/auth/clients/permission-groups.client.d.ts +12 -0
- package/dist/containers/auth/clients/permission-groups.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/permission-groups.client.js +42 -0
- package/dist/containers/auth/clients/permissions.client.d.ts +13 -0
- package/dist/containers/auth/clients/permissions.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/permissions.client.js +48 -0
- package/dist/containers/auth/clients/roles.client.d.ts +17 -0
- package/dist/containers/auth/clients/roles.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/roles.client.js +72 -0
- package/dist/containers/auth/clients/users.client.d.ts +26 -0
- package/dist/containers/auth/clients/users.client.d.ts.map +1 -0
- package/dist/containers/auth/clients/users.client.js +128 -0
- package/dist/containers/auth/service-container.d.ts +23 -0
- package/dist/containers/auth/service-container.d.ts.map +1 -0
- package/dist/containers/auth/service-container.js +48 -0
- package/dist/containers/content/clients/article-types.client.d.ts +15 -0
- package/dist/containers/content/clients/article-types.client.d.ts.map +1 -0
- package/dist/containers/content/clients/article-types.client.js +60 -0
- package/dist/containers/content/clients/articles.client.d.ts +15 -0
- package/dist/containers/content/clients/articles.client.d.ts.map +1 -0
- package/dist/containers/content/clients/articles.client.js +60 -0
- package/dist/containers/content/clients/comments.client.d.ts +15 -0
- package/dist/containers/content/clients/comments.client.d.ts.map +1 -0
- package/dist/containers/content/clients/comments.client.js +60 -0
- package/dist/containers/content/clients/reviews.client.d.ts +15 -0
- package/dist/containers/content/clients/reviews.client.d.ts.map +1 -0
- package/dist/containers/content/clients/reviews.client.js +60 -0
- package/dist/containers/content/clients/taxonomies.client.d.ts +15 -0
- package/dist/containers/content/clients/taxonomies.client.d.ts.map +1 -0
- package/dist/containers/content/clients/taxonomies.client.js +60 -0
- package/dist/containers/content/clients/terms.client.d.ts +15 -0
- package/dist/containers/content/clients/terms.client.d.ts.map +1 -0
- package/dist/containers/content/clients/terms.client.js +60 -0
- package/dist/containers/content/clients/translation.items.client.d.ts +16 -0
- package/dist/containers/content/clients/translation.items.client.d.ts.map +1 -0
- package/dist/containers/content/clients/translation.items.client.js +66 -0
- package/dist/containers/content/clients/translation.namespaces.client.d.ts +16 -0
- package/dist/containers/content/clients/translation.namespaces.client.d.ts.map +1 -0
- package/dist/containers/content/clients/translation.namespaces.client.js +66 -0
- package/dist/containers/content/clients/translation.projects.client.d.ts +16 -0
- package/dist/containers/content/clients/translation.projects.client.d.ts.map +1 -0
- package/dist/containers/content/clients/translation.projects.client.js +66 -0
- package/dist/containers/content/service-container.d.ts +29 -0
- package/dist/containers/content/service-container.d.ts.map +1 -0
- package/dist/containers/content/service-container.js +66 -0
- package/dist/containers/storage/clients/files.client.d.ts +13 -0
- package/dist/containers/storage/clients/files.client.d.ts.map +1 -0
- package/dist/containers/storage/clients/files.client.js +48 -0
- package/dist/containers/storage/clients/uploader.client.d.ts +6 -0
- package/dist/containers/storage/clients/uploader.client.d.ts.map +1 -0
- package/dist/containers/storage/clients/uploader.client.js +12 -0
- package/dist/containers/storage/clients/utils.client.d.ts +15 -0
- package/dist/containers/storage/clients/utils.client.d.ts.map +1 -0
- package/dist/containers/storage/clients/utils.client.js +45 -0
- package/dist/containers/storage/service-container.d.ts +31 -0
- package/dist/containers/storage/service-container.d.ts.map +1 -0
- package/dist/containers/storage/service-container.js +63 -0
- package/dist/containers/system/clients/apps.client.d.ts +16 -0
- package/dist/containers/system/clients/apps.client.d.ts.map +1 -0
- package/dist/containers/system/clients/apps.client.js +66 -0
- package/dist/containers/system/service-container.d.ts +13 -0
- package/dist/containers/system/service-container.d.ts.map +1 -0
- package/dist/containers/system/service-container.js +18 -0
- package/dist/exceptions/api-response.exception.d.ts +15 -0
- package/dist/exceptions/api-response.exception.d.ts.map +1 -0
- package/dist/exceptions/api-response.exception.js +26 -0
- package/dist/http-client.d.ts +20 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +187 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +237 -0
- package/dist/init-sdk.d.ts +21 -0
- package/dist/init-sdk.d.ts.map +1 -0
- package/dist/init-sdk.js +17 -0
- package/dist/sdk.test.d.ts +1 -0
- package/dist/sdk.test.d.ts.map +1 -0
- package/dist/sdk.test.js +1 -0
- package/dist/utils/helpers.d.ts +5 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +13 -0
- package/dist/utils/logger.d.ts +133 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +176 -0
- package/package.json +49 -0
- package/typings/index.d.ts +1 -0
- package/typings/v1/cache-manager/class.d.ts +0 -0
- package/typings/v1/cache-manager/entity.d.ts +83 -0
- package/typings/v1/cache-manager/index.d.ts +5 -0
- package/typings/v1/cache-manager/store.d.ts +35 -0
- package/typings/v1/events/index.d.ts +3 -0
- package/typings/v1/events/payloads.d.ts +339 -0
- package/typings/v1/index.d.ts +8 -0
- package/typings/v1/lib/execution-scenario/index.d.ts +27 -0
- package/typings/v1/lib/index.d.ts +4 -0
- package/typings/v1/lib/logger/index.d.ts +3 -0
- package/typings/v1/lib/logger/logger.d.ts +53 -0
- package/typings/v1/modules/express/express.d.ts +40 -0
- package/typings/v1/modules/express/index.d.ts +3 -0
- package/typings/v1/modules/index.d.ts +4 -0
- package/typings/v1/modules/mongoose/index.d.ts +3 -0
- package/typings/v1/modules/mongoose/mongoose.d.ts +48 -0
- package/typings/v1/sdk/index.d.ts +3 -0
- package/typings/v1/sdk/sdk.d.ts +158 -0
- package/typings/v1/security/auth-data.d.ts +36 -0
- package/typings/v1/security/index.d.ts +4 -0
- package/typings/v1/security/jwt.d.ts +36 -0
- package/typings/v1/services/auth/api/api-key.d.ts +144 -0
- package/typings/v1/services/auth/api/auth.d.ts +168 -0
- package/typings/v1/services/auth/api/index.d.ts +9 -0
- package/typings/v1/services/auth/api/permission-group.d.ts +95 -0
- package/typings/v1/services/auth/api/permission.d.ts +128 -0
- package/typings/v1/services/auth/api/role.d.ts +193 -0
- package/typings/v1/services/auth/api/tools.d.ts +33 -0
- package/typings/v1/services/auth/api/user.d.ts +391 -0
- package/typings/v1/services/auth/entities/_shared.d.ts +11 -0
- package/typings/v1/services/auth/entities/api-key.d.ts +29 -0
- package/typings/v1/services/auth/entities/federated-credential.d.ts +22 -0
- package/typings/v1/services/auth/entities/index.d.ts +9 -0
- package/typings/v1/services/auth/entities/permission-group.d.ts +20 -0
- package/typings/v1/services/auth/entities/permission.d.ts +24 -0
- package/typings/v1/services/auth/entities/role.d.ts +25 -0
- package/typings/v1/services/auth/entities/user.d.ts +153 -0
- package/typings/v1/services/auth/index.d.ts +5 -0
- package/typings/v1/services/auth/models/.DS_Store +0 -0
- package/typings/v1/services/auth/models/api-key.d.ts +19 -0
- package/typings/v1/services/auth/models/api-key.model.d.ts +3 -0
- package/typings/v1/services/auth/models/federated-credential.d.ts +24 -0
- package/typings/v1/services/auth/models/index.d.ts +9 -0
- package/typings/v1/services/auth/models/permission-group.d.ts +24 -0
- package/typings/v1/services/auth/models/permission.d.ts +22 -0
- package/typings/v1/services/auth/models/role.d.ts +22 -0
- package/typings/v1/services/auth/models/user.d.ts +22 -0
- package/typings/v1/services/content/api/article-type.d.ts +160 -0
- package/typings/v1/services/content/api/article.d.ts +108 -0
- package/typings/v1/services/content/api/comment.d.ts +106 -0
- package/typings/v1/services/content/api/index.d.ts +12 -0
- package/typings/v1/services/content/api/review.d.ts +105 -0
- package/typings/v1/services/content/api/taxonomy.d.ts +101 -0
- package/typings/v1/services/content/api/term.d.ts +101 -0
- package/typings/v1/services/content/api/translation.item.d.ts +195 -0
- package/typings/v1/services/content/api/translation.namespace.d.ts +135 -0
- package/typings/v1/services/content/api/translation.project.d.ts +196 -0
- package/typings/v1/services/content/api/translation.tools.d.ts +85 -0
- package/typings/v1/services/content/entities/article-type.d.ts +51 -0
- package/typings/v1/services/content/entities/article.d.ts +53 -0
- package/typings/v1/services/content/entities/comment.d.ts +34 -0
- package/typings/v1/services/content/entities/index.d.ts +11 -0
- package/typings/v1/services/content/entities/review.d.ts +35 -0
- package/typings/v1/services/content/entities/taxonomy.d.ts +40 -0
- package/typings/v1/services/content/entities/term.d.ts +43 -0
- package/typings/v1/services/content/entities/translation.item.d.ts +48 -0
- package/typings/v1/services/content/entities/translation.namespace.d.ts +29 -0
- package/typings/v1/services/content/entities/translation.project.d.ts +98 -0
- package/typings/v1/services/content/index.d.ts +5 -0
- package/typings/v1/services/content/models/article-type.d.ts +19 -0
- package/typings/v1/services/content/models/article.d.ts +19 -0
- package/typings/v1/services/content/models/comment.d.ts +19 -0
- package/typings/v1/services/content/models/index.d.ts +11 -0
- package/typings/v1/services/content/models/review.d.ts +19 -0
- package/typings/v1/services/content/models/taxonomy.d.ts +19 -0
- package/typings/v1/services/content/models/term.d.ts +19 -0
- package/typings/v1/services/content/models/translation.item.d.ts +21 -0
- package/typings/v1/services/content/models/translation.namespace.d.ts +22 -0
- package/typings/v1/services/content/models/translation.project.d.ts +21 -0
- package/typings/v1/services/index.d.ts +4 -0
- package/typings/v1/services/storage/api/index.d.ts +3 -0
- package/typings/v1/services/storage/api/uploaded-file.d.ts +166 -0
- package/typings/v1/services/storage/entities/index.d.ts +3 -0
- package/typings/v1/services/storage/entities/uploaded-file.d.ts +49 -0
- package/typings/v1/services/storage/index.d.ts +5 -0
- package/typings/v1/services/storage/models/index.d.ts +3 -0
- package/typings/v1/services/storage/models/uploaded-file.d.ts +19 -0
- package/typings/v1/services/system/api/app.d.ts +130 -0
- package/typings/v1/services/system/api/index.d.ts +3 -0
- package/typings/v1/services/system/entities/app.d.ts +97 -0
- package/typings/v1/services/system/entities/index.d.ts +3 -0
- package/typings/v1/services/system/index.d.ts +5 -0
- package/typings/v1/services/system/models/app.d.ts +19 -0
- package/typings/v1/services/system/models/index.d.ts +3 -0
- package/typings/v1/ui/admin/index.d.ts +1 -0
- package/typings/v1/ui/forms/article/custom-fieds/custom-field.d.ts +189 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/article_object.custom-field.d.ts +29 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/boolean.custom-field.d.ts +24 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/checkbox.custom-field.d.ts +26 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/date.custom-field.d.ts +23 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/date_range.custom-field.d.ts +26 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/file.custom-field.d.ts +26 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/image.custom-field.d.ts +25 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/index.d.ts +11 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/number.custom-field.d.ts +26 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/radiobox.custom-field.d.ts +27 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/select.custom-field.d.ts +27 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/text.custom-field.d.ts +26 -0
- package/typings/v1/ui/forms/article/custom-fieds/fields/time.custom-field.d.ts +24 -0
- package/typings/v1/ui/forms/article/custom-fieds/index.d.ts +1 -0
- package/typings/v1/ui/forms/article/index.d.ts +1 -0
- package/typings/v1/ui/forms/index.d.ts +1 -0
- package/typings/v1/ui/index.d.ts +3 -0
- package/typings/v1/ui/routes/index.d.ts +1 -0
- package/typings/v1/ui/routes/routes.d.ts +73 -0
- package/typings/v1/utils/api/index.d.ts +4 -0
- package/typings/v1/utils/api/request.d.ts +215 -0
- package/typings/v1/utils/api/response.d.ts +188 -0
- package/typings/v1/utils/common/common.d.ts +53 -0
- package/typings/v1/utils/common/index.d.ts +3 -0
- package/typings/v1/utils/dev/config.d.ts +135 -0
- package/typings/v1/utils/dev/index.d.ts +4 -0
- package/typings/v1/utils/dev/instrumentation.d.ts +41 -0
- package/typings/v1/utils/entities/entities.d.ts +66 -0
- package/typings/v1/utils/entities/index.d.ts +4 -0
- package/typings/v1/utils/entities/snapshots.d.ts +69 -0
- package/typings/v1/utils/index.d.ts +10 -0
- package/typings/v1/utils/models/index.d.ts +3 -0
- package/typings/v1/utils/models/models.d.ts +50 -0
- package/typings/v1/utils/seed/index.d.ts +3 -0
- package/typings/v1/utils/seed/locations.d.ts +41 -0
- package/typings/v1/utils/system/microservice.d.ts +11 -0
- package/typings/v1/utils/system/models.d.ts +21 -0
- package/typings/v1/utils/utils.d.ts +171 -0
@@ -0,0 +1,158 @@
|
|
1
|
+
import {
|
2
|
+
AxiosHeaderValue,
|
3
|
+
AxiosRequestConfig,
|
4
|
+
AxiosResponse,
|
5
|
+
AxiosInstance,
|
6
|
+
} from "axios";
|
7
|
+
|
8
|
+
|
9
|
+
declare global {
|
10
|
+
namespace Levelup {
|
11
|
+
|
12
|
+
namespace CMS {
|
13
|
+
namespace V1 {
|
14
|
+
|
15
|
+
namespace SDK {
|
16
|
+
|
17
|
+
interface ISdk {
|
18
|
+
generateHeadersFromRequestConfig(config?: TRequestConfig): { [key: string]: AxiosHeaderValue; }
|
19
|
+
|
20
|
+
handleError(err: any): IError;
|
21
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
22
|
+
handleResponse<T extends SDK.IResponse>(response: AxiosResponse<T, any>, callback: Function, path: string, ...args: any[]): Promise<SDK.TResponseDatum<T>>;
|
23
|
+
reinitRequestCount(): void;
|
24
|
+
incrementRequestCount(): void;
|
25
|
+
getRequestCount(): number
|
26
|
+
readonly httpClient: IHttpClient;
|
27
|
+
readonly config: ISdkConfig;
|
28
|
+
}
|
29
|
+
|
30
|
+
interface ISdkConfig {
|
31
|
+
baseURL: string;
|
32
|
+
appId: string;
|
33
|
+
appSecret: string;
|
34
|
+
logResponses?: boolean;
|
35
|
+
env?: TEnvironment;
|
36
|
+
headers: () => { [key: string]: string } | PromiseLike<{ [key: string]: string }>;
|
37
|
+
refreshTokenHandler?: (sdk: ISdk) => Promise<void>;
|
38
|
+
debug: boolean;
|
39
|
+
}
|
40
|
+
|
41
|
+
type TRequestConfig = {
|
42
|
+
token?: string;
|
43
|
+
app?: string;
|
44
|
+
company?: string;
|
45
|
+
office?: string;
|
46
|
+
store?: string;
|
47
|
+
} & ({
|
48
|
+
serviceName: string;
|
49
|
+
serviceToken: string;
|
50
|
+
} | {
|
51
|
+
serviceName?: never;
|
52
|
+
serviceToken?: never;
|
53
|
+
}) & {
|
54
|
+
throw_not_found_error?: boolean;
|
55
|
+
};
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
interface IAppContainer {
|
60
|
+
readonly sdk: ISdk;
|
61
|
+
}
|
62
|
+
|
63
|
+
interface IServiceContainer {
|
64
|
+
readonly sdk: ISdk;
|
65
|
+
readonly prefix: string;
|
66
|
+
}
|
67
|
+
|
68
|
+
interface IClient {
|
69
|
+
// readonly prefix: string;
|
70
|
+
}
|
71
|
+
|
72
|
+
type TEnvironment = "production" | "development";
|
73
|
+
type PathPrefix = '' | `/${string}`;
|
74
|
+
|
75
|
+
type TResponseDatum<T extends { data?: object | Array<object>; } & Levelup.V2.Utils.Api.Response.DefaultResponse & Levelup.V2.Utils.Api.Response.PagedResponse> =
|
76
|
+
Levelup.V2.Utils.NonUndefined<T['data']> extends Array<any> ? {
|
77
|
+
data: Levelup.V2.Utils.NonUndefined<T['data']>;
|
78
|
+
edge: Levelup.V2.Utils.NonUndefined<T['edge']>;
|
79
|
+
pagination?: Levelup.V2.Utils.NonUndefined<Levelup.V2.Utils.Api.Response.PagedResponse['pagination']>;
|
80
|
+
} : {
|
81
|
+
data: Levelup.V2.Utils.NonUndefined<T['data']>;
|
82
|
+
edge: Levelup.V2.Utils.NonUndefined<T['edge']>;
|
83
|
+
};
|
84
|
+
|
85
|
+
type IResponse = {
|
86
|
+
data?: any;
|
87
|
+
edge?: any;
|
88
|
+
error?: Levelup.V2.Utils.Api.Response.Error;
|
89
|
+
} & Levelup.V2.Utils.Api.Response.PagedResponse;
|
90
|
+
|
91
|
+
type IError = Error & object;
|
92
|
+
|
93
|
+
interface IHttpClient {
|
94
|
+
get axios(): AxiosInstance;
|
95
|
+
request<T extends IResponse, D = any>(
|
96
|
+
config: AxiosRequestConfig<D>
|
97
|
+
): Promise<SDK.TResponseDatum<T>>;
|
98
|
+
get<T extends IResponse, D = any>(
|
99
|
+
path: string,
|
100
|
+
query?: object,
|
101
|
+
config?: AxiosRequestConfig<D>
|
102
|
+
): Promise<SDK.TResponseDatum<T>>;
|
103
|
+
delete<T extends SDK.IResponse, D = any>(
|
104
|
+
path: string,
|
105
|
+
query?: object,
|
106
|
+
config?: AxiosRequestConfig<D>
|
107
|
+
): Promise<SDK.TResponseDatum<T>>;
|
108
|
+
head<T extends SDK.IResponse>(
|
109
|
+
path: string,
|
110
|
+
query: object
|
111
|
+
): Promise<SDK.TResponseDatum<T>>;
|
112
|
+
options<T extends SDK.IResponse>(
|
113
|
+
path: string,
|
114
|
+
query: object
|
115
|
+
): Promise<SDK.TResponseDatum<T>>;
|
116
|
+
post<T extends SDK.IResponse, D = any>(
|
117
|
+
path: string,
|
118
|
+
data?: D,
|
119
|
+
config?: AxiosRequestConfig<D>
|
120
|
+
): Promise<SDK.TResponseDatum<T>>;
|
121
|
+
put<T extends SDK.IResponse, D = any>(
|
122
|
+
path: string,
|
123
|
+
data?: D,
|
124
|
+
config?: AxiosRequestConfig<D>
|
125
|
+
): Promise<SDK.TResponseDatum<T>>;
|
126
|
+
patch<T extends SDK.IResponse, D = any>(
|
127
|
+
path: string,
|
128
|
+
data?: D,
|
129
|
+
config?: AxiosRequestConfig<D>
|
130
|
+
): Promise<SDK.TResponseDatum<T>>;
|
131
|
+
postForm<T extends SDK.IResponse, D = any>(
|
132
|
+
path: string,
|
133
|
+
data?: D,
|
134
|
+
config?: AxiosRequestConfig<D>
|
135
|
+
): Promise<SDK.TResponseDatum<T>>;
|
136
|
+
putForm<T extends SDK.IResponse, D = any>(
|
137
|
+
path: string,
|
138
|
+
data?: D,
|
139
|
+
config?: AxiosRequestConfig<D>
|
140
|
+
): Promise<SDK.TResponseDatum<T>>;
|
141
|
+
patchForm<T extends SDK.IResponse, D = any>(
|
142
|
+
path: string,
|
143
|
+
data?: D,
|
144
|
+
config?: AxiosRequestConfig<D>
|
145
|
+
): Promise<SDK.TResponseDatum<T>>;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
type TResponseDatum<T extends { data?: object | Array<object>; }> = {
|
154
|
+
data: T['data'];
|
155
|
+
edge: T['edge'];
|
156
|
+
pagination: T['data'] extends Array ? boolean : never;
|
157
|
+
|
158
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Request } from "express";
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
namespace Levelup {
|
5
|
+
namespace CMS {
|
6
|
+
namespace V1 {
|
7
|
+
namespace Security {
|
8
|
+
export type AuthData = {
|
9
|
+
/**
|
10
|
+
* @description the properties parsed from the request
|
11
|
+
*/
|
12
|
+
current?: {
|
13
|
+
token?: string;
|
14
|
+
app?: Levelup.V2.System.Entity.App | null;
|
15
|
+
user?: Levelup.V2.Users.Entity.User | null;
|
16
|
+
api_key?: Levelup.V2.Auth.Entity.ExposedApiKey | null;
|
17
|
+
service?: {
|
18
|
+
name: string;
|
19
|
+
is_external: boolean;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* @description the properties collected from the current item
|
24
|
+
*/
|
25
|
+
attributed?: {
|
26
|
+
user: Utils.Entity.Snapshots.Auth.User | null;
|
27
|
+
};
|
28
|
+
|
29
|
+
req?: () => Request;
|
30
|
+
isServiceRequest?: () => boolean;
|
31
|
+
} | null;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* @description project levelup
|
4
|
+
* @version 2.0.0
|
5
|
+
* @namespace Levelup
|
6
|
+
* @global
|
7
|
+
* @export Levelup
|
8
|
+
* @copyright drsalmi@icloud.com
|
9
|
+
* @name Salmi Ahmed
|
10
|
+
*/
|
11
|
+
|
12
|
+
|
13
|
+
declare module Levelup {
|
14
|
+
|
15
|
+
namespace CMS {
|
16
|
+
namespace V1 {
|
17
|
+
namespace Security {
|
18
|
+
|
19
|
+
export type JWTPaymentAuthPayload = {
|
20
|
+
_id: string;
|
21
|
+
tracking_id: string;
|
22
|
+
role: string;
|
23
|
+
space: Levelup.V2.Auth.Entity.TJWTTokenSpace;
|
24
|
+
}
|
25
|
+
|
26
|
+
export type JWTUserAuthPayload = {
|
27
|
+
_id: string;
|
28
|
+
tracking_id: string;
|
29
|
+
role: string;
|
30
|
+
space: Levelup.V2.Auth.Entity.TJWTTokenSpace;
|
31
|
+
}
|
32
|
+
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
declare module Levelup {
|
2
|
+
namespace CMS {
|
3
|
+
namespace V1 {
|
4
|
+
namespace Auth {
|
5
|
+
|
6
|
+
export namespace Api {
|
7
|
+
|
8
|
+
export namespace ApiKeys {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* --------------------------------------------------------------------------
|
12
|
+
* Create
|
13
|
+
* --------------------------------------------------------------------------
|
14
|
+
* @link
|
15
|
+
* @fires ApiKeysService.Create
|
16
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.Create.Request} query
|
17
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.Create.Response}
|
18
|
+
* @method POST
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
export namespace Create {
|
22
|
+
export type Request = Utils.Api.Request.BuildCreateRequest<Entity.ApiKey>;
|
23
|
+
export type Response = Utils.Api.Response.BuildSingleItemResponse<Entity.ApiKey>;
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
/**
|
28
|
+
* --------------------------------------------------------------------------
|
29
|
+
* Update
|
30
|
+
* --------------------------------------------------------------------------
|
31
|
+
* @link
|
32
|
+
* @fires ApiKeysService.Update
|
33
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.Update.Request} query
|
34
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.Update.Response}
|
35
|
+
* @method PUT
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
export namespace Update {
|
39
|
+
export type Request = Utils.Api.Request.BuildUpdateRequest<Entity.ApiKey>;
|
40
|
+
export type Response = Utils.Api.Response.BuildSingleItemResponse<Entity.ApiKey>;
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* --------------------------------------------------------------------------
|
45
|
+
* Delete
|
46
|
+
* --------------------------------------------------------------------------
|
47
|
+
* @link
|
48
|
+
* @fires ApiKeysService.Delete
|
49
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.Delete.Request} query
|
50
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.Delete.Response}
|
51
|
+
* @method DELETE
|
52
|
+
*
|
53
|
+
*/
|
54
|
+
export namespace Delete {
|
55
|
+
export type Response = Utils.Api.Response.DefaultDeleteResponse;
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
/**
|
60
|
+
* --------------------------------------------------------------------------
|
61
|
+
* BulkDelete
|
62
|
+
* --------------------------------------------------------------------------
|
63
|
+
* @link
|
64
|
+
* @fires ApiKeysService.BulkDelete
|
65
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.BulkDelete.Request} query
|
66
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.BulkDelete.Response}
|
67
|
+
* @method DELETE
|
68
|
+
*
|
69
|
+
*/
|
70
|
+
export namespace BulkDelete {
|
71
|
+
export type Request = Utils.Api.Request.Build<{
|
72
|
+
data: {
|
73
|
+
id?: string[];
|
74
|
+
tracking_id?: string[];
|
75
|
+
}
|
76
|
+
}>
|
77
|
+
export type Response = Utils.Api.Response.DefaultDeleteResponse;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* --------------------------------------------------------------------------
|
82
|
+
* GetOne
|
83
|
+
* --------------------------------------------------------------------------
|
84
|
+
* @link
|
85
|
+
* @fires ApiKeysService.GetOne
|
86
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.GetOne.Request} query
|
87
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.GetOne.Response}
|
88
|
+
* @method GET
|
89
|
+
*
|
90
|
+
*/
|
91
|
+
export namespace GetOne {
|
92
|
+
type Scope = '';
|
93
|
+
export type Request = Utils.Api.Request.Build<Record<string, unknown>>
|
94
|
+
export type Response = Utils.Api.Response.BuildSingleItemResponse<Entity.ApiKey>
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* --------------------------------------------------------------------------
|
99
|
+
* List
|
100
|
+
* --------------------------------------------------------------------------
|
101
|
+
* @link
|
102
|
+
* @fires ApiKeysService.List
|
103
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.List.Request} query
|
104
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.List.Response}
|
105
|
+
* @method GET
|
106
|
+
*
|
107
|
+
*/
|
108
|
+
export namespace List {
|
109
|
+
type Scope = 'listing' | 'ids' | 'trackings';
|
110
|
+
|
111
|
+
export type Request = Utils.Api.Request.BuildSearchablePagedSortableFilterableProjectable<Entity.ApiKey> & {
|
112
|
+
scope?: Scope;
|
113
|
+
filters?: {
|
114
|
+
/**
|
115
|
+
* Here will be the custom filters
|
116
|
+
*/
|
117
|
+
};
|
118
|
+
}
|
119
|
+
export type Response = Utils.Api.Response.BuildListResponse<Entity.ApiKey>
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* --------------------------------------------------------------------------
|
124
|
+
* GetByToken
|
125
|
+
* --------------------------------------------------------------------------
|
126
|
+
* @link
|
127
|
+
* @fires ApiKeysService.GetByToken
|
128
|
+
* @param {Levelup.V2.Auth.Api.ApiKeys.GetByToken.Request} query
|
129
|
+
* @returns {Levelup.V2.Auth.Api.ApiKeys.GetByToken.Response}
|
130
|
+
* @method GET
|
131
|
+
*
|
132
|
+
*/
|
133
|
+
export namespace GetByToken {
|
134
|
+
export type Response = Utils.Api.Response.BuildSingleItemResponse<Entity.ExposedApiKey>
|
135
|
+
}
|
136
|
+
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
@@ -0,0 +1,168 @@
|
|
1
|
+
declare module Levelup {
|
2
|
+
namespace CMS {
|
3
|
+
namespace V1 {
|
4
|
+
namespace Auth {
|
5
|
+
export namespace Api {
|
6
|
+
export namespace Auth {
|
7
|
+
/**
|
8
|
+
* --------------------------------------------------------------------------
|
9
|
+
* Signup
|
10
|
+
* --------------------------------------------------------------------------
|
11
|
+
* @link
|
12
|
+
* @fires AuthService.Signup
|
13
|
+
* @param {Levelup.V2.Auth.Api.Auth.Signup.Request} query
|
14
|
+
* @returns {Levelup.V2.Auth.Api.Auth.Signup.Response}
|
15
|
+
* @method POST
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
export namespace Signup {
|
19
|
+
export type Request =
|
20
|
+
Levelup.V2.Utils.Api.Request.BuildCreateRequest<{
|
21
|
+
name: string;
|
22
|
+
email: string;
|
23
|
+
password: string;
|
24
|
+
}>;
|
25
|
+
export type Response =
|
26
|
+
Utils.Api.Response.BuildSingleItemResponse<{
|
27
|
+
user: Users.Entity.User;
|
28
|
+
token: string;
|
29
|
+
refresh_token: string;
|
30
|
+
}>;
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* --------------------------------------------------------------------------
|
34
|
+
* Signin
|
35
|
+
* --------------------------------------------------------------------------
|
36
|
+
* @link
|
37
|
+
* @fires AuthService.Signin
|
38
|
+
* @param {Levelup.V2.Auth.Api.Auth.Signin.Request} query
|
39
|
+
* @returns {Levelup.V2.Auth.Api.Auth.Signin.Response}
|
40
|
+
* @method POST
|
41
|
+
*
|
42
|
+
*/
|
43
|
+
export namespace Signin {
|
44
|
+
export type Request =
|
45
|
+
Levelup.V2.Utils.Api.Request.BuildCreateRequest<{
|
46
|
+
email: string;
|
47
|
+
password: string;
|
48
|
+
}>;
|
49
|
+
export type Response =
|
50
|
+
Utils.Api.Response.BuildSingleItemResponse<{
|
51
|
+
user: Users.Entity.User;
|
52
|
+
token: string;
|
53
|
+
refresh_token: string;
|
54
|
+
}>;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* --------------------------------------------------------------------------
|
59
|
+
* RefreshToken
|
60
|
+
* --------------------------------------------------------------------------
|
61
|
+
* @link
|
62
|
+
* @fires AuthService.RefreshToken
|
63
|
+
* @param {Levelup.V2.Auth.Api.Auth.RefreshToken.Request}
|
64
|
+
* @returns {Levelup.V2.Auth.Api.Auth.RefreshToken.Response}
|
65
|
+
* @method POST
|
66
|
+
*/
|
67
|
+
export namespace RefreshToken {
|
68
|
+
export type Request =
|
69
|
+
Levelup.V2.Utils.Api.Request.BuildCreateRequest<{
|
70
|
+
refresh_token?: string;
|
71
|
+
}>;
|
72
|
+
export type Response =
|
73
|
+
Utils.Api.Response.BuildSingleItemResponse<{
|
74
|
+
user: Users.Entity.User;
|
75
|
+
token: string;
|
76
|
+
refresh_token: string;
|
77
|
+
}>;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* --------------------------------------------------------------------------
|
82
|
+
* SigninWithID
|
83
|
+
* --------------------------------------------------------------------------
|
84
|
+
* @method POST
|
85
|
+
* @link /api/v2/auth/login-with-id
|
86
|
+
* @fires AuthService.SigninWithId
|
87
|
+
* @param {Levelup.V2.Auth.Api.Auth.SigninWithId.Request} query
|
88
|
+
* @returns {Levelup.V2.Auth.Api.Auth.SigninWithId.Response}
|
89
|
+
*
|
90
|
+
*/
|
91
|
+
export namespace SigninWithId {
|
92
|
+
export type Request = Levelup.V2.Utils.Api.Request.Build<{
|
93
|
+
user_id: Utils.Common.ID;
|
94
|
+
}>;
|
95
|
+
export type Response =
|
96
|
+
Utils.Api.Response.BuildSingleItemResponse<{
|
97
|
+
user?: Users.Entity.User;
|
98
|
+
token?: string;
|
99
|
+
refresh_token: string;
|
100
|
+
}>;
|
101
|
+
}
|
102
|
+
/**
|
103
|
+
* --------------------------------------------------------------------------
|
104
|
+
* SigninForPayment
|
105
|
+
* --------------------------------------------------------------------------
|
106
|
+
* @link
|
107
|
+
* @fires AuthService.SigninForPayment
|
108
|
+
* @param {Levelup.V2.Auth.Api.Auth.SigninForPayment.Request} query
|
109
|
+
* @returns {Levelup.V2.Auth.Api.Auth.SigninForPayment.Response}
|
110
|
+
* @method POST
|
111
|
+
*
|
112
|
+
*/
|
113
|
+
export namespace SigninForPayment {
|
114
|
+
export type Request = Levelup.V2.Utils.Api.Request.Build<{
|
115
|
+
password: string;
|
116
|
+
}>;
|
117
|
+
export type Response = Utils.Api.Response.DefaultResponse & {
|
118
|
+
payment_token?: string;
|
119
|
+
};
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* --------------------------------------------------------------------------
|
124
|
+
* UpdatePaymentPassword
|
125
|
+
* --------------------------------------------------------------------------
|
126
|
+
* @link
|
127
|
+
* @fires AuthService.UpdatePaymentPassword
|
128
|
+
* @param {Levelup.V2.Auth.Api.Auth.UpdatePaymentPassword.Request} query
|
129
|
+
* @returns {Levelup.V2.Auth.Api.Auth.UpdatePaymentPassword.Response}
|
130
|
+
* @method PUT
|
131
|
+
*
|
132
|
+
*/
|
133
|
+
export namespace UpdatePaymentPassword {
|
134
|
+
export type Request = Levelup.V2.Utils.Api.Request.Build<{
|
135
|
+
old_password: string;
|
136
|
+
password: string;
|
137
|
+
}>;
|
138
|
+
export type Response = Utils.Api.Response.DefaultResponse & {
|
139
|
+
payment_token?: string;
|
140
|
+
};
|
141
|
+
}
|
142
|
+
|
143
|
+
/**
|
144
|
+
* --------------------------------------------------------------------------
|
145
|
+
* ChangeSellerPaymentPassword
|
146
|
+
* --------------------------------------------------------------------------
|
147
|
+
* @link
|
148
|
+
* @fires AuthService.ChangeSellerPaymentPassword
|
149
|
+
* @param {Levelup.V2.Auth.Api.Auth.ChangeSellerPaymentPassword.Request} query
|
150
|
+
* @returns {Levelup.V2.Auth.Api.Auth.ChangeSellerPaymentPassword.Response}
|
151
|
+
* @method PUT
|
152
|
+
*
|
153
|
+
*/
|
154
|
+
export namespace ChangeSellerPaymentPassword {
|
155
|
+
export type Request = Levelup.V2.Utils.Api.Request.Build<{
|
156
|
+
password: string;
|
157
|
+
}>;
|
158
|
+
export type Response = Utils.Api.Response.DefaultResponse & {
|
159
|
+
data: Users.Entity.User;
|
160
|
+
};
|
161
|
+
}
|
162
|
+
// end of request
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
'generated by levelup';
|
2
|
+
|
3
|
+
export * from "./user.d.ts";
|
4
|
+
export * from "./tools.d.ts";
|
5
|
+
export * from "./role.d.ts";
|
6
|
+
export * from "./permission.d.ts";
|
7
|
+
export * from "./permission-group.d.ts";
|
8
|
+
export * from "./auth.d.ts";
|
9
|
+
export * from "./api-key.d.ts";
|
@@ -0,0 +1,95 @@
|
|
1
|
+
declare module Levelup {
|
2
|
+
namespace CMS {
|
3
|
+
namespace V1 {
|
4
|
+
namespace Auth {
|
5
|
+
export namespace Api {
|
6
|
+
export namespace PermissionGroups {
|
7
|
+
/**
|
8
|
+
* --------------------------------------------------------------------------
|
9
|
+
* Create
|
10
|
+
* --------------------------------------------------------------------------
|
11
|
+
* @link
|
12
|
+
* @fires PermissionGroupsService.Create
|
13
|
+
* @param {Levelup.V2.Auth.Api.PermissionGroups.Create.Request} query
|
14
|
+
* @returns {Levelup.V2.Auth.Api.PermissionGroups.Create.Response}
|
15
|
+
* @method POST
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
export namespace Create {
|
19
|
+
export type Request =
|
20
|
+
Levelup.V2.Utils.Api.Request.BuildCreateRequest<Entity.PermissionGroup>;
|
21
|
+
export type Response =
|
22
|
+
Utils.Api.Response.BuildSingleItemResponse<Entity.PermissionGroup>;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* --------------------------------------------------------------------------
|
26
|
+
* Update
|
27
|
+
* --------------------------------------------------------------------------
|
28
|
+
* @link
|
29
|
+
* @fires PermissionGroupsService.Update
|
30
|
+
* @param {Levelup.V2.Auth.Api.PermissionGroups.Update.Request} query
|
31
|
+
* @returns {Levelup.V2.Auth.Api.PermissionGroups.Update.Response}
|
32
|
+
* @method PUT
|
33
|
+
*
|
34
|
+
*/
|
35
|
+
export namespace Update {
|
36
|
+
export type Request =
|
37
|
+
Levelup.V2.Utils.Api.Request.BuildUpdateRequest<Entity.PermissionGroup>;
|
38
|
+
export type Response =
|
39
|
+
Utils.Api.Response.BuildSingleItemResponse<Entity.PermissionGroup>;
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* --------------------------------------------------------------------------
|
44
|
+
* Delete
|
45
|
+
* --------------------------------------------------------------------------
|
46
|
+
* @link
|
47
|
+
* @fires PermissionGroupsService.Delete
|
48
|
+
* @param {Levelup.V2.Auth.Api.PermissionGroups.Delete.Request} query
|
49
|
+
* @returns {Levelup.V2.Auth.Api.PermissionGroups.Delete.Response}
|
50
|
+
* @method DELETE
|
51
|
+
*
|
52
|
+
*/
|
53
|
+
export namespace Delete {
|
54
|
+
export type Response = Utils.Api.Response.DefaultDeleteResponse;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* --------------------------------------------------------------------------
|
59
|
+
* Get
|
60
|
+
* --------------------------------------------------------------------------
|
61
|
+
* @link
|
62
|
+
* @fires PermissionGroupsService.Get
|
63
|
+
* @param {Levelup.V2.Auth.Api.PermissionGroups.GetOne.Request} query
|
64
|
+
* @returns {Levelup.V2.Auth.Api.PermissionGroups.GetOne.Response}
|
65
|
+
* @method GET
|
66
|
+
*
|
67
|
+
*/
|
68
|
+
export namespace GetOne {
|
69
|
+
export type Response =
|
70
|
+
Utils.Api.Response.BuildSingleItemResponse<Entity.PermissionGroup>;
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* --------------------------------------------------------------------------
|
75
|
+
* List
|
76
|
+
* --------------------------------------------------------------------------
|
77
|
+
* @link
|
78
|
+
* @fires PermissionGroupsService.List
|
79
|
+
* @param {Levelup.V2.Auth.Api.PermissionGroups.List.Request} query
|
80
|
+
* @returns {Levelup.V2.Auth.Api.PermissionGroups.List.Response}
|
81
|
+
* @method GET
|
82
|
+
*
|
83
|
+
*/
|
84
|
+
export namespace List {
|
85
|
+
export type Request =
|
86
|
+
Levelup.V2.Utils.Api.Request.BuildSearchablePagedSortableFilterableProjectable<Entity.PermissionGroup>;
|
87
|
+
export type Response =
|
88
|
+
Utils.Api.Response.BuildListResponse<Entity.PermissionGroup>;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|