jamespot-user-api 1.0.43 → 1.0.44

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 (121) hide show
  1. package/documentation/classes/JApplication.html +1 -1
  2. package/documentation/classes/JApplicationApi.html +8 -8
  3. package/documentation/classes/JArticleApi.html +1 -1
  4. package/documentation/classes/JAudienceApi.html +1 -1
  5. package/documentation/classes/JBaseApi.html +1 -1
  6. package/documentation/classes/JBaseObject.html +1 -1
  7. package/documentation/classes/JBookmark.html +1 -1
  8. package/documentation/classes/JBookmarkApi.html +1 -1
  9. package/documentation/classes/JCommunityApi.html +1 -1
  10. package/documentation/classes/JConcept.html +1 -1
  11. package/documentation/classes/JConceptApi.html +1 -1
  12. package/documentation/classes/JDiapazoneApi.html +1 -1
  13. package/documentation/classes/JFileApi.html +1 -1
  14. package/documentation/classes/JFilebankApi.html +1 -1
  15. package/documentation/classes/JGroupApi.html +1 -1
  16. package/documentation/classes/JLandApi.html +1 -1
  17. package/documentation/classes/JMessengerApi.html +1 -1
  18. package/documentation/classes/JSearchApi.html +6 -6
  19. package/documentation/classes/JUser.html +1 -1
  20. package/documentation/classes/JUserApi.html +3 -3
  21. package/documentation/classes/JWedocApi.html +1 -1
  22. package/documentation/classes/JamespotUserApi.html +1 -1
  23. package/documentation/classes/Network.html +1 -1
  24. package/documentation/enums/JApplicationStatus.html +1 -1
  25. package/documentation/interfaces/ApiError.html +1 -1
  26. package/documentation/interfaces/ApiWrapper.html +1 -1
  27. package/documentation/interfaces/AseiGroups.html +1 -1
  28. package/documentation/interfaces/AseiInstitution.html +1 -1
  29. package/documentation/interfaces/AseiRights.html +1 -1
  30. package/documentation/interfaces/AseiTicket.html +1 -1
  31. package/documentation/interfaces/BaseAutocomplete.html +1 -1
  32. package/documentation/interfaces/BaseMessage.html +1 -1
  33. package/documentation/interfaces/Category.html +1 -1
  34. package/documentation/interfaces/CreateGroup.html +1 -1
  35. package/documentation/interfaces/FileBankProps.html +1 -1
  36. package/documentation/interfaces/FileOption.html +1 -1
  37. package/documentation/interfaces/FolderProps.html +1 -1
  38. package/documentation/interfaces/ListFilterSpec.html +1 -1
  39. package/documentation/interfaces/OF.html +1 -1
  40. package/documentation/interfaces/PagingResults.html +1 -1
  41. package/documentation/interfaces/Result.html +1 -1
  42. package/documentation/interfaces/RootFolderProps.html +1 -1
  43. package/documentation/interfaces/SearchCategoryModel.html +1 -1
  44. package/documentation/interfaces/SearchConfig.html +1 -1
  45. package/documentation/interfaces/SearchFacetModel.html +1 -1
  46. package/documentation/interfaces/SearchFacetValueModel.html +1 -1
  47. package/documentation/interfaces/SearchQuery.html +1 -1
  48. package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
  49. package/documentation/interfaces/SearchQueryOption.html +1 -1
  50. package/documentation/interfaces/SearchQueryResult.html +1 -1
  51. package/documentation/interfaces/SearchQuerySortModel.html +1 -1
  52. package/documentation/interfaces/SearchResultCatProps.html +1 -1
  53. package/documentation/interfaces/SearchResultProps.html +1 -1
  54. package/documentation/interfaces/SpotProps.html +1 -1
  55. package/documentation/interfaces/Taxonomy.html +1 -1
  56. package/documentation/interfaces/TaxonomyCreate.html +1 -1
  57. package/documentation/interfaces/TmpApplication.html +1 -1
  58. package/documentation/interfaces/TmpUser.html +1 -1
  59. package/documentation/interfaces/UserModel.html +1 -1
  60. package/documentation/modules.html +1 -1
  61. package/package.json +1 -1
  62. package/src/apis/application.ts +0 -132
  63. package/src/apis/article.ts +0 -74
  64. package/src/apis/asei.ts +0 -73
  65. package/src/apis/audience.ts +0 -18
  66. package/src/apis/base.ts +0 -9
  67. package/src/apis/bookmark.ts +0 -110
  68. package/src/apis/community.ts +0 -20
  69. package/src/apis/concept.ts +0 -31
  70. package/src/apis/diapazone.ts +0 -65
  71. package/src/apis/file.ts +0 -14
  72. package/src/apis/filebank.ts +0 -50
  73. package/src/apis/group.ts +0 -48
  74. package/src/apis/index.ts +0 -17
  75. package/src/apis/jamespotUserApi.ts +0 -69
  76. package/src/apis/jland.ts +0 -51
  77. package/src/apis/messenger.ts +0 -25
  78. package/src/apis/search.ts +0 -85
  79. package/src/apis/taxonomy.ts +0 -30
  80. package/src/apis/user.ts +0 -53
  81. package/src/apis/wedoc.ts +0 -77
  82. package/src/classes/JApplication.ts +0 -55
  83. package/src/classes/JBaseObject.ts +0 -64
  84. package/src/classes/JBookmark.ts +0 -44
  85. package/src/classes/JConcept.ts +0 -3
  86. package/src/classes/JDiapazone.ts +0 -42
  87. package/src/classes/JFile.ts +0 -37
  88. package/src/classes/JUser.ts +0 -7
  89. package/src/classes/index.ts +0 -5
  90. package/src/index.ts +0 -21
  91. package/src/indexMock.ts +0 -17
  92. package/src/mock/data/autocomplete/audience/data.json +0 -191
  93. package/src/mock/data/autocomplete/community/data.json +0 -47
  94. package/src/mock/data/autocomplete/taxonomy/data.json +0 -35
  95. package/src/mock/data/autocomplete/user/data.json +0 -107
  96. package/src/mock/data/bookmarks/addBookmark/data.json +0 -54
  97. package/src/mock/data/bookmarks/addLink/data.json +0 -63
  98. package/src/mock/data/bookmarks/bookmarkList/data.json +0 -271
  99. package/src/mock/data/bookmarks/delete/data.json +0 -12
  100. package/src/mock/data/community/sendRequest/data.json +0 -12
  101. package/src/mock/data/file/create/data.json +0 -18
  102. package/src/mock/data/messenger/newMessage/data.json +0 -47
  103. package/src/mock/data/misc/tokenCSRF/data.json +0 -7
  104. package/src/mock/data/search/getConfig/data.json +0 -318
  105. package/src/mock/data/search/lastQueries/data.json +0 -7
  106. package/src/mock/data/search/proposition/data.json +0 -125
  107. package/src/mock/data/spot/create/data.json +0 -7
  108. package/src/mock/data/spot/get-available-widget/data.json +0 -56
  109. package/src/mock/data/spot/get-categories/data.json +0 -28
  110. package/src/mock/data/user/signIn/data.json +0 -197
  111. package/src/mock/windowMock.ts +0 -113
  112. package/src/types/asei.ts +0 -33
  113. package/src/types/autocomplete.ts +0 -17
  114. package/src/types/group.ts +0 -27
  115. package/src/types/index.ts +0 -7
  116. package/src/types/listWrapper.ts +0 -6
  117. package/src/types/search.ts +0 -105
  118. package/src/types/taxonomy.ts +0 -47
  119. package/src/types/user.ts +0 -14
  120. package/src/types/utils.ts +0 -66
  121. package/src/util/network.ts +0 -96
