jamespot-user-api 1.0.62 → 1.0.65

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.
Files changed (99) hide show
  1. package/documentation/classes/JApplicationApi.html +8 -8
  2. package/documentation/classes/JArticleApi.html +1 -1
  3. package/documentation/classes/JAudienceApi.html +1 -1
  4. package/documentation/classes/JBaseApi.html +1 -1
  5. package/documentation/classes/JBookmarkApi.html +1 -1
  6. package/documentation/classes/JCommunityApi.html +1 -1
  7. package/documentation/classes/JConceptApi.html +1 -1
  8. package/documentation/classes/JDiapazoneApi.html +1 -1
  9. package/documentation/classes/JFileApi.html +1 -1
  10. package/documentation/classes/JFilebankApi.html +1 -1
  11. package/documentation/classes/JGroupApi.html +1 -1
  12. package/documentation/classes/JLandApi.html +1 -1
  13. package/documentation/classes/JMessengerApi.html +1 -1
  14. package/documentation/classes/JSearchApi.html +6 -6
  15. package/documentation/classes/JShareApi.html +1 -1
  16. package/documentation/classes/JUserApi.html +3 -3
  17. package/documentation/classes/JWedocApi.html +1 -1
  18. package/documentation/classes/JamespotUserApi.html +1 -1
  19. package/documentation/classes/Network.html +1 -1
  20. package/documentation/enums/StudioApplicationStatus.html +1 -1
  21. package/documentation/interfaces/ApiError.html +1 -1
  22. package/documentation/interfaces/ApiWrapper.html +1 -1
  23. package/documentation/interfaces/AseiGroups.html +1 -1
  24. package/documentation/interfaces/AseiInstitution.html +1 -1
  25. package/documentation/interfaces/AseiRights.html +1 -1
  26. package/documentation/interfaces/AseiTicket.html +1 -1
  27. package/documentation/interfaces/BaseAutocomplete.html +1 -1
  28. package/documentation/interfaces/BaseMessage.html +1 -1
  29. package/documentation/interfaces/Category.html +1 -1
  30. package/documentation/interfaces/CreateGroup.html +1 -1
  31. package/documentation/interfaces/FileBankProps.html +1 -1
  32. package/documentation/interfaces/FolderProps.html +1 -1
  33. package/documentation/interfaces/ListFilterSpec.html +1 -1
  34. package/documentation/interfaces/OF.html +1 -1
  35. package/documentation/interfaces/PagingResults.html +1 -1
  36. package/documentation/interfaces/Result.html +1 -1
  37. package/documentation/interfaces/RootFolderProps.html +1 -1
  38. package/documentation/interfaces/SearchCategoryModel.html +1 -1
  39. package/documentation/interfaces/SearchConfig.html +1 -1
  40. package/documentation/interfaces/SearchFacetModel.html +1 -1
  41. package/documentation/interfaces/SearchFacetValueModel.html +1 -1
  42. package/documentation/interfaces/SearchQuery.html +1 -1
  43. package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
  44. package/documentation/interfaces/SearchQueryOption.html +1 -1
  45. package/documentation/interfaces/SearchQueryResult.html +1 -1
  46. package/documentation/interfaces/SearchQuerySortModel.html +1 -1
  47. package/documentation/interfaces/SearchResultCatProps.html +1 -1
  48. package/documentation/interfaces/SearchResultProps.html +1 -1
  49. package/documentation/interfaces/SpotProps.html +1 -1
  50. package/documentation/interfaces/Taxonomy.html +1 -1
  51. package/documentation/interfaces/TaxonomyCreate.html +1 -1
  52. package/documentation/interfaces/User.html +1 -1
  53. package/documentation/interfaces/UserModel.html +1 -1
  54. package/documentation/modules.html +1 -1
  55. package/package.json +2 -2
  56. package/lib/jamespot-user-api.js +0 -2
  57. package/lib/jamespot-user-api.js.map +0 -1
  58. package/lib/src/apis/application.d.ts +0 -84
  59. package/lib/src/apis/article.d.ts +0 -40
  60. package/lib/src/apis/asei.d.ts +0 -25
  61. package/lib/src/apis/audience.d.ts +0 -9
  62. package/lib/src/apis/base.d.ts +0 -5
  63. package/lib/src/apis/bookmark.d.ts +0 -20
  64. package/lib/src/apis/community.d.ts +0 -9
  65. package/lib/src/apis/concept.d.ts +0 -12
  66. package/lib/src/apis/diapazone.d.ts +0 -24
  67. package/lib/src/apis/file.d.ts +0 -9
  68. package/lib/src/apis/filebank.d.ts +0 -34
  69. package/lib/src/apis/group.d.ts +0 -16
  70. package/lib/src/apis/index.d.ts +0 -18
  71. package/lib/src/apis/jamespotUserApi.d.ts +0 -49
  72. package/lib/src/apis/jland.d.ts +0 -24
  73. package/lib/src/apis/messenger.d.ts +0 -6
  74. package/lib/src/apis/search.d.ts +0 -47
  75. package/lib/src/apis/share.d.ts +0 -17
  76. package/lib/src/apis/taxonomy.d.ts +0 -9
  77. package/lib/src/apis/user.d.ts +0 -29
  78. package/lib/src/apis/wedoc.d.ts +0 -26
  79. package/lib/src/index.d.ts +0 -15
  80. package/lib/src/types/asei.d.ts +0 -28
  81. package/lib/src/types/autocomplete.d.ts +0 -16
  82. package/lib/src/types/bookmark.d.ts +0 -14
  83. package/lib/src/types/file.d.ts +0 -12
  84. package/lib/src/types/group.d.ts +0 -22
  85. package/lib/src/types/index.d.ts +0 -11
  86. package/lib/src/types/listWrapper.d.ts +0 -6
  87. package/lib/src/types/search.d.ts +0 -99
  88. package/lib/src/types/share.d.ts +0 -37
  89. package/lib/src/types/taxonomy.d.ts +0 -46
  90. package/lib/src/types/user.d.ts +0 -14
  91. package/lib/src/types/utils.d.ts +0 -56
  92. package/lib/src/types/wedoc.d.ts +0 -47
  93. package/lib/src/util/network.d.ts +0 -23
  94. package/lib/src/util/promise.d.ts +0 -1
  95. package/lib/src/window/Window.d.ts +0 -7
  96. package/lib/src/window/WindowBrowser.d.ts +0 -5
  97. package/lib/src/window/WindowJestFetch.d.ts +0 -6
  98. package/lib/src/window/WindowMobile.d.ts +0 -9
  99. package/lib/src/window/WindowMock.d.ts +0 -16
