@pax2pay/client 0.3.52 → 0.3.53

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 (97) hide show
  1. package/Client/Accounts/index.ts +40 -32
  2. package/Client/Beneficiaries/index.ts +15 -17
  3. package/Client/Cards/index.ts +62 -88
  4. package/Client/Categories/index.ts +9 -9
  5. package/Client/Configuration/index.ts +5 -9
  6. package/Client/Email/index.ts +1 -2
  7. package/Client/List.ts +4 -32
  8. package/Client/Omnisetup/index.ts +3 -1
  9. package/Client/Organisations/index.ts +7 -15
  10. package/Client/Reports/index.spec.ignore.ts +0 -7
  11. package/Client/Reports/index.ts +22 -33
  12. package/Client/Transfers/factory.ts +4 -2
  13. package/Client/Transfers/index.ts +4 -19
  14. package/Client/Users/index.ts +29 -33
  15. package/Client/index.ts +1 -20
  16. package/dist/Client/Accounts/index.d.ts +3 -6
  17. package/dist/Client/Accounts/index.js +25 -19
  18. package/dist/Client/Accounts/index.js.map +1 -1
  19. package/dist/Client/Beneficiaries/index.d.ts +3 -7
  20. package/dist/Client/Beneficiaries/index.js +11 -15
  21. package/dist/Client/Beneficiaries/index.js.map +1 -1
  22. package/dist/Client/Cards/index.d.ts +14 -19
  23. package/dist/Client/Cards/index.js +28 -61
  24. package/dist/Client/Cards/index.js.map +1 -1
  25. package/dist/Client/Categories/index.d.ts +4 -6
  26. package/dist/Client/Categories/index.js +7 -10
  27. package/dist/Client/Categories/index.js.map +1 -1
  28. package/dist/Client/Configuration/index.js +5 -9
  29. package/dist/Client/Configuration/index.js.map +1 -1
  30. package/dist/Client/Email/index.js +1 -2
  31. package/dist/Client/Email/index.js.map +1 -1
  32. package/dist/Client/List.d.ts +3 -24
  33. package/dist/Client/List.js +1 -17
  34. package/dist/Client/List.js.map +1 -1
  35. package/dist/Client/Omnisetup/index.js +3 -1
  36. package/dist/Client/Omnisetup/index.js.map +1 -1
  37. package/dist/Client/Organisations/index.d.ts +5 -6
  38. package/dist/Client/Organisations/index.js +7 -8
  39. package/dist/Client/Organisations/index.js.map +1 -1
  40. package/dist/Client/Reports/index.d.ts +1 -1
  41. package/dist/Client/Reports/index.js +15 -29
  42. package/dist/Client/Reports/index.js.map +1 -1
  43. package/dist/Client/Transfers/index.d.ts +3 -7
  44. package/dist/Client/Transfers/index.js +3 -15
  45. package/dist/Client/Transfers/index.js.map +1 -1
  46. package/dist/Client/Users/index.d.ts +5 -6
  47. package/dist/Client/Users/index.js +20 -27
  48. package/dist/Client/Users/index.js.map +1 -1
  49. package/dist/Client/index.d.ts +1 -21
  50. package/dist/Client/index.js.map +1 -1
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.js.map +1 -1
  53. package/dist/model/index.d.ts +1 -2
  54. package/dist/model/index.js.map +1 -1
  55. package/index.ts +0 -2
  56. package/model/index.ts +0 -2
  57. package/package.json +1 -1
  58. package/Client/Account/index.ts +0 -9
  59. package/Client/Beneficiary/index.ts +0 -9
  60. package/Client/Card/index.ts +0 -57
  61. package/Client/Collection.ts +0 -24
  62. package/Client/Organisation/index.ts +0 -9
  63. package/Client/Resource.ts +0 -25
  64. package/Client/Transfer/index.ts +0 -9
  65. package/Client/User/index.ts +0 -9
  66. package/Client/generatePagination.ts +0 -14
  67. package/dist/Client/Account/index.d.ts +0 -6
  68. package/dist/Client/Account/index.js +0 -7
  69. package/dist/Client/Account/index.js.map +0 -1
  70. package/dist/Client/Beneficiary/index.d.ts +0 -6
  71. package/dist/Client/Beneficiary/index.js +0 -7
  72. package/dist/Client/Beneficiary/index.js.map +0 -1
  73. package/dist/Client/Card/index.d.ts +0 -24
  74. package/dist/Client/Card/index.js +0 -25
  75. package/dist/Client/Card/index.js.map +0 -1
  76. package/dist/Client/Collection.d.ts +0 -31
  77. package/dist/Client/Collection.js +0 -19
  78. package/dist/Client/Collection.js.map +0 -1
  79. package/dist/Client/Organisation/index.d.ts +0 -6
  80. package/dist/Client/Organisation/index.js +0 -7
  81. package/dist/Client/Organisation/index.js.map +0 -1
  82. package/dist/Client/Resource.d.ts +0 -17
  83. package/dist/Client/Resource.js +0 -38
  84. package/dist/Client/Resource.js.map +0 -1
  85. package/dist/Client/Transfer/index.d.ts +0 -6
  86. package/dist/Client/Transfer/index.js +0 -7
  87. package/dist/Client/Transfer/index.js.map +0 -1
  88. package/dist/Client/User/index.d.ts +0 -6
  89. package/dist/Client/User/index.js +0 -7
  90. package/dist/Client/User/index.js.map +0 -1
  91. package/dist/Client/generatePagination.d.ts +0 -6
  92. package/dist/Client/generatePagination.js +0 -9
  93. package/dist/Client/generatePagination.js.map +0 -1
  94. package/dist/model/Sorting.d.ts +0 -8
  95. package/dist/model/Sorting.js +0 -2
  96. package/dist/model/Sorting.js.map +0 -1
  97. package/model/Sorting.ts +0 -6
