All files / building third-party-licenses.static.cjs

100% Statements 5/5
100% Branches 0/0
100% Functions 0/0
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206                                                      18x                                                                                                                   18x                                                                             18x                                                                             18x                                                                                 18x  
/*
  Copyright (C) 2026 Sber
 
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0
 
  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 for the specific language governing permissions and
  limitations under the License.
*/
 
// @ts-check
// Сторонний код, который лежит в репозитории, а не в node_modules: генератор файла лицензий
// (third-party-licenses.cjs) не может прочитать его package.json и LICENSE. Значения совпадают
// с NOTICE; при пересборке libCode dbml обновить оба места (тест сверяет их с маркерами бандла).
 
/**
 * @typedef {{ name: string, version: string, license: string, copyright: string[] }} StaticComponent
 * @typedef {{ path: string, title: string, components: StaticComponent[] }} InTreeEntry
 */
 
/** @type {StaticComponent[]} */
const LIBCODE_COMPONENTS = [
    {
        name: 'DB Schema Visualizer',
        version: '',
        license: 'MIT',
        copyright: ['Copyright (c) 2024 DBSchemaVisualizer', 'Modified by Sber for SEAF.ArchTool (2025-2026).']
    },
    {
        name: 'konva',
        version: '9.3.22',
        license: 'MIT',
        copyright: [
            'Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)',
            'Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)'
        ]
    },
    { name: 'react-konva', version: '18.2.16', license: 'MIT', copyright: ['Copyright (c) 2017 Anton Lavrenov'] },
    { name: 'its-fine', version: '1.2.5', license: 'MIT', copyright: ['Copyright (c) 2022 Poimandres'] },
    {
        name: 'react-reconciler',
        version: '0.29.2',
        license: 'MIT',
        copyright: ['Copyright (c) Facebook, Inc. and its affiliates.']
    },
    { name: 'scheduler', version: '0.23.2', license: 'MIT', copyright: ['Copyright (c) Facebook, Inc. and its affiliates.'] },
    { name: '@dagrejs/dagre', version: '1.1.8', license: 'MIT', copyright: ['Copyright (c) 2012-2014 Chris Pettitt'] },
    { name: '@dagrejs/graphlib', version: '2.2.4', license: 'MIT', copyright: ['Copyright (c) 2012-2014 Chris Pettitt'] },
    { name: 'eventemitter3', version: '5.0.4', license: 'MIT', copyright: ['Copyright (c) 2014 Arnout Kazemier'] },
    {
        name: 'pluralize',
        version: '8.0.0',
        license: 'MIT',
        copyright: ['Copyright (c) 2013 Blake Embrey (hello@blakeembrey.com)']
    },
    {
        name: 'lodash',
        version: '4.18.1',
        license: 'MIT',
        copyright: [
            'Copyright OpenJS Foundation and other contributors <https://openjsf.org/>',
            'Based on Underscore.js, copyright Jeremy Ashkenas,',
            'DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>'
        ]
    },
    {
        name: 'lucide-react',
        version: '0.365.0',
        license: 'ISC',
        copyright: [
            'Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).',
            'All other copyright (c) for Lucide are held by Lucide Contributors 2022.'
        ]
    },
    { name: '@dbml/core', version: '3.14.1', license: 'Apache-2.0', copyright: ['Copyright 2019 Holistics Software Pte Ltd.'] },
    { name: 'tailwindcss', version: '3.4.19', license: 'MIT', copyright: ['Copyright (c) Tailwind Labs, Inc.'] }
];
 
/** Пути (от корня репозитория, по префиксу) → состав стороннего кода в них. @type {InTreeEntry[]} */
const IN_TREE_VENDORED = [
    {
        path: 'plugins/dbml/components/libCode/',
        title: 'Prebuilt bundle of DB Schema Visualizer (plugins/dbml/components/libCode)',
        components: LIBCODE_COMPONENTS
    },
    {
        path: 'src/assets/styles/material_icons.css',
        title: 'Material Icons (font embedded in src/assets/styles/material_icons.css)',
        components: [
            {
                name: 'Material Icons',
                version: '',
                license: 'Apache-2.0',
                copyright: ['Copyright 2018 Google, Inc. All Rights Reserved.']
            }
        ]
    },
    {
        path: 'src/frontend/components/Schema/DHSchema/rounding.js',
        title: 'SVG Path Rounding Function (src/frontend/components/Schema/DHSchema/rounding.js)',
        components: [
            {
                name: 'SVG Path Rounding Function',
                version: '',
                license: 'Apache-2.0',
                copyright: ['Copyright (C) 2014 Yona Appletree']
            }
        ]
    }
];
 
/**
 * Решения ИТ-лида по пакетам без лицензии в package.json или без правообладателя (ревью ERA-3561).
 * Ключ — name@version: при обновлении пакета переопределение перестаёт действовать и сборка снова
 * предупреждает, решение надо пересмотреть.
 * @typedef {{ license: string, note: string, text?: string, copyrightHolder?: string }} PackageOverride
 * @type {Record<string, PackageOverride>}
 */
const PACKAGE_OVERRIDES = {
    // Транзитивная зависимость (stream). В package.json 1.1.2 нет поля license, файла лицензии нет;
    // component.json и bower.json пакета указывают MIT. Текст — LICENSE upstream-репозитория.
    'emitter-component@1.1.2': {
        license: 'MIT',
        note: 'license and text from the upstream repository https://github.com/sindresorhus/component-emitter (LICENSE); '
            + 'version 1.1.2 declares MIT in component.json and bower.json',
        text: `MIT License
 
Copyright (c) TJ Holowaychuk <tj@tjholowaychuk.com>
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
 
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:
 
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
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.`
    },
    // В package.json нет поля license; файл license пакета — MIT (© Fabio Spampinato, Andrew Maney),
    // его текст попадает в выдачу как есть
    'khroma@2.1.0': {
        license: 'MIT',
        note: 'MIT per the license file of the package; package.json has no license field'
    },
    // Apache-2.0 по package.json, файла лицензии в пакете нет: стандартный текст Apache-2.0 — в конце файла
    'short-unique-id@5.3.2': {
        license: 'Apache-2.0',
        note: 'standard Apache-2.0 text; the package contains no license file',
        text: 'Apache License 2.0 text: see the end of this file.'
    },
    // Пакет Сбера (ai-forever/gigachat-js): ISC по package.json, автор не указан
    'gigachat@0.0.21': {
        license: 'ISC',
        note: 'ISC per package.json; the package is published by Sber (https://github.com/ai-forever/gigachat-js)',
        copyrightHolder: 'Sber'
    }
};
 
// Стандартные тексты SPDX без строки Copyright
const LICENSE_TEXTS = {
    MIT: `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:
 
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
 
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.`,
    ISC: `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.
 
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.`,
    '0BSD': `Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
 
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.`
};
 
module.exports = { LIBCODE_COMPONENTS, IN_TREE_VENDORED, LICENSE_TEXTS, PACKAGE_OVERRIDES };