@@ -1,47 +0,0 @@
1
- import { ApiWrapper, SearchConfig, SearchQuery, SearchQueryResult, SearchResultCatProps, SearchLastQuery } from '../types';
2
- import { JBaseApi } from './base';
3
- export declare class JSearchApi extends JBaseApi {
4
- /**
5
- * return a completed version of the current config, taking in account platform installed modules
6
- */
7
- getConfig(): Promise<ApiWrapper<SearchConfig>>;
8
- /**
9
- * Return a maximum of 8 results for a given text query, classed upon config categories
10
- * @param query string, words can be preceded by + and - for inclusive/exclusive search
11
- * @param signal: @AbortSignal to cancel the fetch
12
- */
13
- proposition({ query, format }: {
14
- query: string;
15
- format?: 'list' | 'little';
16
- }, signal?: AbortSignal): Promise<ApiWrapper<SearchResultCatProps[]>>;
17
- /**
18
- * Return a page of results based on a text query and various filters.
19
- * All parameters are optional
20
- * @param query
21
- * @param query.keywords string, words can be preceded by + and - for inclusive/exclusive search (default *:*)
22
- * @param query.category text id of a category from config,if specified: restrict results to these category
23
- * @param query.facetCategories boolean, if true: count by categories are returned
24
- * @param query.filters array of @SearchQueryFilterModel @SearchQueryFilterModel.
25
- * @param query.page integer. default 1. index of returned page (start by 1)
26
- * @param query.limit integer. default 20. number of result by page
27
- * @param query.sort @SearchQuerySortModel default score then date
28
- * @param query.options @SearchQueryOption. extra possible options for the search
29
- * @param signal: @AbortSignal to cancel the fetch
30
-
31
- * // Todo add query.facets (to be specified first)
32
- */
33
- searchQuery(query: SearchQuery, signal?: AbortSignal): Promise<ApiWrapper<SearchQueryResult>>;
34
- /**
35
- * return the five last keywords typed in the searchbar by the user
36
- */
37
- getLastQueries(): Promise<ApiWrapper<SearchLastQuery[]>>;
38
- /**
39
- * return the current platform json search-config object
40
- */
41
- getAdminConfig(): Promise<any>;
42
- /**
43
- * set the platform search-config to the given json object
44
- * @param config object. json search config
45
- */
46
- setAdminConfig(config: any): Promise<any>;
47
- }
@@ -1,17 +0,0 @@
1
- import { ApiWrapper } from '../types';
2
- import { JBaseApi } from './base';
3
- import { ShareAccessObject, ShareAccessProps, ShareAccessRequestProps } from '../types/share';
4
- export declare class JShareApi extends JBaseApi {
5
- setObjectAccessRequest(uri: string, idUser: number, requestAccessValue: 'accept' | 'deny', requestResponseMessage?: string): Promise<ApiWrapper<boolean, {
6
- code: number;
7
- msg: string;
8
- }>>;
9
- getObjectAccessRequest(uri: string, idUser?: number): Promise<ShareAccessRequestProps[]>;
10
- getObject(uri: string): Promise<ShareAccessObject>;
11
- askObjectAccess(uri: string, askAccess: 'read' | 'write', askMessage?: string): Promise<boolean>;
12
- setObjectAccess(uri: string, access: {
13
- read: string[];
14
- write: string[];
15
- }, message: string, generalAccessRule: string): Promise<boolean>;
16
- getObjectAccess(uri: string): Promise<ShareAccessProps>;
17
- }
@@ -1,9 +0,0 @@
1
- import { JBaseApi } from './base';
2
- import { ApiWrapper, BaseMessagesOne, Taxonomy, TaxonomyCreate } from '../types';
3
- export declare class JTaxonomyApi extends JBaseApi {
4
- /**
5
- * list all taxonomies (no pagination)
6
- */
7
- list(): Promise<Taxonomy[]>;
8
- create(taxonomy: TaxonomyCreate): Promise<ApiWrapper<Taxonomy, BaseMessagesOne>>;
9
- }
@@ -1,29 +0,0 @@
1
- import { JBaseApi } from './base';
2
- import { ApiWrapper, Little } from '../types';
3
- export interface User {
4
- idUser: string;
5
- type: string;
6
- id: string;
7
- _values: {
8
- mail: string;
9
- };
10
- }
11
- export declare class JUserApi extends JBaseApi {
12
- /**
13
- * autocomplete return a list users
14
- * @param query <string>
15
- */
16
- autocomplete(query: string): Promise<User[]>;
17
- /**
18
- * Get a user
19
- * @param uri uri
20
- * @param format little by default. If another format is provided, the generic types should be defined
21
- */
22
- get<T extends Little = Little>(uri: string, format?: string): Promise<ApiWrapper<T>>;
23
- /**
24
- * signIn function returns a Promise of users.
25
- * @param mail Mail or username
26
- * @param pwd Password to be validated
27
- */
28
- signIn(mail: string, pwd: string): Promise<ApiWrapper<User, string[]>>;
29
- }
@@ -1,26 +0,0 @@
1
- import { ApiWrapper, WedocFileType, WedocQueryResults, WedocQueryType, WedocTemplate } from '../types';
2
- import { JBaseApi } from './base';
3
- export declare class JWedocApi extends JBaseApi {
4
- getFiles(query: WedocQueryType): Promise<WedocQueryResults>;
5
- getFile(idFile: number, hash?: string): Promise<WedocFileType>;
6
- getTemplates(): Promise<WedocTemplate[]>;
7
- duplicateFile(idFile: number, title: string, publishTo: string[]): Promise<ApiWrapper<boolean, {
8
- code: number;
9
- msg: string;
10
- }>>;
11
- deleteFile(idFile: number): Promise<ApiWrapper<boolean, {
12
- code: number;
13
- msg: string;
14
- }>>;
15
- createFile(title: string, type: string, publishTo: string[]): Promise<{
16
- idFile: number;
17
- }>;
18
- updateFile(idFile: number, title: string): Promise<ApiWrapper<boolean, {
19
- code: number;
20
- msg: string;
21
- }>>;
22
- getFileInfo(idFile: number, mode: string): Promise<ApiWrapper<boolean, {
23
- code: number;
24
- msg: string;
25
- }>>;
26
- }
@@ -1,15 +0,0 @@
1
- import { JamespotUserApi } from './apis';
2
- import { Network } from './util/network';
3
- export declare const network: Network;
4
- declare const JamespotUserApiInstance: JamespotUserApi;
5
- declare global {
6
- interface Window {
7
- JamespotUserApi: JamespotUserApi;
8
- }
9
- }
10
- export { JamespotUserApiInstance };
11
- export default JamespotUserApiInstance;
12
- export * from './apis';
13
- export * from './types';
14
- export * from './util/network';
15
- export declare const api: typeof JamespotUserApi;
@@ -1,28 +0,0 @@
1
- import { Little, Rights } from './utils';
2
- export declare type AseiTicketStatus = 'created' | 'validated' | 'handled';
3
- export interface AseiTicket extends Little {
4
- _right: Rights;
5
- _user: Little;
6
- aseiClearanceTicketValidator: Little[];
7
- aseiClearanceTicketInstitution: Little[];
8
- processContext: null;
9
- aseiClearanceTicketType: string;
10
- aseiClearanceTicketNatureOfDemand: null;
11
- aseiClearanceTicketLastName: string;
12
- aseiClearanceTicketFirstName: string;
13
- aseiClearanceTicketStatus: AseiTicketStatus;
14
- }
15
- export interface AseiInstitution extends Little {
16
- _right: Rights;
17
- _user: Little;
18
- aseiInstitutionValidator: Little[];
19
- processContext: null;
20
- }
21
- export interface AseiGroups {
22
- dsi: number;
23
- gestionnaireApplicatif: number;
24
- }
25
- export interface AseiRights {
26
- accessWriter: boolean;
27
- accessApp: boolean;
28
- }
@@ -1,16 +0,0 @@
1
- export interface BaseAutocomplete {
2
- value: string;
3
- uri: string;
4
- shortUri: string;
5
- title: string;
6
- name: string;
7
- mainType: string;
8
- type: string;
9
- label: string;
10
- cssClass: string;
11
- cssColor: string;
12
- class: string;
13
- Pseudo: string;
14
- }
15
- export declare type AudienceAutocomplete = BaseAutocomplete;
16
- export declare type CommunityAutocomplete = BaseAutocomplete;
@@ -1,14 +0,0 @@
1
- export declare type Bookmark = {
2
- id: number;
3
- type: string;
4
- targetId?: number;
5
- targetType?: string;
6
- bookmarkUrl?: string;
7
- bookmarkOrder?: number;
8
- bookmarkLabel?: string;
9
- bookmarkMeta?: string;
10
- _cssClass?: string;
11
- _cssColor?: string;
12
- _values?: Record<string, string>;
13
- url?: string;
14
- };
@@ -1,12 +0,0 @@
1
- export declare type FileResponse = {
2
- id: string;
3
- name: string;
4
- type: 'fileTmp';
5
- token: string;
6
- size: string;
7
- mediaKey: string;
8
- imagesize: {
9
- width: number;
10
- height: number;
11
- };
12
- };
@@ -1,22 +0,0 @@
1
- export interface CreateGroup {
2
- title: string;
3
- description: string;
4
- privacy: string;
5
- idCategory?: string;
6
- type: string;
7
- uriCommunity?: string;
8
- widgets: Array<string>;
9
- }
10
- export declare type GroupWidgets = Record<string, {
11
- idWidget: string;
12
- title: string;
13
- url: string;
14
- type: string;
15
- icon: string;
16
- description: string;
17
- }>;
18
- export interface Category {
19
- id: string;
20
- idorder: number;
21
- label: string;
22
- }
@@ -1,11 +0,0 @@
1
- export * from './asei';
2
- export * from './autocomplete';
3
- export * from './bookmark';
4
- export * from './file';
5
- export * from './group';
6
- export * from './search';
7
- export * from './share';
8
- export * from './utils';
9
- export * from './taxonomy';
10
- export * from './user';
11
- export * from './wedoc';
@@ -1,6 +0,0 @@
1
- export interface ListWrapper<T> {
2
- page?: number;
3
- limit?: number;
4
- cnt?: number;
5
- data: T[];
6
- }
@@ -1,99 +0,0 @@
1
- export interface SearchCategoryModel {
2
- id: string;
3
- mainType: string;
4
- type?: string;
5
- title: string;
6
- cssclass?: string;
7
- active?: boolean;
8
- count?: number;
9
- typesExcluded: string[];
10
- facets: SearchFacetModel[];
11
- }
12
- export interface SearchFacetModel {
13
- facetType: string;
14
- facetOptions: any;
15
- field: string;
16
- title: string;
17
- category?: SearchCategoryModel['id'];
18
- }
19
- export interface SearchFacetValueModel {
20
- count: number;
21
- value: string;
22
- title: string;
23
- }
24
- /** *
25
- * Used in search query to specify a filter
26
- * field : name/id of the filter category (ie skills)
27
- * value : id of the field (ie react)
28
- * exclude : boolean to include or exclude the filter
29
- */
30
- export interface SearchQueryFilterModel {
31
- field: string;
32
- value: string;
33
- exclude: boolean;
34
- }
35
- /**
36
- * Used in search query to specify a filter
37
- * field : name/id of the field to sort
38
- * order : desc' | 'asc'
39
- */
40
- export interface SearchQuerySortModel {
41
- field: string;
42
- order: 'desc' | 'asc';
43
- }
44
- /**
45
- * facetLimit : max number of facets (default 25)
46
- * skipEmptyFacets : remove empty facets (with 0 results)
47
- */
48
- export interface SearchQueryOption {
49
- facetLimit: number;
50
- skipEmptyFacets: boolean;
51
- }
52
- export interface SearchConfig {
53
- home: {
54
- mode: 'result' | 'category';
55
- facets: SearchFacetModel[];
56
- };
57
- categories: SearchCategoryModel[];
58
- viewcard?: Record<string, {
59
- name: string;
60
- title: string;
61
- }[]>;
62
- }
63
- export interface SearchResultCatProps {
64
- title: string;
65
- id: string;
66
- showAll?: boolean;
67
- results: SearchResultProps[];
68
- }
69
- export interface SearchResultProps {
70
- title: string;
71
- picture: string;
72
- uri: string;
73
- }
74
- export interface SearchQuery {
75
- keywords?: string;
76
- category?: string;
77
- facetCategories?: boolean;
78
- filters?: SearchQueryFilterModel[];
79
- page?: number;
80
- limit?: number;
81
- sort?: SearchQuerySortModel;
82
- options?: SearchQueryOption;
83
- }
84
- export interface Result {
85
- id: number;
86
- type: string;
87
- uri: string;
88
- title: string;
89
- mainType: string;
90
- _url: string;
91
- }
92
- export interface SearchQueryResult {
93
- results: Result[];
94
- facets: SearchFacetModel[];
95
- categories: SearchCategoryModel[];
96
- }
97
- export declare type SearchLastQuery = {
98
- keywords: string;
99
- };
@@ -1,37 +0,0 @@
1
- import { Rights } from './utils';
2
- export declare type ShareAccessObjectAudience = {
3
- id: number;
4
- uri: string;
5
- title: string;
6
- type: string;
7
- };
8
- export declare type ShareOptionObject = {
9
- id: number;
10
- title: string;
11
- uri: string;
12
- idUser: number;
13
- _right: Rights;
14
- };
15
- export declare type ShareAccessObject = {
16
- id: number;
17
- type: string;
18
- uri: string;
19
- title: string;
20
- generalAccessRule: 'link' | 'invitation';
21
- generalAccessHash: string;
22
- idUser: number;
23
- _audience: ShareAccessObjectAudience[];
24
- _right: Rights;
25
- _user: ShareAccessObjectAudience;
26
- };
27
- export declare type ShareAccessProps = {
28
- audience: ShareAccessObjectAudience[];
29
- read: string[];
30
- write: string[];
31
- };
32
- export declare type ShareAccessRequestProps = {
33
- id: number;
34
- uri: string;
35
- title: string;
36
- type: string;
37
- };
@@ -1,46 +0,0 @@
1
- export interface Taxonomy {
2
- id: number;
3
- type: string;
4
- title: string;
5
- dateCreation: string;
6
- mainTypes: never[];
7
- types: null;
8
- mandatory: null;
9
- public: null;
10
- wallFilter: null;
11
- jamespot: string;
12
- uri: string;
13
- mainType: string;
14
- _cssColor: string;
15
- _cssClass: string;
16
- _right: {
17
- create: boolean;
18
- read: boolean;
19
- publish: boolean;
20
- administrate: boolean;
21
- update: boolean;
22
- delete: boolean;
23
- comment: boolean;
24
- member: boolean;
25
- };
26
- _values: {
27
- type: string;
28
- title: string;
29
- dateCreation: string;
30
- mainTypes: null;
31
- types: null;
32
- mandatory: null;
33
- public: null;
34
- wallFilter: null;
35
- jamespot: string;
36
- };
37
- _timezone: {
38
- dateCreation: string;
39
- };
40
- _url: string;
41
- }
42
- export interface TaxonomyCreate {
43
- type: 'taxonomyClose' | 'taxonomyOpen';
44
- title: string;
45
- concepts: Array<string>;
46
- }
@@ -1,14 +0,0 @@
1
- export interface UserModel {
2
- id: number;
3
- title: string;
4
- type: string;
5
- uri: string;
6
- mainType: string;
7
- _cssColor: string;
8
- _cssClass: string;
9
- url: string;
10
- firstname: string;
11
- lastname: string;
12
- company: string;
13
- mail: string;
14
- }
@@ -1,56 +0,0 @@
1
- export interface ApiWrapper<T, U = string[]> {
2
- o: string;
3
- f: string;
4
- error: number;
5
- messages: U;
6
- errorMsg?: string;
7
- result: T;
8
- }
9
- export interface PagingResults<T> {
10
- cnt: number;
11
- data: Array<T>;
12
- facets: Array<{}>;
13
- idQuery?: number;
14
- limit: number;
15
- page: number;
16
- }
17
- export interface ApiError<U = string> {
18
- error: number;
19
- messages: U[];
20
- }
21
- export interface BaseMessage {
22
- msg: string;
23
- code: number;
24
- }
25
- export declare type BaseMessages = BaseMessage[];
26
- export declare type BaseMessagesOne = [BaseMessage];
27
- export declare type Rights = {
28
- create: boolean;
29
- read: boolean;
30
- publish: boolean;
31
- administrate: boolean;
32
- update: boolean;
33
- delete: boolean;
34
- comment: boolean;
35
- member: boolean;
36
- };
37
- export declare type Little = {
38
- id: number;
39
- type: string;
40
- uri: string;
41
- title: string;
42
- _url: string;
43
- dateCreation: string;
44
- dateModified: string;
45
- };
46
- export declare type Order = {
47
- name: string;
48
- sort: 'ASC' | 'DESC';
49
- };
50
- export declare type Orders = Array<Order>;
51
- export declare type Filter = {
52
- name: string;
53
- value: string;
54
- operator?: '<' | '>' | '<=' | '>=' | '!=' | '<>' | 'like' | 'between' | 'is' | 'is not' | 'in' | 'link' | 'match';
55
- };
56
- export declare type Filters = Array<Filter>;
@@ -1,47 +0,0 @@
1
- import { Filters, Orders, Rights } from './utils';
2
- export declare type WedocFileType = {
3
- dateCreation: string;
4
- dateModified: string;
5
- id: string;
6
- mimetype: string;
7
- title: string;
8
- type: string;
9
- uri: string;
10
- _extend: Record<string, string>;
11
- _audience: WedocFileAudienceType[];
12
- _right: Rights;
13
- _user: WedocFileUserType;
14
- };
15
- export declare type WedocFileAudienceType = {
16
- id: number;
17
- title: string;
18
- uri: string;
19
- type: string;
20
- };
21
- export declare type WedocFileUserType = {
22
- id: number;
23
- title: string;
24
- uri: string;
25
- type: string;
26
- };
27
- export declare type WedocTemplate = {
28
- color: string;
29
- description: string;
30
- extension: string;
31
- icon: string;
32
- label: string;
33
- };
34
- export declare type WedocQueryResults = {
35
- page: number;
36
- cnt: number;
37
- limit: number;
38
- data: WedocFileType[];
39
- };
40
- export declare type WedocQueryType = {
41
- query: string;
42
- filters: Filters;
43
- orders: Orders;
44
- page: number;
45
- limit: number;
46
- };
47
- export declare type WedocEmptyType = {};
@@ -1,23 +0,0 @@
1
- import { ApiWrapper, FileResponse } from '../types';
2
- import { FetchReturnType, WindowInterface } from '../window/Window';
3
- export interface OF {
4
- o: string;
5
- f: string;
6
- }
7
- /**
8
- * deprecated
9
- */
10
- export declare class Network {
11
- private readonly action;
12
- private readonly window;
13
- constructor(window: WindowInterface, action?: string);
14
- static _formatPostOptions(body: object): RequestInit;
15
- static _formatQueryOptions(options: Record<string, string | boolean | number>): string;
16
- getUrl(o: string, f: string): Promise<string>;
17
- fetch({ o, f, ...body }: OF, signal?: AbortSignal): FetchReturnType;
18
- post<T, U = string[]>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
19
- postFile(body: FormData): Promise<FileResponse>;
20
- postCSRF<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
21
- token(): Promise<ApiWrapper<string>>;
22
- tokenCSRF(): Promise<ApiWrapper<string>>;
23
- }
@@ -1 +0,0 @@
1
- export declare function wait<T>(obj: T, timeout?: number): Promise<T>;
@@ -1,7 +0,0 @@
1
- export declare type FetchReturnType = Promise<{
2
- json: () => unknown;
3
- }>;
4
- export interface WindowInterface {
5
- getBackendUrl: () => Promise<string>;
6
- fetch: (url: string, init?: RequestInit) => FetchReturnType;
7
- }
@@ -1,5 +0,0 @@
1
- import { WindowInterface } from './Window';
2
- export declare class WindowBrowser implements WindowInterface {
3
- getBackendUrl(): Promise<string>;
4
- fetch(url: string, init?: RequestInit): Promise<Response>;
5
- }
@@ -1,6 +0,0 @@
1
- import { FetchReturnType, WindowInterface } from './Window';
2
- export declare class WindowJestFetch implements WindowInterface {
3
- cookie?: string;
4
- getBackendUrl(): Promise<string>;
5
- fetch(url: string, init?: RequestInit): FetchReturnType;
6
- }
@@ -1,9 +0,0 @@
1
- import { FetchReturnType, WindowInterface } from './Window';
2
- export declare class WindowMobile implements WindowInterface {
3
- private token;
4
- private readonly backendUrl;
5
- constructor(backUrl: string);
6
- getBackendUrl(): Promise<string>;
7
- setToken(token: string): void;
8
- fetch(url: string, { headers, ...init }?: RequestInit): FetchReturnType;
9
- }
@@ -1,16 +0,0 @@
1
- import { FetchReturnType, WindowInterface } from './Window';
2
- export declare class WindowMock implements WindowInterface {
3
- /**
4
- * The data object is a 2 level record:
5
- * - the first key is the "o" parameter
6
- * - the second level key is the "f" parameter.
7
- * The value can be :
8
- * - the direct json value of the api call
9
- * - a method which mimics the api call
10
- */
11
- private readonly data;
12
- constructor();
13
- getBackendUrl(): Promise<string>;
14
- private static unwrap;
15
- fetch(url: string, init?: RequestInit): FetchReturnType;
16
- }