@pax2pay/client 0.10.10 → 0.10.13

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.
@@ -21,10 +21,8 @@ jobs:
21
21
  uses: "actions/setup-node@v3"
22
22
  with:
23
23
  node-version: 20
24
- - name: Update NPM
25
- run: npm install -g npm
26
- - name: Install Dependencies
27
- run: npm install
24
+ - name: Install
25
+ run: npm ci
28
26
  - name: Build
29
27
  run: npm run build
30
28
  - name: Lint
@@ -6,7 +6,7 @@ on:
6
6
  - "master"
7
7
  jobs:
8
8
  bump-version:
9
- name: "Deploy from master"
9
+ name: "Bump Version"
10
10
  timeout-minutes: 60
11
11
  runs-on: ubuntu-latest
12
12
  if: "!contains(github.event.head_commit.message, 'ci: version bump to ')"
@@ -20,8 +20,7 @@ jobs:
20
20
  uses: "actions/setup-node@v3"
21
21
  with:
22
22
  node-version: 20
23
- - name: Update NPM
24
- run: npm install -g npm
23
+ cache: 'npm'
25
24
  - name: "Version Bump"
26
25
  id: version-bump
27
26
  uses: "phips28/gh-action-bump-version@master"
@@ -16,10 +16,8 @@ jobs:
16
16
  uses: "actions/setup-node@v3"
17
17
  with:
18
18
  node-version: 20
19
- - name: Update NPM
20
- run: npm install -g npm
21
19
  - name: Install
22
- run: npm install
20
+ run: npm ci
23
21
  - name: Build
24
22
  run: npm run build
25
23
  - name: Publish
