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.
@@ -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
- export declare function createApiConnections<AE extends ApiEndpoints>(endpoints: AE): {
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
- export declare function getRequestConfig(sendAsFormData: boolean, basicAuth: AxiosBasicCredentials): AxiosRequestConfig;
4
+ type GetRequestConfigConfig = {
5
+ sendAsFormData: boolean;
6
+ basicAuth: AxiosBasicCredentials;
7
+ };
8
+ export declare function getRequestConfig(accessToken: ComputedRef<string>, config: GetRequestConfigConfig): AxiosRequestConfig;
9
+ export {};
@@ -84,11 +84,6 @@ declare const _default: {
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;
@@ -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" | "authStore" | "validations", MP extends void | import('pangea-helpers').ExtractPrefixes<{
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;
@@ -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
- type InstallConfig = {
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';
@@ -14,5 +14,8 @@ export type Item = {
14
14
  id: Id;
15
15
  [key: string]: any;
16
16
  };
17
+ export type ClassWithConstructor<T = any> = {
18
+ new (params?: Partial<T>): T;
19
+ };
17
20
  export type TextProp = string | number | (() => string);
18
21
  export type Align = 'center' | 'left' | 'right';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-lib",
3
3
  "description": "",
4
- "version": "2.11.656",
4
+ "version": "2.11.658",
5
5
  "author": "Gianfranco Raselli",
6
6
  "license": "ISC",
7
7
  "homepage": "https://github.com/GianfrancoRaselli/pangea#readme",
@@ -1,6 +0,0 @@
1
- declare const _default: {
2
- es: {
3
- successfulLogout: string;
4
- };
5
- };
6
- export default _default;
@@ -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