pangea-lib 2.11.656 → 2.11.658
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/main.cjs.js +40 -40
- package/dist/main.es.js +3013 -3017
- package/dist/types/api-connections/api-connections.types.d.ts +2 -1
- package/dist/types/api-connections/create-api-connections.d.ts +8 -1
- package/dist/types/api-connections/methods/connect-to-api.d.ts +2 -1
- package/dist/types/api-connections/methods/get-request-config.d.ts +7 -1
- package/dist/types/i18n/all-messages.d.ts +0 -5
- package/dist/types/i18n/i18n.d.ts +1 -16
- package/dist/types/main.d.ts +1 -6
- package/dist/types/types/index.d.ts +3 -0
- package/package.json +1 -1
- package/dist/types/stores/auth-store/auth-store.i18n.d.ts +0 -6
- package/dist/types/stores/auth-store/auth-store.types.d.ts +0 -1
- package/dist/types/stores/auth-store/auth-user.models.d.ts +0 -17
- package/dist/types/stores/auth-store/auth.store.d.ts +0 -0
- package/dist/types/stores/route-store/route.store.d.ts +0 -0
|
@@ -4,6 +4,7 @@ import { ExtractConstructor } from 'pangea-helpers';
|
|
|
4
4
|
import { DatabaseDefault } from '../models/database-default';
|
|
5
5
|
import { BaseParams } from '../models/base-params';
|
|
6
6
|
import { BaseResponse } from '../models/base-responses';
|
|
7
|
+
import { ClassWithConstructor } from '../types';
|
|
7
8
|
|
|
8
9
|
export type ApiMethod = 'delete' | 'get' | 'patch' | 'post' | 'put';
|
|
9
10
|
export type ApiConnectionMethod = 'getOne' | 'getMany' | 'postOne' | 'postMany' | 'putOne' | 'putMany' | 'deleteOne' | 'deleteMany';
|
|
@@ -18,7 +19,7 @@ export type ApiConfig<SuccessRes> = {
|
|
|
18
19
|
basicAuth?: AxiosBasicCredentials;
|
|
19
20
|
};
|
|
20
21
|
export type EndpointSettingsParams = typeof BaseParams;
|
|
21
|
-
export type EndpointSettingsResponse = typeof DatabaseDefault | typeof BaseResponse | undefined;
|
|
22
|
+
export type EndpointSettingsResponse = typeof DatabaseDefault | typeof BaseResponse | ClassWithConstructor | undefined;
|
|
22
23
|
export type EndpointSettingsMeta = {
|
|
23
24
|
sendAsFormData?: boolean;
|
|
24
25
|
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
1
2
|
import { Arrayify } from 'pangea-helpers';
|
|
2
3
|
import { Id } from '../types';
|
|
3
4
|
import { ApiConfig, ApiEndpoints, ApiEndpointName, ApiEndpointParams, ApiEndpointResponse } from './api-connections.types';
|
|
5
|
+
import { I18nMessages } from '../types/i18n';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
type CreateApiConnectionsConfig = {
|
|
8
|
+
apiConnectionsSuccessI18n: I18nMessages;
|
|
9
|
+
apiConnectionsErrorI18n: I18nMessages;
|
|
10
|
+
};
|
|
11
|
+
export declare function createApiConnections<AE extends ApiEndpoints>(endpoints: AE, accessToken: ComputedRef<string>, config?: CreateApiConnectionsConfig): {
|
|
6
12
|
getOne<T extends ApiEndpointName<AE, "getOne">>(url: T, id?: Id, params?: ApiEndpointParams<AE, T, 'getOne'>, config?: ApiConfig<ApiEndpointResponse<AE, T, 'getOne'>>): Promise<{
|
|
7
13
|
data: ApiEndpointResponse<AE, T, "getOne">;
|
|
8
14
|
totalCount?: number;
|
|
@@ -36,3 +42,4 @@ export declare function createApiConnections<AE extends ApiEndpoints>(endpoints:
|
|
|
36
42
|
totalCount?: number;
|
|
37
43
|
}>;
|
|
38
44
|
};
|
|
45
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
1
2
|
import { PlainObject } from 'pangea-helpers';
|
|
2
3
|
import { ApiMethod, ApiConfig, EndpointSettings } from '../api-connections.types';
|
|
3
4
|
|
|
4
|
-
export declare function connectToApi<T extends ApiMethod, SuccessRes>(method: T, url: string, endpointSettings: EndpointSettings, params: PlainObject | Array<any>, config?: ApiConfig<SuccessRes>): Promise<{
|
|
5
|
+
export declare function connectToApi<T extends ApiMethod, SuccessRes>(accessToken: ComputedRef<string>, method: T, url: string, endpointSettings: EndpointSettings, params: PlainObject | Array<any>, config?: ApiConfig<SuccessRes>): Promise<{
|
|
5
6
|
data: SuccessRes;
|
|
6
7
|
totalCount?: number;
|
|
7
8
|
}>;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
1
2
|
import { AxiosRequestConfig, AxiosBasicCredentials } from 'axios';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
type GetRequestConfigConfig = {
|
|
5
|
+
sendAsFormData: boolean;
|
|
6
|
+
basicAuth: AxiosBasicCredentials;
|
|
7
|
+
};
|
|
8
|
+
export declare function getRequestConfig(accessToken: ComputedRef<string>, config: GetRequestConfigConfig): AxiosRequestConfig;
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getLanguage: () => "es", setLanguage: (language: "es") => void, useI18n: <FN extends "alert" | "pgaDisplayNoItems" | "pgaDatePicker" | "pgaInputFile" | "pgaInputGroup" | "pgaLoginForm" | "pgaSelect" | "pgaImage" | "pgaButton" | "pgaLayout" | "pgaModal" | "pgaTable" | "notifications" | "
|
|
1
|
+
export declare const getLanguage: () => "es", setLanguage: (language: "es") => void, useI18n: <FN extends "alert" | "pgaDisplayNoItems" | "pgaDatePicker" | "pgaInputFile" | "pgaInputGroup" | "pgaLoginForm" | "pgaSelect" | "pgaImage" | "pgaButton" | "pgaLayout" | "pgaModal" | "pgaTable" | "notifications" | "validations", MP extends void | import('pangea-helpers').ExtractPrefixes<{
|
|
2
2
|
alert: {
|
|
3
3
|
es: {
|
|
4
4
|
alertTitle: string;
|
|
@@ -84,11 +84,6 @@ export declare const getLanguage: () => "es", setLanguage: (language: "es") => v
|
|
|
84
84
|
removeAllBtn: string;
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
authStore: {
|
|
88
|
-
es: {
|
|
89
|
-
successfulLogout: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
87
|
validations: {
|
|
93
88
|
es: {
|
|
94
89
|
requiredRuleError: string;
|
|
@@ -187,11 +182,6 @@ export declare const getLanguage: () => "es", setLanguage: (language: "es") => v
|
|
|
187
182
|
removeAllBtn: string;
|
|
188
183
|
};
|
|
189
184
|
};
|
|
190
|
-
authStore: {
|
|
191
|
-
es: {
|
|
192
|
-
successfulLogout: string;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
185
|
validations: {
|
|
196
186
|
es: {
|
|
197
187
|
requiredRuleError: string;
|
|
@@ -290,11 +280,6 @@ export declare const getLanguage: () => "es", setLanguage: (language: "es") => v
|
|
|
290
280
|
removeAllBtn: string;
|
|
291
281
|
};
|
|
292
282
|
};
|
|
293
|
-
authStore: {
|
|
294
|
-
es: {
|
|
295
|
-
successfulLogout: string;
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
283
|
validations: {
|
|
299
284
|
es: {
|
|
300
285
|
requiredRuleError: string;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import { UserOptions } from './options/options.types';
|
|
3
|
-
import { I18nMessages } from './types/i18n';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
apiConnectionsSuccessI18n: I18nMessages;
|
|
7
|
-
apiConnectionsErrorI18n: I18nMessages;
|
|
8
|
-
};
|
|
9
|
-
declare function install(app: App, userOptions?: UserOptions, config?: InstallConfig): void;
|
|
4
|
+
declare function install(app: App, userOptions?: UserOptions): void;
|
|
10
5
|
export default install;
|
|
11
6
|
export * from './alert';
|
|
12
7
|
export * from './api-connections';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type AuthType = 'admin' | 'client';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { User } from '../../models/user/user.model';
|
|
2
|
-
import { Admin } from '../../models/user/admin.model';
|
|
3
|
-
import { Client } from '../../models/user/client.model';
|
|
4
|
-
|
|
5
|
-
export declare class AuthUser {
|
|
6
|
-
accessToken: string;
|
|
7
|
-
user: User;
|
|
8
|
-
constructor(params?: Partial<AuthUser>);
|
|
9
|
-
}
|
|
10
|
-
export declare class AuthAdmin extends AuthUser {
|
|
11
|
-
user: Admin;
|
|
12
|
-
constructor(params?: Partial<AuthAdmin>);
|
|
13
|
-
}
|
|
14
|
-
export declare class AuthClient extends AuthUser {
|
|
15
|
-
user: Client;
|
|
16
|
-
constructor(params?: Partial<AuthClient>);
|
|
17
|
-
}
|
|
File without changes
|
|
File without changes
|