@@ -10,6 +10,9 @@ export class Batch extends List<model.Batch.Response> {
10
10
  static create(connection: Connection) {
11
11
  return new Batch(connection)
12
12
  }
13
+ async create(type: model.Batch.Type, request: Blob): Promise<model.Batch.Response | model.ErrorResponse> {
14
+ return await this.connection.post<model.Batch.Response>(`${this.folder}/${type}`, request)
15
+ }
13
16
  async get(batchId: string): Promise<model.Batch.Response | model.ErrorResponse> {
14
17
  return await this.connection.get<model.Batch.Response>(`${this.folder}/${batchId}`)
15
18
  }
@@ -27,91 +27,117 @@ export class Connection {
27
27
  set assumedOrg(value: string | undefined) {
28
28
  this.#assumedOrg = value
29
29
  }
30
-
31
- async fetch<Response, Codes = 400 | 403 | 404 | 500>(
30
+ async fetch<T, Codes = 400 | 403 | 404 | 500>(
32
31
  path: string,
33
32
  method: string,
34
33
  request?: any,
35
34
  parameters?: Record<string, any>,
36
- header?: any
37
- ): Promise<Response | (model.ErrorResponse & { status?: number; value?: string })> {
38
- const isMultipart = request && request instanceof FormData
39
- const cookie = window.localStorage.getItem("cookie")
40
- const publicKey = Session.publicKey.get()
41
- let requestHeaders: Record<string, string> = { "x-invoking-system": "portal_2" }
42
- if (!isMultipart)
43
- requestHeaders = {
44
- ...header,
45
- ...requestHeaders,
46
- "Content-Type": "application/json; charset=utf-8",
47
- }
35
+ overrides?: Record<string, string>
36
+ ): Promise<T | (model.ErrorResponse & { status?: number; value?: string })> {
37
+ const url = this.buildUrl(path, parameters)
38
+ const headers = this.prepareHeaders(request, overrides)
39
+ const body = this.prepareBody(request)
40
+
48
41
  try {
49
- const data = Session.authentication.get()
50
- this.#token = data?.token
51
- } catch (e) {
52
- if (this.token)
53
- console.error("Caught exception ", JSON.stringify(e))
42
+ const response = await fetch(url, { method, headers, body })
43
+
44
+ // Handle Side Effects (Cookies/2FA)
45
+ this.handleSessionSideEffects(response)
46
+
47
+ // Handle Auth Challenges
48
+ if (response.status === 401 && (await this.unauthorized(this))) {
49
+ return this.fetch<T, Codes>(path, method, request, parameters, overrides)
50
+ }
51
+
52
+ return await this.parseResponse(response)
53
+ } catch (error: any) {
54
+ console.error("Fetch Error:", error)
55
+ return { code: 500, errors: [{ message: error.message || "Internal Server Error" }] }
56
+ }
57
+ }
58
+ private buildUrl(path: string, parameters?: Record<string, any>): string {
59
+ const url = new URL(`${this.url}/${path}`)
60
+ if (parameters) {
61
+ Object.entries(parameters).forEach(([key, value]) => {
62
+ if (value === undefined)
63
+ return
64
+ // Handles arrays as comma-separated strings
65
+ url.searchParams.append(key, Array.isArray(value) ? value.join(",") : String(value))
66
+ })
67
+ }
68
+ return url.toString()
69
+ }
70
+ private prepareBody(request: any): BodyInit | undefined {
71
+ if (!request)
72
+ return undefined
73
+ if (request instanceof FormData || request instanceof Blob)
74
+ return request
75
+
76
+ // Clean strings by trimming before stringifying
77
+ return JSON.stringify(request, (_, v) => (typeof v === "string" ? v.trim() : v))
78
+ }
79
+ private prepareHeaders(request: any, overrides?: Record<string, string>): Record<string, string> {
80
+ const headers: Record<string, string> = {
81
+ "x-invoking-system": "portal_2",
82
+ ...overrides,
83
+ }
84
+
85
+ // Content-Type Logic
86
+ if (request instanceof Blob) {
87
+ headers["Content-Type"] = `${request.type}; charset=utf-8`
88
+ } else if (!(request instanceof FormData)) {
89
+ headers["Content-Type"] = "application/json"
54
90
  }
55
- if (this.token)
56
- requestHeaders["X-Auth-Token"] = this.token
91
+
92
+ // Session & Auth
93
+ const token = Session.authentication.get()?.token || this.token
94
+ if (token)
95
+ headers["X-Auth-Token"] = token
57
96
  if (this.#pax2payPortalLanguage)
58
- requestHeaders["Pax2pay-Portal-Language"] = this.#pax2payPortalLanguage
97
+ headers["Pax2pay-Portal-Language"] = this.#pax2payPortalLanguage
59
98
  if (this.assumedOrg)
60
- requestHeaders["x-assume"] = this.assumedOrg
99
+ headers["x-assume"] = this.assumedOrg
100
+
101
+ const cookie = window.localStorage.getItem("cookie")
61
102
  if (cookie)
62
- requestHeaders["x-otp-cookie"] = cookie
103
+ headers["x-otp-cookie"] = cookie
104
+
105
+ const publicKey = Session.publicKey.get()
63
106
  if (publicKey)
64
- requestHeaders["cde-public-key"] = publicKey
65
- let caughtErrorResponse
66
- const response = await fetch(
67
- this.url +
68
- "/" +
69
- path +
70
- (parameters
71
- ? "?" +
72
- Object.entries(parameters)
73
- .map(([key, value]) =>
74
- Array.isArray(value) ? `${key}=${value.join(",")}` : value != undefined ? `${key}=${value}` : undefined
75
- )
76
- .filter(param => param != undefined)
77
- .join("&")
78
- : ""),
79
- {
80
- method,
81
- headers: requestHeaders,
82
- body: !isMultipart
83
- ? request && JSON.stringify(request, (_, value) => (typeof value == "string" ? value.trim() : value))
84
- : request,
85
- }
86
- ).catch((error: Error) => {
87
- caughtErrorResponse = { code: 500, errors: [{ message: error.message }] }
88
- console.error(error)
89
- })
90
- if (caughtErrorResponse)
91
- return caughtErrorResponse
92
- if (response && response.headers.has("x-otp-cookie"))
93
- window.localStorage.setItem("cookie", response.headers.get("x-otp-cookie") ?? "")
94
- //get temp token to set up 2fa before login
95
- if (
96
- response &&
97
- response.status == 403 &&
98
- (response.url.includes("login") || response.url.includes("sso/google")) &&
99
- response.headers.has("X-Auth-Token")
100
- )
107
+ headers["cde-public-key"] = publicKey
108
+
109
+ return headers
110
+ }
111
+
112
+ private handleSessionSideEffects(response: Response): void {
113
+ const otpCookie = response.headers.get("x-otp-cookie")
114
+ if (otpCookie)
115
+ window.localStorage.setItem("cookie", otpCookie)
116
+
117
+ const isLoginPath = response.url.includes("login") || response.url.includes("sso/google")
118
+ if (response.status === 403 && isLoginPath && response.headers.has("X-Auth-Token")) {
101
119
  Session.authentication.set({ token: response.headers.get("X-Auth-Token") ?? undefined })
120
+ }
121
+ }
122
+ private async parseResponse(response: Response): Promise<any> {
123
+ if (!response || response.status === 503) {
124
+ return { code: 503, errors: [{ message: "Service unavailable" }] }
125
+ }
102
126
 
103
- return !response
104
- ? { code: 503, errors: [{ message: "Service unavailable" }] }
105
- : response.status == 401 && (await this.unauthorized(this))
106
- ? await this.fetch<Response, Codes>(path, method, request, parameters)
107
- : response.headers.get("Content-Type")?.startsWith("application/json")
108
- ? response.ok
109
- ? response.headers.has("x-total-count")
110
- ? ({ list: await response.json(), totalCount: response.headers.get("x-total-count") } as Response)
111
- : await response.json()
112
- : { status: response.status, ...(await response.json()) }
113
- : { status: response.status, value: await response.text() }
127
+ const contentType = response.headers.get("Content-Type") ?? ""
128
+
129
+ if (contentType.includes("application/json")) {
130
+ const json = await response.json()
131
+ if (!response.ok)
132
+ return { status: response.status, ...json }
133
+
134
+ const totalCount = response.headers.get("x-total-count")
135
+ return totalCount ? { list: json, totalCount } : json
136
+ }
137
+ // Fallback
138
+ return { status: response.status, value: await response.text() }
114
139
  }
140
+
115
141
  async post<Response, Codes = 400 | 403 | 404 | 500>(
116
142
  path: string,
117
143
  request: any,
@@ -6,6 +6,7 @@ export declare class Batch extends List<model.Batch.Response> {
6
6
  protected readonly folder = "batch";
7
7
  private constructor();
8
8
  static create(connection: Connection): Batch;
9
+ create(type: model.Batch.Type, request: Blob): Promise<model.Batch.Response | model.ErrorResponse>;
9
10
  get(batchId: string): Promise<model.Batch.Response | model.ErrorResponse>;
10
11
  listByType(type: model.Batch.Type, previous?: Paginated<model.Batch.Response>, page?: number, size?: number, sort?: string): Promise<Paginated<model.Batch.Response> | model.ErrorResponse>;
11
12
  run(batchId: string, otp?: string): Promise<model.Batch.Response | model.ErrorResponse>;
@@ -7,6 +7,9 @@ export class Batch extends List {
7
7
  static create(connection) {
8
8
  return new Batch(connection);
9
9
  }
10
+ async create(type, request) {
11
+ return await this.connection.post(`${this.folder}/${type}`, request);
12
+ }
10
13
  async get(batchId) {
11
14
  return await this.connection.get(`${this.folder}/${batchId}`);
12
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Batch/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,OAAO,KAAM,SAAQ,IAA0B;IAEpD,YAAoB,UAAsB;QACzC,KAAK,CAAC,UAAU,CAAC,CAAA;QAFC,WAAM,GAAG,OAAO,CAAA;IAGnC,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;IAC7B,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAe;QACxB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAuB,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC,CAAA;IACpF,CAAC;IACD,KAAK,CAAC,UAAU,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AAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAC3B,CAAA;IACF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe;QAC3B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAuB,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,SAAS,CAAC,CAAA;IAC3F,CAAC;IACD,KAAK,CAAC,SAAS,CACd,OAAe,EACf,QAAuB,EACvB,IAAa,EACb,IAAa;QAEb,OAAO,MAAM,IAAI,CAAC,gBAAgB,CACjC,QAAQ,EACR,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CACpB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAoC,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,QAAQ,EAAE;YACzF,IAAI;YACJ,IAAI;YACJ,IAAI;SACJ,CAAC,EACH,SAAS,EACT,IAAI,EACJ,IAAI,CACJ,CAAA;IACF,CAAC;CACD"}
@@ -9,10 +9,15 @@ export declare class Connection {
9
9
  private constructor();
10
10
  get assumedOrg(): string | undefined;
11
11
  set assumedOrg(value: string | undefined);
12
- fetch<Response, Codes = 400 | 403 | 404 | 500>(path: string, method: string, request?: any, parameters?: Record<string, any>, header?: any): Promise<Response | (model.ErrorResponse & {
12
+ fetch<T, Codes = 400 | 403 | 404 | 500>(path: string, method: string, request?: any, parameters?: Record<string, any>, overrides?: Record<string, string>): Promise<T | (model.ErrorResponse & {
13
13
  status?: number;
14
14
  value?: string;
15
15
  })>;
16
+ private buildUrl;
17
+ private prepareBody;
18
+ private prepareHeaders;
19
+ private handleSessionSideEffects;
20
+ private parseResponse;
16
21
  post<Response, Codes = 400 | 403 | 404 | 500>(path: string, request: any, parameters?: Record<string, any>, header?: any): Promise<Response | (model.ErrorResponse & {
17
22
  status?: number;
18
23
  value?: string;
@@ -35,75 +35,89 @@ export class Connection {
35
35
  set assumedOrg(value) {
36
36
  __classPrivateFieldSet(this, _Connection_assumedOrg, value, "f");
37
37
  }
38
- async fetch(path, method, request, parameters, header) {
39
- const isMultipart = request && request instanceof FormData;
40
- const cookie = window.localStorage.getItem("cookie");
41
- const publicKey = Session.publicKey.get();
42
- let requestHeaders = { "x-invoking-system": "portal_2" };
43
- if (!isMultipart)
44
- requestHeaders = {
45
- ...header,
46
- ...requestHeaders,
47
- "Content-Type": "application/json; charset=utf-8",
48
- };
38
+ async fetch(path, method, request, parameters, overrides) {
39
+ const url = this.buildUrl(path, parameters);
40
+ const headers = this.prepareHeaders(request, overrides);
41
+ const body = this.prepareBody(request);
49
42
  try {
50
- const data = Session.authentication.get();
51
- __classPrivateFieldSet(this, _Connection_token, data?.token, "f");
43
+ const response = await fetch(url, { method, headers, body });
44
+ this.handleSessionSideEffects(response);
45
+ if (response.status === 401 && (await this.unauthorized(this))) {
46
+ return this.fetch(path, method, request, parameters, overrides);
47
+ }
48
+ return await this.parseResponse(response);
49
+ }
50
+ catch (error) {
51
+ console.error("Fetch Error:", error);
52
+ return { code: 500, errors: [{ message: error.message || "Internal Server Error" }] };
53
+ }
54
+ }
55
+ buildUrl(path, parameters) {
56
+ const url = new URL(`${this.url}/${path}`);
57
+ if (parameters) {
58
+ Object.entries(parameters).forEach(([key, value]) => {
59
+ if (value === undefined)
60
+ return;
61
+ url.searchParams.append(key, Array.isArray(value) ? value.join(",") : String(value));
62
+ });
63
+ }
64
+ return url.toString();
65
+ }
66
+ prepareBody(request) {
67
+ if (!request)
68
+ return undefined;
69
+ if (request instanceof FormData || request instanceof Blob)
70
+ return request;
71
+ return JSON.stringify(request, (_, v) => (typeof v === "string" ? v.trim() : v));
72
+ }
73
+ prepareHeaders(request, overrides) {
74
+ const headers = {
75
+ "x-invoking-system": "portal_2",
76
+ ...overrides,
77
+ };
78
+ if (request instanceof Blob) {
79
+ headers["Content-Type"] = `${request.type}; charset=utf-8`;
52
80
  }
53
- catch (e) {
54
- if (this.token)
55
- console.error("Caught exception ", JSON.stringify(e));
81
+ else if (!(request instanceof FormData)) {
82
+ headers["Content-Type"] = "application/json";
56
83
  }
57
- if (this.token)
58
- requestHeaders["X-Auth-Token"] = this.token;
84
+ const token = Session.authentication.get()?.token || this.token;
85
+ if (token)
86
+ headers["X-Auth-Token"] = token;
59
87
  if (__classPrivateFieldGet(this, _Connection_pax2payPortalLanguage, "f"))
60
- requestHeaders["Pax2pay-Portal-Language"] = __classPrivateFieldGet(this, _Connection_pax2payPortalLanguage, "f");
88
+ headers["Pax2pay-Portal-Language"] = __classPrivateFieldGet(this, _Connection_pax2payPortalLanguage, "f");
61
89
  if (this.assumedOrg)
62
- requestHeaders["x-assume"] = this.assumedOrg;
90
+ headers["x-assume"] = this.assumedOrg;
91
+ const cookie = window.localStorage.getItem("cookie");
63
92
  if (cookie)
64
- requestHeaders["x-otp-cookie"] = cookie;
93
+ headers["x-otp-cookie"] = cookie;
94
+ const publicKey = Session.publicKey.get();
65
95
  if (publicKey)
66
- requestHeaders["cde-public-key"] = publicKey;
67
- let caughtErrorResponse;
68
- const response = await fetch(this.url +
69
- "/" +
70
- path +
71
- (parameters
72
- ? "?" +
73
- Object.entries(parameters)
74
- .map(([key, value]) => Array.isArray(value) ? `${key}=${value.join(",")}` : value != undefined ? `${key}=${value}` : undefined)
75
- .filter(param => param != undefined)
76
- .join("&")
77
- : ""), {
78
- method,
79
- headers: requestHeaders,
80
- body: !isMultipart
81
- ? request && JSON.stringify(request, (_, value) => (typeof value == "string" ? value.trim() : value))
82
- : request,
83
- }).catch((error) => {
84
- caughtErrorResponse = { code: 500, errors: [{ message: error.message }] };
85
- console.error(error);
86
- });
87
- if (caughtErrorResponse)
88
- return caughtErrorResponse;
89
- if (response && response.headers.has("x-otp-cookie"))
90
- window.localStorage.setItem("cookie", response.headers.get("x-otp-cookie") ?? "");
91
- if (response &&
92
- response.status == 403 &&
93
- (response.url.includes("login") || response.url.includes("sso/google")) &&
94
- response.headers.has("X-Auth-Token"))
96
+ headers["cde-public-key"] = publicKey;
97
+ return headers;
98
+ }
99
+ handleSessionSideEffects(response) {
100
+ const otpCookie = response.headers.get("x-otp-cookie");
101
+ if (otpCookie)
102
+ window.localStorage.setItem("cookie", otpCookie);
103
+ const isLoginPath = response.url.includes("login") || response.url.includes("sso/google");
104
+ if (response.status === 403 && isLoginPath && response.headers.has("X-Auth-Token")) {
95
105
  Session.authentication.set({ token: response.headers.get("X-Auth-Token") ?? undefined });
96
- return !response
97
- ? { code: 503, errors: [{ message: "Service unavailable" }] }
98
- : response.status == 401 && (await this.unauthorized(this))
99
- ? await this.fetch(path, method, request, parameters)
100
- : response.headers.get("Content-Type")?.startsWith("application/json")
101
- ? response.ok
102
- ? response.headers.has("x-total-count")
103
- ? { list: await response.json(), totalCount: response.headers.get("x-total-count") }
104
- : await response.json()
105
- : { status: response.status, ...(await response.json()) }
106
- : { status: response.status, value: await response.text() };
106
+ }
107
+ }
108
+ async parseResponse(response) {
109
+ if (!response || response.status === 503) {
110
+ return { code: 503, errors: [{ message: "Service unavailable" }] };
111
+ }
112
+ const contentType = response.headers.get("Content-Type") ?? "";
113
+ if (contentType.includes("application/json")) {
114
+ const json = await response.json();
115
+ if (!response.ok)
116
+ return { status: response.status, ...json };
117
+ const totalCount = response.headers.get("x-total-count");
118
+ return totalCount ? { list: json, totalCount } : json;
119
+ }
120
+ return { status: response.status, value: await response.text() };
107
121
  }
108
122
  async post(path, request, parameters, header) {
109
123
  return await this.fetch(path, "POST", request, parameters, header);
@@ -1 +1 @@
1
- {"version":3,"file":"Connection.js","sourceRoot":"../","sources":["Client/Connection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,OAAO,UAAU;IAGtB,IAAI,qBAAqB,CAAC,KAAa;QACtC,uBAAA,IAAI,qCAA0B,KAAK,MAAA,CAAA;IACpC,CAAC;IAID,IAA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AA;IACpF,CAAC;IACD,KAAK,CAAC,GAAG,CACR,IAAY,EACZ,UAAgC,EAChC,MAAY;QAEZ,OAAO,MAAM,IAAI,CAAC,KAAK,CAAkB,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IACrF,CAAC;IACD,KAAK,CAAC,GAAG,CACR,IAAY,EACZ,OAAY,EACZ,UAAgC,EAChC,MAAY;QAEZ,OAAO,MAAM,IAAI,CAAC,KAAK,CAAkB,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IACnF,CAAC;IACD,KAAK,CAAC,MAAM,CACX,IAAY,EACZ,OAAa,EACb,UAAgC,EAChC,MAAY;QAEZ,OAAO,MAAM,IAAI,CAAC,KAAK,CAAkB,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IACtF,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,KAAyB;QACjD,OAAO,IAAI,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAClC,CAAC;IACD,MAAM,CAAC,OAAO,CACb,KAAuD;QAEvD,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,CAAA;IAC1F,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ import { PaymentRequest } from "../../PaymentRequest";
2
+ export interface PaymentTask {
3
+ request: PaymentRequest;
4
+ }
5
+ export declare namespace PaymentTask {
6
+ const type: import("isly/dist/types/object").IslyObject<PaymentTask, object>;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { isly } from "isly";
2
+ import { PaymentRequest } from "../../PaymentRequest";
3
+ export var PaymentTask;
4
+ (function (PaymentTask) {
5
+ PaymentTask.type = isly.object({
6
+ request: isly.fromIs("PaymentRequest", PaymentRequest.is),
7
+ });
8
+ })(PaymentTask || (PaymentTask = {}));
9
+ //# sourceMappingURL=PaymentTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentTask.js","sourceRoot":"../","sources":["model/Batch/Item/PaymentTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAMrD,MAAM,KAAW,WAAW,CAI3B;AAJD,WAAiB,WAAW;IACd,gBAAI,GAAG,IAAI,CAAC,MAAM,CAAc;QAC5C,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;AACH,CAAC,EAJgB,WAAW,KAAX,WAAW,QAI3B"}
@@ -1,5 +1,6 @@
1
1
  import { PaymentResponse } from "../../PaymentResponse";
2
2
  import { Type } from "../Type";
3
+ import { PaymentTask as IPaymentTask } from "./PaymentTask";
3
4
  import { RebateTask as IRebateTask } from "./RebateTask";
4
5
  import { Status as IStatus } from "./Status";
5
6
  export interface Item<T = unknown, R = unknown> {
@@ -8,15 +9,22 @@ export interface Item<T = unknown, R = unknown> {
8
9
  errorMessage?: string;
9
10
  task?: T;
10
11
  result?: R;
12
+ reference?: string;
11
13
  }
12
14
  export declare namespace Item {
13
15
  export import Status = IStatus;
14
16
  export import RebateTask = IRebateTask;
17
+ export import PaymentTask = IPaymentTask;
15
18
  type Rebate = Item<IRebateTask, PaymentResponse>;
19
+ type Payment = Item<IPaymentTask, PaymentResponse>;
16
20
  const baseType: import("isly/dist/types/object").IslyObject<Item<unknown, unknown>, object>;
17
21
  const is: (value: Item<unknown, unknown> | any) => value is Item<unknown, unknown>;
18
22
  namespace Rebate {
19
23
  const type: import("isly/dist/types/object").IslyObject<Item<RebateTask, PaymentResponse>, Item<unknown, unknown>>;
20
24
  const is: (value: Item<RebateTask, PaymentResponse> | any) => value is Item<RebateTask, PaymentResponse>;
21
25
  }
26
+ namespace Payment {
27
+ const type: import("isly/dist/types/object").IslyObject<Item<PaymentTask, PaymentResponse>, Item<unknown, unknown>>;
28
+ const is: (value: Item<PaymentTask, PaymentResponse> | any) => value is Item<PaymentTask, PaymentResponse>;
29
+ }
22
30
  }
@@ -1,18 +1,21 @@
1
1
  import { isly } from "isly";
2
2
  import { PaymentResponse } from "../../PaymentResponse";
3
3
  import { Type } from "../Type";
4
+ import { PaymentTask as IPaymentTask } from "./PaymentTask";
4
5
  import { RebateTask as IRebateTask } from "./RebateTask";
5
6
  import { Status as IStatus } from "./Status";
6
7
  export var Item;
7
8
  (function (Item) {
8
9
  Item.Status = IStatus;
9
10
  Item.RebateTask = IRebateTask;
11
+ Item.PaymentTask = IPaymentTask;
10
12
  Item.baseType = isly.object({
11
13
  type: Type.type,
12
14
  status: IStatus.type,
13
15
  errorMessage: isly.string().optional(),
14
16
  task: isly.any().optional(),
15
17
  result: isly.any().optional(),
18
+ reference: isly.string().optional(),
16
19
  });
17
20
  Item.is = Item.baseType.is;
18
21
  let Rebate;
@@ -23,5 +26,13 @@ export var Item;
23
26
  });
24
27
  Rebate.is = Rebate.type.is;
25
28
  })(Rebate = Item.Rebate || (Item.Rebate = {}));
29
+ let Payment;
30
+ (function (Payment) {
31
+ Payment.type = Item.baseType.extend({
32
+ task: IPaymentTask.type.optional(),
33
+ result: PaymentResponse.type.optional(),
34
+ });
35
+ Payment.is = Payment.type.is;
36
+ })(Payment = Item.Payment || (Item.Payment = {}));
26
37
  })(Item || (Item = {}));
27
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["model/Batch/Item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,UAAU,IAAI,W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AAC,CAAA;QACW,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EANgB,OAAO,GAAP,YAAO,KAAP,YAAO,QAMvB;AACF,CAAC,EA7BgB,IAAI,KAAJ,IAAI,QA6BpB"}
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly";
2
2
  export type Status = typeof Status.values[number];
3
3
  export declare namespace Status {
4
- const values: readonly ["todo", "processing", "completed", "failed to finalise", "cancelled"];
5
- const type: isly.Type<"completed" | "todo" | "processing" | "failed to finalise" | "cancelled">;
6
- const is: (value: any | ("completed" | "todo" | "processing" | "failed to finalise" | "cancelled")) => value is "completed" | "todo" | "processing" | "failed to finalise" | "cancelled";
4
+ const values: readonly ["todo", "processing", "completed", "failed to finalise", "cancelled", "importing"];
5
+ const type: isly.Type<"completed" | "todo" | "processing" | "failed to finalise" | "cancelled" | "importing">;
6
+ const is: (value: any | ("completed" | "todo" | "processing" | "failed to finalise" | "cancelled" | "importing")) => value is "completed" | "todo" | "processing" | "failed to finalise" | "cancelled" | "importing";
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly";
2
2
  export var Status;
3
3
  (function (Status) {
4
- Status.values = ["todo", "processing", "completed", "failed to finalise", "cancelled"];
4
+ Status.values = ["todo", "processing", "completed", "failed to finalise", "cancelled", "importing"];
5
5
  Status.type = isly.string(Status.values);
6
6
  Status.is = Status.type.is;
7
7
  })(Status || (Status = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"Status.js","sourceRoot":"../","sources":["model/Batch/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,MAAM,CAItB;AAJD,WAAiB,MAAM;IACT,aAAM,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,CAAU,CAAA;IACxF,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAA,MAAM,CAAC,CAAA;IAC1B,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAJgB,MAAM,KAAN,MAAM,QAItB"}
1
+ {"version":3,"file":"Status.js","sourceRoot":"../","sources":["model/Batch/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,MAAM,CAItB;AAJD,WAAiB,MAAM;IACT,aAAM,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,CAAU,CAAA;IACrG,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAA,MAAM,CAAC,CAAA;IAC1B,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAJgB,MAAM,KAAN,MAAM,QAItB"}
@@ -3,6 +3,7 @@ export interface Summary {
3
3
  failed: number;
4
4
  remaining: number;
5
5
  total: number;
6
+ expectedTotal: number;
6
7
  }
7
8
  export declare namespace Summary {
8
9
  const type: import("isly/dist/types/object").IslyObject<Summary, object>;
@@ -6,6 +6,7 @@ export var Summary;
6
6
  failed: isly.number(),
7
7
  remaining: isly.number(),
8
8
  total: isly.number(),
9
+ expectedTotal: isly.number(),
9
10
  });
10
11
  Summary.is = Summary.type.is;
11
12
  })(Summary || (Summary = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"Summary.js","sourceRoot":"../","sources":["model/Batch/Summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAS3B,MAAM,KAAW,OAAO,CAQvB;AARD,WAAiB,OAAO;IACV,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU;QACxC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;KACpB,CAAC,CAAA;IACW,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EARgB,OAAO,KAAP,OAAO,QAQvB"}
1
+ {"version":3,"file":"Summary.js","sourceRoot":"../","sources":["model/Batch/Summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAU3B,MAAM,KAAW,OAAO,CASvB;AATD,WAAiB,OAAO;IACV,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU;QACxC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE;KAC5B,CAAC,CAAA;IACW,UAAE,GAAG,QAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EATgB,OAAO,KAAP,OAAO,QASvB"}
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly";
2
2
  export type Type = typeof Type.values[number];
3
3
  export declare namespace Type {
4
- const values: readonly ["TEST", "PAYMENT", "REBATE"];
5
- const type: isly.Type<"REBATE" | "TEST" | "PAYMENT">;
6
- const is: (value: any | ("REBATE" | "TEST" | "PAYMENT")) => value is "REBATE" | "TEST" | "PAYMENT";
4
+ const values: readonly ["TEST", "PAYMENT", "REBATE", "LEGACY_PAYMENT"];
5
+ const type: isly.Type<"REBATE" | "TEST" | "PAYMENT" | "LEGACY_PAYMENT">;
6
+ const is: (value: any | ("REBATE" | "TEST" | "PAYMENT" | "LEGACY_PAYMENT")) => value is "REBATE" | "TEST" | "PAYMENT" | "LEGACY_PAYMENT";
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly";
2
2
  export var Type;
3
3
  (function (Type) {
4
- Type.values = ["TEST", "PAYMENT", "REBATE"];
4
+ Type.values = ["TEST", "PAYMENT", "REBATE", "LEGACY_PAYMENT"];
5
5
  Type.type = isly.string(Type.values);
6
6
  Type.is = Type.type.is;
7
7
  })(Type || (Type = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"Type.js","sourceRoot":"../","sources":["model/Batch/Type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,IAAI,CAIpB;AAJD,WAAiB,IAAI;IACP,WAAM,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAA;IAC/C,SAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAA,MAAM,CAAC,CAAA;IAC1B,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAJgB,IAAI,KAAJ,IAAI,QAIpB"}
1
+ {"version":3,"file":"Type.js","sourceRoot":"../","sources":["model/Batch/Type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,IAAI,CAIpB;AAJD,WAAiB,IAAI;IACP,WAAM,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,CAAU,CAAA;IACjE,SAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAA,MAAM,CAAC,CAAA;IAC1B,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAJgB,IAAI,KAAJ,IAAI,QAIpB"}
@@ -0,0 +1,12 @@
1
+ import { isly } from "isly"
2
+ import { PaymentRequest } from "../../PaymentRequest"
3
+
4
+ export interface PaymentTask {
5
+ request: PaymentRequest
6
+ }
7
+
8
+ export namespace PaymentTask {
9
+ export const type = isly.object<PaymentTask>({
10
+ request: isly.fromIs("PaymentRequest", PaymentRequest.is),
11
+ })
12
+ }
@@ -1,6 +1,7 @@
1
1
  import { isly } from "isly"
2
2
  import { PaymentResponse } from "../../PaymentResponse"
3
3
  import { Type } from "../Type"
4
+ import { PaymentTask as IPaymentTask } from "./PaymentTask"
4
5
  import { RebateTask as IRebateTask } from "./RebateTask"
5
6
  import { Status as IStatus } from "./Status"
6
7
 
@@ -10,18 +11,22 @@ export interface Item<T = unknown, R = unknown> {
10
11
  errorMessage?: string
11
12
  task?: T
12
13
  result?: R
14
+ reference?: string
13
15
  }
14
16
 
15
17
  export namespace Item {
16
18
  export import Status = IStatus
17
19
  export import RebateTask = IRebateTask
20
+ export import PaymentTask = IPaymentTask
18
21
  export type Rebate = Item<IRebateTask, PaymentResponse>
22
+ export type Payment = Item<IPaymentTask, PaymentResponse>
19
23
  export const baseType = isly.object<Item<unknown, unknown>>({
20
24
  type: Type.type,
21
25
  status: IStatus.type,
22
26
  errorMessage: isly.string().optional(),
23
27
  task: isly.any().optional(),
24
28
  result: isly.any().optional(),
29
+ reference: isly.string().optional(),
25
30
  })
26
31
  export const is = baseType.is
27
32
  export namespace Rebate {
@@ -31,4 +36,11 @@ export namespace Item {
31
36
  })
32
37
  export const is = type.is
33
38
  }
39
+ export namespace Payment {
40
+ export const type = baseType.extend<Item<IPaymentTask, PaymentResponse>>({
41
+ task: IPaymentTask.type.optional(),
42
+ result: PaymentResponse.type.optional(),
43
+ })
44
+ export const is = type.is
45
+ }
34
46
  }
@@ -3,7 +3,7 @@ import { isly } from "isly"
3
3
  export type Status = typeof Status.values[number]
4
4
 
5
5
  export namespace Status {
6
- export const values = ["todo", "processing", "completed", "failed to finalise", "cancelled"] as const
6
+ export const values = ["todo", "processing", "completed", "failed to finalise", "cancelled", "importing"] as const
7
7
  export const type = isly.string(values)
8
8
  export const is = type.is
9
9
  }
@@ -5,6 +5,7 @@ export interface Summary {
5
5
  failed: number
6
6
  remaining: number
7
7
  total: number
8
+ expectedTotal: number
8
9
  }
9
10
 
10
11
  export namespace Summary {
@@ -13,6 +14,7 @@ export namespace Summary {
13
14
  failed: isly.number(),
14
15
  remaining: isly.number(),
15
16
  total: isly.number(),
17
+ expectedTotal: isly.number(),
16
18
  })
17
19
  export const is = type.is
18
20
  }
@@ -3,7 +3,7 @@ import { isly } from "isly"
3
3
  export type Type = typeof Type.values[number]
4
4
 
5
5
  export namespace Type {
6
- export const values = ["TEST", "PAYMENT", "REBATE"] as const
6
+ export const values = ["TEST", "PAYMENT", "REBATE", "LEGACY_PAYMENT"] as const
7
7
  export const type = isly.string(values)
8
8
  export const is = type.is
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.10.10",
3
+ "version": "0.10.13",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",