├── .github
├── ISSUE_TEMPLATE
│ ├── 01_bug.md
│ ├── 02_feature_request.md
│ ├── 03_enhancement.md
│ ├── 04_question.md
│ ├── 05_other.md
│ └── config.yml
└── workflows
│ └── build.yml
├── .gitignore
├── .husky
├── .gitignore
├── commit-msg
└── pre-commit
├── .npmignore
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── SECURITY.md
├── THIRD-PARTY-NOTICES
├── assets
└── pt-poster-1.0.0.pdf
├── bin
└── cli
├── examples
└── sample-data.csv
├── lib
├── generate-poster.js
├── generate-qr-code-payload.js
├── generate-qr-code-url.js
├── index.js
├── protobuf-util.js
├── read-qr-code-data-from-csv.js
├── validate-qr-code-data.js
└── yargs
│ ├── commands
│ ├── file.js
│ ├── poster.js
│ └── terminal.js
│ ├── index.js
│ └── util
│ ├── data-from-argv.js
│ ├── data-from-csv.js
│ └── data-provider.js
├── package-lock.json
├── package.json
├── proto
└── internal
│ └── pt
│ └── trace_location.proto
└── test
├── cli.spec.js
└── validate-qr-code-data.spec.js
/.github/ISSUE_TEMPLATE/01_bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F6A8 Bug"
3 | about: Did you come across a bug or unexpected behaviour differing from the docs?
4 | labels: bug
5 | ---
6 |
7 |
13 |
14 | ## Describe the bug
15 |
16 |
17 |
18 | ## Expected behaviour
19 |
20 |
21 |
22 | ## Steps to reproduce the issue
23 |
24 |
25 |
26 |
32 |
33 | ## Technical details
34 |
35 | - Host Machine OS (Windows/Linux/Mac):
36 |
37 | ## Possible Fix
38 |
39 |
40 |
41 | ## Additional context
42 |
43 |
44 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/02_feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F381 Feature Request"
3 | about: Do you have an idea for a new feature?
4 | labels: feature request
5 | ---
6 |
7 |
13 |
14 | ## Feature description
15 |
16 |
21 |
22 | ## Problem and motivation
23 |
24 |
28 |
29 | ## Is this something you're interested in working on
30 |
31 |
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/03_enhancement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\u23F1\uFE0F Enhancement"
3 | about: Do you have an idea for an enhancement?
4 | labels: enhancement
5 | ---
6 |
7 |
13 |
14 | ## Current Implementation
15 |
16 |
17 |
18 | ## Suggested Enhancement
19 |
20 |
24 |
25 | ## Expected Benefits
26 |
27 |
31 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/04_question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U00002753 Question"
3 | about: If you have questions about pieces of the code or documentation for this component, please post them here.
4 | labels: question
5 | ---
6 |
7 |
13 |
14 | ## Your Question
15 |
16 |
17 |
18 | * Source File:
19 | * Line(s):
20 | * Question:
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/05_other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F4AC Other"
3 | about: For conceptual questions, please consider opening an issue in the documentation repository.
4 | labels: other
5 | ---
6 |
7 |
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Node.js CI
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | branches: [ main ]
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 | strategy:
13 | matrix:
14 | node-version: [14.x, 15.x, 16.x]
15 | steps:
16 | - uses: actions/checkout@v2
17 | - uses: actions/setup-node@v1
18 | with:
19 | node-version: ${{ matrix.node-version }}
20 | - run: npm install
21 | - run: npm test
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 |
106 | # Files generated by tests
107 | test/*.jpg
108 | test/*.pdf
109 | test/*.png
110 | test/*.svg
--------------------------------------------------------------------------------
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx commitlint --edit $1
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx lint-staged
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | /*.csv
2 | /*.js
3 | /*.pdf
4 | /*.png
5 | /*.svg
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # This file provides an overview of code owners in this repository.
2 |
3 | # Each line is a file pattern followed by one or more owners.
4 | # The last matching pattern has the most precedence.
5 | # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/.
6 |
7 | # These are the default owners for the whole content of this repository. The default owners are automatically added as reviewers when you open a pull request, unless different owners are specified in the file.
8 | * @corona-warn-app/cwa-app-architecture @corona-warn-app/cwa-moderators
9 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributor Covenant Code of Conduct
3 |
4 | ## Our Pledge
5 |
6 | We as members, contributors, and leaders pledge to make participation in our
7 | community a harassment-free experience for everyone, regardless of age, body
8 | size, visible or invisible disability, ethnicity, sex characteristics, gender
9 | identity and expression, level of experience, education, socio-economic status,
10 | nationality, personal appearance, race, religion, or sexual identity
11 | and orientation.
12 |
13 | We pledge to act and interact in ways that contribute to an open, welcoming,
14 | diverse, inclusive, and healthy community.
15 |
16 | ## Our Standards
17 |
18 | Examples of behavior that contributes to a positive environment for our
19 | community include:
20 |
21 | * Demonstrating empathy and kindness toward other people
22 | * Being respectful of differing opinions, viewpoints, and experiences
23 | * Giving and gracefully accepting constructive feedback
24 | * Accepting responsibility and apologizing to those affected by our mistakes,
25 | and learning from the experience
26 | * Focusing on what is best not just for us as individuals, but for the
27 | overall community
28 |
29 | Examples of unacceptable behavior include:
30 |
31 | * The use of sexualized language or imagery, and sexual attention or
32 | advances of any kind
33 | * Trolling, insulting or derogatory comments, and personal or political attacks
34 | * Public or private harassment
35 | * Publishing others' private information, such as a physical or email
36 | address, without their explicit permission
37 | * Other conduct which could reasonably be considered inappropriate in a
38 | professional setting
39 |
40 | ## Enforcement Responsibilities
41 |
42 | Community leaders are responsible for clarifying and enforcing our standards of
43 | acceptable behavior and will take appropriate and fair corrective action in
44 | response to any behavior that they deem inappropriate, threatening, offensive,
45 | or harmful.
46 |
47 | Community leaders have the right and responsibility to remove, edit, or reject
48 | comments, commits, code, wiki edits, issues, and other contributions that are
49 | not aligned to this Code of Conduct, and will communicate reasons for moderation
50 | decisions when appropriate.
51 |
52 | ## Scope
53 |
54 | This Code of Conduct applies within all community spaces, and also applies when
55 | an individual is officially representing the community in public spaces.
56 | Examples of representing our community include using an official e-mail address,
57 | posting via an official social media account, or acting as an appointed
58 | representative at an online or offline event.
59 |
60 | ## Enforcement
61 |
62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
63 | reported to the community leaders responsible for enforcement at
64 | [corona-warn-app.opensource@sap.com](mailto:corona-warn-app.opensource@sap.com).
65 | All complaints will be reviewed and investigated promptly and fairly.
66 |
67 | All community leaders are obligated to respect the privacy and security of the
68 | reporter of any incident.
69 |
70 | ## Enforcement Guidelines
71 |
72 | Community leaders will follow these Community Impact Guidelines in determining
73 | the consequences for any action they deem in violation of this Code of Conduct:
74 |
75 | ### 1. Correction
76 |
77 | **Community Impact**: Use of inappropriate language or other behavior deemed
78 | unprofessional or unwelcome in the community.
79 |
80 | **Consequence**: A private, written warning from community leaders, providing
81 | clarity around the nature of the violation and an explanation of why the
82 | behavior was inappropriate. A public apology may be requested.
83 |
84 | ### 2. Warning
85 |
86 | **Community Impact**: A violation through a single incident or series
87 | of actions.
88 |
89 | **Consequence**: A warning with consequences for continued behavior. No
90 | interaction with the people involved, including unsolicited interaction with
91 | those enforcing the Code of Conduct, for a specified period of time. This
92 | includes avoiding interactions in community spaces as well as external channels
93 | like social media. Violating these terms may lead to a temporary or
94 | permanent ban.
95 |
96 | ### 3. Temporary Ban
97 |
98 | **Community Impact**: A serious violation of community standards, including
99 | sustained inappropriate behavior.
100 |
101 | **Consequence**: A temporary ban from any sort of interaction or public
102 | communication with the community for a specified period of time. No public or
103 | private interaction with the people involved, including unsolicited interaction
104 | with those enforcing the Code of Conduct, is allowed during this period.
105 | Violating these terms may lead to a permanent ban.
106 |
107 | ### 4. Permanent Ban
108 |
109 | **Community Impact**: Demonstrating a pattern of violation of community
110 | standards, including sustained inappropriate behavior, harassment of an
111 | individual, or aggression toward or disparagement of classes of individuals.
112 |
113 | **Consequence**: A permanent ban from any sort of public interaction within
114 | the community.
115 |
116 | ## Attribution
117 |
118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119 | version 2.0, available at
120 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121 |
122 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
123 | enforcement ladder](https://github.com/mozilla/diversity).
124 |
125 | [homepage]: https://www.contributor-covenant.org
126 |
127 | For answers to common questions about this code of conduct, see the FAQ at
128 | https://www.contributor-covenant.org/faq. Translations are available at
129 | https://www.contributor-covenant.org/translations.
130 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Code of Conduct
4 |
5 | All members of the project community must abide by the [Contributor Covenant, version 2.0](CODE_OF_CONDUCT.md).
6 | Only by respecting each other we can develop a productive, collaborative community.
7 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting [corona-warn-app.opensource@sap.com](mailto:corona-warn-app.opensource@sap.com) and/or a project maintainer.
8 |
9 | We appreciate your courtesy of avoiding political questions here. Issues which are not related to the project itself will be closed by our community managers.
10 |
11 | ## Engaging in Our Project
12 |
13 | We use GitHub to manage reviews of pull requests.
14 |
15 | * If you are a new contributor, see: [Steps to Contribute](#steps-to-contribute)
16 |
17 | * If you have a trivial fix or improvement, go ahead and create a pull request, addressing (with `@...`) a suitable maintainer of this repository (see [CODEOWNERS](CODEOWNERS) of the repository you want to contribute to) in the description of the pull request.
18 |
19 | * If you plan to do something more involved, please reach out to us and send an [email](mailto:corona-warn-app.opensource@sap.com). This will avoid unnecessary work and surely give you and us a good deal of inspiration.
20 |
21 | * Relevant coding style guidelines are available in the respective sub-repositories as they are programming language-dependent.
22 |
23 | ## Steps to Contribute
24 |
25 | Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on. This is to prevent duplicated efforts from other contributors on the same issue.
26 |
27 | If you have questions about one of the issues, please comment on them, and one of the maintainers will clarify.
28 |
29 | We kindly ask you to follow the [Pull Request Checklist](#Pull-Request-Checklist) to ensure reviews can happen accordingly.
30 |
31 | ## Contributing Code
32 |
33 | You are welcome to contribute code in order to fix a bug or to implement a new feature.
34 |
35 | The following rule governs code contributions:
36 |
37 | * Contributions must be licensed under the [Apache 2.0 License](LICENSE)
38 |
39 | ## Contributing Documentation
40 |
41 | You are welcome to contribute documentation to the project.
42 |
43 | The following rule governs documentation contributions:
44 |
45 | * Contributions must be licensed under the same license as code, the [Apache 2.0 License](LICENSE)
46 |
47 | ## Pull Request Checklist
48 |
49 | * Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master, you may be asked to rebase your changes.
50 |
51 | * Commits should be as small as possible while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).
52 |
53 | * Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests. If tested manually, provide information about the test scope in the PR description (e.g. “Test passed: Upgrade version from 0.42 to 0.42.23.”).
54 |
55 | * Create _Work In Progress [WIP]_ pull requests only if you need clarification or an explicit review before you can continue your work item.
56 |
57 | * If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment, or you can ask for a review by contacting us via [email](mailto:corona-warn-app.opensource@sap.com).
58 |
59 | * Post review:
60 | * If a review requires you to change your commit(s), please test the changes again.
61 | * Amend the affected commit(s) and force push onto your branch.
62 | * Set respective comments in your GitHub review to resolved.
63 | * Create a general PR comment to notify the reviewers that your amendments are ready for another round of review.
64 |
65 | ## Issues and Planning
66 |
67 | * We use GitHub issues to track bugs and enhancement requests.
68 |
69 | * Please provide as much context as possible when you open an issue. The information you provide must be comprehensive enough to reproduce that issue for the assignee. Therefore, contributors should use but aren't restricted to the issue template provided by the project maintainers.
70 |
71 | * When creating an issue, try using one of our issue templates which already contain some guidelines on which content is expected to process the issue most efficiently. If no template applies, you can of course also create an issue from scratch.
72 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2020-2021 Deutsche Telekom AG and SAP SE or an SAP affiliate company.
2 |
3 | This project is licensed under Apache License, Version 2.0;
4 | you may not use them except in compliance with the License.
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | About this Repository •
12 | Requirements •
13 | CLI Usage •
14 | Usage in Node.js •
15 | Documentation •
16 | Support and Feedback •
17 | How to contribute •
18 | Licensing •
19 | Web Site
20 |
21 |
22 |
23 | # Corona-Warn-App: cwa-event-qr-code
24 |
25 | ## About this Repository
26 |
27 | Utility to generate QR codes for Event Registration (incl. from the CLI). For information about the project, please see our [documentation repository](https://github.com/corona-warn-app/cwa-documentation).
28 |
29 | Remark: This utility is in early stages of development and should help you to create multiple QR codes at once. If you find this useful or you identified a bug, feel free to create an issue.
30 |
31 | ## Requirements
32 |
33 | You need version 14 (LTS) or higher of [Node.js](https://nodejs.org/en/) (which includes npm) to use this utility.
34 |
35 | ## Usage Guide
36 |
37 | A step by step explanation on how to use this tool is available [here](https://coronawarn.app/en/event-qr-code-guide/), on our website.
38 |
39 | ## CLI Usage
40 |
41 | #### Installation and Basics
42 |
43 | ```shell
44 | # Option a) Install globally to make executable available
45 | $ npm install cwa-event-qr-code --global
46 | $ cwa-event-qr-code --help
47 | $ cwa-event-qr-code --version
48 |
49 | # Option b) Use npx and skip the installation
50 | $ npx cwa-event-qr-code --help
51 | $ npx cwa-event-qr-code --version
52 | ```
53 |
54 | #### Create Posters
55 |
56 | ```shell
57 | # Multiple posters from CSV
58 | $ cwa-event-qr-code poster \
59 | --csv examples/sample-data.csv \
60 | --dest posters
61 |
62 | # Single poster from arguments
63 | $ cwa-event-qr-code poster \
64 | --description "Some Bakery" \
65 | --address "Some Street, Some City" \
66 | --type 4 \
67 | --default-check-in-length-in-minutes 15 \
68 | --filepath bakery.pdf
69 | ```
70 |
71 | #### Create QR codes only
72 |
73 | ```shell
74 | # Multiple QR codes from CSV
75 | $ cwa-event-qr-code file \
76 | --csv examples/sample-data.csv \
77 | --dest qr-codes
78 |
79 | # Single QR code from arguments (as PNG)
80 | $ cwa-event-qr-code file \
81 | --description "Some Bakery" \
82 | --address "Some Street, Some City" \
83 | --type 4 \
84 | --default-check-in-length-in-minutes 15 \
85 | --filepath bakery.png
86 |
87 | # Single QR code from arguments (as SVG)
88 | $ cwa-event-qr-code file \
89 | --description "Some Bakery" \
90 | --address "Some Street, Some City" \
91 | --type 4 \
92 | --default-check-in-length-in-minutes 15 \
93 | --filepath bakery.svg
94 | ```
95 |
96 | ## Usage in Node.js
97 |
98 | Install as a dependency:
99 |
100 | ```shell
101 | $ npm install cwa-event-qr-code
102 | ```
103 |
104 | Then use it in your script:
105 |
106 | ```javascript
107 | const { createEventQRCode } = require('cwa-event-qr-code')
108 |
109 | const eventQRCode = createEventQRCode({
110 | locationData: {
111 | description: 'hello-world',
112 | address: 'hello'
113 | },
114 | vendorData: {
115 | type: 1,
116 | defaultCheckInLengthInMinutes: 30
117 | }
118 | })
119 |
120 | // Create a PNG
121 | await eventQRCode.toPNG('hello-world.png')
122 |
123 | // Get just the url
124 | const url = await eventQRCode.toURL()
125 | ```
126 |
127 | ### Debug local changes
128 |
129 | ```shell
130 | # Run the CLI-Tool locally
131 | $ node bin/cli file \
132 | --description "Some Bakery" \
133 | --address "Some Street, Some City" \
134 | --type 4 \
135 | --default-check-in-length-in-minutes 15 \
136 | --filepath bakery.png
137 | ```
138 |
139 | ## Documentation
140 |
141 | The full documentation for the Corona-Warn-App can be found in the [cwa-documentation](https://github.com/corona-warn-app/cwa-documentation) repository. The documentation repository contains technical documents, architecture information, and white papers related to this implementation.
142 |
143 | ## Support and Feedback
144 |
145 | The following channels are available for discussions, feedback, and support requests:
146 |
147 | | Type | Channel |
148 | | ------------------------ | ------------------------------------------------------ |
149 | | **General discussion, issues, bugs** |
|
150 | | **Other requests** |
|
151 |
152 | ## How to contribute
153 |
154 | The German government has asked SAP and Deutsche Telekom AG to develop the Corona-Warn-App for Germany as open source software. Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe, scalable and stable manner. SAP is responsible for the app development, its framework and the underlying platform. Therefore, development teams of SAP and Deutsche Telekom are contributing to this project. At the same time our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community.
155 |
156 | For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md). By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times.
157 |
158 | ## Repositories
159 |
160 | A list of all public repositories from the Corona-Warn-App can be found [here](https://github.com/corona-warn-app/cwa-documentation/blob/master/README.md#repositories).
161 |
162 | ## Licensing
163 |
164 | Copyright (c) 2020-2022 Deutsche Telekom AG and SAP SE or an SAP affiliate company.
165 |
166 | Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License.
167 |
168 | You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.
169 |
170 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the [LICENSE](./LICENSE) for the specific language governing permissions and limitations under the License.
171 |
172 | The "Corona-Warn-App" logo is a registered trademark of The Press and Information Office of the Federal Government. For more information please see [bundesregierung.de](https://www.bundesregierung.de/breg-en/federal-government/federal-press-office).
173 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Vulnerabilities
2 |
3 | The Corona-Warn-App is built with security and data privacy in mind to ensure your data is safe.
4 |
5 | ## Reporting
6 |
7 | We are grateful for security researchers and users reporting a vulnerability to us, first. To ensure that your request is handled in a timely manner and non-disclosure of vulnerabilities can be assured, please follow the below guideline.
8 |
9 | **Please do not report security vulnerabilities directly on GitHub. GitHub Issues can be publicly seen and therefore would result in a direct disclosure.**
10 |
11 | * Please address questions about data privacy, security concepts, and other media requests to the corona-warn-app.opensource@sap.com mailbox.
12 | * For reporting a vulnerability, please use the Vulnerability Report Form for Security Researchers on [SAP Trust Center](https://www.sap.com/about/trust-center/security/incident-management.html).
13 | * Please select "Corona-Warn-App" in the _product_ list.
14 | * In the _versions_ field, either note the specific [release version](https://github.com/corona-warn-app/cwa-event-qr-code/releases) or commit id of the master branch you investigated.
15 | * The affected repository should be mentioned in the _vulnerability description_.
16 | * Please use this channel only for reporting vulnerabilities of the _cwa-event-qr-code_ component and check the security of the respective repositories for other components.
17 |
18 | ## Disclosure Handling
19 |
20 | SAP is committed to timely review and respond to your request. The resolution of code defects will be handled by a dedicated group of security experts and prepared in a private GitHub repository. The project will inform the public about resolved security vulnerabilities. For more information on the disclosure guidelines, please consult [SAP security information page](https://www.sap.com/about/trust-center/security/incident-management.html).
21 |
--------------------------------------------------------------------------------
/THIRD-PARTY-NOTICES:
--------------------------------------------------------------------------------
1 | The following NPM packages may be included in this product:
2 |
3 | - @fast-csv/parse@4.3.6
4 |
5 | These packages each contain the following license and notice below:
6 |
7 | The MIT License
8 |
9 | Copyright (c) 2011-2019 C2FO
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in
19 | all copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | THE SOFTWARE.
28 |
29 | -----------
30 |
31 | The following NPM packages may be included in this product:
32 |
33 | - @pdf-lib/standard-fonts@1.0.0
34 |
35 | These packages each contain the following license and notice below:
36 |
37 | MIT License
38 |
39 | Copyright (c) 2018 Andrew Dillon
40 |
41 | Permission is hereby granted, free of charge, to any person obtaining a copy
42 | of this software and associated documentation files (the "Software"), to deal
43 | in the Software without restriction, including without limitation the rights
44 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45 | copies of the Software, and to permit persons to whom the Software is
46 | furnished to do so, subject to the following conditions:
47 |
48 | The above copyright notice and this permission notice shall be included in all
49 | copies or substantial portions of the Software.
50 |
51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
57 | SOFTWARE.
58 |
59 | -----------
60 |
61 | The following NPM packages may be included in this product:
62 |
63 | - @pdf-lib/upng@1.0.1
64 |
65 | These packages each contain the following license and notice below:
66 |
67 | MIT License
68 |
69 | Copyright (c) 2017 Photopea
70 |
71 | Permission is hereby granted, free of charge, to any person obtaining a copy
72 | of this software and associated documentation files (the "Software"), to deal
73 | in the Software without restriction, including without limitation the rights
74 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75 | copies of the Software, and to permit persons to whom the Software is
76 | furnished to do so, subject to the following conditions:
77 |
78 | The above copyright notice and this permission notice shall be included in all
79 | copies or substantial portions of the Software.
80 |
81 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
87 | SOFTWARE.
88 |
89 | -----------
90 |
91 | The following NPM packages may be included in this product:
92 |
93 | - @protobufjs/aspromise@1.1.2
94 | - @protobufjs/base64@1.1.2
95 | - @protobufjs/codegen@2.0.4
96 | - @protobufjs/eventemitter@1.1.0
97 | - @protobufjs/fetch@1.1.0
98 | - @protobufjs/float@1.0.2
99 | - @protobufjs/inquire@1.1.0
100 | - @protobufjs/path@1.1.2
101 | - @protobufjs/pool@1.1.0
102 | - @protobufjs/utf8@1.1.0
103 |
104 | These packages each contain the following license and notice below:
105 |
106 | Copyright (c) 2016, Daniel Wirtz All rights reserved.
107 |
108 | Redistribution and use in source and binary forms, with or without
109 | modification, are permitted provided that the following conditions are
110 | met:
111 |
112 | * Redistributions of source code must retain the above copyright
113 | notice, this list of conditions and the following disclaimer.
114 | * Redistributions in binary form must reproduce the above copyright
115 | notice, this list of conditions and the following disclaimer in the
116 | documentation and/or other materials provided with the distribution.
117 | * Neither the name of its author, nor the names of its contributors
118 | may be used to endorse or promote products derived from this software
119 | without specific prior written permission.
120 |
121 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
122 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
123 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
124 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
125 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
126 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
127 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
128 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
129 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
130 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
131 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
132 |
133 | -----------
134 |
135 | The following NPM packages may be included in this product:
136 |
137 | - @types/long@4.0.1
138 |
139 | These packages each contain the following license and notice below:
140 |
141 | MIT License
142 |
143 | Copyright (c) Microsoft Corporation. All rights reserved.
144 |
145 | Permission is hereby granted, free of charge, to any person obtaining a copy
146 | of this software and associated documentation files (the "Software"), to deal
147 | in the Software without restriction, including without limitation the rights
148 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
149 | copies of the Software, and to permit persons to whom the Software is
150 | furnished to do so, subject to the following conditions:
151 |
152 | The above copyright notice and this permission notice shall be included in all
153 | copies or substantial portions of the Software.
154 |
155 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
156 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
158 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
159 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
160 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
161 | SOFTWARE
162 |
163 | -----------
164 |
165 | The following NPM packages may be included in this product:
166 |
167 | - @types/node@13.13.50
168 | - @types/node@14.14.41
169 |
170 | These packages each contain the following license and notice below:
171 |
172 | MIT License
173 |
174 | Copyright (c) Microsoft Corporation.
175 |
176 | Permission is hereby granted, free of charge, to any person obtaining a copy
177 | of this software and associated documentation files (the "Software"), to deal
178 | in the Software without restriction, including without limitation the rights
179 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
180 | copies of the Software, and to permit persons to whom the Software is
181 | furnished to do so, subject to the following conditions:
182 |
183 | The above copyright notice and this permission notice shall be included in all
184 | copies or substantial portions of the Software.
185 |
186 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
187 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
189 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
190 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
191 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
192 | SOFTWARE
193 |
194 | -----------
195 |
196 | The following NPM packages may be included in this product:
197 |
198 | - ansi-regex@4.1.0
199 | - ansi-regex@5.0.0
200 | - ansi-styles@3.2.1
201 | - ansi-styles@4.3.0
202 | - camelcase@5.3.1
203 | - find-up@3.0.0
204 | - is-fullwidth-code-point@3.0.0
205 | - locate-path@3.0.0
206 | - p-limit@2.3.0
207 | - p-locate@3.0.0
208 | - p-try@2.2.0
209 | - string-width@3.1.0
210 | - string-width@4.2.2
211 | - strip-ansi@5.2.0
212 | - strip-ansi@6.0.0
213 | - wrap-ansi@5.1.0
214 |
215 | These packages each contain the following license and notice below:
216 |
217 | MIT License
218 |
219 | Copyright (c) Sindre Sorhus (sindresorhus.com)
220 |
221 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
222 |
223 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
224 |
225 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
226 |
227 | -----------
228 |
229 | The following NPM packages may be included in this product:
230 |
231 | - base64-js@1.5.1
232 |
233 | These packages each contain the following license and notice below:
234 |
235 | The MIT License (MIT)
236 |
237 | Copyright (c) 2014 Jameson Little
238 |
239 | Permission is hereby granted, free of charge, to any person obtaining a copy
240 | of this software and associated documentation files (the "Software"), to deal
241 | in the Software without restriction, including without limitation the rights
242 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
243 | copies of the Software, and to permit persons to whom the Software is
244 | furnished to do so, subject to the following conditions:
245 |
246 | The above copyright notice and this permission notice shall be included in
247 | all copies or substantial portions of the Software.
248 |
249 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
250 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
251 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
252 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
253 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
254 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
255 | THE SOFTWARE.
256 |
257 | -----------
258 |
259 | The following NPM packages may be included in this product:
260 |
261 | - buffer-alloc-unsafe@1.1.0
262 |
263 | These packages each contain the following license and notice below:
264 |
265 | # Buffer Alloc Unsafe
266 |
267 | A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.
268 |
269 | Works as Node.js: `v7.0.0`
270 | Works on Node.js: `v0.10.0`
271 |
272 | ## Installation
273 |
274 | ```sh
275 | npm install --save buffer-alloc-unsafe
276 | ```
277 |
278 | ## Usage
279 |
280 | ```js
281 | const allocUnsafe = require('buffer-alloc-unsafe')
282 |
283 | console.log(allocUnsafe(10))
284 | //=>
285 |
286 | console.log(allocUnsafe(10))
287 | //=>
288 |
289 | console.log(allocUnsafe(10))
290 | //=>
291 |
292 | allocUnsafe(-10)
293 | //=> RangeError: "size" argument must not be negative
294 | ```
295 |
296 | ## API
297 |
298 | ### allocUnsafe(size)
299 |
300 | - `size` <Integer> The desired length of the new `Buffer`
301 |
302 | Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be
303 | less than or equal to the value of `buffer.kMaxLength` and greater than or equal
304 | to zero. Otherwise, a `RangeError` is thrown.
305 |
306 | ## See also
307 |
308 | - [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
309 | - [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill`
310 | - [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from`
311 |
312 | -----------
313 |
314 | The following NPM packages may be included in this product:
315 |
316 | - buffer-alloc@1.2.0
317 |
318 | These packages each contain the following license and notice below:
319 |
320 | # Buffer Alloc
321 |
322 | A [ponyfill](https://ponyfill.com) for `Buffer.alloc`.
323 |
324 | Works as Node.js: `v7.0.0`
325 | Works on Node.js: `v0.10.0`
326 |
327 | ## Installation
328 |
329 | ```sh
330 | npm install --save buffer-alloc
331 | ```
332 |
333 | ## Usage
334 |
335 | ```js
336 | const alloc = require('buffer-alloc')
337 |
338 | console.log(alloc(4))
339 | //=>
340 |
341 | console.log(alloc(6, 0x41))
342 | //=>
343 |
344 | console.log(alloc(10, 'linus', 'utf8'))
345 | //=>
346 | ```
347 |
348 | ## API
349 |
350 | ### alloc(size[, fill[, encoding]])
351 |
352 | - `size` <Integer> The desired length of the new `Buffer`
353 | - `fill` <String> | <Buffer> | <Integer> A value to pre-fill the new `Buffer` with. **Default:** `0`
354 | - `encoding` <String> If `fill` is a string, this is its encoding. **Default:** `'utf8'`
355 |
356 | Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the `Buffer` will be zero-filled.
357 |
358 | ## See also
359 |
360 | - [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`
361 | - [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill`
362 | - [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from`
363 |
364 | -----------
365 |
366 | The following NPM packages may be included in this product:
367 |
368 | - buffer-fill@1.0.0
369 |
370 | These packages each contain the following license and notice below:
371 |
372 | # Buffer Fill
373 |
374 | A [ponyfill](https://ponyfill.com) for `Buffer.fill`.
375 |
376 | Works as Node.js: `v6.4.0`
377 | Works on Node.js: `v0.10.0`
378 |
379 | ## Installation
380 |
381 | ```sh
382 | npm install --save buffer-fill
383 | ```
384 |
385 | ## Usage
386 |
387 | ```js
388 | const fill = require('buffer-fill')
389 | const buf = Buffer.allocUnsafe(5)
390 |
391 | console.log(buf.fill(8))
392 | //=>
393 |
394 | console.log(buf.fill(9, 2, 4))
395 | //=>
396 |
397 | console.log(buf.fill('linus', 'latin1'))
398 | //=>
399 |
400 | console.log(buf.fill('\u0222'))
401 | //=>
402 | ```
403 |
404 | ## API
405 |
406 | ### fill(buf, value[, offset[, end]][, encoding])
407 |
408 | - `value` <String> | <Buffer> | <Integer> The value to fill `buf` with
409 | - `offset` <Integer> Where to start filling `buf`. **Default:** `0`
410 | - `end` <Integer> Where to stop filling `buf` (not inclusive). **Default:** `buf.length`
411 | - `encoding` <String> If `value` is a string, this is its encoding. **Default:** `'utf8'`
412 | - Return: <Buffer> A reference to `buf`
413 |
414 | Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
415 | the entire `buf` will be filled. This is meant to be a small simplification to
416 | allow the creation and filling of a `Buffer` to be done on a single line.
417 |
418 | If the final write of a `fill()` operation falls on a multi-byte character, then
419 | only the first bytes of that character that fit into `buf` are written.
420 |
421 | ## See also
422 |
423 | - [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`
424 | - [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
425 | - [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from`
426 |
427 | -----------
428 |
429 | The following NPM packages may be included in this product:
430 |
431 | - buffer-from@1.1.1
432 |
433 | These packages each contain the following license and notice below:
434 |
435 | MIT License
436 |
437 | Copyright (c) 2016, 2018 Linus Unnebäck
438 |
439 | Permission is hereby granted, free of charge, to any person obtaining a copy
440 | of this software and associated documentation files (the "Software"), to deal
441 | in the Software without restriction, including without limitation the rights
442 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
443 | copies of the Software, and to permit persons to whom the Software is
444 | furnished to do so, subject to the following conditions:
445 |
446 | The above copyright notice and this permission notice shall be included in all
447 | copies or substantial portions of the Software.
448 |
449 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
450 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
451 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
452 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
453 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
454 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
455 | SOFTWARE.
456 |
457 | -----------
458 |
459 | The following NPM packages may be included in this product:
460 |
461 | - buffer@5.7.1
462 |
463 | These packages each contain the following license and notice below:
464 |
465 | The MIT License (MIT)
466 |
467 | Copyright (c) Feross Aboukhadijeh, and other contributors.
468 |
469 | Permission is hereby granted, free of charge, to any person obtaining a copy
470 | of this software and associated documentation files (the "Software"), to deal
471 | in the Software without restriction, including without limitation the rights
472 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
473 | copies of the Software, and to permit persons to whom the Software is
474 | furnished to do so, subject to the following conditions:
475 |
476 | The above copyright notice and this permission notice shall be included in
477 | all copies or substantial portions of the Software.
478 |
479 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
480 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
481 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
482 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
483 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
484 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
485 | THE SOFTWARE.
486 |
487 | -----------
488 |
489 | The following NPM packages may be included in this product:
490 |
491 | - cliui@5.0.0
492 | - cliui@7.0.4
493 |
494 | These packages each contain the following license and notice below:
495 |
496 | Copyright (c) 2015, Contributors
497 |
498 | Permission to use, copy, modify, and/or distribute this software
499 | for any purpose with or without fee is hereby granted, provided
500 | that the above copyright notice and this permission notice
501 | appear in all copies.
502 |
503 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
504 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
505 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
506 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
507 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
508 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
509 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
510 |
511 | -----------
512 |
513 | The following NPM packages may be included in this product:
514 |
515 | - color-convert@1.9.3
516 | - color-convert@2.0.1
517 |
518 | These packages each contain the following license and notice below:
519 |
520 | Copyright (c) 2011-2016 Heather Arthur
521 |
522 | Permission is hereby granted, free of charge, to any person obtaining
523 | a copy of this software and associated documentation files (the
524 | "Software"), to deal in the Software without restriction, including
525 | without limitation the rights to use, copy, modify, merge, publish,
526 | distribute, sublicense, and/or sell copies of the Software, and to
527 | permit persons to whom the Software is furnished to do so, subject to
528 | the following conditions:
529 |
530 | The above copyright notice and this permission notice shall be
531 | included in all copies or substantial portions of the Software.
532 |
533 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
534 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
535 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
536 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
537 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
538 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
539 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
540 |
541 | -----------
542 |
543 | The following NPM packages may be included in this product:
544 |
545 | - color-name@1.1.3
546 | - color-name@1.1.4
547 |
548 | These packages each contain the following license and notice below:
549 |
550 | The MIT License (MIT)
551 | Copyright (c) 2015 Dmitry Ivanov
552 |
553 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
554 |
555 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
556 |
557 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
558 |
559 | -----------
560 |
561 | The following NPM packages may be included in this product:
562 |
563 | - cwa-event-qr-code@1.3.0
564 |
565 | These packages each contain the following license and notice below:
566 |
567 | Apache License
568 | Version 2.0, January 2004
569 | http://www.apache.org/licenses/
570 |
571 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
572 |
573 | 1. Definitions.
574 |
575 | "License" shall mean the terms and conditions for use, reproduction,
576 | and distribution as defined by Sections 1 through 9 of this document.
577 |
578 | "Licensor" shall mean the copyright owner or entity authorized by
579 | the copyright owner that is granting the License.
580 |
581 | "Legal Entity" shall mean the union of the acting entity and all
582 | other entities that control, are controlled by, or are under common
583 | control with that entity. For the purposes of this definition,
584 | "control" means (i) the power, direct or indirect, to cause the
585 | direction or management of such entity, whether by contract or
586 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
587 | outstanding shares, or (iii) beneficial ownership of such entity.
588 |
589 | "You" (or "Your") shall mean an individual or Legal Entity
590 | exercising permissions granted by this License.
591 |
592 | "Source" form shall mean the preferred form for making modifications,
593 | including but not limited to software source code, documentation
594 | source, and configuration files.
595 |
596 | "Object" form shall mean any form resulting from mechanical
597 | transformation or translation of a Source form, including but
598 | not limited to compiled object code, generated documentation,
599 | and conversions to other media types.
600 |
601 | "Work" shall mean the work of authorship, whether in Source or
602 | Object form, made available under the License, as indicated by a
603 | copyright notice that is included in or attached to the work
604 | (an example is provided in the Appendix below).
605 |
606 | "Derivative Works" shall mean any work, whether in Source or Object
607 | form, that is based on (or derived from) the Work and for which the
608 | editorial revisions, annotations, elaborations, or other modifications
609 | represent, as a whole, an original work of authorship. For the purposes
610 | of this License, Derivative Works shall not include works that remain
611 | separable from, or merely link (or bind by name) to the interfaces of,
612 | the Work and Derivative Works thereof.
613 |
614 | "Contribution" shall mean any work of authorship, including
615 | the original version of the Work and any modifications or additions
616 | to that Work or Derivative Works thereof, that is intentionally
617 | submitted to Licensor for inclusion in the Work by the copyright owner
618 | or by an individual or Legal Entity authorized to submit on behalf of
619 | the copyright owner. For the purposes of this definition, "submitted"
620 | means any form of electronic, verbal, or written communication sent
621 | to the Licensor or its representatives, including but not limited to
622 | communication on electronic mailing lists, source code control systems,
623 | and issue tracking systems that are managed by, or on behalf of, the
624 | Licensor for the purpose of discussing and improving the Work, but
625 | excluding communication that is conspicuously marked or otherwise
626 | designated in writing by the copyright owner as "Not a Contribution."
627 |
628 | "Contributor" shall mean Licensor and any individual or Legal Entity
629 | on behalf of whom a Contribution has been received by Licensor and
630 | subsequently incorporated within the Work.
631 |
632 | 2. Grant of Copyright License. Subject to the terms and conditions of
633 | this License, each Contributor hereby grants to You a perpetual,
634 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
635 | copyright license to reproduce, prepare Derivative Works of,
636 | publicly display, publicly perform, sublicense, and distribute the
637 | Work and such Derivative Works in Source or Object form.
638 |
639 | 3. Grant of Patent License. Subject to the terms and conditions of
640 | this License, each Contributor hereby grants to You a perpetual,
641 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
642 | (except as stated in this section) patent license to make, have made,
643 | use, offer to sell, sell, import, and otherwise transfer the Work,
644 | where such license applies only to those patent claims licensable
645 | by such Contributor that are necessarily infringed by their
646 | Contribution(s) alone or by combination of their Contribution(s)
647 | with the Work to which such Contribution(s) was submitted. If You
648 | institute patent litigation against any entity (including a
649 | cross-claim or counterclaim in a lawsuit) alleging that the Work
650 | or a Contribution incorporated within the Work constitutes direct
651 | or contributory patent infringement, then any patent licenses
652 | granted to You under this License for that Work shall terminate
653 | as of the date such litigation is filed.
654 |
655 | 4. Redistribution. You may reproduce and distribute copies of the
656 | Work or Derivative Works thereof in any medium, with or without
657 | modifications, and in Source or Object form, provided that You
658 | meet the following conditions:
659 |
660 | (a) You must give any other recipients of the Work or
661 | Derivative Works a copy of this License; and
662 |
663 | (b) You must cause any modified files to carry prominent notices
664 | stating that You changed the files; and
665 |
666 | (c) You must retain, in the Source form of any Derivative Works
667 | that You distribute, all copyright, patent, trademark, and
668 | attribution notices from the Source form of the Work,
669 | excluding those notices that do not pertain to any part of
670 | the Derivative Works; and
671 |
672 | (d) If the Work includes a "NOTICE" text file as part of its
673 | distribution, then any Derivative Works that You distribute must
674 | include a readable copy of the attribution notices contained
675 | within such NOTICE file, excluding those notices that do not
676 | pertain to any part of the Derivative Works, in at least one
677 | of the following places: within a NOTICE text file distributed
678 | as part of the Derivative Works; within the Source form or
679 | documentation, if provided along with the Derivative Works; or,
680 | within a display generated by the Derivative Works, if and
681 | wherever such third-party notices normally appear. The contents
682 | of the NOTICE file are for informational purposes only and
683 | do not modify the License. You may add Your own attribution
684 | notices within Derivative Works that You distribute, alongside
685 | or as an addendum to the NOTICE text from the Work, provided
686 | that such additional attribution notices cannot be construed
687 | as modifying the License.
688 |
689 | You may add Your own copyright statement to Your modifications and
690 | may provide additional or different license terms and conditions
691 | for use, reproduction, or distribution of Your modifications, or
692 | for any such Derivative Works as a whole, provided Your use,
693 | reproduction, and distribution of the Work otherwise complies with
694 | the conditions stated in this License.
695 |
696 | 5. Submission of Contributions. Unless You explicitly state otherwise,
697 | any Contribution intentionally submitted for inclusion in the Work
698 | by You to the Licensor shall be under the terms and conditions of
699 | this License, without any additional terms or conditions.
700 | Notwithstanding the above, nothing herein shall supersede or modify
701 | the terms of any separate license agreement you may have executed
702 | with Licensor regarding such Contributions.
703 |
704 | 6. Trademarks. This License does not grant permission to use the trade
705 | names, trademarks, service marks, or product names of the Licensor,
706 | except as required for reasonable and customary use in describing the
707 | origin of the Work and reproducing the content of the NOTICE file.
708 |
709 | 7. Disclaimer of Warranty. Unless required by applicable law or
710 | agreed to in writing, Licensor provides the Work (and each
711 | Contributor provides its Contributions) on an "AS IS" BASIS,
712 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
713 | implied, including, without limitation, any warranties or conditions
714 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
715 | PARTICULAR PURPOSE. You are solely responsible for determining the
716 | appropriateness of using or redistributing the Work and assume any
717 | risks associated with Your exercise of permissions under this License.
718 |
719 | 8. Limitation of Liability. In no event and under no legal theory,
720 | whether in tort (including negligence), contract, or otherwise,
721 | unless required by applicable law (such as deliberate and grossly
722 | negligent acts) or agreed to in writing, shall any Contributor be
723 | liable to You for damages, including any direct, indirect, special,
724 | incidental, or consequential damages of any character arising as a
725 | result of this License or out of the use or inability to use the
726 | Work (including but not limited to damages for loss of goodwill,
727 | work stoppage, computer failure or malfunction, or any and all
728 | other commercial damages or losses), even if such Contributor
729 | has been advised of the possibility of such damages.
730 |
731 | 9. Accepting Warranty or Additional Liability. While redistributing
732 | the Work or Derivative Works thereof, You may choose to offer,
733 | and charge a fee for, acceptance of support, warranty, indemnity,
734 | or other liability obligations and/or rights consistent with this
735 | License. However, in accepting such obligations, You may act only
736 | on Your own behalf and on Your sole responsibility, not on behalf
737 | of any other Contributor, and only if You agree to indemnify,
738 | defend, and hold each Contributor harmless for any liability
739 | incurred by, or claims asserted against, such Contributor by reason
740 | of your accepting any such warranty or additional liability.
741 |
742 | END OF TERMS AND CONDITIONS
743 |
744 | APPENDIX: How to apply the Apache License to your work.
745 |
746 | To apply the Apache License to your work, attach the following
747 | boilerplate notice, with the fields enclosed by brackets "[]"
748 | replaced with your own identifying information. (Don't include
749 | the brackets!) The text should be enclosed in the appropriate
750 | comment syntax for the file format. We also recommend that a
751 | file or class name and description of purpose be included on the
752 | same "printed page" as the copyright notice for easier
753 | identification within third-party archives.
754 |
755 | Copyright [yyyy] [name of copyright owner]
756 |
757 | Licensed under the Apache License, Version 2.0 (the "License");
758 | you may not use this file except in compliance with the License.
759 | You may obtain a copy of the License at
760 |
761 | http://www.apache.org/licenses/LICENSE-2.0
762 |
763 | Unless required by applicable law or agreed to in writing, software
764 | distributed under the License is distributed on an "AS IS" BASIS,
765 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
766 | See the License for the specific language governing permissions and
767 | limitations under the License.
768 |
769 | -----------
770 |
771 | The following NPM packages may be included in this product:
772 |
773 | - decamelize@1.2.0
774 | - is-fullwidth-code-point@2.0.0
775 | - path-exists@3.0.0
776 |
777 | These packages each contain the following license and notice below:
778 |
779 | The MIT License (MIT)
780 |
781 | Copyright (c) Sindre Sorhus (sindresorhus.com)
782 |
783 | Permission is hereby granted, free of charge, to any person obtaining a copy
784 | of this software and associated documentation files (the "Software"), to deal
785 | in the Software without restriction, including without limitation the rights
786 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
787 | copies of the Software, and to permit persons to whom the Software is
788 | furnished to do so, subject to the following conditions:
789 |
790 | The above copyright notice and this permission notice shall be included in
791 | all copies or substantial portions of the Software.
792 |
793 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
794 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
795 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
796 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
797 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
798 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
799 | THE SOFTWARE.
800 |
801 | -----------
802 |
803 | The following NPM packages may be included in this product:
804 |
805 | - dijkstrajs@1.0.1
806 |
807 | These packages each contain the following license and notice below:
808 |
809 | ```
810 | Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
811 |
812 | Copyright (C) 2008
813 | Wyatt Baldwin
814 | All rights reserved
815 |
816 | Licensed under the MIT license.
817 |
818 | http://www.opensource.org/licenses/mit-license.php
819 |
820 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
821 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
822 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
823 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
824 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
825 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
826 | THE SOFTWARE.
827 | ```
828 |
829 | -----------
830 |
831 | The following NPM packages may be included in this product:
832 |
833 | - emoji-regex@7.0.3
834 | - emoji-regex@8.0.0
835 |
836 | These packages each contain the following license and notice below:
837 |
838 | Copyright Mathias Bynens
839 |
840 | Permission is hereby granted, free of charge, to any person obtaining
841 | a copy of this software and associated documentation files (the
842 | "Software"), to deal in the Software without restriction, including
843 | without limitation the rights to use, copy, modify, merge, publish,
844 | distribute, sublicense, and/or sell copies of the Software, and to
845 | permit persons to whom the Software is furnished to do so, subject to
846 | the following conditions:
847 |
848 | The above copyright notice and this permission notice shall be
849 | included in all copies or substantial portions of the Software.
850 |
851 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
852 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
853 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
854 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
855 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
856 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
857 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
858 |
859 | -----------
860 |
861 | The following NPM packages may be included in this product:
862 |
863 | - escalade@3.1.1
864 |
865 | These packages each contain the following license and notice below:
866 |
867 | MIT License
868 |
869 | Copyright (c) Luke Edwards (lukeed.com)
870 |
871 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
872 |
873 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
874 |
875 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
876 |
877 | -----------
878 |
879 | The following NPM packages may be included in this product:
880 |
881 | - get-caller-file@2.0.5
882 |
883 | These packages each contain the following license and notice below:
884 |
885 | ISC License (ISC)
886 | Copyright 2018 Stefan Penner
887 |
888 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
889 |
890 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
891 |
892 | -----------
893 |
894 | The following NPM packages may be included in this product:
895 |
896 | - ieee754@1.2.1
897 |
898 | These packages each contain the following license and notice below:
899 |
900 | Copyright 2008 Fair Oaks Labs, Inc.
901 |
902 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
903 |
904 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
905 |
906 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
907 |
908 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
909 |
910 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
911 |
912 | -----------
913 |
914 | The following NPM packages may be included in this product:
915 |
916 | - isarray@2.0.5
917 |
918 | These packages each contain the following license and notice below:
919 |
920 | MIT License
921 |
922 | Copyright (c) 2013 Julian Gruber
923 |
924 | Permission is hereby granted, free of charge, to any person obtaining a copy
925 | of this software and associated documentation files (the "Software"), to deal
926 | in the Software without restriction, including without limitation the rights
927 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
928 | copies of the Software, and to permit persons to whom the Software is
929 | furnished to do so, subject to the following conditions:
930 |
931 | The above copyright notice and this permission notice shall be included in all
932 | copies or substantial portions of the Software.
933 |
934 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
935 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
936 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
937 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
938 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
939 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
940 | SOFTWARE.
941 |
942 | -----------
943 |
944 | The following NPM packages may be included in this product:
945 |
946 | - lodash.escaperegexp@4.1.2
947 | - lodash.groupby@4.6.0
948 | - lodash.uniq@4.5.0
949 |
950 | These packages each contain the following license and notice below:
951 |
952 | Copyright jQuery Foundation and other contributors
953 |
954 | Based on Underscore.js, copyright Jeremy Ashkenas,
955 | DocumentCloud and Investigative Reporters & Editors
956 |
957 | This software consists of voluntary contributions made by many
958 | individuals. For exact contribution history, see the revision history
959 | available at https://github.com/lodash/lodash
960 |
961 | The following license applies to all parts of this software except as
962 | documented below:
963 |
964 | ====
965 |
966 | Permission is hereby granted, free of charge, to any person obtaining
967 | a copy of this software and associated documentation files (the
968 | "Software"), to deal in the Software without restriction, including
969 | without limitation the rights to use, copy, modify, merge, publish,
970 | distribute, sublicense, and/or sell copies of the Software, and to
971 | permit persons to whom the Software is furnished to do so, subject to
972 | the following conditions:
973 |
974 | The above copyright notice and this permission notice shall be
975 | included in all copies or substantial portions of the Software.
976 |
977 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
978 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
979 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
980 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
981 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
982 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
983 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
984 |
985 | ====
986 |
987 | Copyright and related rights for sample code are waived via CC0. Sample
988 | code is defined as all source code displayed within the prose of the
989 | documentation.
990 |
991 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
992 |
993 | ====
994 |
995 | Files located in the node_modules and vendor directories are externally
996 | maintained libraries used by this software which have their own
997 | licenses; we recommend you read them, as their terms may differ from the
998 | terms above.
999 |
1000 | -----------
1001 |
1002 | The following NPM packages may be included in this product:
1003 |
1004 | - lodash.isfunction@3.0.9
1005 |
1006 | These packages each contain the following license and notice below:
1007 |
1008 | Copyright JS Foundation and other contributors
1009 |
1010 | Based on Underscore.js, copyright Jeremy Ashkenas,
1011 | DocumentCloud and Investigative Reporters & Editors
1012 |
1013 | This software consists of voluntary contributions made by many
1014 | individuals. For exact contribution history, see the revision history
1015 | available at https://github.com/lodash/lodash
1016 |
1017 | The following license applies to all parts of this software except as
1018 | documented below:
1019 |
1020 | ====
1021 |
1022 | Permission is hereby granted, free of charge, to any person obtaining
1023 | a copy of this software and associated documentation files (the
1024 | "Software"), to deal in the Software without restriction, including
1025 | without limitation the rights to use, copy, modify, merge, publish,
1026 | distribute, sublicense, and/or sell copies of the Software, and to
1027 | permit persons to whom the Software is furnished to do so, subject to
1028 | the following conditions:
1029 |
1030 | The above copyright notice and this permission notice shall be
1031 | included in all copies or substantial portions of the Software.
1032 |
1033 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1034 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1035 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1036 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1037 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1038 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1039 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1040 |
1041 | ====
1042 |
1043 | Copyright and related rights for sample code are waived via CC0. Sample
1044 | code is defined as all source code displayed within the prose of the
1045 | documentation.
1046 |
1047 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
1048 |
1049 | ====
1050 |
1051 | Files located in the node_modules and vendor directories are externally
1052 | maintained libraries used by this software which have their own
1053 | licenses; we recommend you read them, as their terms may differ from the
1054 | terms above.
1055 |
1056 | -----------
1057 |
1058 | The following NPM packages may be included in this product:
1059 |
1060 | - lodash.isnil@4.0.0
1061 |
1062 | These packages each contain the following license and notice below:
1063 |
1064 | Copyright 2012-2016 The Dojo Foundation
1065 | Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
1066 | DocumentCloud and Investigative Reporters & Editors
1067 |
1068 | Permission is hereby granted, free of charge, to any person obtaining
1069 | a copy of this software and associated documentation files (the
1070 | "Software"), to deal in the Software without restriction, including
1071 | without limitation the rights to use, copy, modify, merge, publish,
1072 | distribute, sublicense, and/or sell copies of the Software, and to
1073 | permit persons to whom the Software is furnished to do so, subject to
1074 | the following conditions:
1075 |
1076 | The above copyright notice and this permission notice shall be
1077 | included in all copies or substantial portions of the Software.
1078 |
1079 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1080 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1081 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1082 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1083 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1084 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1085 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1086 |
1087 | -----------
1088 |
1089 | The following NPM packages may be included in this product:
1090 |
1091 | - lodash.isundefined@3.0.1
1092 |
1093 | These packages each contain the following license and notice below:
1094 |
1095 | Copyright 2012-2015 The Dojo Foundation
1096 | Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
1097 | DocumentCloud and Investigative Reporters & Editors
1098 |
1099 | Permission is hereby granted, free of charge, to any person obtaining
1100 | a copy of this software and associated documentation files (the
1101 | "Software"), to deal in the Software without restriction, including
1102 | without limitation the rights to use, copy, modify, merge, publish,
1103 | distribute, sublicense, and/or sell copies of the Software, and to
1104 | permit persons to whom the Software is furnished to do so, subject to
1105 | the following conditions:
1106 |
1107 | The above copyright notice and this permission notice shall be
1108 | included in all copies or substantial portions of the Software.
1109 |
1110 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1111 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1112 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1113 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1114 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1115 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1116 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1117 |
1118 | -----------
1119 |
1120 | The following NPM packages may be included in this product:
1121 |
1122 | - long@4.0.0
1123 |
1124 | These packages each contain the following license and notice below:
1125 |
1126 | Apache License
1127 | Version 2.0, January 2004
1128 | http://www.apache.org/licenses/
1129 |
1130 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1131 |
1132 | 1. Definitions.
1133 |
1134 | "License" shall mean the terms and conditions for use, reproduction,
1135 | and distribution as defined by Sections 1 through 9 of this document.
1136 |
1137 | "Licensor" shall mean the copyright owner or entity authorized by
1138 | the copyright owner that is granting the License.
1139 |
1140 | "Legal Entity" shall mean the union of the acting entity and all
1141 | other entities that control, are controlled by, or are under common
1142 | control with that entity. For the purposes of this definition,
1143 | "control" means (i) the power, direct or indirect, to cause the
1144 | direction or management of such entity, whether by contract or
1145 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
1146 | outstanding shares, or (iii) beneficial ownership of such entity.
1147 |
1148 | "You" (or "Your") shall mean an individual or Legal Entity
1149 | exercising permissions granted by this License.
1150 |
1151 | "Source" form shall mean the preferred form for making modifications,
1152 | including but not limited to software source code, documentation
1153 | source, and configuration files.
1154 |
1155 | "Object" form shall mean any form resulting from mechanical
1156 | transformation or translation of a Source form, including but
1157 | not limited to compiled object code, generated documentation,
1158 | and conversions to other media types.
1159 |
1160 | "Work" shall mean the work of authorship, whether in Source or
1161 | Object form, made available under the License, as indicated by a
1162 | copyright notice that is included in or attached to the work
1163 | (an example is provided in the Appendix below).
1164 |
1165 | "Derivative Works" shall mean any work, whether in Source or Object
1166 | form, that is based on (or derived from) the Work and for which the
1167 | editorial revisions, annotations, elaborations, or other modifications
1168 | represent, as a whole, an original work of authorship. For the purposes
1169 | of this License, Derivative Works shall not include works that remain
1170 | separable from, or merely link (or bind by name) to the interfaces of,
1171 | the Work and Derivative Works thereof.
1172 |
1173 | "Contribution" shall mean any work of authorship, including
1174 | the original version of the Work and any modifications or additions
1175 | to that Work or Derivative Works thereof, that is intentionally
1176 | submitted to Licensor for inclusion in the Work by the copyright owner
1177 | or by an individual or Legal Entity authorized to submit on behalf of
1178 | the copyright owner. For the purposes of this definition, "submitted"
1179 | means any form of electronic, verbal, or written communication sent
1180 | to the Licensor or its representatives, including but not limited to
1181 | communication on electronic mailing lists, source code control systems,
1182 | and issue tracking systems that are managed by, or on behalf of, the
1183 | Licensor for the purpose of discussing and improving the Work, but
1184 | excluding communication that is conspicuously marked or otherwise
1185 | designated in writing by the copyright owner as "Not a Contribution."
1186 |
1187 | "Contributor" shall mean Licensor and any individual or Legal Entity
1188 | on behalf of whom a Contribution has been received by Licensor and
1189 | subsequently incorporated within the Work.
1190 |
1191 | 2. Grant of Copyright License. Subject to the terms and conditions of
1192 | this License, each Contributor hereby grants to You a perpetual,
1193 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1194 | copyright license to reproduce, prepare Derivative Works of,
1195 | publicly display, publicly perform, sublicense, and distribute the
1196 | Work and such Derivative Works in Source or Object form.
1197 |
1198 | 3. Grant of Patent License. Subject to the terms and conditions of
1199 | this License, each Contributor hereby grants to You a perpetual,
1200 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1201 | (except as stated in this section) patent license to make, have made,
1202 | use, offer to sell, sell, import, and otherwise transfer the Work,
1203 | where such license applies only to those patent claims licensable
1204 | by such Contributor that are necessarily infringed by their
1205 | Contribution(s) alone or by combination of their Contribution(s)
1206 | with the Work to which such Contribution(s) was submitted. If You
1207 | institute patent litigation against any entity (including a
1208 | cross-claim or counterclaim in a lawsuit) alleging that the Work
1209 | or a Contribution incorporated within the Work constitutes direct
1210 | or contributory patent infringement, then any patent licenses
1211 | granted to You under this License for that Work shall terminate
1212 | as of the date such litigation is filed.
1213 |
1214 | 4. Redistribution. You may reproduce and distribute copies of the
1215 | Work or Derivative Works thereof in any medium, with or without
1216 | modifications, and in Source or Object form, provided that You
1217 | meet the following conditions:
1218 |
1219 | (a) You must give any other recipients of the Work or
1220 | Derivative Works a copy of this License; and
1221 |
1222 | (b) You must cause any modified files to carry prominent notices
1223 | stating that You changed the files; and
1224 |
1225 | (c) You must retain, in the Source form of any Derivative Works
1226 | that You distribute, all copyright, patent, trademark, and
1227 | attribution notices from the Source form of the Work,
1228 | excluding those notices that do not pertain to any part of
1229 | the Derivative Works; and
1230 |
1231 | (d) If the Work includes a "NOTICE" text file as part of its
1232 | distribution, then any Derivative Works that You distribute must
1233 | include a readable copy of the attribution notices contained
1234 | within such NOTICE file, excluding those notices that do not
1235 | pertain to any part of the Derivative Works, in at least one
1236 | of the following places: within a NOTICE text file distributed
1237 | as part of the Derivative Works; within the Source form or
1238 | documentation, if provided along with the Derivative Works; or,
1239 | within a display generated by the Derivative Works, if and
1240 | wherever such third-party notices normally appear. The contents
1241 | of the NOTICE file are for informational purposes only and
1242 | do not modify the License. You may add Your own attribution
1243 | notices within Derivative Works that You distribute, alongside
1244 | or as an addendum to the NOTICE text from the Work, provided
1245 | that such additional attribution notices cannot be construed
1246 | as modifying the License.
1247 |
1248 | You may add Your own copyright statement to Your modifications and
1249 | may provide additional or different license terms and conditions
1250 | for use, reproduction, or distribution of Your modifications, or
1251 | for any such Derivative Works as a whole, provided Your use,
1252 | reproduction, and distribution of the Work otherwise complies with
1253 | the conditions stated in this License.
1254 |
1255 | 5. Submission of Contributions. Unless You explicitly state otherwise,
1256 | any Contribution intentionally submitted for inclusion in the Work
1257 | by You to the Licensor shall be under the terms and conditions of
1258 | this License, without any additional terms or conditions.
1259 | Notwithstanding the above, nothing herein shall supersede or modify
1260 | the terms of any separate license agreement you may have executed
1261 | with Licensor regarding such Contributions.
1262 |
1263 | 6. Trademarks. This License does not grant permission to use the trade
1264 | names, trademarks, service marks, or product names of the Licensor,
1265 | except as required for reasonable and customary use in describing the
1266 | origin of the Work and reproducing the content of the NOTICE file.
1267 |
1268 | 7. Disclaimer of Warranty. Unless required by applicable law or
1269 | agreed to in writing, Licensor provides the Work (and each
1270 | Contributor provides its Contributions) on an "AS IS" BASIS,
1271 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1272 | implied, including, without limitation, any warranties or conditions
1273 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
1274 | PARTICULAR PURPOSE. You are solely responsible for determining the
1275 | appropriateness of using or redistributing the Work and assume any
1276 | risks associated with Your exercise of permissions under this License.
1277 |
1278 | 8. Limitation of Liability. In no event and under no legal theory,
1279 | whether in tort (including negligence), contract, or otherwise,
1280 | unless required by applicable law (such as deliberate and grossly
1281 | negligent acts) or agreed to in writing, shall any Contributor be
1282 | liable to You for damages, including any direct, indirect, special,
1283 | incidental, or consequential damages of any character arising as a
1284 | result of this License or out of the use or inability to use the
1285 | Work (including but not limited to damages for loss of goodwill,
1286 | work stoppage, computer failure or malfunction, or any and all
1287 | other commercial damages or losses), even if such Contributor
1288 | has been advised of the possibility of such damages.
1289 |
1290 | 9. Accepting Warranty or Additional Liability. While redistributing
1291 | the Work or Derivative Works thereof, You may choose to offer,
1292 | and charge a fee for, acceptance of support, warranty, indemnity,
1293 | or other liability obligations and/or rights consistent with this
1294 | License. However, in accepting such obligations, You may act only
1295 | on Your own behalf and on Your sole responsibility, not on behalf
1296 | of any other Contributor, and only if You agree to indemnify,
1297 | defend, and hold each Contributor harmless for any liability
1298 | incurred by, or claims asserted against, such Contributor by reason
1299 | of your accepting any such warranty or additional liability.
1300 |
1301 | END OF TERMS AND CONDITIONS
1302 |
1303 | APPENDIX: How to apply the Apache License to your work.
1304 |
1305 | To apply the Apache License to your work, attach the following
1306 | boilerplate notice, with the fields enclosed by brackets "[]"
1307 | replaced with your own identifying information. (Don't include
1308 | the brackets!) The text should be enclosed in the appropriate
1309 | comment syntax for the file format. We also recommend that a
1310 | file or class name and description of purpose be included on the
1311 | same "printed page" as the copyright notice for easier
1312 | identification within third-party archives.
1313 |
1314 | Copyright [yyyy] [name of copyright owner]
1315 |
1316 | Licensed under the Apache License, Version 2.0 (the "License");
1317 | you may not use this file except in compliance with the License.
1318 | You may obtain a copy of the License at
1319 |
1320 | http://www.apache.org/licenses/LICENSE-2.0
1321 |
1322 | Unless required by applicable law or agreed to in writing, software
1323 | distributed under the License is distributed on an "AS IS" BASIS,
1324 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1325 | See the License for the specific language governing permissions and
1326 | limitations under the License.
1327 |
1328 | -----------
1329 |
1330 | The following NPM packages may be included in this product:
1331 |
1332 | - pako@1.0.11
1333 |
1334 | These packages each contain the following license and notice below:
1335 |
1336 | (The MIT License)
1337 |
1338 | Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn
1339 |
1340 | Permission is hereby granted, free of charge, to any person obtaining a copy
1341 | of this software and associated documentation files (the "Software"), to deal
1342 | in the Software without restriction, including without limitation the rights
1343 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1344 | copies of the Software, and to permit persons to whom the Software is
1345 | furnished to do so, subject to the following conditions:
1346 |
1347 | The above copyright notice and this permission notice shall be included in
1348 | all copies or substantial portions of the Software.
1349 |
1350 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1351 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1352 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1353 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1354 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1355 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1356 | THE SOFTWARE.
1357 |
1358 | -----------
1359 |
1360 | The following NPM packages may be included in this product:
1361 |
1362 | - pdf-lib@1.16.0
1363 |
1364 | These packages each contain the following license and notice below:
1365 |
1366 | MIT License
1367 |
1368 | Copyright (c) 2019 Andrew Dillon
1369 |
1370 | Permission is hereby granted, free of charge, to any person obtaining a copy
1371 | of this software and associated documentation files (the "Software"), to deal
1372 | in the Software without restriction, including without limitation the rights
1373 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1374 | copies of the Software, and to permit persons to whom the Software is
1375 | furnished to do so, subject to the following conditions:
1376 |
1377 | The above copyright notice and this permission notice shall be included in all
1378 | copies or substantial portions of the Software.
1379 |
1380 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1381 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1382 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1383 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1384 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1385 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1386 | SOFTWARE.
1387 |
1388 | -----------
1389 |
1390 | The following NPM packages may be included in this product:
1391 |
1392 | - pngjs@3.4.0
1393 |
1394 | These packages each contain the following license and notice below:
1395 |
1396 | pngjs2 original work Copyright (c) 2015 Luke Page & Original Contributors
1397 | pngjs derived work Copyright (c) 2012 Kuba Niegowski
1398 |
1399 | Permission is hereby granted, free of charge, to any person obtaining a copy
1400 | of this software and associated documentation files (the "Software"), to deal
1401 | in the Software without restriction, including without limitation the rights
1402 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1403 | copies of the Software, and to permit persons to whom the Software is
1404 | furnished to do so, subject to the following conditions:
1405 |
1406 | The above copyright notice and this permission notice shall be included in
1407 | all copies or substantial portions of the Software.
1408 |
1409 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1410 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1411 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1412 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1413 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1414 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1415 | THE SOFTWARE.
1416 |
1417 | -----------
1418 |
1419 | The following NPM packages may be included in this product:
1420 |
1421 | - protobufjs@6.10.2
1422 |
1423 | These packages each contain the following license and notice below:
1424 |
1425 | This license applies to all parts of protobuf.js except those files
1426 | either explicitly including or referencing a different license or
1427 | located in a directory containing a different LICENSE file.
1428 |
1429 | ---
1430 |
1431 | Copyright (c) 2016, Daniel Wirtz All rights reserved.
1432 |
1433 | Redistribution and use in source and binary forms, with or without
1434 | modification, are permitted provided that the following conditions are
1435 | met:
1436 |
1437 | * Redistributions of source code must retain the above copyright
1438 | notice, this list of conditions and the following disclaimer.
1439 | * Redistributions in binary form must reproduce the above copyright
1440 | notice, this list of conditions and the following disclaimer in the
1441 | documentation and/or other materials provided with the distribution.
1442 | * Neither the name of its author, nor the names of its contributors
1443 | may be used to endorse or promote products derived from this software
1444 | without specific prior written permission.
1445 |
1446 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1447 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1448 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1449 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1450 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1451 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1452 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1453 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1454 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1455 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1456 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1457 |
1458 | ---
1459 |
1460 | Code generated by the command line utilities is owned by the owner
1461 | of the input file used when generating it. This code is not
1462 | standalone and requires a support library to be linked with it. This
1463 | support library is itself covered by the above license.
1464 |
1465 | -----------
1466 |
1467 | The following NPM packages may be included in this product:
1468 |
1469 | - qrcode@1.4.4
1470 |
1471 | These packages each contain the following license and notice below:
1472 |
1473 | The MIT License (MIT)
1474 |
1475 | Copyright (c) 2012 Ryan Day
1476 |
1477 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1478 |
1479 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1480 |
1481 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1482 |
1483 | -----------
1484 |
1485 | The following NPM packages may be included in this product:
1486 |
1487 | - require-directory@2.1.1
1488 |
1489 | These packages each contain the following license and notice below:
1490 |
1491 | The MIT License (MIT)
1492 |
1493 | Copyright (c) 2011 Troy Goode
1494 |
1495 | Permission is hereby granted, free of charge, to any person obtaining a
1496 | copy of this software and associated documentation files (the
1497 | "Software"), to deal in the Software without restriction, including
1498 | without limitation the rights to use, copy, modify, merge, publish,
1499 | distribute, sublicense, and/or sell copies of the Software, and to
1500 | permit persons to whom the Software is furnished to do so, subject to
1501 | the following conditions:
1502 |
1503 | The above copyright notice and this permission notice shall be included
1504 | in all copies or substantial portions of the Software.
1505 |
1506 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1507 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1508 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1509 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1510 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1511 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1512 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1513 |
1514 | -----------
1515 |
1516 | The following NPM packages may be included in this product:
1517 |
1518 | - require-main-filename@2.0.0
1519 | - set-blocking@2.0.0
1520 | - yargs-parser@13.1.2
1521 | - yargs-parser@20.2.7
1522 |
1523 | These packages each contain the following license and notice below:
1524 |
1525 | Copyright (c) 2016, Contributors
1526 |
1527 | Permission to use, copy, modify, and/or distribute this software
1528 | for any purpose with or without fee is hereby granted, provided
1529 | that the above copyright notice and this permission notice
1530 | appear in all copies.
1531 |
1532 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1533 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
1534 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
1535 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
1536 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1537 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1538 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1539 |
1540 | -----------
1541 |
1542 | The following NPM packages may be included in this product:
1543 |
1544 | - tslib@1.14.1
1545 |
1546 | These packages each contain the following license and notice below:
1547 |
1548 | Copyright (c) Microsoft Corporation.
1549 |
1550 | Permission to use, copy, modify, and/or distribute this software for any
1551 | purpose with or without fee is hereby granted.
1552 |
1553 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1554 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1555 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1556 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1557 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1558 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1559 | PERFORMANCE OF THIS SOFTWARE.
1560 |
1561 | -----------
1562 |
1563 | The following NPM packages may be included in this product:
1564 |
1565 | - which-module@2.0.0
1566 |
1567 | These packages each contain the following license and notice below:
1568 |
1569 | Copyright (c) 2016, Contributors
1570 |
1571 | Permission to use, copy, modify, and/or distribute this software for any purpose
1572 | with or without fee is hereby granted, provided that the above copyright notice
1573 | and this permission notice appear in all copies.
1574 |
1575 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1576 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1577 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1578 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
1579 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1580 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
1581 | THIS SOFTWARE.
1582 |
1583 | -----------
1584 |
1585 | The following NPM packages may be included in this product:
1586 |
1587 | - wrap-ansi@7.0.0
1588 |
1589 | These packages each contain the following license and notice below:
1590 |
1591 | MIT License
1592 |
1593 | Copyright (c) Sindre Sorhus (https://sindresorhus.com)
1594 |
1595 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1596 |
1597 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1598 |
1599 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1600 |
1601 | -----------
1602 |
1603 | The following NPM packages may be included in this product:
1604 |
1605 | - y18n@4.0.3
1606 | - y18n@5.0.8
1607 |
1608 | These packages each contain the following license and notice below:
1609 |
1610 | Copyright (c) 2015, Contributors
1611 |
1612 | Permission to use, copy, modify, and/or distribute this software for any purpose
1613 | with or without fee is hereby granted, provided that the above copyright notice
1614 | and this permission notice appear in all copies.
1615 |
1616 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1617 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1618 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1619 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
1620 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1621 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
1622 | THIS SOFTWARE.
1623 |
1624 | -----------
1625 |
1626 | The following NPM packages may be included in this product:
1627 |
1628 | - yargs@13.3.2
1629 |
1630 | These packages each contain the following license and notice below:
1631 |
1632 | Copyright 2010 James Halliday (mail@substack.net)
1633 | Modified work Copyright 2014 Contributors (ben@npmjs.com)
1634 |
1635 | This project is free software released under the MIT/X11 license:
1636 |
1637 | Permission is hereby granted, free of charge, to any person obtaining a copy
1638 | of this software and associated documentation files (the "Software"), to deal
1639 | in the Software without restriction, including without limitation the rights
1640 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1641 | copies of the Software, and to permit persons to whom the Software is
1642 | furnished to do so, subject to the following conditions:
1643 |
1644 | The above copyright notice and this permission notice shall be included in
1645 | all copies or substantial portions of the Software.
1646 |
1647 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1648 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1649 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1650 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1651 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1652 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1653 | THE SOFTWARE.
1654 |
1655 | -----------
1656 |
1657 | The following NPM packages may be included in this product:
1658 |
1659 | - yargs@16.2.0
1660 |
1661 | These packages each contain the following license and notice below:
1662 |
1663 | MIT License
1664 |
1665 | Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com)
1666 |
1667 | Permission is hereby granted, free of charge, to any person obtaining a copy
1668 | of this software and associated documentation files (the "Software"), to deal
1669 | in the Software without restriction, including without limitation the rights
1670 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1671 | copies of the Software, and to permit persons to whom the Software is
1672 | furnished to do so, subject to the following conditions:
1673 |
1674 | The above copyright notice and this permission notice shall be included in
1675 | all copies or substantial portions of the Software.
1676 |
1677 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1678 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1679 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1680 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1681 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1682 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1683 | THE SOFTWARE.
1684 |
1685 | -----------
1686 |
1687 | This file was generated with generate-license-file! https://www.npmjs.com/package/generate-license-file
--------------------------------------------------------------------------------
/assets/pt-poster-1.0.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/corona-warn-app/cwa-event-qr-code/00f353d98609474eaf264f58da2cdf189d15ec94/assets/pt-poster-1.0.0.pdf
--------------------------------------------------------------------------------
/bin/cli:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /* eslint-disable no-unused-expressions */
3 |
4 | const parser = require('./../lib/yargs/index')
5 | parser({ process, console }).argv
6 |
--------------------------------------------------------------------------------
/examples/sample-data.csv:
--------------------------------------------------------------------------------
1 | description;address;startDate;endDate;type;defaultCheckInLengthInMinutes;filepath
2 | Some Bakery;Some Street, Some City;;;4;15;some-bakery.pdf
3 | Birthday Party;My place, outside of course;2021-04-25T15:00;2021-04-25T20:00;11;;birthday-party.pdf
--------------------------------------------------------------------------------
/lib/generate-poster.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const fs = require('fs/promises')
4 | const path = require('path')
5 | const {
6 | PDFDocument,
7 | rgb,
8 | StandardFonts
9 | } = require('pdf-lib')
10 |
11 | module.exports = async ({ qrCode, locationData }) => {
12 | const templateFilepath = path.resolve(__dirname, '../assets/pt-poster-1.0.0.pdf')
13 | const template = await fs.readFile(templateFilepath)
14 | const pdfDoc = await PDFDocument.load(template.buffer)
15 |
16 | const pngImage = await pdfDoc.embedPng(qrCode.buffer)
17 | const pngDims = pngImage.scaleToFit(400, 400)
18 | const page = pdfDoc.getPage(0)
19 | page.drawImage(pngImage, {
20 | x: page.getWidth() / 2 - pngDims.width / 2,
21 | y: page.getHeight() / 2 - pngDims.height + 340,
22 | width: pngDims.width,
23 | height: pngDims.height
24 | })
25 |
26 | const fontSize = 10
27 | const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)
28 | const maxTextWidth = 420
29 | const truncateText = text => {
30 | while (helveticaFont.widthOfTextAtSize(text, fontSize) > maxTextWidth) {
31 | text = text.substr(0, text.length - 1)
32 | }
33 | return text
34 | }
35 |
36 | page.drawText(truncateText(locationData.description), {
37 | x: 80,
38 | y: 325,
39 | size: fontSize,
40 | font: helveticaFont,
41 | color: rgb(0, 0, 0)
42 | })
43 | page.drawText(truncateText(locationData.address), {
44 | x: 80,
45 | y: 310,
46 | size: fontSize,
47 | font: helveticaFont,
48 | color: rgb(0, 0, 0)
49 | })
50 |
51 | return pdfDoc.save()
52 | }
53 |
--------------------------------------------------------------------------------
/lib/generate-qr-code-payload.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const crypto = require('crypto')
4 | const protobufUtil = require('./protobuf-util')
5 |
6 | const assignIfTruthy = (srcObj, destObj, attribute) => {
7 | if (srcObj[attribute]) destObj[attribute] = srcObj[attribute]
8 | }
9 |
10 | module.exports = async ({ locationData, vendorData }) => {
11 | const isPermanentLocation = vendorData.type === 1 ||
12 | (vendorData.type >= 3 && vendorData.type <= 8)
13 |
14 | const _locationData = {
15 | version: 1
16 | }
17 | assignIfTruthy(locationData, _locationData, 'description')
18 | assignIfTruthy(locationData, _locationData, 'address')
19 | if (!isPermanentLocation) {
20 | assignIfTruthy(locationData, _locationData, 'startTimestamp')
21 | assignIfTruthy(locationData, _locationData, 'endTimestamp')
22 | }
23 |
24 | const _crowdNotifierData = {
25 | version: 1,
26 | publicKey: Buffer.from('gwLMzE153tQwAOf2MZoUXXfzWTdlSpfS99iZffmcmxOG9njSK4RTimFOFwDh6t0Tyw8XR01ugDYjtuKwjjuK49Oh83FWct6XpefPi9Skjxvvz53i9gaMmUEc96pbtoaA', 'base64'),
27 | cryptographicSeed: crypto.randomBytes(16)
28 | }
29 |
30 | const _vendorData = {
31 | version: 1,
32 | type: vendorData.type
33 | }
34 | assignIfTruthy(vendorData, _vendorData, 'defaultCheckInLengthInMinutes')
35 |
36 | const qrCodePayload = {
37 | version: 1,
38 | locationData: _locationData,
39 | crowdNotifierData: _crowdNotifierData,
40 | vendorData: await protobufUtil.types.ptCWALocationData.toBuffer(_vendorData)
41 | }
42 |
43 | return protobufUtil.types.ptQrCodePayload.toBuffer(qrCodePayload)
44 | }
45 |
--------------------------------------------------------------------------------
/lib/generate-qr-code-url.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = async (buffer) => {
4 | const asBase64url = buffer.toString('base64')
5 | .replace(/\+/g, '-')
6 | .replace(/\//g, '_')
7 | .replace(/=/g, '')
8 | return `https://e.coronawarn.app/?v=1#${asBase64url}`
9 | }
10 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const fs = require('fs/promises')
4 | const QRCode = require('qrcode')
5 | const { promisify } = require('util')
6 |
7 | const generateQRCodePayload = require('./generate-qr-code-payload')
8 | const generateQRCodeUrl = require('./generate-qr-code-url')
9 | const generatePoster = require('./generate-poster')
10 | const validateQRCodeData = require('./validate-qr-code-data')
11 |
12 | const qrCodeToFile = promisify(QRCode.toFile)
13 | const qrCodeToBuffer = promisify(QRCode.toBuffer)
14 | const qrCodeToString = promisify(QRCode.toString)
15 |
16 | const createEventQRCode = ({ locationData, vendorData }) => {
17 | const {
18 | isValid,
19 | errors,
20 | validatedLocationData,
21 | validatedVendorData
22 | } = validateQRCodeData({ locationData, vendorData })
23 |
24 | if (!isValid) {
25 | const err = new Error('QR code data not valid')
26 | err.name = 'ValidationError'
27 | err.violations = errors
28 | throw err
29 | } else {
30 | locationData = validatedLocationData
31 | vendorData = validatedVendorData
32 | }
33 |
34 | const toQRCodePayloadBuffer = () => generateQRCodePayload({ locationData, vendorData })
35 | const toURL = async () => {
36 | const buffer = await generateQRCodePayload({ locationData, vendorData })
37 | const url = generateQRCodeUrl(buffer)
38 | return url
39 | }
40 | const toFile = async (filepath, options = {}) => {
41 | const url = await toURL()
42 | return qrCodeToFile(filepath, url, options)
43 | }
44 | const toBuffer = async (options = {}) => {
45 | const url = await toURL()
46 | return qrCodeToBuffer(url, options)
47 | }
48 | const toPNG = async (filepath, options = {}) => {
49 | options.type = 'png'
50 | return toFile(filepath, options)
51 | }
52 | const toSVG = async (filepath, options = {}) => {
53 | options.type = 'svg'
54 | return toFile(filepath, options)
55 | }
56 | const toString = async () => {
57 | const url = await toURL()
58 | return qrCodeToString(url, { type: 'terminal' })
59 | }
60 | const toPoster = async (filepath) => {
61 | const qrCode = await toBuffer({ width: 1000, type: 'png' })
62 | const pdf = await generatePoster({ qrCode, locationData })
63 | await fs.writeFile(filepath, pdf)
64 | }
65 |
66 | return {
67 | toQRCodePayloadBuffer,
68 | toURL,
69 | toFile,
70 | toPNG,
71 | toSVG,
72 | toString,
73 | toPoster
74 | }
75 | }
76 |
77 | module.exports = {
78 | createEventQRCode,
79 | validateQRCodeData
80 | }
81 |
--------------------------------------------------------------------------------
/lib/protobuf-util.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 | const protobuf = require('protobufjs')
5 |
6 | const loadTypeFromFile = (partialPath, partialType) => {
7 | const getType = async () => {
8 | const root = await protobuf.load(path.resolve(__dirname, `./../proto/${partialPath}`))
9 | const type = root.lookupType(partialType)
10 | return type
11 | }
12 | return {
13 | fromBuffer: async buffer => protobufUtil.dataWithoutHeader(await getType(), buffer),
14 | toBuffer: async data => protobufUtil.bufferWithoutHeader(await getType(), data)
15 | }
16 | }
17 |
18 | const protobufUtil = module.exports = {
19 | bufferWithoutHeader: (type, data) => {
20 | const message = type.create(data)
21 | return type.encode(message).finish()
22 | },
23 | dataWithoutHeader: (type, buffer) => {
24 | return type.decode(buffer)
25 | },
26 | types: {
27 | ptCWALocationData: loadTypeFromFile('internal/pt/trace_location.proto', 'internal.pt.CWALocationData'),
28 | ptQrCodePayload: loadTypeFromFile('internal/pt/trace_location.proto', 'internal.pt.QRCodePayload')
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/read-qr-code-data-from-csv.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const { parse } = require('@fast-csv/parse')
4 | const fs = require('fs')
5 |
6 | const columns = [
7 | 'filepath',
8 | 'description',
9 | 'address',
10 | 'startdate',
11 | 'enddate',
12 | 'type',
13 | 'defaultcheckinlengthinminutes'
14 | ]
15 |
16 | module.exports = async filepath => {
17 | const stream = fs.createReadStream(filepath)
18 | .pipe(
19 | parse({
20 | delimiter: ';',
21 | headers: headers => headers.map(h => h.toLowerCase())
22 | })
23 | .transform(data => {
24 | const missingColumns = columns
25 | .filter(it => !Object.prototype.hasOwnProperty.call(data, it))
26 | if (missingColumns.length > 0) {
27 | throw new Error(`Mandatory column(s) missing in CSV: ${missingColumns}`)
28 | }
29 | const { filepath } = data
30 | const locationData = {
31 | description: data.description.replace(/\s+/g, ' '),
32 | address: data.address.replace(/\s+/g, ' '),
33 | startTimestamp: parseInt(new Date(data.startdate).getTime() / 1000),
34 | endTimestamp: parseInt(new Date(data.enddate).getTime() / 1000)
35 | }
36 | const vendorData = {
37 | type: parseInt(data.type),
38 | defaultCheckInLengthInMinutes: parseInt(data.defaultcheckinlengthinminutes || 0, 10)
39 | }
40 | return { filepath, locationData, vendorData, data }
41 | })
42 | .validate(({ data }, cb) => {
43 | // TODO: validate data
44 | return cb(null, true)
45 | })
46 | )
47 |
48 | const data = []
49 | return new Promise((resolve, reject) => {
50 | stream
51 | .on('data', record => {
52 | data.push(record)
53 | })
54 | // .on('data-invalid', (row, rowNumber, reason) => {
55 | // // console.log(`Invalid [row=${JSON.stringify(row)}]`)
56 | // console.log(rowNumber, reason)
57 | // })
58 | .on('error', error => {
59 | reject(error)
60 | })
61 | .on('end', () => {
62 | resolve(data)
63 | })
64 | })
65 | }
66 |
--------------------------------------------------------------------------------
/lib/validate-qr-code-data.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = ({ locationData, vendorData }) => {
4 | const permanentLocationTypes = [1, 3, 4, 5, 6, 7, 8]
5 | const temporaryLocationTypes = [2, 9, 10, 11, 12]
6 | const errors = []
7 | const validatedLocationData = {}
8 | const validatedVendorData = {}
9 |
10 | const {
11 | description,
12 | address,
13 | startTimestamp: _startTimestamp,
14 | endTimestamp: _endTimestamp
15 | } = locationData
16 | const startTimestamp = parseInt(_startTimestamp)
17 | const endTimestamp = parseInt(_endTimestamp)
18 |
19 | const {
20 | type,
21 | defaultCheckInLengthInMinutes: _defaultCheckInLengthInMinutes
22 | } = vendorData
23 | const defaultCheckInLengthInMinutes = parseInt(_defaultCheckInLengthInMinutes)
24 |
25 | if (typeof description !== 'string' ||
26 | description.length === 0 ||
27 | description.length > 100) {
28 | errors.push({
29 | property: 'description',
30 | constraint: 'is mandatory and must not exceed 100 characters'
31 | })
32 | } else validatedLocationData.description = description
33 |
34 | if (typeof address !== 'string' ||
35 | address.length === 0 ||
36 | address.length > 100) {
37 | errors.push({
38 | property: 'address',
39 | constraint: 'is mandatory and must not exceed 100 characters'
40 | })
41 | } else validatedLocationData.address = address
42 |
43 | const isPermanent = permanentLocationTypes.includes(type)
44 | const isTemporary = temporaryLocationTypes.includes(type)
45 |
46 | if (isPermanent) {
47 | validatedVendorData.type = type
48 |
49 | if (startTimestamp) {
50 | errors.push({
51 | property: 'startTimestamp',
52 | constraint: `must be empty for type ${type}`
53 | })
54 | }
55 | if (endTimestamp) {
56 | errors.push({
57 | property: 'endTimestamp',
58 | constraint: `must be empty for type ${type}`
59 | })
60 | }
61 |
62 | if (isNaN(defaultCheckInLengthInMinutes) ||
63 | defaultCheckInLengthInMinutes <= 0 ||
64 | defaultCheckInLengthInMinutes > 1440) {
65 | errors.push({
66 | property: 'defaultCheckInLengthInMinutes',
67 | constraint: 'is mandatory, must be greater than 0, and must not exceed 1440'
68 | })
69 | } else validatedVendorData.defaultCheckInLengthInMinutes = defaultCheckInLengthInMinutes
70 | } else if (isTemporary) {
71 | validatedVendorData.type = type
72 |
73 | if (endTimestamp <= startTimestamp) {
74 | errors.push({
75 | property: 'startTimestamp',
76 | constraint: 'must be less than endTimestamp'
77 | })
78 | }
79 |
80 | if (startTimestamp < 0 || isNaN(startTimestamp)) {
81 | errors.push({
82 | property: 'startTimestamp',
83 | constraint: 'is mandatory and must not be negative'
84 | })
85 | } else validatedLocationData.startTimestamp = startTimestamp
86 |
87 | if (endTimestamp < 0 || isNaN(endTimestamp)) {
88 | errors.push({
89 | property: 'endTimestamp',
90 | constraint: 'is mandatory and must not be negative'
91 | })
92 | } else validatedLocationData.endTimestamp = endTimestamp
93 |
94 | if (defaultCheckInLengthInMinutes < 0 ||
95 | defaultCheckInLengthInMinutes > 1440) {
96 | errors.push({
97 | property: 'defaultCheckInLengthInMinutes',
98 | constraint: 'must be greater than 0 and must not exceed 1440'
99 | })
100 | } else validatedVendorData.defaultCheckInLengthInMinutes = defaultCheckInLengthInMinutes
101 | } else {
102 | errors.push({ property: 'type' })
103 | }
104 |
105 | return { isValid: errors.length === 0, errors, validatedLocationData, validatedVendorData }
106 | }
107 |
--------------------------------------------------------------------------------
/lib/yargs/commands/file.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 | const { createEventQRCode } = require('../../index')
5 |
6 | const supportedExtensions = ['png', 'svg']
7 |
8 | module.exports = ({ process, console, dataProvider }) => {
9 | return {
10 | command: ['file'],
11 | desc: 'write QR code to a file',
12 | builder: yargs => {
13 | dataProvider.builder(yargs)
14 | },
15 | handler: async argv => {
16 | try {
17 | const data = await dataProvider.getData(argv)
18 | const allQRCodesCreated = data
19 | .map(async ({ locationData, vendorData, filepath }) => {
20 | if (!filepath) {
21 | throw new Error('Filepath may not be empty')
22 | }
23 | const ext = path.extname(filepath).substr(1)
24 | if (!supportedExtensions.includes(ext)) {
25 | throw new Error(`File extension ${ext} of ${filepath} not in ${supportedExtensions}`)
26 | }
27 |
28 | const eventQRCode = createEventQRCode({ locationData, vendorData })
29 | const absFilepath = path.resolve(process.cwd(), filepath)
30 | await eventQRCode.toFile(absFilepath, { type: ext })
31 |
32 | console.log(`Created ${filepath}`)
33 | })
34 | await Promise.all(allQRCodesCreated)
35 |
36 | console.log(`Done creating ${data.length} QR code(s).`)
37 | } catch (err) {
38 | console.error(err)
39 | process.exit(1)
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/yargs/commands/poster.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 | const { createEventQRCode } = require('../../index')
5 |
6 | module.exports = ({ process, console, dataProvider }) => {
7 | return {
8 | command: ['poster'],
9 | desc: 'create poster with QR code',
10 | builder: yargs => {
11 | dataProvider.builder(yargs)
12 | },
13 | handler: async argv => {
14 | try {
15 | const data = await dataProvider.getData(argv)
16 | const allPostersCreated = data
17 | .map(async ({ locationData, vendorData, filepath }) => {
18 | if (!filepath) {
19 | throw new Error('Filepath may not be empty')
20 | }
21 | const eventQRCode = createEventQRCode({ locationData, vendorData })
22 |
23 | const absFilepath = path.resolve(process.cwd(), filepath)
24 | await eventQRCode.toPoster(absFilepath)
25 |
26 | console.log(`Created ${filepath}`)
27 | })
28 | await Promise.all(allPostersCreated)
29 |
30 | console.log(`Done creating ${data.length} QR code poster(s).`)
31 | } catch (err) {
32 | console.error(err)
33 | process.exit(1)
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/yargs/commands/terminal.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const { createEventQRCode } = require('../../index')
4 |
5 | module.exports = ({ process, console, dataProvider }) => {
6 | return {
7 | command: ['terminal'],
8 | desc: 'print a QR code on the terminal',
9 | builder: yargs => {
10 | dataProvider.builder(yargs)
11 | },
12 | handler: async argv => {
13 | try {
14 | const data = await dataProvider.getData(argv)
15 | const allQRCodesCreated = data
16 | .map(async ({ locationData, vendorData }) => {
17 | const eventQRCode = createEventQRCode({ locationData, vendorData })
18 | console.log(await eventQRCode.toString())
19 | })
20 | await Promise.all(allQRCodesCreated)
21 | console.log(`Done creating ${data.length} QR code(s).`)
22 | } catch (err) {
23 | console.error(err)
24 | process.exit(1)
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/yargs/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /* eslint-disable no-unused-expressions */
3 | 'use strict'
4 |
5 | const yargs = require('yargs')
6 | const dataFromArgvFactory = require('./util/data-from-argv')
7 | const dataFromCSVFactory = require('./util/data-from-csv')
8 | const dataProviderFactory = require('./util/data-provider')
9 |
10 | module.exports = ({ process, console }) => {
11 | const dataProvider = dataProviderFactory({
12 | sources: [
13 | dataFromCSVFactory({ process }),
14 | dataFromArgvFactory()
15 | ]
16 | })
17 |
18 | return yargs
19 | .command(require('./commands/file')({ process, console, dataProvider }))
20 | .command(require('./commands/poster')({ process, console, dataProvider }))
21 | .command(require('./commands/terminal')({ process, console, dataProvider }))
22 | .showHelpOnFail(true)
23 | }
24 |
--------------------------------------------------------------------------------
/lib/yargs/util/data-from-argv.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const dateStrToTimestamp = dateStr => parseInt(new Date(dateStr).getTime() / 1000)
4 |
5 | module.exports = () => {
6 | const hasData = argv => !!argv.description || !!argv.address
7 | const getData = argv => {
8 | if (argv.startDate) argv.startTimestamp = dateStrToTimestamp(argv.startDate)
9 | if (argv.endDate) argv.endTimestamp = dateStrToTimestamp(argv.endDate)
10 |
11 | const locationData = {
12 | description: argv.description,
13 | address: argv.address,
14 | startTimestamp: argv.startTimestamp,
15 | endTimestamp: argv.endTimestamp
16 | }
17 | const vendorData = {
18 | type: argv.type,
19 | defaultCheckInLengthInMinutes: argv.defaultCheckInLengthInMinutes
20 | }
21 | const data = [
22 | { locationData, vendorData, filepath: argv.filepath }
23 | ]
24 | return data
25 | }
26 |
27 | const builder = yargs => {
28 | yargs
29 | .option('description', {
30 | description: 'Description of the event',
31 | group: 'Event Data',
32 | string: true
33 | })
34 | .option('address', {
35 | description: 'Address of the event',
36 | group: 'Event Data',
37 | string: true
38 | })
39 | .option('start-timestamp', {
40 | description: 'Start timestamp of the event (UNIX timestamp)',
41 | group: 'Event Data',
42 | number: true,
43 | conflicts: 'start-date'
44 | })
45 | .option('start-date', {
46 | description: 'Start date in ISO8601',
47 | group: 'Event Data',
48 | string: true,
49 | conflicts: 'start-timestamp'
50 | })
51 | .option('end-timestamp', {
52 | description: 'End timestamp of the event (UNIX timestamp)',
53 | group: 'Event Data',
54 | number: true,
55 | conflicts: 'end-date'
56 | })
57 | .option('end-date', {
58 | description: 'End date in ISO8601',
59 | group: 'Event Data',
60 | string: true,
61 | conflicts: 'end-timestamp'
62 | })
63 | .option('type', {
64 | description: 'Type of the event (see values below)',
65 | group: 'Event Data',
66 | number: true
67 | })
68 | .option('default-check-in-length-in-minutes', {
69 | description: 'Default check-in length in minutes of the event',
70 | group: 'Event Data',
71 | number: true
72 | })
73 | .option('filepath', {
74 | description: 'Destination filepath of the generated file',
75 | group: 'Event Data',
76 | string: true
77 | })
78 | .epilog(`Types of events
79 | Places
80 | 3 - Retail
81 | 4 - Hospitality
82 | 5 - Craft business
83 | 6 - Workplace
84 | 7 - Education facility
85 | 8 - Public building
86 | 1 - Other place
87 | Events
88 | 9 - Cultural event
89 | 10 - Club activities
90 | 11 - Private party
91 | 12 - Religious service
92 | 2 - Other event
93 | `)
94 | }
95 |
96 | return {
97 | hasData,
98 | getData,
99 | builder
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/lib/yargs/util/data-from-csv.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 | const readQRCodeDataFromCSV = require('../../read-qr-code-data-from-csv')
5 |
6 | module.exports = ({ process }) => {
7 | let __data
8 | const __getData = async argv => {
9 | if (!argv.csv) return
10 | if (__data) return __data
11 | const filepath = path.resolve(process.cwd(), argv.csv)
12 | __data = (await readQRCodeDataFromCSV(filepath))
13 | .map(it => {
14 | return {
15 | ...it,
16 | filepath: path.join(argv.dest || '', it.filepath)
17 | }
18 | })
19 | return __data
20 | }
21 |
22 | const hasData = async argv => Array.isArray(await __getData(argv))
23 | const getData = argv => !argv.csv ? [] : __getData(argv)
24 |
25 | const builder = yargs => {
26 | yargs
27 | .option('csv', {
28 | description: 'Path to the CSV file (see below for file structure)',
29 | group: 'CSV',
30 | string: true,
31 | conflicts: ['description']
32 | })
33 | .option('destination', {
34 | description: 'Destination directory for the generated files',
35 | group: 'CSV',
36 | alias: 'dest',
37 | string: true
38 | })
39 | .epilog(`CSV file structure
40 | The first row of the CSV file must have the following column headers:
41 | filepath
42 | description
43 | address
44 | startdate
45 | enddate
46 | type
47 | defaultcheckinlengthinminutes
48 | `)
49 | }
50 |
51 | return {
52 | hasData,
53 | getData,
54 | builder
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/yargs/util/data-provider.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = ({ sources }) => {
4 | const builder = yargs => sources.forEach(source => source.builder(yargs))
5 |
6 | const getData = async argv => {
7 | const sourcesHaveData = await Promise.all(sources
8 | .map(async sources => sources.hasData(argv)))
9 | const effectiveSourceIdx = sourcesHaveData.findIndex(it => !!it)
10 |
11 | if (effectiveSourceIdx < 0) throw new Error('No data provided')
12 | const effectiveSource = sources[effectiveSourceIdx]
13 | return effectiveSource.getData(argv)
14 | }
15 |
16 | return {
17 | getData,
18 | builder
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cwa-event-qr-code",
3 | "version": "1.3.0",
4 | "description": "Utility to generate QR codes for Event Registration (incl. from the CLI)",
5 | "main": "lib/index.js",
6 | "bin": {
7 | "cwa-event-qr-code": "bin/cli"
8 | },
9 | "scripts": {
10 | "fix": "standard bin/cli 'lib/**/*.js' 'test/**/*.js' --fix --verbose | snazzy",
11 | "lint": "standard bin/cli 'lib/**/*.js' 'test/**/*.js' --verbose | snazzy",
12 | "tpn": "generate-license-file --input package.json --output THIRD-PARTY-NOTICES",
13 | "prepare": "husky install",
14 | "test": "npm run lint && jest",
15 | "watch": "jest --watch"
16 | },
17 | "repository": {
18 | "type": "git",
19 | "url": "git+https://github.com/corona-warn-app/cwa-event-qr-code.git"
20 | },
21 | "keywords": [
22 | "cwa",
23 | "corona-warn-app",
24 | "event registration"
25 | ],
26 | "author": "SAP SE",
27 | "license": "Apache-2.0",
28 | "bugs": {
29 | "url": "https://github.com/corona-warn-app/cwa-event-qr-code/issues"
30 | },
31 | "homepage": "https://github.com/corona-warn-app/cwa-event-qr-code#readme",
32 | "dependencies": {
33 | "@fast-csv/parse": "4.3.6",
34 | "pdf-lib": "1.16.0",
35 | "protobufjs": "6.10.3",
36 | "qrcode": "1.4.4",
37 | "yargs": "16.2.0"
38 | },
39 | "devDependencies": {
40 | "@commitlint/cli": "12.1.1",
41 | "@commitlint/config-conventional": "12.1.1",
42 | "file-type": "16.5.4",
43 | "generate-license-file": "1.1.0",
44 | "husky": "6.0.0",
45 | "jest": "26.6.3",
46 | "lint-staged": "10.5.4",
47 | "snazzy": "9.0.0",
48 | "standard": "16.0.3"
49 | },
50 | "engines": {
51 | "node": ">=14"
52 | },
53 | "lint-staged": {
54 | "*.js": [
55 | "standard --fix"
56 | ],
57 | "package.json": [
58 | "npm run tpn",
59 | "git add THIRD-PARTY-NOTICES"
60 | ]
61 | },
62 | "commitlint": {
63 | "extends": [
64 | "@commitlint/config-conventional"
65 | ]
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/proto/internal/pt/trace_location.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 | package internal.pt;
3 |
4 | message QRCodePayload {
5 | uint32 version = 1;
6 | TraceLocation locationData = 2;
7 | CrowdNotifierData crowdNotifierData = 3;
8 | // byte sequence of CWALocationData
9 | bytes vendorData = 4;
10 | }
11 |
12 | message TraceLocation {
13 | uint32 version = 1;
14 | // max. 100 characters
15 | string description = 2;
16 | // max. 100 characters
17 | string address = 3;
18 |
19 | // UNIX timestamp (in seconds)
20 | uint64 startTimestamp = 5;
21 | // UNIX timestamp (in seconds)
22 | uint64 endTimestamp = 6;
23 | }
24 |
25 | message CrowdNotifierData {
26 | uint32 version = 1;
27 | bytes publicKey = 2;
28 | bytes cryptographicSeed = 3;
29 | }
30 |
31 | enum TraceLocationType {
32 | LOCATION_TYPE_UNSPECIFIED = 0;
33 | LOCATION_TYPE_PERMANENT_OTHER = 1;
34 | LOCATION_TYPE_TEMPORARY_OTHER = 2;
35 |
36 | LOCATION_TYPE_PERMANENT_RETAIL = 3;
37 | LOCATION_TYPE_PERMANENT_FOOD_SERVICE = 4;
38 | LOCATION_TYPE_PERMANENT_CRAFT = 5;
39 | LOCATION_TYPE_PERMANENT_WORKPLACE = 6;
40 | LOCATION_TYPE_PERMANENT_EDUCATIONAL_INSTITUTION = 7;
41 | LOCATION_TYPE_PERMANENT_PUBLIC_BUILDING = 8;
42 |
43 | LOCATION_TYPE_TEMPORARY_CULTURAL_EVENT = 9;
44 | LOCATION_TYPE_TEMPORARY_CLUB_ACTIVITY = 10;
45 | LOCATION_TYPE_TEMPORARY_PRIVATE_EVENT = 11;
46 | LOCATION_TYPE_TEMPORARY_WORSHIP_SERVICE = 12;
47 |
48 | }
49 |
50 | message CWALocationData {
51 | uint32 version = 1;
52 | TraceLocationType type = 2;
53 | uint32 defaultCheckInLengthInMinutes = 3;
54 | }
--------------------------------------------------------------------------------
/test/cli.spec.js:
--------------------------------------------------------------------------------
1 | /* eslint-env jest */
2 | /* eslint-disable no-return-assign */
3 | 'use strict'
4 |
5 | const path = require('path')
6 | const fs = require('fs/promises')
7 | const FileType = require('file-type')
8 |
9 | const parser = require('../lib/yargs/index')
10 |
11 | const fixturePath = fixture => path.resolve(__dirname, fixture)
12 | const rmrf = fixture => fs.unlink(fixturePath(fixture)).catch(() => {})
13 | const rmrfAll = fixtures => Promise.all(fixtures.map(rmrf))
14 | const exists = fixture => fs.stat(fixturePath(fixture))
15 | .then(() => true).catch(() => false)
16 |
17 | const toExist = async fixture => await exists(fixturePath(fixture))
18 | ? { pass: true, message: () => `expected ${fixture} not to exist` }
19 | : { pass: false, message: () => `expected ${fixture} to exist` }
20 | const toBeOfMimeType = async (fixture, expMime) => {
21 | const { mime } = await FileType.fromFile(fixturePath(fixture))
22 | return mime === expMime
23 | ? { pass: true, message: () => `expected ${fixture} of mime ${expMime}, got ${mime}` }
24 | : { pass: false, message: () => `expected ${fixture} not of mime ${expMime}, got ${mime}` }
25 | }
26 | const toBeOfTypePDF = async fixture => toBeOfMimeType(fixture, 'application/pdf')
27 | const toBeOfTypePNG = async fixture => toBeOfMimeType(fixture, 'image/png')
28 | const toBeOfTypeSVG = async fixture => toBeOfMimeType(fixture, 'application/xml')
29 |
30 | expect.extend({
31 | toExist,
32 | toBeOfTypePDF,
33 | toBeOfTypePNG,
34 | toBeOfTypeSVG
35 | })
36 |
37 | const mockProcess = () => ({ cwd: () => __dirname, exit: jest.fn() })
38 | const mockConsole = () => ({ log: jest.fn(), error: jest.fn() })
39 |
40 | const run = async ({ process, console, argv }) => new Promise((resolve, reject) => {
41 | parser({ process, console })
42 | .onFinishCommand(() => resolve())
43 | .parse(argv, async err => {
44 | if (err) return reject(err)
45 | })
46 | })
47 |
48 | describe('cwa-event-qr-code', () => {
49 | jest.setTimeout(15000)
50 | jest.retryTimes(3)
51 |
52 | const FIXTURE_JPG = 'test.jpg'
53 | const FIXTURE_PDF = 'test.pdf'
54 | const FIXTURE_PNG = 'test.png'
55 | const FIXTURE_SVG = 'test.svg'
56 | const FIXTURE_CSV_INPUT = '../examples/sample-data.csv'
57 | const FIXTURE_CSV_PDF = [
58 | 'some-bakery.pdf',
59 | 'birthday-party.pdf'
60 | ]
61 | const ALL_FIXTURES = [
62 | FIXTURE_JPG,
63 | FIXTURE_PDF,
64 | FIXTURE_PNG,
65 | FIXTURE_SVG,
66 | ...FIXTURE_CSV_PDF
67 | ]
68 |
69 | let process, console
70 |
71 | beforeEach(async () => {
72 | process = mockProcess()
73 | console = mockConsole()
74 | await rmrfAll(ALL_FIXTURES)
75 | })
76 |
77 | afterAll(async () => {
78 | await rmrfAll(ALL_FIXTURES)
79 | })
80 |
81 | describe('file', () => {
82 | test('creates png file', async () => {
83 | const argv = `file \
84 | --description "Some Bakery" \
85 | --address "Some Street, Some City" \
86 | --type 4 \
87 | --default-check-in-length-in-minutes 15 \
88 | --filepath ${FIXTURE_PNG}`
89 | await run({ process, console, argv })
90 |
91 | await expect(FIXTURE_PNG).toExist()
92 | await expect(FIXTURE_PNG).toBeOfTypePNG()
93 | expect(process.exit).not.toHaveBeenCalled()
94 | })
95 | test('creates svg file', async () => {
96 | const argv = `file \
97 | --description "Some Bakery" \
98 | --address "Some Street, Some City" \
99 | --type 4 \
100 | --default-check-in-length-in-minutes 15 \
101 | --filepath ${FIXTURE_SVG}`
102 | await run({ process, console, argv })
103 |
104 | await expect(FIXTURE_SVG).toExist()
105 | await expect(FIXTURE_SVG).toBeOfTypeSVG()
106 | expect(process.exit).not.toHaveBeenCalled()
107 | })
108 | test('fails when called with invalid data', async () => {
109 | const argv = `file \
110 | --description "Some Bakery" \
111 | --address "Some Street, Some City" \
112 | --type 4 \
113 | --filepath ${FIXTURE_PNG}`
114 | await run({ process, console, argv })
115 |
116 | await expect(FIXTURE_PNG).not.toExist()
117 | expect(console.error).toHaveBeenCalled()
118 | expect(process.exit).toHaveBeenCalledWith(1)
119 | })
120 | test('fails when called with unsupported file extension', async () => {
121 | const argv = `file \
122 | --description "Some Bakery" \
123 | --address "Some Street, Some City" \
124 | --type 4 \
125 | --default-check-in-length-in-minutes 15 \
126 | --filepath ${FIXTURE_JPG}`
127 | await run({ process, console, argv })
128 |
129 | await expect(FIXTURE_JPG).not.toExist()
130 | expect(console.error).toHaveBeenCalled()
131 | expect(process.exit).toHaveBeenCalledWith(1)
132 | })
133 | })
134 |
135 | describe('poster', () => {
136 | test('creates pdf file from arguments', async () => {
137 | const argv = `poster \
138 | --description "Some Bakery" \
139 | --address "Some Street, Some City" \
140 | --type 4 \
141 | --default-check-in-length-in-minutes 15 \
142 | --filepath ${FIXTURE_PDF}`
143 | await run({ process, console, argv })
144 |
145 | await expect(FIXTURE_PDF).toExist()
146 | await expect(FIXTURE_PDF).toBeOfTypePDF()
147 | expect(process.exit).not.toHaveBeenCalled()
148 | })
149 | test('fails when called with invalid arguments', async () => {
150 | const argv = `poster \
151 | --description "Some Bakery" \
152 | --address "Some Street, Some City" \
153 | --type 4 \
154 | --filepath ${FIXTURE_PDF}`
155 | await run({ process, console, argv })
156 |
157 | await expect(FIXTURE_PDF).not.toExist()
158 | expect(console.error).toHaveBeenCalled()
159 | expect(process.exit).toHaveBeenCalledWith(1)
160 | })
161 | test('creates pdf files from CSV', async () => {
162 | const argv = `poster \
163 | --csv ${FIXTURE_CSV_INPUT} \
164 | --dest .`
165 | await run({ process, console, argv })
166 |
167 | await Promise.all(FIXTURE_CSV_PDF.map(async it => {
168 | await expect(it).toExist()
169 | await expect(it).toBeOfTypePDF()
170 | }))
171 | expect(process.exit).not.toHaveBeenCalled()
172 | })
173 | })
174 | })
175 |
--------------------------------------------------------------------------------
/test/validate-qr-code-data.spec.js:
--------------------------------------------------------------------------------
1 | /* eslint-env jest */
2 | /* eslint-disable no-return-assign */
3 | 'use strict'
4 |
5 | expect.extend({
6 | toYieldErrorFor ({ isValid, errors }, property) {
7 | const pass = isValid === false &&
8 | Array.isArray(errors) &&
9 | errors.filter(it => it.property === property).length === 1
10 | if (pass) {
11 | return {
12 | message: () => new Error('Negation not supported for toYieldErrorFor'),
13 | pass: true
14 | }
15 | } else {
16 | return {
17 | message: () =>
18 | `expected error for ${property}, received isValid=${isValid} and errors=${errors}`,
19 | pass: false
20 | }
21 | }
22 | },
23 | toPassValidation ({ isValid, errors, validatedLocationData, validatedVendorData }, { locationData, vendorData }) {
24 | try {
25 | expect(isValid).toBe(true)
26 | expect(errors).toHaveLength(0)
27 | expect(validatedLocationData).toMatchObject(locationData)
28 | expect(validatedVendorData).toMatchObject(vendorData)
29 | return {
30 | message: () => new Error('Negation not supported for toPassValidation'),
31 | pass: true
32 | }
33 | } catch (e) {
34 | return {
35 | message: () => e,
36 | pass: false
37 | }
38 | }
39 | }
40 | })
41 |
42 | const { validateQRCodeData } = require('../lib/index')
43 |
44 | const generateRandomStringWithLength = length => Array.from(Array(length), () => 'a').join('')
45 |
46 | const permanentLocationTypes = [1, 3, 4, 5, 6, 7, 8]
47 | const temporaryLocationTypes = [2, 9, 10, 11, 12]
48 |
49 | describe('validateQRCodeData', () => {
50 | let locationData, vendorData
51 |
52 | beforeEach(() => {
53 | locationData = {
54 | description: 'My Bakery',
55 | address: 'Springfield'
56 | }
57 | vendorData = {
58 | type: permanentLocationTypes[0],
59 | defaultCheckInLengthInMinutes: 15
60 | }
61 | })
62 |
63 | test('returns true if all attributes are valid', () => {
64 | expect(validateQRCodeData({ locationData, vendorData }))
65 | .toPassValidation({ locationData, vendorData })
66 | })
67 |
68 | describe('description', () => {
69 | test('returns true if description has 100 characters', () => {
70 | locationData.description = generateRandomStringWithLength(100)
71 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData, vendorData })
72 | })
73 |
74 | test.each([
75 | ['is missing', locationData => delete locationData.description],
76 | ['is empty', locationData => locationData.description = ''],
77 | ['exceeds 100 characters', locationData => locationData.description = generateRandomStringWithLength(101)]
78 | ])('returns false if description %s', (_, mutate) => {
79 | mutate(locationData)
80 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('description')
81 | })
82 | })
83 |
84 | describe('address', () => {
85 | test('returns true if address has 100 characters', () => {
86 | locationData.address = generateRandomStringWithLength(100)
87 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData, vendorData })
88 | })
89 |
90 | test.each([
91 | ['is missing', locationData => delete locationData.address],
92 | ['is empty', locationData => locationData.address = ''],
93 | ['exceeds 100 characters', locationData => locationData.address = generateRandomStringWithLength(101)]
94 | ])('returns false if address %s', (_, mutate) => {
95 | mutate(locationData)
96 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('address')
97 | })
98 | })
99 |
100 | describe.each(permanentLocationTypes)('permanent location type %i', type => {
101 | beforeEach(() => {
102 | vendorData.type = type
103 | })
104 | describe.each(['startTimestamp', 'endTimestamp'])('%s', timestampProperty => {
105 | test.each([
106 | ['is missing', locationData => delete locationData[timestampProperty]],
107 | ['is empty', locationData => locationData[timestampProperty] = ''],
108 | ['is zero (int)', locationData => locationData[timestampProperty] = 0],
109 | ['is zero (str)', locationData => locationData[timestampProperty] = '0']
110 | ])(`returns true if ${timestampProperty} %s`, (_, mutate) => {
111 | mutate(locationData)
112 | const expLocationData = { ...locationData }
113 | delete expLocationData[timestampProperty]
114 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData: expLocationData, vendorData })
115 | })
116 | test.each([
117 | ['is less than 0 (int)', locationData => locationData[timestampProperty] = -1],
118 | ['is less than 0 (str)', locationData => locationData[timestampProperty] = '-1'],
119 | ['is greater than 0 (int)', locationData => locationData[timestampProperty] = 1],
120 | ['is greater than 0 (str)', locationData => locationData[timestampProperty] = '1']
121 | ])(`returns false if ${timestampProperty} %s`, (_, mutate) => {
122 | mutate(locationData)
123 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor(timestampProperty)
124 | })
125 | })
126 | describe('defaultCheckInLengthInMinutes', () => {
127 | test.each([
128 | ['is 15 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 15, 15],
129 | ['is 15 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '15', 15],
130 | ['is 1440 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 1440, 1440],
131 | ['is 1440 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '1440', 1440]
132 | ])('returns true if defaultCheckInLengthInMinutes %s', (_, mutate, expDefaultCheckInLengthInMinutes) => {
133 | mutate(vendorData)
134 | const expVendorData = { ...vendorData }
135 | expVendorData.defaultCheckInLengthInMinutes = expDefaultCheckInLengthInMinutes
136 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData: locationData, vendorData: expVendorData })
137 | })
138 | test.each([
139 | ['is equals 0 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 0],
140 | ['is equals 0 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '0'],
141 | ['is less than 0 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = -1],
142 | ['is less than 0 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '-1'],
143 | ['is greater than 1440 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 1441],
144 | ['is greater than 1440 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '1441'],
145 | ['is missing', vendorData => delete vendorData.defaultCheckInLengthInMinutes],
146 | ['is empty', vendorData => vendorData.defaultCheckInLengthInMinutes = '']
147 | ])('returns false if defaultCheckInLengthInMinutes %s', (_, mutate) => {
148 | mutate(vendorData)
149 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('defaultCheckInLengthInMinutes')
150 | })
151 | })
152 | })
153 |
154 | describe.each(temporaryLocationTypes)('temporary location type %i', type => {
155 | beforeEach(() => {
156 | locationData.startTimestamp = 1
157 | locationData.endTimestamp = 2
158 | vendorData.type = type
159 | })
160 | describe('startTimestamp and endTimestamp', () => {
161 | test('returns true if endTimestamp is greater than startTimestamp', () => {
162 | locationData.startTimestamp = 1619535600
163 | locationData.endTimestamp = 1619539200
164 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData: locationData, vendorData })
165 | })
166 | test('returns false if endTimestamp equals startTimestamp', () => {
167 | locationData.startTimestamp = 1
168 | locationData.endTimestamp = 1
169 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('startTimestamp')
170 | })
171 | test('returns false if endTimestamp is less or than startTimestamp', () => {
172 | locationData.startTimestamp = 2
173 | locationData.endTimestamp = 1
174 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('startTimestamp')
175 | })
176 | })
177 | describe.each(['startTimestamp', 'endTimestamp'])('%s', timestampProperty => {
178 | test.each([
179 | ['is less than 0 (int)', locationData => locationData[timestampProperty] = -1],
180 | ['is less than 0 (str)', locationData => locationData[timestampProperty] = '-1'],
181 | ['is missing', locationData => delete locationData[timestampProperty]],
182 | ['is empty', locationData => locationData[timestampProperty] = '']
183 | ])(`returns false if ${timestampProperty} %s`, (_, mutate) => {
184 | mutate(locationData)
185 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor(timestampProperty)
186 | })
187 | })
188 | describe('defaultCheckInLengthInMinutes', () => {
189 | test.each([
190 | ['is 15 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 15, 15],
191 | ['is 15 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '15', 15],
192 | ['is 1440 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 1440, 1440],
193 | ['is 1440 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '1440', 1440],
194 | ['is missing', vendorData => delete vendorData.defaultCheckInLengthInMinutes, undefined],
195 | ['is empty', vendorData => vendorData.defaultCheckInLengthInMinutes = '', undefined]
196 | ])('returns true if defaultCheckInLengthInMinutes %s', (_, mutate, expDefaultCheckInLengthInMinutes) => {
197 | mutate(vendorData)
198 | expect(validateQRCodeData({ locationData, vendorData })).toHaveProperty('isValid', true)
199 | const expVendorData = { ...vendorData }
200 | if (expDefaultCheckInLengthInMinutes === undefined) delete expVendorData.defaultCheckInLengthInMinutes
201 | else expVendorData.defaultCheckInLengthInMinutes = expDefaultCheckInLengthInMinutes
202 | expect(validateQRCodeData({ locationData, vendorData })).toPassValidation({ locationData: locationData, vendorData: expVendorData })
203 | })
204 | test.each([
205 | ['is less than 0 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = -1],
206 | ['is less than 0 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '-1'],
207 | ['is greater than 1440 (int)', vendorData => vendorData.defaultCheckInLengthInMinutes = 1441],
208 | ['is greater than 1440 (str)', vendorData => vendorData.defaultCheckInLengthInMinutes = '1441']
209 | ])('returns false if defaultCheckInLengthInMinutes %s', (_, mutate) => {
210 | mutate(vendorData)
211 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('defaultCheckInLengthInMinutes')
212 | })
213 | })
214 | })
215 |
216 | describe('other location types', () => {
217 | test('returns false for location type 0', () => {
218 | vendorData.type = 0
219 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('type')
220 | })
221 | test('returns false for location type 13', () => {
222 | vendorData.type = 13
223 | expect(validateQRCodeData({ locationData, vendorData })).toYieldErrorFor('type')
224 | })
225 | })
226 | })
227 |
--------------------------------------------------------------------------------