@cityssm/mpac-tools 0.1.0 → 0.2.0

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.
@@ -1,4 +1,7 @@
1
+ // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
2
+ /* eslint-disable @cspell/spellchecker, max-lines, sonarjs/no-duplicate-string */
1
3
  export const rollNumberMunicipalities = Object.freeze({
4
+ // Prescott, Russell, Stormont Dundas & Glengarry Counties
2
5
  '0101': 'South Glengarry Township',
3
6
  '0111': 'North Glengarry Township',
4
7
  '0201': 'East Hawkesbury Township',
@@ -14,6 +17,7 @@ export const rollNumberMunicipalities = Object.freeze({
14
17
  '0411': 'North Stormont Township',
15
18
  '0506': 'South Dundas Township',
16
19
  '0511': 'North Dundas Township',
20
+ // Lanark, Leeds & Grenville Counties
17
21
  '0701': 'Edwardsburgh/Cardinal Township',
18
22
  '0706': 'Augusta Township',
19
23
  '0708': 'Prescott Town',
@@ -36,7 +40,9 @@ export const rollNumberMunicipalities = Object.freeze({
36
40
  '0928': 'Carleton Place Town',
37
41
  '0931': 'Mississippi Mills Town',
38
42
  '0940': 'Lanark Highlands Township',
43
+ // Regional Municipality of the City of Ottawa
39
44
  '0614': 'Ottawa City',
45
+ // Renfrew County
40
46
  '4701': 'Mcnab/Braeside Township',
41
47
  '4702': 'Arnprior Town',
42
48
  '4706': 'Greater Madawaska Township',
@@ -55,6 +61,7 @@ export const rollNumberMunicipalities = Object.freeze({
55
61
  '4792': 'Laurentian Hills Town',
56
62
  '4796': 'Deep River Town',
57
63
  '4798': 'Head Clara Maria Township',
64
+ // Frontenac, Lennox & Addington Counties
58
65
  '1001': 'Frontenac Islands Township',
59
66
  '1011': 'Corporation Of The City Of Kingston',
60
67
  '1029': 'South Frontenac Township',
@@ -64,6 +71,7 @@ export const rollNumberMunicipalities = Object.freeze({
64
71
  '1121': 'Greater Napanee Town',
65
72
  '1124': 'Stone Mills Township',
66
73
  '1134': 'Addington Highlands Township',
74
+ // Hastings, Northumberland, City of Prince Edward Counties
67
75
  '1201': 'Tyendinaga Township',
68
76
  '1202': 'Deseronto Town',
69
77
  '1204': 'Quinte West City',
@@ -88,6 +96,7 @@ export const rollNumberMunicipalities = Object.freeze({
88
96
  '1423': 'Port Hope Municipality',
89
97
  '1435': 'Trent Hills Municipality',
90
98
  '1450': 'Alnwick/Haldimand Township',
99
+ // Peterborough County, Kawartha Lakes County, Haliburton County
91
100
  '1501': 'Asphodel-norwood Township',
92
101
  '1506': 'Otonabee-south Monaghan Township',
93
102
  '1509': 'Cavan Monaghan Township',
@@ -102,7 +111,9 @@ export const rollNumberMunicipalities = Object.freeze({
102
111
  '4616': 'Minden Hills Township',
103
112
  '4621': 'Algonquin Highlands Township',
104
113
  '4624': 'Dysart Et Al Municipality',
114
+ // City of Toronto
105
115
  '1900': 'City Of Toronto',
116
+ // Regional Municipality of Durham
106
117
  '1801': 'Pickering City',
107
118
  '1805': 'Ajax Town',
108
119
  '1809': 'Whitby Town',
@@ -111,6 +122,7 @@ export const rollNumberMunicipalities = Object.freeze({
111
122
  '1820': 'Scugog Township',
112
123
  '1829': 'Uxbridge Township',
113
124
  '1839': 'Brock Township',
125
+ // Regional Municipality of York
114
126
  '1928': 'Vaughan City',
115
127
  '1936': 'Markham City',
116
128
  '1938': 'Richmond Hill Town',
@@ -120,6 +132,7 @@ export const rollNumberMunicipalities = Object.freeze({
120
132
  '1949': 'King Township',
121
133
  '1954': 'East Gwillimbury Town',
122
134
  '1970': 'Georgina Town',
135
+ // Regional Municipalities of Halton and Peel
123
136
  '2105': 'Mississauga City',
124
137
  '2110': 'Brampton City',
125
138
  '2124': 'Caledon Town',
@@ -127,6 +140,7 @@ export const rollNumberMunicipalities = Object.freeze({
127
140
  '2402': 'Burlington City',
128
141
  '2409': 'Milton Town',
129
142
  '2415': 'Halton Hills Town',
143
+ // Simcoe County
130
144
  '4301': 'Adjala-tosorontio Township',
131
145
  '4312': 'Bradford West Gwillimbury Town',
132
146
  '4316': 'Innisfil Town',
@@ -145,12 +159,14 @@ export const rollNumberMunicipalities = Object.freeze({
145
159
  '4368': 'Tiny Township',
146
160
  '4372': 'Penetanguishene Town',
147
161
  '4374': 'Midland Town',
162
+ // District Municipality of Muskoka
148
163
  '4402': 'Gravenhurst Town',
149
164
  '4418': 'Bracebridge Town',
150
165
  '4427': 'Lake Of Bays Township',
151
166
  '4442': 'Huntsville Town',
152
167
  '4453': 'Muskoka Lakes Township',
153
168
  '4465': 'Georgian Bay Township',
169
+ // Regional Municipality of Niagara
154
170
  '2602': 'West Lincoln Township',
155
171
  '2615': 'Grimsby Town',
156
172
  '2622': 'Lincoln Town',
@@ -163,11 +179,14 @@ export const rollNumberMunicipalities = Object.freeze({
163
179
  '2725': 'Niagara Falls City',
164
180
  '2731': 'Thorold City',
165
181
  '2732': 'Pelham Town',
182
+ // Regional Municipality of Hamilton
166
183
  '2518': 'Hamilton City',
184
+ // City of Brantford, Brant, Haldimand County and Norfolk Counties
167
185
  '2810': 'Haldimand County',
168
186
  '2906': 'Brantford City',
169
187
  '2920': 'County Of Brant',
170
188
  '3310': 'Norfolk County',
189
+ // Regional Municipality of Waterloo, the Counties of Dufferin and Wellington, and the City of Guelph
171
190
  '2201': 'East Garafraxa Township',
172
191
  '2204': 'Grand Valley Town',
173
192
  '2208': 'Amaranth Township',
@@ -191,6 +210,7 @@ export const rollNumberMunicipalities = Object.freeze({
191
210
  '3018': 'Wilmot Township',
192
211
  '3024': 'Wellesley Township',
193
212
  '3029': 'Woolwich Township',
213
+ // Elgin, Middlesex and Oxford Counties
194
214
  '3202': 'Norwich Township',
195
215
  '3204': 'Tillsonburg Town',
196
216
  '3211': 'South-west Oxford Township',
@@ -216,6 +236,7 @@ export const rollNumberMunicipalities = Object.freeze({
216
236
  '3946': 'Adelaide Metcalfe Township',
217
237
  '3954': 'North Middlesex Municipality',
218
238
  '3958': 'Lucan Biddulph Township',
239
+ // Huron and Perth Counties
219
240
  '3110': 'Perth East Township',
220
241
  '3111': 'Stratford City',
221
242
  '3116': 'St Marys Town',
@@ -231,6 +252,7 @@ export const rollNumberMunicipalities = Object.freeze({
231
252
  '4050': 'North Huron Township',
232
253
  '4060': 'Morris-turnberry Municipality',
233
254
  '4070': 'Ashfield-colborne-wawanosh Township',
255
+ // Bruce and Grey Counties
234
256
  '4102': 'South Bruce Peninsula Town',
235
257
  '4103': 'Arran-elderslie Municipality',
236
258
  '4104': 'Brockton Municipality',
@@ -248,6 +270,7 @@ export const rollNumberMunicipalities = Object.freeze({
248
270
  '4229': 'Hanover Town',
249
271
  '4242': 'Blue Mountains Town',
250
272
  '4259': 'Owen Sound City',
273
+ // Municipality of Chatham-Kent, Lambton County
251
274
  '3650': 'Chatham-kent Municipality',
252
275
  '3805': 'St Clair Township',
253
276
  '3806': 'Dawn-euphemia Township',
@@ -260,6 +283,7 @@ export const rollNumberMunicipalities = Object.freeze({
260
283
  '3835': 'Plympton-wyoming Town',
261
284
  '3841': 'Warwick Township',
262
285
  '3845': 'Lambton Shores Municipality',
286
+ // Essex County
263
287
  '3701': 'Peele Township',
264
288
  '3706': 'Leamington Municipality',
265
289
  '3711': 'Kingsville Town',
@@ -269,6 +293,7 @@ export const rollNumberMunicipalities = Object.freeze({
269
293
  '3744': 'Tecumseh Town',
270
294
  '3751': 'Lakeshore Town',
271
295
  '3754': 'Essex Town',
296
+ // Territorial Districts of Nipissing and Parry Sound
272
297
  '4801': 'South Algonquin Township',
273
298
  '4803': 'Province Of Ontario',
274
299
  '4816': 'Papineau-cameron Township',
@@ -307,6 +332,7 @@ export const rollNumberMunicipalities = Object.freeze({
307
332
  '4995': 'Province Of Ontario',
308
333
  '4998': 'Province Of Ontario',
309
334
  '4999': 'Province Of Ontario',
335
+ // Territorial Districts of Cochrane and Timiskaming
310
336
  '5401': 'Coleman Township',
311
337
  '5406': 'Latchford Town',
312
338
  '5408': 'Cobalt Town',
@@ -351,6 +377,7 @@ export const rollNumberMunicipalities = Object.freeze({
351
377
  '5676': 'Hearst Town',
352
378
  '5677': 'Mattice-val Cote Township',
353
379
  '5699': 'Province Of Ontario',
380
+ // Regional Municipality of Sudbury and the Territorial Districts of Sudbury and Manitoulin
354
381
  '5101': 'Tehkummah Township',
355
382
  '5102': 'Province Of Ontario',
356
383
  '5104': 'Central Manitoulin Municipality',
@@ -379,6 +406,7 @@ export const rollNumberMunicipalities = Object.freeze({
379
406
  '5298': 'Province Of Ontario',
380
407
  '5299': 'Province Of Ontario',
381
408
  '5307': 'Greater Sudbury City',
409
+ // Territorial District of Algoma
382
410
  '5701': 'Jocelyn Township',
383
411
  '5704': 'Hilton Township',
384
412
  '5706': 'Hilton Beach Village',
@@ -403,6 +431,7 @@ export const rollNumberMunicipalities = Object.freeze({
403
431
  '5791': 'White River Township',
404
432
  '5796': 'Hornepayne Township',
405
433
  '5799': 'Province Of Ontario',
434
+ // Territorials District of Kenora, Rainy River and Thunder Bay
406
435
  '5801': 'Neebing Municipality',
407
436
  '5803': 'Province Of Ontario',
408
437
  '5804': 'Thunder Bay City',
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Validates a roll number.
3
+ * @param rollNumber - The roll number to validate
4
+ * @returns True if the roll number is valid, false otherwise
5
+ */
1
6
  export declare function validateRollNumber(rollNumber: string): boolean;
2
7
  export interface ParsedRollNumber {
3
8
  county?: string;
@@ -9,4 +14,9 @@ export interface ParsedRollNumber {
9
14
  parcelSub: string;
10
15
  primarySubordinate: string;
11
16
  }
17
+ /**
18
+ * Parses a roll number into its component parts.
19
+ * @param rollNumber - The roll number to parse
20
+ * @returns An object containing the parsed roll number components
21
+ */
12
22
  export declare function parseRollNumber(rollNumber: string): ParsedRollNumber;
@@ -1,9 +1,20 @@
1
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
1
2
  import { rollNumberMunicipalities } from './lookups.js';
3
+ /**
4
+ * Validates a roll number.
5
+ * @param rollNumber - The roll number to validate
6
+ * @returns True if the roll number is valid, false otherwise
7
+ */
2
8
  export function validateRollNumber(rollNumber) {
3
9
  return (/^\d{15}$/.test(rollNumber) ||
4
10
  (/^\d{19}$/.test(rollNumber) &&
5
11
  Object.keys(rollNumberMunicipalities).includes(rollNumber.slice(0, 4))));
6
12
  }
13
+ /**
14
+ * Parses a roll number into its component parts.
15
+ * @param rollNumber - The roll number to parse
16
+ * @returns An object containing the parsed roll number components
17
+ */
7
18
  export function parseRollNumber(rollNumber) {
8
19
  if (!validateRollNumber(rollNumber)) {
9
20
  throw new Error(`Invalid roll number: ${rollNumber}`);
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
2
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
3
2
 
4
3
  import { rollNumberMunicipalities } from './lookups.js'
@@ -1,140 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- - Demonstrating empathy and kindness toward other people
21
-
22
- - Being respectful of differing opinions, viewpoints, and experiences
23
-
24
- - Giving and gracefully accepting constructive feedback
25
-
26
- - Accepting responsibility and apologizing to those affected by our mistakes,
27
- and learning from the experience
28
-
29
- - Focusing on what is best not just for us as individuals, but for the overall
30
- community
31
-
32
- Examples of unacceptable behavior include:
33
-
34
- - The use of sexualized language or imagery, and sexual attention or advances of
35
- any kind
36
-
37
- - Trolling, insulting or derogatory comments, and personal or political attacks
38
-
39
- - Public or private harassment
40
-
41
- - Publishing others' private information, such as a physical or email address,
42
- without their explicit permission
43
-
44
- - Other conduct which could reasonably be considered inappropriate in a
45
- professional setting
46
-
47
- ## Enforcement Responsibilities
48
-
49
- Community leaders are responsible for clarifying and enforcing our standards of
50
- acceptable behavior and will take appropriate and fair corrective action in
51
- response to any behavior that they deem inappropriate, threatening, offensive,
52
- or harmful.
53
-
54
- Community leaders have the right and responsibility to remove, edit, or reject
55
- comments, commits, code, wiki edits, issues, and other contributions that are
56
- not aligned to this Code of Conduct, and will communicate reasons for moderation
57
- decisions when appropriate.
58
-
59
- ## Scope
60
-
61
- This Code of Conduct applies within all community spaces, and also applies when
62
- an individual is officially representing the community in public spaces.
63
- Examples of representing our community include using an official e-mail address,
64
- posting via an official social media account, or acting as an appointed
65
- representative at an online or offline event.
66
-
67
- ## Enforcement
68
-
69
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
70
- reported to the community leaders responsible for enforcement at
71
- **corporateapps@cityssm.on.ca**.
72
- All complaints will be reviewed and investigated promptly and fairly.
73
-
74
- All community leaders are obligated to respect the privacy and security of the
75
- reporter of any incident.
76
-
77
- ## Enforcement Guidelines
78
-
79
- Community leaders will follow these Community Impact Guidelines in determining
80
- the consequences for any action they deem in violation of this Code of Conduct:
81
-
82
- ### 1. Correction
83
-
84
- **Community Impact**: Use of inappropriate language or other behavior deemed
85
- unprofessional or unwelcome in the community.
86
-
87
- **Consequence**: A private, written warning from community leaders, providing
88
- clarity around the nature of the violation and an explanation of why the
89
- behavior was inappropriate. A public apology may be requested.
90
-
91
- ### 2. Warning
92
-
93
- **Community Impact**: A violation through a single incident or series of
94
- actions.
95
-
96
- **Consequence**: A warning with consequences for continued behavior. No
97
- interaction with the people involved, including unsolicited interaction with
98
- those enforcing the Code of Conduct, for a specified period of time. This
99
- includes avoiding interactions in community spaces as well as external channels
100
- like social media. Violating these terms may lead to a temporary or permanent
101
- ban.
102
-
103
- ### 3. Temporary Ban
104
-
105
- **Community Impact**: A serious violation of community standards, including
106
- sustained inappropriate behavior.
107
-
108
- **Consequence**: A temporary ban from any sort of interaction or public
109
- communication with the community for a specified period of time. No public or
110
- private interaction with the people involved, including unsolicited interaction
111
- with those enforcing the Code of Conduct, is allowed during this period.
112
- Violating these terms may lead to a permanent ban.
113
-
114
- ### 4. Permanent Ban
115
-
116
- **Community Impact**: Demonstrating a pattern of violation of community
117
- standards, including sustained inappropriate behavior, harassment of an
118
- individual, or aggression toward or disparagement of classes of individuals.
119
-
120
- **Consequence**: A permanent ban from any sort of public interaction within the
121
- community.
122
-
123
- ## Attribution
124
-
125
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
126
- version 2.1, available at
127
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
128
-
129
- Community Impact Guidelines were inspired by
130
- [Mozilla's code of conduct enforcement ladder][mozilla coc].
131
-
132
- For answers to common questions about this code of conduct, see the FAQ at
133
- [https://www.contributor-covenant.org/faq][faq]. Translations are available at
134
- [https://www.contributor-covenant.org/translations][translations].
135
-
136
- [homepage]: https://www.contributor-covenant.org
137
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
138
- [mozilla coc]: https://github.com/mozilla/diversity
139
- [faq]: https://www.contributor-covenant.org/faq
140
- [translations]: https://www.contributor-covenant.org/translations
package/CONTRIBUTING.md DELETED
@@ -1,33 +0,0 @@
1
- ### Thank you for your interest in making this project better!
2
-
3
- Together, we can build high quality software that meets the needs of municipalities,
4
- while remaining open and budget conscious.
5
-
6
- **Thank you for taking the time to read the contributing guidelines.**
7
-
8
- ### All contributions are welcome
9
-
10
- Being a very small team, contributions are greatly appreciated. How can you contribute?
11
-
12
- - **Promote this project!**
13
- - Documentation and tutorials
14
- - Submit bug reports (or fix them!)
15
- - Request new features (or build them!)
16
-
17
- ### Please Read the Code of Conduct
18
-
19
- The [Code of Conduct](CODE_OF_CONDUCT.md) document describes how we should act when working together.
20
- Be nice! :smile:
21
-
22
- ### How to report a bug or suggest an enhancement
23
-
24
- **If you find a security vulnerability, do NOT open an issue. Email
25
- <corporateapps@cityssm.on.ca> instead.**
26
-
27
- For all other bug reports, feature requests, or enhancements,
28
- open an issue and use the closest template.
29
-
30
- ### Thanks Again
31
-
32
- We are a very small team with big aspirations and limited resources.
33
- Thank you for helping with this project in any way you can!
package/SECURITY.md DELETED
@@ -1,15 +0,0 @@
1
- # Security Policy
2
-
3
- **Thank you for your interest in keeping this project safe for everyone.**
4
-
5
- ## Supported Versions
6
-
7
- Due to limited resources, only the latest version is supported only for security updates.
8
-
9
- ## Reporting a Vulnerability
10
-
11
- To report a security vulnerability,
12
- please email <corporateapps@cityssm.on.ca>.
13
-
14
- Every attempt will be made to resolve confirmed vulnerabilities
15
- in a timely manner.