@notabene/javascript-sdk 2.0.0-next.6 → 2.0.0-next.8

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.
package/dist/notabene.js CHANGED
@@ -1,11 +1,11 @@
1
- var l = Object.defineProperty;
2
- var u = (s, e, t) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var o = (s, e, t) => u(s, typeof e != "symbol" ? e + "" : e, t);
4
- var h = /* @__PURE__ */ ((s) => (s.COMPLETE = "complete", s.RESIZE = "resize", s.RESULT = "result", s.READY = "ready", s.INVALID = "invalid", s.MODAL = "openModal", s.ERROR = "error", s.CLOSE = "closeModal", s.CANCEL = "cancel", s))(h || {}), c = /* @__PURE__ */ ((s) => (s.UPDATE = "update", s.REQUEST_RESPONSE = "requestResponse", s))(c || {});
5
- class f {
1
+ var d = Object.defineProperty;
2
+ var c = (r, e, t) => e in r ? d(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var n = (r, e, t) => c(r, typeof e != "symbol" ? e + "" : e, t);
4
+ var h = /* @__PURE__ */ ((r) => (r.COMPLETE = "complete", r.RESIZE = "resize", r.RESULT = "result", r.READY = "ready", r.INVALID = "invalid", r.MODAL = "openModal", r.ERROR = "error", r.CLOSE = "closeModal", r.CANCEL = "cancel", r))(h || {}), l = /* @__PURE__ */ ((r) => (r.UPDATE = "update", r.REQUEST_RESPONSE = "requestResponse", r))(l || {});
5
+ class m {
6
6
  constructor() {
7
- o(this, "listeners", /* @__PURE__ */ new Map());
8
- o(this, "port");
7
+ n(this, "listeners", /* @__PURE__ */ new Map());
8
+ n(this, "port");
9
9
  this.handleMessage = this.handleMessage.bind(this);
10
10
  }
11
11
  setPort(e) {
@@ -15,36 +15,36 @@ class f {
15
15
  this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t);
16
16
  }
17
17
  off(e, t) {
18
- const r = this.listeners.get(e);
19
- r && (r.delete(t), r.size === 0 && this.listeners.delete(e));
18
+ const s = this.listeners.get(e);
19
+ s && (s.delete(t), s.size === 0 && this.listeners.delete(e));
20
20
  }
21
21
  handleMessage(e) {
22
22
  console.log("received message", e.data);
23
23
  const t = e.data;
24
24
  if (typeof t == "object" && t !== null && "type" in t) {
25
- const r = t.type, i = this.listeners.get(r);
26
- i && i.forEach((n) => n(t));
25
+ const s = t.type, o = this.listeners.get(s);
26
+ o && o.forEach((i) => i(t));
27
27
  }
28
28
  }
29
29
  // Method to send messages through the port
30
30
  send(e) {
31
- if (!this.port)
32
- throw new Error("No port set");
33
- this.port.postMessage(e);
31
+ this.port && this.port.postMessage(e);
34
32
  }
35
33
  }
36
- class m {
34
+ class u {
35
+ // private popup?: HTMLElement;
37
36
  constructor(e, t) {
38
- o(this, "_url");
39
- o(this, "_value");
40
- o(this, "_errors", []);
41
- o(this, "iframe");
42
- o(this, "eventManager");
43
- o(this, "ready", !1);
44
- this._url = e, this._value = t, this.eventManager = new f(), this.on(h.INVALID, (r) => {
45
- r.type === h.INVALID && (this._errors = r.errors, this._value = r.value);
46
- }), this.on(h.RESIZE, (r) => {
47
- r.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
37
+ n(this, "_url");
38
+ n(this, "_value");
39
+ n(this, "_errors", []);
40
+ n(this, "iframe");
41
+ n(this, "eventManager");
42
+ n(this, "ready", !1);
43
+ n(this, "modal");
44
+ this._url = e, this._value = t, this.eventManager = new m(), this.on(h.INVALID, (s) => {
45
+ s.type === h.INVALID && (this._errors = s.errors, this._value = s.value);
46
+ }), this.on(h.RESIZE, (s) => {
47
+ s.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${s.height}px`);
48
48
  });
49
49
  }
50
50
  get url() {
@@ -60,14 +60,16 @@ class m {
60
60
  document.location.href = this.url;
61
61
  }
62
62
  mount(e) {
63
- var r, i;
64
- this.iframe = document.createElement("iframe"), this.iframe.src = this.url, this.iframe.style.width = "100%", this.iframe.style.height = "100px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", window.addEventListener("message", (n) => {
65
- var a, d;
66
- n.source === ((a = this.iframe) == null ? void 0 : a.contentWindow) && (console.log("received message from iframe", n.data), (d = this.eventManager) == null || d.setPort(n.ports[0]), this.ready = !0);
67
- });
68
63
  const t = document.querySelector(e);
69
64
  if (!t) throw new Error(`parentID ${e} not found`);
70
- t.appendChild(this.iframe), (i = (r = this.iframe) == null ? void 0 : r.contentWindow) == null || i.focus();
65
+ this.embed(t);
66
+ }
67
+ embed(e) {
68
+ var t, s;
69
+ this.iframe = document.createElement("iframe"), this.iframe.src = this.url, this.iframe.style.width = "100%", this.iframe.style.height = "100px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.setAttribute("allowtransparency", "true"), this.iframe.style.backgroundColor = "transparent", e.appendChild(this.iframe), window.addEventListener("message", (o) => {
70
+ var i, a;
71
+ o.source === ((i = this.iframe) == null ? void 0 : i.contentWindow) && (console.log("received message from iframe", o.data), (a = this.eventManager) == null || a.setPort(o.ports[0]), this.ready = !0);
72
+ }), (s = (t = this.iframe) == null ? void 0 : t.contentWindow) == null || s.focus();
71
73
  }
72
74
  send(e) {
73
75
  this.eventManager.send(e);
@@ -79,109 +81,87 @@ class m {
79
81
  this.eventManager.off(e, t);
80
82
  }
81
83
  update(e) {
82
- this._value = e, this.send({ type: c.UPDATE, value: e });
84
+ this._value = e, this.send({ type: l.UPDATE, value: e });
83
85
  }
84
86
  completion() {
85
87
  return new Promise((e, t) => {
86
- this.on(h.COMPLETE, (r) => {
87
- e(r.response);
88
- }), this.on("error", (r) => {
89
- t(new Error(r.message));
88
+ this.closeModal(), this.on(h.COMPLETE, (s) => {
89
+ e(s.response);
90
+ }), this.on("error", (s) => {
91
+ t(new Error(s.message));
90
92
  });
91
93
  });
92
94
  }
95
+ // popup(): void {
96
+ // this.popup = document.createElement('div');
97
+ // this.popup.style;
98
+ // }
99
+ openModal() {
100
+ this.modal && this.closeModal(), this.modal = document.createElement("dialog"), document.body.appendChild(this.modal), this.embed(this.modal), this.modal.show(), this.modal.addEventListener("click", () => {
101
+ this.closeModal();
102
+ });
103
+ }
104
+ closeModal() {
105
+ var e;
106
+ this.modal && (console.log("closeModal"), (e = this.modal) == null || e.close(), this.modal.remove(), this.modal = void 0);
107
+ }
93
108
  }
94
- function p(s) {
95
- return Object.entries(s).map(([e, t]) => {
109
+ function f(r) {
110
+ return Object.entries(r).map(([e, t]) => {
96
111
  if (!(e && t)) return;
97
- const r = encodeURIComponent(e), i = encodeURIComponent(
112
+ const s = encodeURIComponent(e), o = encodeURIComponent(
98
113
  typeof t == "object" ? JSON.stringify(t) : t
99
114
  );
100
- return `${r}=${i}`;
115
+ return `${s}=${o}`;
101
116
  }).filter((e) => !!e).join("&");
102
117
  }
103
- class g {
118
+ class E {
104
119
  constructor(e) {
105
- o(this, "nodeUrl");
106
- o(this, "authToken");
107
- o(this, "uxUrl");
108
- o(this, "theme");
109
- o(this, "dictionary");
110
- this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.dictionary = e.dictionary;
111
- }
112
- componentUrl(e, t, r, i) {
113
- const n = new URL(this.uxUrl);
114
- n.pathname = e;
115
- const a = p({
120
+ n(this, "nodeUrl");
121
+ n(this, "authToken");
122
+ n(this, "uxUrl");
123
+ n(this, "theme");
124
+ n(this, "locale");
125
+ this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.locale = e.locale;
126
+ }
127
+ componentUrl(e, t, s, o) {
128
+ const i = new URL(this.uxUrl);
129
+ i.pathname = e;
130
+ const a = f({
116
131
  authToken: this.authToken,
117
132
  value: t,
118
- configuration: r
133
+ configuration: s
119
134
  });
120
- return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.dictionary && n.searchParams.set("dictionary", JSON.stringify(this.dictionary)), i && (i.callback && n.searchParams.set("callback_url", i.callback), i.redirectUri && n.searchParams.set("redirect_uri", i.redirectUri)), n.toString();
135
+ return i.hash = a, this.nodeUrl && i.searchParams.set("nodeUrl", this.nodeUrl), this.theme && i.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && i.searchParams.set("locale", this.locale), o && (o.callback && i.searchParams.set("callback_url", o.callback), o.redirectUri && i.searchParams.set("redirect_uri", o.redirectUri)), i.toString();
121
136
  }
122
- createComponent(e, t, r, i) {
123
- return new m(
124
- this.componentUrl(e, t, r, i),
137
+ createComponent(e, t, s, o) {
138
+ return new u(
139
+ this.componentUrl(e, t, s, o),
125
140
  t
126
141
  );
127
142
  }
128
- createWithdrawalAssist(e, t, r) {
129
- return this.createComponent("withdrawal-assist", e, t, r);
143
+ createWithdrawalAssist(e, t, s) {
144
+ return this.createComponent("withdrawal-assist", e, t, s);
145
+ }
146
+ createDepositAssist(e, t, s) {
147
+ return this.createComponent("deposit-assist", e, t, s);
148
+ }
149
+ createConnect(e, t, s) {
150
+ return this.createComponent("connect", e, t, s);
151
+ }
152
+ createDepositRequest(e, t, s) {
153
+ return this.createComponent("deposit-request", e, t, s);
130
154
  }
131
155
  decodeFragmentToObject(e) {
132
156
  return e.slice(1).split("&").reduce(
133
- (r, i) => {
134
- const [n, a] = i.split("=");
135
- return r[decodeURIComponent(n)] = decodeURIComponent(a), r;
157
+ (s, o) => {
158
+ const [i, a] = o.split("=");
159
+ return s[decodeURIComponent(i)] = decodeURIComponent(a), s;
136
160
  },
137
161
  {}
138
162
  );
139
163
  }
140
- // private openModal(url: string): void {
141
- // if (this.modal) {
142
- // this.closeModal();
143
- // }
144
- // this.modal = document.createElement('div');
145
- // this.modal.style.position = 'fixed';
146
- // this.modal.style.top = '0';
147
- // this.modal.style.left = '0';
148
- // this.modal.style.width = '100%';
149
- // this.modal.style.height = '100%';
150
- // this.modal.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
151
- // this.modal.style.display = 'flex';
152
- // this.modal.style.justifyContent = 'center';
153
- // this.modal.style.alignItems = 'center';
154
- // const iframe = document.createElement('iframe');
155
- // iframe.src = url;
156
- // iframe.setAttribute('allowtransparency', 'true');
157
- // // iframe.allowtransparency = true;
158
- // iframe.style.backgroundColor = 'transparent';
159
- // iframe.style.width = '90%';
160
- // iframe.style.height = '90%';
161
- // iframe.style.border = 'none';
162
- // iframe.style.overflow = 'hidden';
163
- // this.modal.appendChild(iframe);
164
- // document.body.appendChild(this.modal);
165
- // this.modal.addEventListener('click', () => {
166
- // console.log('click');
167
- // this.closeModal();
168
- // });
169
- // document.addEventListener('keydown', ({ key }) => {
170
- // console.log(`key: ${key}`);
171
- // if (key === 'Escape') {
172
- // console.log('esc');
173
- // this.closeModal();
174
- // }
175
- // });
176
- // }
177
- // private closeModal(): void {
178
- // if (this.modal) {
179
- // console.log('this.closeModal');
180
- // this.modal.remove();
181
- // this.modal = undefined;
182
- // }
183
- // }
184
164
  }
185
165
  export {
186
- g as default
166
+ E as default
187
167
  };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "author": "Notabene <developers@notabene.id>",
11
11
  "license": "MIT",
12
- "version": "2.0.0-next.6",
12
+ "version": "2.0.0-next.8",
13
13
  "source": "src/notabene.ts",
14
14
  "main": "dist/notabene.js",
15
15
  "types": "dist/notabene.d.ts",
@@ -2,6 +2,7 @@ import { fc, test } from '@fast-check/vitest';
2
2
  import { describe } from 'vitest';
3
3
  import { abitraryCallbackOptions, arbitraryComponent } from '../arbitraries';
4
4
  import Notabene from '../notabene';
5
+ import { arbitraryLocale } from '../utils/arbitraries';
5
6
 
6
7
  describe('Notabene', () => {
7
8
  describe('defaults', () => {
@@ -28,6 +29,33 @@ describe('Notabene', () => {
28
29
  );
29
30
  });
30
31
 
32
+ describe('locale', () => {
33
+ test.prop([
34
+ fc.string({ minLength: 3 }),
35
+ fc.webUrl(),
36
+ arbitraryComponent(),
37
+ fc.object(),
38
+ arbitraryLocale(),
39
+ ])(
40
+ 'Should set the correct values',
41
+ (authToken, nodeUrl, component, value, locale) => {
42
+ const notabene = new Notabene({
43
+ nodeUrl,
44
+ authToken,
45
+ locale,
46
+ });
47
+ const url = new URL(notabene.componentUrl(component, value));
48
+ return (
49
+ url.hash ===
50
+ `#authToken=${encodeURIComponent(authToken)}&value=${encodeURIComponent(JSON.stringify(value))}` &&
51
+ url.searchParams.get('nodeUrl') === nodeUrl &&
52
+ url.searchParams.get('locale') === locale &&
53
+ url.pathname === `/${component}`
54
+ );
55
+ },
56
+ );
57
+ });
58
+
31
59
  describe('minimal', () => {
32
60
  test.prop([arbitraryComponent(), fc.object()])(
33
61
  'Should set the correct values',
@@ -23,6 +23,8 @@ export default class EmbeddedComponent {
23
23
  private iframe?: HTMLIFrameElement;
24
24
  private eventManager: MessageEventManager;
25
25
  private ready = false;
26
+ private modal?: HTMLDialogElement;
27
+ // private popup?: HTMLElement;
26
28
 
27
29
  constructor(url: string, value: Partial<Transaction>) {
28
30
  this._url = url;
@@ -58,14 +60,23 @@ export default class EmbeddedComponent {
58
60
  }
59
61
 
60
62
  mount(parentId: string) {
63
+ const parent = document.querySelector(parentId);
64
+ if (!parent) throw new Error(`parentID ${parentId} not found`);
65
+ this.embed(parent);
66
+ }
67
+
68
+ embed(parent: Element) {
61
69
  this.iframe = document.createElement('iframe');
62
70
  this.iframe.src = this.url;
63
71
  this.iframe.style.width = '100%';
64
72
  this.iframe.style.height = '100px';
65
73
  this.iframe.style.border = 'none';
66
74
  this.iframe.style.overflow = 'hidden';
75
+ this.iframe.setAttribute('allowtransparency', 'true');
76
+ this.iframe.style.backgroundColor = 'transparent';
77
+ parent.appendChild(this.iframe);
67
78
 
68
- window.addEventListener('message', (event) => {
79
+ window.addEventListener('message', (event: MessageEvent) => {
69
80
  if (event.source !== this.iframe?.contentWindow) {
70
81
  return;
71
82
  }
@@ -74,9 +85,6 @@ export default class EmbeddedComponent {
74
85
  this.ready = true;
75
86
  });
76
87
 
77
- const parent = document.querySelector(parentId);
78
- if (!parent) throw new Error(`parentID ${parentId} not found`);
79
- parent.appendChild(this.iframe);
80
88
  this.iframe?.contentWindow?.focus();
81
89
  }
82
90
 
@@ -99,6 +107,7 @@ export default class EmbeddedComponent {
99
107
 
100
108
  completion(): Promise<TransactionResponse> {
101
109
  return new Promise((resolve, reject) => {
110
+ this.closeModal();
102
111
  this.on(CMType.COMPLETE, (message) => {
103
112
  resolve((message as any).response);
104
113
  });
@@ -107,4 +116,60 @@ export default class EmbeddedComponent {
107
116
  });
108
117
  });
109
118
  }
119
+
120
+ // popup(): void {
121
+ // this.popup = document.createElement('div');
122
+ // this.popup.style;
123
+ // }
124
+
125
+ openModal(): void {
126
+ if (this.modal) {
127
+ this.closeModal();
128
+ }
129
+ this.modal = document.createElement('dialog');
130
+ // this.modal.style.maxWidth = '600px';
131
+ // this.modal.style.border = 'none !important';
132
+ // this.modal.style.background = 'transparent';
133
+ // this.modal.style.flexDirection = 'column';
134
+ // this.modal.style.alignItems = 'end';
135
+ // const close = document.createElement('button');
136
+ // close.innerText = 'X';
137
+ // close.style.fontSize = '1rem';
138
+ // close.style.padding = '0.25rem 0.5rem';
139
+ // close.style.display = 'block';
140
+ // close.style.background = 'white';
141
+ // close.style.color = '#aaa';
142
+ // close.style.border = '#aaa';
143
+ // close.addEventListener('click', () => this.closeModal());
144
+ // this.modal.appendChild(close);
145
+ // this.modal.css;
146
+ // this.modal.style.position = 'fixed';
147
+ // this.modal.style.bottom = '0';
148
+ // this.modal.style.left = '0';
149
+ // this.modal.style.right = '0';
150
+ // this.modal.style.top = '0';
151
+ // this.modal.style.left = '0';
152
+ // this.modal.style.width = '100%';
153
+ // this.modal.style.height = '100%';
154
+ // this.modal.style.backgroundColor = 'transparent';
155
+ // this.modal.style.display = 'flex';
156
+ // this.modal.style.justifyContent = 'center';
157
+ // this.modal.style.alignItems = 'center';
158
+ document.body.appendChild(this.modal);
159
+ this.embed(this.modal);
160
+ this.modal.show();
161
+ this.modal.addEventListener('click', () => {
162
+ // console.log('click');
163
+ this.closeModal();
164
+ });
165
+ }
166
+
167
+ private closeModal(): void {
168
+ if (this.modal) {
169
+ console.log('closeModal');
170
+ this.modal?.close();
171
+ this.modal.remove();
172
+ this.modal = undefined;
173
+ }
174
+ }
110
175
  }
package/src/ivms/types.ts CHANGED
@@ -120,22 +120,38 @@ export type DateAndPlaceOfBirth = {
120
120
  * Address
121
121
  */
122
122
  export type Address = {
123
- addressType?: AddressTypeCode;
124
- department?: string; //Max50Text
125
- subDepartment?: string; //Max70Text
126
- streetName?: string; //Max70Text
127
- buildingNumber?: string; //Max16Text
128
- buildingName?: string; //Max35Text
129
- floor?: string; //Max70Text
130
- postBox?: string; //Max16Text
131
- room?: string; //Max70Text
132
- postCode?: string; //Max16Text
133
- townName?: string; //Max35Text
134
- townLocationName?: string; //Max35Text
135
- districtName?: string; //Max35Text
136
- countrySubDivision?: string; //Max35Text
137
- addressLine?: string[]; //Max35Text max 7 items in array
138
- country?: string; //CountryCode (^[A-Z]= {2}$)
123
+ /** Identifies the nature of the address. */
124
+ addressType: AddressTypeCode;
125
+ /** Identification of a division of a large organisation or building. */
126
+ department?: string;
127
+ /** Identification of a sub-division of a large organisation or building. */
128
+ subDepartment?: string;
129
+ /** Name of a street or thoroughfare. */
130
+ streetName?: string;
131
+ /** Number that identifies the position of a building on a street. */
132
+ buildingNumber?: string;
133
+ /** Name of the building or house. */
134
+ buildingName?: string;
135
+ /** Floor or storey within a building. */
136
+ floor?: string;
137
+ /** Numbered box in a post office. */
138
+ postBox?: string;
139
+ /** Building room number. */
140
+ room?: string;
141
+ /** Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail. */
142
+ postcode?: string;
143
+ /** Name of a built-up area, with defined boundaries, and a local government. */
144
+ townName: string;
145
+ /** Specific location name within the town. */
146
+ townLocationName?: string;
147
+ /** Identifies a subdivision within a country subdivision. */
148
+ districtName?: string;
149
+ /** Identifies a subdivision of a country such as state, region, province. */
150
+ countrySubDivision?: string;
151
+ /** Information that locates and identifies a specific address, presented in free format text. */
152
+ addressLine?: string[];
153
+ /** Nation with its own government. */
154
+ country: string;
139
155
  };
140
156
 
141
157
  /**
@@ -173,12 +189,18 @@ export type NaturalPersonName = {
173
189
  * NaturalPerson
174
190
  */
175
191
  export type NaturalPerson = {
176
- name?: NaturalPersonName[];
192
+ /** The distinct words used as identification for an individual. */
193
+ name: NaturalPersonName;
194
+ /** The particulars of a location at which a person may be communicated with. */
177
195
  geographicAddress?: Address[];
196
+ /** A distinct identifier used by governments to uniquely identify a natural person. */
178
197
  nationalIdentification?: NationalIdentification;
179
- customerIdentification?: string; //Max50Text
198
+ /** A distinct identifier that uniquely identifies the person to the institution in context. */
199
+ customerIdentification?: string;
200
+ /** Date and place of birth of a person. */
180
201
  dateAndPlaceOfBirth?: DateAndPlaceOfBirth;
181
- countryOfResidence?: string; //CountryCode (^[A-Z]{2}$)
202
+ /** Country in which a person resides (the place of a person's home). */
203
+ countryOfResidence?: string;
182
204
  };
183
205
 
184
206
  /**
@@ -195,8 +217,10 @@ export type LocalLegalPersonNameID = {
195
217
  * LegalPersonNameID
196
218
  */
197
219
  export type LegalPersonNameID = {
198
- legalPersonName?: string; //Max100Text
199
- legalPersonNameIdentifierType?: LegalPersonNameTypeCode;
220
+ /** Name by which the legal person is known. */
221
+ legalPersonName: string;
222
+ /** The nature of the name specified. */
223
+ legalPersonNameIdentifierType: LegalPersonNameTypeCode;
200
224
  };
201
225
 
202
226
  /**
@@ -204,7 +228,7 @@ export type LegalPersonNameID = {
204
228
  * LegalPersonName
205
229
  */
206
230
  export type LegalPersonName = {
207
- nameIdentifier?: LegalPersonNameID[];
231
+ nameIdentifier: LegalPersonNameID[];
208
232
  localNameIdentifier?: LocalLegalPersonNameID[];
209
233
  phoneticNameIdentifier?: LocalLegalPersonNameID[];
210
234
  };
@@ -214,11 +238,16 @@ export type LegalPersonName = {
214
238
  * LegalPerson
215
239
  */
216
240
  export type LegalPerson = {
217
- name?: LegalPersonName;
241
+ /** The name of the legal person. */
242
+ name: LegalPersonName;
243
+ /** The address of the legal person. */
218
244
  geographicAddress?: Address[];
219
- customerNumber?: string; //Max50Text
245
+ /** A distinct identifier that uniquely identifies the person to the institution in context. */
246
+ customerNumber?: string;
247
+ /** A distinct identifier used by governments to uniquely identify a legal person. */
220
248
  nationalIdentification?: NationalIdentification;
221
- countryOfRegistration?: string; //CountryCode (^[A-Z]{2}$);
249
+ /** The country in which the legal person is registered. */
250
+ countryOfRegistration?: string;
222
251
  };
223
252
 
224
253
  /**
@@ -285,9 +314,21 @@ export type TransferPath = {
285
314
  * 6.7
286
315
  * Data describing the contents of the payload.
287
316
  */
288
- export type PayloadMetadata = {
289
- transferPath?: TransliterationMethodCode[];
290
- };
317
+ export interface PayloadMetadata {
318
+ /** The method used to map from a national system of writing to Latin script. */
319
+ transliterationMethod?: TransliterationMethodCode[];
320
+ /** The version of IVMS 101 to which the payload complies. */
321
+ payloadVersion: PayloadVersionCode;
322
+ }
323
+ /**
324
+ * The version of IVMS 101 to which the payload complies.
325
+ */
326
+ export enum PayloadVersionCode {
327
+ /** Published May 2020 */
328
+ V101 = '101',
329
+ /** Published August 2023 */
330
+ V101_2023 = '101.2023',
331
+ }
291
332
 
292
333
  /**
293
334
  * IVMS101 definition