@@ -1,57 +0,0 @@
1
- import * as model from "../../model"
2
- import { Connection } from "../Connection"
3
- import { Resource } from "../Resource"
4
-
5
- export class Card extends Resource<model.CardResponse | model.CardResponseV2, model.CreateCardRequest> {
6
- constructor(connection: Connection, folder: string, backend: model.CardResponse | model.CardResponseV2) {
7
- super(connection, folder, backend)
8
- }
9
- amend(request: model.AmendCardRequest): Promise<
10
- | model.CardResponse
11
- | (model.ErrorResponse & {
12
- status: 400 | 403 | 404 | 500 | 503
13
- })
14
- > {
15
- return this.connection.post<model.CardResponse>(`${this.folder}/amend`, request)
16
- }
17
- freeze(): Promise<
18
- | model.CardResponse
19
- | (model.ErrorResponse & {
20
- status: 400 | 403 | 404 | 500 | 503
21
- })
22
- > {
23
- return this.connection.get<model.CardResponse>(`${this.folder}/freeze`)
24
- }
25
- thaw(): Promise<
26
- | model.CardResponse
27
- | (model.ErrorResponse & {
28
- status: 400 | 403 | 404 | 500 | 503
29
- })
30
- > {
31
- return this.connection.get<model.CardResponse>(`${this.folder}/thaw`)
32
- }
33
- cancel(): Promise<
34
- | model.CardResponse
35
- | (model.ErrorResponse & {
36
- status: 400 | 403 | 404 | 500 | 503
37
- })
38
- > {
39
- return this.connection.get<model.CardResponse>(`${this.folder}/cancel`)
40
- }
41
- process(): Promise<
42
- | model.CardResponse
43
- | (model.ErrorResponse & {
44
- status: 400 | 403 | 404 | 500 | 503
45
- })
46
- > {
47
- return this.connection.get<model.CardResponse>(`${this.folder}/statements/processed`)
48
- }
49
- getTransactions(): Promise<
50
- | model.CardResponse
51
- | (model.ErrorResponse & {
52
- status: 400 | 403 | 404 | 500 | 503
53
- })
54
- > {
55
- return this.connection.get<model.TransactionResponse>(`${this.folder}/transactions`)
56
- }
57
- }
@@ -1,24 +0,0 @@
1
- import { Connection } from "./Connection"
2
- import { List } from "./List"
3
-
4
- export abstract class Collection<
5
- Response extends { [key: string]: any },
6
- Search extends { [key: string]: any },
7
- Request extends { [key: string]: any }
8
- > extends List<Response, Search> {
9
- constructor(connection: Connection) {
10
- super(connection)
11
- }
12
- async fetch(resource?: string) {
13
- return this.convert(await this.connection.get<Response>(`${this.folder}/${resource}`))
14
- }
15
- async create(request: Request) {
16
- return this.convert(await this.connection.post<Response>(this.folder, request))
17
- }
18
- async remove(user: string) {
19
- return this.convert(await this.connection.remove<Response>(`${this.folder}/${user}`))
20
- }
21
- async update(request: Request) {
22
- return this.convert(await this.connection.put<Response>(`${this.folder}/${request.user}`, request))
23
- }
24
- }
@@ -1,9 +0,0 @@
1
- import * as model from "../../model"
2
- import { Connection } from "../Connection"
3
- import { Resource } from "../Resource"
4
-
5
- export class Organisation extends Resource<model.OrganisationResponse, model.OrganisationResponse> {
6
- constructor(connection: Connection, folder: string, backend: model.OrganisationResponse) {
7
- super(connection, folder, backend)
8
- }
9
- }
@@ -1,25 +0,0 @@
1
- import { Connection } from "./Connection"
2
-
3
- export class Resource<Response, Request> {
4
- #connection: Connection
5
- protected get connection() {
6
- return this.#connection
7
- }
8
- #backend: Response
9
- protected get backend() {
10
- return this.#backend
11
- }
12
- constructor(connection: Connection, protected readonly folder: string, backend: Response) {
13
- this.#connection = connection
14
- this.#backend = backend
15
- }
16
- reload() {
17
- return this.connection.get<Response>(`${this.folder}`)
18
- }
19
- update(request: Request) {
20
- return this.connection.put<Response>(`${this.folder}`, request)
21
- }
22
- remove() {
23
- return this.connection.remove<Response>(`${this.folder}`)
24
- }
25
- }
@@ -1,9 +0,0 @@
1
- import * as model from "../../model"
2
- import { Connection } from "../Connection"
3
- import { Resource } from "../Resource"
4
-
5
- export class Transfer extends Resource<model.TransferResponse, model.TransferRequest> {
6
- constructor(connection: Connection, folder: string, backend: model.TransferResponse) {
7
- super(connection, folder, backend)
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import * as model from "../../model"
2
- import { Connection } from "../Connection"
3
- import { Resource } from "../Resource"
4
-
5
- export class User extends Resource<model.UserResponse, model.UserResponse> {
6
- constructor(connection: Connection, folder: string, backend: model.UserResponse) {
7
- super(connection, folder, backend)
8
- }
9
- }
@@ -1,14 +0,0 @@
1
- import * as model from "../model"
2
-
3
- export function generatePagination<T extends { [key: string]: any } = { [key: string]: any }>(
4
- page = 0,
5
- size = 20,
6
- sort: model.Sorting<T>[] = []
7
- ): string {
8
- const result = [
9
- ...(page ? [`page=${page}`] : []),
10
- ...(size ? [`size=${size}`] : []),
11
- ...sort.map(s => `sort=${String(typeof s == "object" ? s + (s.direction == "descending" ? "desc" : "") : s)}`),
12
- ].join("&")
13
- return result ? "?" + result : ""
14
- }
@@ -1,6 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class Account extends Resource<model.AccountResponse, model.AccountCreationRequest> {
5
- constructor(connection: Connection, folder: string, backend: model.AccountResponse);
6
- }
@@ -1,7 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class Account extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- }
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Account/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,OAAQ,SAAQ,QAA6D;IACzF,YAAY,UAAsB,EAAE,MAAc,EAAE,OAA8B;QACjF,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class Beneficiary extends Resource<model.BeneficiaryResponse, model.BeneficiaryRequest> {
5
- constructor(connection: Connection, folder: string, backend: model.BeneficiaryResponse);
6
- }
@@ -1,7 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class Beneficiary extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- }
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Beneficiary/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,WAAY,SAAQ,QAA6D;IAC7F,YAAY,UAAsB,EAAE,MAAc,EAAE,OAAkC;QACrF,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,24 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class Card extends Resource<model.CardResponse | model.CardResponseV2, model.CreateCardRequest> {
5
- constructor(connection: Connection, folder: string, backend: model.CardResponse | model.CardResponseV2);
6
- amend(request: model.AmendCardRequest): Promise<model.CardResponse | (model.ErrorResponse & {
7
- status: 400 | 403 | 404 | 500 | 503;
8
- })>;
9
- freeze(): Promise<model.CardResponse | (model.ErrorResponse & {
10
- status: 400 | 403 | 404 | 500 | 503;
11
- })>;
12
- thaw(): Promise<model.CardResponse | (model.ErrorResponse & {
13
- status: 400 | 403 | 404 | 500 | 503;
14
- })>;
15
- cancel(): Promise<model.CardResponse | (model.ErrorResponse & {
16
- status: 400 | 403 | 404 | 500 | 503;
17
- })>;
18
- process(): Promise<model.CardResponse | (model.ErrorResponse & {
19
- status: 400 | 403 | 404 | 500 | 503;
20
- })>;
21
- getTransactions(): Promise<model.CardResponse | (model.ErrorResponse & {
22
- status: 400 | 403 | 404 | 500 | 503;
23
- })>;
24
- }
@@ -1,25 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class Card extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- amend(request) {
7
- return this.connection.post(`${this.folder}/amend`, request);
8
- }
9
- freeze() {
10
- return this.connection.get(`${this.folder}/freeze`);
11
- }
12
- thaw() {
13
- return this.connection.get(`${this.folder}/thaw`);
14
- }
15
- cancel() {
16
- return this.connection.get(`${this.folder}/cancel`);
17
- }
18
- process() {
19
- return this.connection.get(`${this.folder}/statements/processed`);
20
- }
21
- getTransactions() {
22
- return this.connection.get(`${this.folder}/transactions`);
23
- }
24
- }
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Card/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,IAAK,SAAQ,QAA4E;IACrG,YAAY,UAAsB,EAAE,MAAc,EAAE,OAAkD;QACrG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;IACD,KAAK,CAAC,OAA+B;QAMpC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAqB,GAAG,IAAI,CAAC,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAA;IACjF,CAAC;IACD,MAAM;QAML,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAqB,GAAG,IAAI,CAAC,MAAM,SAAS,CAAC,CAAA;IACxE,CAAC;IACD,IAAI;QAMH,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAqB,GAAG,IAAI,CAAC,MAAM,OAAO,CAAC,CAAA;IACtE,CAAC;IACD,MAAM;QAML,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAqB,GAAG,IAAI,CAAC,MAAM,SAAS,CAAC,CAAA;IACxE,CAAC;IACD,OAAO;QAMN,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAqB,GAAG,IAAI,CAAC,MAAM,uBAAuB,CAAC,CAAA;IACtF,CAAC;IACD,eAAe;QAMd,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAA4B,GAAG,IAAI,CAAC,MAAM,eAAe,CAAC,CAAA;IACrF,CAAC;CACD"}
@@ -1,31 +0,0 @@
1
- import { Connection } from "./Connection";
2
- import { List } from "./List";
3
- export declare abstract class Collection<Response extends {
4
- [key: string]: any;
5
- }, Search extends {
6
- [key: string]: any;
7
- }, Request extends {
8
- [key: string]: any;
9
- }> extends List<Response, Search> {
10
- constructor(connection: Connection);
11
- fetch(resource?: string): Promise<(import("..").ErrorResponse & {
12
- status: 400 | 404 | 500 | 403 | 503;
13
- }) | (import("./Resource").Resource<Response, {
14
- [key: string]: any;
15
- }> & Response)>;
16
- create(request: Request): Promise<(import("..").ErrorResponse & {
17
- status: 400 | 404 | 500 | 403 | 503;
18
- }) | (import("./Resource").Resource<Response, {
19
- [key: string]: any;
20
- }> & Response)>;
21
- remove(user: string): Promise<(import("..").ErrorResponse & {
22
- status: 400 | 404 | 500 | 403 | 503;
23
- }) | (import("./Resource").Resource<Response, {
24
- [key: string]: any;
25
- }> & Response)>;
26
- update(request: Request): Promise<(import("..").ErrorResponse & {
27
- status: 400 | 404 | 500 | 403 | 503;
28
- }) | (import("./Resource").Resource<Response, {
29
- [key: string]: any;
30
- }> & Response)>;
31
- }
@@ -1,19 +0,0 @@
1
- import { List } from "./List";
2
- export class Collection extends List {
3
- constructor(connection) {
4
- super(connection);
5
- }
6
- async fetch(resource) {
7
- return this.convert(await this.connection.get(`${this.folder}/${resource}`));
8
- }
9
- async create(request) {
10
- return this.convert(await this.connection.post(this.folder, request));
11
- }
12
- async remove(user) {
13
- return this.convert(await this.connection.remove(`${this.folder}/${user}`));
14
- }
15
- async update(request) {
16
- return this.convert(await this.connection.put(`${this.folder}/${request.user}`, request));
17
- }
18
- }
19
- //# sourceMappingURL=Collection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Collection.js","sourceRoot":"../","sources":["Client/Collection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,OAAgB,UAIpB,SAAQ,IAAsB;IAC/B,YAAY,UAAsB;QACjC,KAAK,CAAC,UAAU,CAAC,CAAA;IAClB,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,QAAiB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAA;IACvF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAW,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAChF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAW,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAA;IACtF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;IACpG,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class Organisation extends Resource<model.OrganisationResponse, model.OrganisationResponse> {
5
- constructor(connection: Connection, folder: string, backend: model.OrganisationResponse);
6
- }
@@ -1,7 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class Organisation extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- }
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Organisation/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,YAAa,SAAQ,QAAgE;IACjG,YAAY,UAAsB,EAAE,MAAc,EAAE,OAAmC;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,17 +0,0 @@
1
- import { Connection } from "./Connection";
2
- export declare class Resource<Response, Request> {
3
- #private;
4
- protected readonly folder: string;
5
- protected get connection(): Connection;
6
- protected get backend(): Response;
7
- constructor(connection: Connection, folder: string, backend: Response);
8
- reload(): Promise<Response | (import("..").ErrorResponse & {
9
- status: 400 | 404 | 500 | 403 | 503;
10
- })>;
11
- update(request: Request): Promise<Response | (import("..").ErrorResponse & {
12
- status: 400 | 404 | 500 | 403 | 503;
13
- })>;
14
- remove(): Promise<Response | (import("..").ErrorResponse & {
15
- status: 400 | 404 | 500 | 403 | 503;
16
- })>;
17
- }
@@ -1,38 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
- if (kind === "m") throw new TypeError("Private method is not writable");
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
- };
12
- var _Resource_connection, _Resource_backend;
13
- export class Resource {
14
- get connection() {
15
- return __classPrivateFieldGet(this, _Resource_connection, "f");
16
- }
17
- get backend() {
18
- return __classPrivateFieldGet(this, _Resource_backend, "f");
19
- }
20
- constructor(connection, folder, backend) {
21
- this.folder = folder;
22
- _Resource_connection.set(this, void 0);
23
- _Resource_backend.set(this, void 0);
24
- __classPrivateFieldSet(this, _Resource_connection, connection, "f");
25
- __classPrivateFieldSet(this, _Resource_backend, backend, "f");
26
- }
27
- reload() {
28
- return this.connection.get(`${this.folder}`);
29
- }
30
- update(request) {
31
- return this.connection.put(`${this.folder}`, request);
32
- }
33
- remove() {
34
- return this.connection.remove(`${this.folder}`);
35
- }
36
- }
37
- _Resource_connection = new WeakMap(), _Resource_backend = new WeakMap();
38
- //# sourceMappingURL=Resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Resource.js","sourceRoot":"../","sources":["Client/Resource.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAM,OAAO,QAAQ;IAEpB,IAAc,UAAU;QACvB,OAAO,uBAAA,IAAI,4BAAY,CAAA;IACxB,CAAC;IAED,IAAc,OAAO;QACpB,OAAO,uBAAA,IAAI,yBAAS,CAAA;IACrB,CAAC;IACD,YAAY,UAAsB,EAAqB,MAAc,EAAE,OAAiB;QAAjC,WAAM,GAAN,MAAM,CAAQ;QARrE,uCAAuB;QAIvB,oCAAkB;QAKjB,uBAAA,IAAI,wBAAe,UAAU,MAAA,CAAA;QAC7B,uBAAA,IAAI,qBAAY,OAAO,MAAA,CAAA;IACxB,CAAC;IACD,MAAM;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACvD,CAAC;IACD,MAAM,CAAC,OAAgB;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAW,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IACD,MAAM;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAW,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC1D,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class Transfer extends Resource<model.TransferResponse, model.TransferRequest> {
5
- constructor(connection: Connection, folder: string, backend: model.TransferResponse);
6
- }
@@ -1,7 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class Transfer extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- }
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transfer/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,QAAS,SAAQ,QAAuD;IACpF,YAAY,UAAsB,EAAE,MAAc,EAAE,OAA+B;QAClF,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import * as model from "../../model";
2
- import { Connection } from "../Connection";
3
- import { Resource } from "../Resource";
4
- export declare class User extends Resource<model.UserResponse, model.UserResponse> {
5
- constructor(connection: Connection, folder: string, backend: model.UserResponse);
6
- }
@@ -1,7 +0,0 @@
1
- import { Resource } from "../Resource";
2
- export class User extends Resource {
3
- constructor(connection, folder, backend) {
4
- super(connection, folder, backend);
5
- }
6
- }
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/User/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,IAAK,SAAQ,QAAgD;IACzE,YAAY,UAAsB,EAAE,MAAc,EAAE,OAA2B;QAC9E,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import * as model from "../model";
2
- export declare function generatePagination<T extends {
3
- [key: string]: any;
4
- } = {
5
- [key: string]: any;
6
- }>(page?: number, size?: number, sort?: model.Sorting<T>[]): string;
@@ -1,9 +0,0 @@
1
- export function generatePagination(page = 0, size = 20, sort = []) {
2
- const result = [
3
- ...(page ? [`page=${page}`] : []),
4
- ...(size ? [`size=${size}`] : []),
5
- ...sort.map(s => `sort=${String(typeof s == "object" ? s + (s.direction == "descending" ? "desc" : "") : s)}`),
6
- ].join("&");
7
- return result ? "?" + result : "";
8
- }
9
- //# sourceMappingURL=generatePagination.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generatePagination.js","sourceRoot":"../","sources":["Client/generatePagination.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CACjC,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,EAAE,EACT,OAA2B,EAAE;IAE7B,MAAM,MAAM,GAAG;QACd,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,MAAM,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9G,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACX,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;AAClC,CAAC"}
@@ -1,8 +0,0 @@
1
- export type Sorting<T extends {
2
- [key: string]: any;
3
- } = {
4
- [key: string]: any;
5
- }> = keyof T | {
6
- property: keyof T;
7
- direction?: "ascending" | "descending";
8
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Sorting.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sorting.js","sourceRoot":"../","sources":["model/Sorting.ts"],"names":[],"mappings":""}
package/model/Sorting.ts DELETED
@@ -1,6 +0,0 @@
1
- export type Sorting<T extends { [key: string]: any } = { [key: string]: any }> =
2
- | keyof T
3
- | {
4
- property: keyof T
5
- direction?: "ascending" | "descending"
6
- }