@@ -1,85 +0,0 @@
1
- import { ApiWrapper, SearchConfig, SearchQuery, SearchQueryResult, SearchResultCatProps } from '../types';
2
- import { JBaseApi } from './base';
3
- import { OF } from '../util/network';
4
-
5
- export class JSearchApi extends JBaseApi {
6
- /**
7
- * return a completed version of the current config, taking in account platform installed modules
8
- */
9
- public getConfig(): Promise<ApiWrapper<SearchConfig>> {
10
- return this.network.post({ o: 'search', f: 'getConfig' });
11
- }
12
-
13
- /**
14
- * Return a maximum of 8 results for a given text query, classed upon config categories
15
- * @param query string, words can be preceded by + and - for inclusive/exclusive search
16
- * @param signal: @AbortSignal to cancel the fetch
17
- */
18
- public proposition(
19
- { query, format }: { query: string; format?: 'list' | 'little' },
20
- signal?: AbortSignal,
21
- ): Promise<ApiWrapper<SearchResultCatProps[]>> {
22
- return this.network.post({ o: 'search', f: 'proposition', query, format: format || 'little' } as OF, signal);
23
- }
24
-
25
- /**
26
- * Return a page of results based on a text query and various filters.
27
- * All parameters are optional
28
- * @param query
29
- * @param query.keywords string, words can be preceded by + and - for inclusive/exclusive search (default *:*)
30
- * @param query.category text id of a category from config,if specified: restrict results to these category
31
- * @param query.facetCategories boolean, if true: count by categories are returned
32
- * @param query.filters array of @SearchQueryFilterModel @SearchQueryFilterModel.
33
- * @param query.page integer. default 1. index of returned page (start by 1)
34
- * @param query.limit integer. default 20. number of result by page
35
- * @param query.sort @SearchQuerySortModel default score then date
36
- * @param query.options @SearchQueryOption. extra possible options for the search
37
- * @param signal: @AbortSignal to cancel the fetch
38
-
39
- * // Todo add query.facets (to be specified first)
40
- */
41
- public searchQuery(query: SearchQuery, signal?: AbortSignal): Promise<ApiWrapper<SearchQueryResult>> {
42
- const { keywords, category, facetCategories, filters, page, limit, sort, options } = query;
43
- return this.network.post(
44
- {
45
- o: 'search',
46
- f: 'query',
47
- keywords,
48
- category,
49
- facetCategories,
50
- filters,
51
- page,
52
- limit,
53
- sort,
54
- options,
55
- } as OF,
56
- signal,
57
- );
58
- }
59
-
60
- /**
61
- * return the five last keywords typed in the searchbar by the user
62
- */
63
- public getLastQueries(): Promise<ApiWrapper<string[]>> {
64
- return this.network.post({ o: 'search', f: 'getLastQueries' });
65
- }
66
-
67
- /**
68
- * return the current platform json search-config object
69
- */
70
- // FIXME when doing the search admin
71
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
- public getAdminConfig(): Promise<any> {
73
- return this.network.post({ o: 'search', f: 'getAdminConfig' });
74
- }
75
-
76
- /**
77
- * set the platform search-config to the given json object
78
- * @param config object. json search config
79
- */
80
- // FIXME when doing the search admin
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
- public setAdminConfig(config: any): Promise<any> {
83
- return this.network.post({ o: 'search', f: 'setAdminConfig', config } as OF);
84
- }
85
- }
@@ -1,30 +0,0 @@
1
- import { JBaseApi } from './base';
2
- import { OF } from '../util/network';
3
- import { ApiWrapper, BaseMessagesOne, Taxonomy, TaxonomyCreate } from '../types';
4
-
5
- export class JTaxonomyApi extends JBaseApi {
6
- /**
7
- * list all taxonomies (no pagination)
8
- */
9
- public list(): Promise<Taxonomy[]> {
10
- return this.network
11
- .post<Taxonomy[]>({
12
- o: 'taxonomy',
13
- f: 'list',
14
- } as OF)
15
- .then((res) => {
16
- if (Array.isArray(res.result)) {
17
- return res.result;
18
- }
19
- throw 'Bad response from backend';
20
- });
21
- }
22
-
23
- public create(taxonomy: TaxonomyCreate): Promise<ApiWrapper<Taxonomy, BaseMessagesOne>> {
24
- return this.network.post<Taxonomy, BaseMessagesOne>({
25
- o: 'taxonomy',
26
- f: 'create',
27
- ...taxonomy,
28
- } as OF);
29
- }
30
- }
package/src/apis/user.ts DELETED
@@ -1,53 +0,0 @@
1
- import { JBaseApi } from './base';
2
- import { JUser } from '../classes';
3
- import { OF } from '../util/network';
4
- import { ApiWrapper, Little } from '../types';
5
-
6
- export interface TmpUser {
7
- idUser: string;
8
- type: string;
9
- id: string;
10
- }
11
-
12
- export class JUserApi extends JBaseApi {
13
- /**
14
- * autocomplete return a list or JUser
15
- * @param query <string>
16
- */
17
- public autocomplete(query: string): Promise<Array<JUser>> {
18
- return this.network
19
- .post<Array<TmpUser>>({ o: 'autocomplete', f: 'user', q: query, idToUri: false } as OF)
20
- .then((res) => {
21
- if (Array.isArray(res.result)) {
22
- return res.result.map((user) => {
23
- const jUser = new JUser(user.idUser, user.type);
24
- jUser.hydrate(user);
25
- return jUser;
26
- });
27
- }
28
- throw 'Bad response from backend';
29
- });
30
- }
31
-
32
- /**
33
- * Get a user
34
- * @param uri uri
35
- * @param format little by default. If another format is provided, the generic types should be defined
36
- */
37
- public get<T extends Little = Little>(uri: string, format = 'little'): Promise<ApiWrapper<T>> {
38
- return this.network.post<T>({ o: 'user', f: 'get', uri, format } as OF);
39
- }
40
-
41
- /**
42
- * signIn function returns a Promise of JUser.
43
- * @param mail Mail or username
44
- * @param pwd Password to be validated
45
- */
46
- public signIn(mail: string, pwd: string): Promise<JUser> {
47
- return this.network.post<TmpUser>({ o: 'user', f: 'signIn', mail, password: pwd } as OF).then((res) => {
48
- const jUser = new JUser(res.result.id, res.result.type);
49
- jUser.hydrate(res.result);
50
- return jUser;
51
- });
52
- }
53
- }
package/src/apis/wedoc.ts DELETED
@@ -1,77 +0,0 @@
1
- import { ApiWrapper } from '../types';
2
- import { JBaseApi } from './base';
3
- import { OF } from '../util/network';
4
- import { ListWrapper } from '../types/listWrapper';
5
- import { jFile } from '../classes/JFile';
6
-
7
- type File = Record<string, object>;
8
-
9
- type FiletList = {
10
- page: number;
11
- cnt: number;
12
- limit: number;
13
- data: File[];
14
- };
15
-
16
- import { Orders, Filters } from '../types';
17
-
18
- export class JWedocApi extends JBaseApi {
19
- public getFiles(
20
- page: number,
21
- query: string,
22
- filters: Filters,
23
- orders: Orders,
24
- limit: number,
25
- ): Promise<ListWrapper<jFile>> {
26
- return this.network
27
- .post<FiletList>({ o: 'onlyOffice', f: 'getFiles', page, query, filters, orders, limit } as OF)
28
- .then((res) => {
29
- const result = res.result;
30
- if (Array.isArray(result.data)) {
31
- const data: jFile[] = result.data.map((entry) => jFile.createFromObject(entry));
32
- return { page: result.page, cnt: result.cnt, limit: result.limit, data };
33
- }
34
-
35
- throw {
36
- error: res.error,
37
- messages: res.messages,
38
- };
39
- });
40
- }
41
-
42
- public getTemplates(): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
43
- return this.network.post({ o: 'onlyOffice', f: 'getTemplates' } as OF);
44
- }
45
-
46
- public duplicateFile(
47
- idFile: number,
48
- title: string,
49
- publishTo: Array<any>,
50
- ): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
51
- return this.network.post({ o: 'onlyOffice', f: 'duplicateFile', idFile, title, publishTo } as OF);
52
- }
53
-
54
- public deleteFile(idFile: number): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
55
- return this.network.post({ o: 'onlyOffice', f: 'deleteFile', idFile } as OF);
56
- }
57
-
58
- public createFile(
59
- title: string,
60
- type: string,
61
- publishTo: Array<any>,
62
- ): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
63
- return this.network.post({ o: 'onlyOffice', f: 'createFile', title, type, publishTo } as OF);
64
- }
65
-
66
- public updateFile(
67
- idFile: number,
68
- title: string,
69
- publishTo: Array<string>,
70
- ): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
71
- return this.network.post({ o: 'onlyOffice', f: 'updateFile', idFile, title, publishTo } as OF);
72
- }
73
-
74
- public getFileInfo(idFile: number, mode: string): Promise<ApiWrapper<boolean, { code: number; msg: string }>> {
75
- return this.network.post({ o: 'onlyOffice', f: 'GetFileInfo', idFile, mode } as OF);
76
- }
77
- }
@@ -1,55 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* FIXME when working on studio typing */
3
-
4
- import { JBaseObject } from './JBaseObject';
5
-
6
- export enum JApplicationStatus {
7
- local = 'local',
8
- installed = 'installed',
9
- autosaved = 'autosaved',
10
- saved = 'saved',
11
- }
12
- export class JApplication extends JBaseObject {
13
- private status?: JApplicationStatus;
14
-
15
- public constructor(id?: string, type?: string, status?: JApplicationStatus) {
16
- super(id, type);
17
- if (status) {
18
- this.setStatus(status);
19
- } else {
20
- this.setStatus(JApplicationStatus.local);
21
- }
22
- }
23
-
24
- public get(prop: string): any {
25
- if (prop === 'status') {
26
- return this.getStatus();
27
- }
28
- return super.get(prop);
29
- }
30
-
31
- public set(prop: string, val: any): void {
32
- if (prop === 'status') {
33
- return this.setStatus(val);
34
- }
35
- return super.set(prop, val);
36
- }
37
-
38
- public setStatus(status: JApplicationStatus): void {
39
- this.status = status;
40
- }
41
- public getStatus(): JApplicationStatus | undefined {
42
- return this.status;
43
- }
44
-
45
- public updateUsing(newerJApplication: JApplication): JApplication {
46
- if (this.getId() === newerJApplication.getId() && this.getType() === newerJApplication.getType()) {
47
- Object.keys(newerJApplication.record).forEach((key: string) => {
48
- this.set(key, newerJApplication.get(key));
49
- });
50
- } else {
51
- throw new Error('Incompatible update');
52
- }
53
- return this;
54
- }
55
- }
@@ -1,64 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* FIXME when working on studio typing */
3
-
4
- /** Base class to represent objects retreived from or sent to the backend.
5
- * This JBaseObject is then derived to provide a more understandable result for each API.
6
- */
7
- export class JBaseObject {
8
- protected type?: string;
9
- protected id?: string;
10
- protected record: Record<string, any> = {};
11
-
12
- public constructor(id?: string, type?: string) {
13
- if (id) {
14
- this.set('id', id);
15
- }
16
- if (type) {
17
- this.set('type', type);
18
- }
19
- }
20
-
21
- public hydrate(data: any = {}): void {
22
- Object.keys(data).forEach((key) => {
23
- this.set(key, data[key]);
24
- });
25
- }
26
-
27
- public getType(): string | undefined {
28
- return this.type;
29
- }
30
-
31
- public getId(): string | undefined {
32
- return this.id;
33
- }
34
-
35
- public getUri(): string {
36
- return `${this.getType()}/${this.getId()}`;
37
- }
38
-
39
- public get(prop: string): any {
40
- switch (prop) {
41
- case 'type':
42
- return this.getType();
43
- case 'id':
44
- return this.getId();
45
- case 'uri':
46
- return this.getUri();
47
- default:
48
- return this.record[prop];
49
- }
50
- }
51
-
52
- public set(prop: string, val: any): void {
53
- switch (prop) {
54
- case 'type':
55
- this.type = val;
56
- break;
57
- case 'id':
58
- this.id = val;
59
- break;
60
- default:
61
- this.record[prop] = val;
62
- }
63
- }
64
- }
@@ -1,44 +0,0 @@
1
- export class JBookmark {
2
- public id?: number;
3
- public type?: string;
4
- public targetId?: number;
5
- public targetType?: string;
6
- public bookmarkUrl?: string;
7
- public bookmarkOrder?: number;
8
- public bookmarkLabel?: string;
9
- public bookmarkMeta?: string;
10
- public _cssClass?: string;
11
- public _cssColor?: string;
12
- public _values?: Record<string, string>;
13
- public url?: string;
14
-
15
- private static fields: string[] = [
16
- 'id',
17
- 'type',
18
- 'targetId',
19
- 'targetType',
20
- 'bookmarkUrl',
21
- 'bookmarkOrder',
22
- 'bookmarkLabel',
23
- 'bookmarkMeta',
24
- '_cssClass',
25
- '_cssColor',
26
- '_values',
27
- 'url',
28
- ];
29
-
30
- public static createFromObject(o: Record<string, object>): JBookmark {
31
- const toRet = new JBookmark();
32
- const copy: Record<string, object> = {};
33
- // Clean unknown elements
34
- JBookmark.fields.forEach((p) => {
35
- if (o[p] !== undefined) {
36
- copy[p] = o[p];
37
- }
38
- });
39
-
40
- Object.assign(toRet, copy);
41
-
42
- return toRet;
43
- }
44
- }
@@ -1,3 +0,0 @@
1
- import { JBaseObject } from './JBaseObject';
2
-
3
- export class JConcept extends JBaseObject {}
@@ -1,42 +0,0 @@
1
- export class JDiapazone {
2
- public id!: number;
3
- public title!: string;
4
- public type!: string;
5
- public _user?: Record<string, string>;
6
- public _audience?: Record<string, string>;
7
- public _audienceLeft?: number;
8
- public _right?: Record<string, string>;
9
- public _cssClass?: string;
10
- public _cssColor?: string;
11
- public _values?: Record<string, string>;
12
- public _extend?: Record<string, string>;
13
- public _url?: string;
14
-
15
- private static fields: string[] = [
16
- 'id',
17
- 'title',
18
- 'type',
19
- '_user',
20
- '_audience',
21
- '_audienceLeft',
22
- '_right',
23
- '_cssClass',
24
- '_cssColor',
25
- '_values',
26
- '_extend',
27
- '_url',
28
- ];
29
- public static createFromObject(o: Record<string, object>): JDiapazone {
30
- const toRet = new JDiapazone();
31
- const copy: Record<string, object> = {};
32
- // Clean unknown elements
33
- JDiapazone.fields.forEach((p) => {
34
- if (o[p] !== undefined) {
35
- copy[p] = o[p];
36
- }
37
- });
38
- Object.assign(toRet, copy);
39
-
40
- return toRet;
41
- }
42
- }
@@ -1,37 +0,0 @@
1
- export class jFile {
2
- public id!: number;
3
- public title!: string;
4
- public type!: string;
5
- public dateCreation!: string;
6
- public mimetype!: string;
7
- public _extend: any;
8
- public _user: any;
9
- public _right: any;
10
- public _audience: any;
11
-
12
- private static fields: string[] = [
13
- 'id',
14
- 'title',
15
- 'type',
16
- 'dateCreation',
17
- 'dateModified',
18
- 'mimetype',
19
- '_extend',
20
- '_user',
21
- '_right',
22
- '_audience',
23
- ];
24
- public static createFromObject(o: Record<string, object>): jFile {
25
- const toRet = new jFile();
26
- const copy: Record<string, object> = {};
27
- // Clean unknown elements
28
- jFile.fields.forEach((p) => {
29
- if (o[p] !== undefined) {
30
- copy[p] = o[p];
31
- }
32
- });
33
- Object.assign(toRet, copy);
34
-
35
- return toRet;
36
- }
37
- }
@@ -1,7 +0,0 @@
1
- import { JBaseObject } from './JBaseObject';
2
-
3
- export class JUser extends JBaseObject {
4
- public getMail(): string {
5
- return this.get('_values').mail;
6
- }
7
- }
@@ -1,5 +0,0 @@
1
- export * from './JApplication';
2
- export * from './JBaseObject';
3
- export * from './JConcept';
4
- export * from './JUser';
5
- export * from './JBookmark';
package/src/index.ts DELETED
@@ -1,21 +0,0 @@
1
- import { JamespotUserApi } from './apis/jamespotUserApi';
2
- import { Network } from './util/network';
3
-
4
- const network = new Network(window);
5
- const JamespotUserApiInstance = new JamespotUserApi(network);
6
-
7
- declare global {
8
- interface Window {
9
- JamespotUserApi: JamespotUserApi;
10
- }
11
- }
12
-
13
- window.JamespotUserApi = JamespotUserApiInstance;
14
-
15
- export { JamespotUserApiInstance };
16
- export default JamespotUserApiInstance;
17
-
18
- export * from './apis';
19
- export * from './types';
20
- export * from './classes';
21
- export * from './util/network';
package/src/indexMock.ts DELETED
@@ -1,17 +0,0 @@
1
- import { JamespotUserApi } from './apis';
2
- import { Network } from './util/network';
3
- import { WindowMock } from './mock/windowMock';
4
-
5
- const network = new Network(new WindowMock() as unknown as Window);
6
- const JamespotUserApiInstance = new JamespotUserApi(network);
7
-
8
- declare global {
9
- interface Window {
10
- JamespotUserApi: JamespotUserApi;
11
- }
12
- }
13
-
14
- window.JamespotUserApi = JamespotUserApiInstance;
15
-
16
- export { JamespotUserApiInstance };
17
- export default JamespotUserApiInstance;