first commit
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
../esbuild/bin/esbuild
|
||||
+1
@@ -0,0 +1 @@
|
||||
../mime/cli.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
../mkdirp/bin/cmd.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
../prisma/build/index.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
../typescript/bin/tsc
|
||||
+1
@@ -0,0 +1 @@
|
||||
../typescript/bin/tsserver
|
||||
+1
@@ -0,0 +1 @@
|
||||
../tsx/dist/cli.mjs
|
||||
+1413
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
export * from "./index"
|
||||
+1
@@ -0,0 +1 @@
|
||||
module.exports = { ...require('.') }
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class PrismaClient {
|
||||
constructor() {
|
||||
throw new Error(
|
||||
'@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export { PrismaClient }
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from "./default"
|
||||
+652
File diff suppressed because one or more lines are too long
+644
@@ -0,0 +1,644 @@
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
const {
|
||||
Decimal,
|
||||
objectEnumValues,
|
||||
makeStrictEnum,
|
||||
Public,
|
||||
getRuntime,
|
||||
skip
|
||||
} = require('@prisma/client/runtime/index-browser.js')
|
||||
|
||||
|
||||
const Prisma = {}
|
||||
|
||||
exports.Prisma = Prisma
|
||||
exports.$Enums = {}
|
||||
|
||||
/**
|
||||
* Prisma Client JS version: 5.22.0
|
||||
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
|
||||
*/
|
||||
Prisma.prismaVersion = {
|
||||
client: "5.22.0",
|
||||
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
|
||||
}
|
||||
|
||||
Prisma.PrismaClientKnownRequestError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)};
|
||||
Prisma.PrismaClientUnknownRequestError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientRustPanicError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientInitializationError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientValidationError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.NotFoundError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.Decimal = Decimal
|
||||
|
||||
/**
|
||||
* Re-export of sql-template-tag
|
||||
*/
|
||||
Prisma.sql = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.empty = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.join = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.raw = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.validator = Public.validator
|
||||
|
||||
/**
|
||||
* Extensions
|
||||
*/
|
||||
Prisma.getExtensionContext = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.defineExtension = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
|
||||
/**
|
||||
* Shorthand utilities for JSON filtering
|
||||
*/
|
||||
Prisma.DbNull = objectEnumValues.instances.DbNull
|
||||
Prisma.JsonNull = objectEnumValues.instances.JsonNull
|
||||
Prisma.AnyNull = objectEnumValues.instances.AnyNull
|
||||
|
||||
Prisma.NullTypes = {
|
||||
DbNull: objectEnumValues.classes.DbNull,
|
||||
JsonNull: objectEnumValues.classes.JsonNull,
|
||||
AnyNull: objectEnumValues.classes.AnyNull
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enums
|
||||
*/
|
||||
|
||||
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
|
||||
ReadUncommitted: 'ReadUncommitted',
|
||||
ReadCommitted: 'ReadCommitted',
|
||||
RepeatableRead: 'RepeatableRead',
|
||||
Serializable: 'Serializable'
|
||||
});
|
||||
|
||||
exports.Prisma.AppSettingScalarFieldEnum = {
|
||||
id: 'id',
|
||||
key: 'key',
|
||||
value: 'value',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
email: 'email',
|
||||
password: 'password',
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
isActive: 'isActive',
|
||||
customerId: 'customerId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.RoleScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.PermissionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
resource: 'resource',
|
||||
action: 'action'
|
||||
};
|
||||
|
||||
exports.Prisma.RolePermissionScalarFieldEnum = {
|
||||
roleId: 'roleId',
|
||||
permissionId: 'permissionId'
|
||||
};
|
||||
|
||||
exports.Prisma.UserRoleScalarFieldEnum = {
|
||||
userId: 'userId',
|
||||
roleId: 'roleId'
|
||||
};
|
||||
|
||||
exports.Prisma.CustomerScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerNumber: 'customerNumber',
|
||||
type: 'type',
|
||||
salutation: 'salutation',
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
companyName: 'companyName',
|
||||
foundingDate: 'foundingDate',
|
||||
birthDate: 'birthDate',
|
||||
birthPlace: 'birthPlace',
|
||||
email: 'email',
|
||||
phone: 'phone',
|
||||
mobile: 'mobile',
|
||||
taxNumber: 'taxNumber',
|
||||
businessRegistrationPath: 'businessRegistrationPath',
|
||||
commercialRegisterPath: 'commercialRegisterPath',
|
||||
commercialRegisterNumber: 'commercialRegisterNumber',
|
||||
privacyPolicyPath: 'privacyPolicyPath',
|
||||
notes: 'notes',
|
||||
portalEnabled: 'portalEnabled',
|
||||
portalEmail: 'portalEmail',
|
||||
portalPasswordHash: 'portalPasswordHash',
|
||||
portalPasswordEncrypted: 'portalPasswordEncrypted',
|
||||
portalLastLogin: 'portalLastLogin',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.CustomerRepresentativeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
representativeId: 'representativeId',
|
||||
notes: 'notes',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.AddressScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
street: 'street',
|
||||
houseNumber: 'houseNumber',
|
||||
postalCode: 'postalCode',
|
||||
city: 'city',
|
||||
country: 'country',
|
||||
isDefault: 'isDefault',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.BankCardScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
accountHolder: 'accountHolder',
|
||||
iban: 'iban',
|
||||
bic: 'bic',
|
||||
bankName: 'bankName',
|
||||
expiryDate: 'expiryDate',
|
||||
documentPath: 'documentPath',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.IdentityDocumentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
documentNumber: 'documentNumber',
|
||||
issuingAuthority: 'issuingAuthority',
|
||||
issueDate: 'issueDate',
|
||||
expiryDate: 'expiryDate',
|
||||
documentPath: 'documentPath',
|
||||
isActive: 'isActive',
|
||||
licenseClasses: 'licenseClasses',
|
||||
licenseIssueDate: 'licenseIssueDate',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EmailProviderConfigScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
type: 'type',
|
||||
apiUrl: 'apiUrl',
|
||||
apiKey: 'apiKey',
|
||||
username: 'username',
|
||||
passwordEncrypted: 'passwordEncrypted',
|
||||
domain: 'domain',
|
||||
defaultForwardEmail: 'defaultForwardEmail',
|
||||
isActive: 'isActive',
|
||||
isDefault: 'isDefault',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.StressfreiEmailScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
email: 'email',
|
||||
platform: 'platform',
|
||||
notes: 'notes',
|
||||
isActive: 'isActive',
|
||||
isProvisioned: 'isProvisioned',
|
||||
provisionedAt: 'provisionedAt',
|
||||
provisionError: 'provisionError',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.MeterScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
meterNumber: 'meterNumber',
|
||||
type: 'type',
|
||||
location: 'location',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.MeterReadingScalarFieldEnum = {
|
||||
id: 'id',
|
||||
meterId: 'meterId',
|
||||
readingDate: 'readingDate',
|
||||
value: 'value',
|
||||
unit: 'unit',
|
||||
notes: 'notes',
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.SalesPlatformScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
contactInfo: 'contactInfo',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.CancellationPeriodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
description: 'description',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractDurationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
description: 'description',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ProviderScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
portalUrl: 'portalUrl',
|
||||
usernameFieldName: 'usernameFieldName',
|
||||
passwordFieldName: 'passwordFieldName',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.TariffScalarFieldEnum = {
|
||||
id: 'id',
|
||||
providerId: 'providerId',
|
||||
name: 'name',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
icon: 'icon',
|
||||
color: 'color',
|
||||
sortOrder: 'sortOrder',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractNumber: 'contractNumber',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
status: 'status',
|
||||
contractCategoryId: 'contractCategoryId',
|
||||
addressId: 'addressId',
|
||||
bankCardId: 'bankCardId',
|
||||
identityDocumentId: 'identityDocumentId',
|
||||
salesPlatformId: 'salesPlatformId',
|
||||
cancellationPeriodId: 'cancellationPeriodId',
|
||||
contractDurationId: 'contractDurationId',
|
||||
previousContractId: 'previousContractId',
|
||||
providerId: 'providerId',
|
||||
tariffId: 'tariffId',
|
||||
providerName: 'providerName',
|
||||
tariffName: 'tariffName',
|
||||
customerNumberAtProvider: 'customerNumberAtProvider',
|
||||
priceFirst12Months: 'priceFirst12Months',
|
||||
priceFrom13Months: 'priceFrom13Months',
|
||||
priceAfter24Months: 'priceAfter24Months',
|
||||
startDate: 'startDate',
|
||||
endDate: 'endDate',
|
||||
commission: 'commission',
|
||||
cancellationLetterPath: 'cancellationLetterPath',
|
||||
cancellationConfirmationPath: 'cancellationConfirmationPath',
|
||||
cancellationLetterOptionsPath: 'cancellationLetterOptionsPath',
|
||||
cancellationConfirmationOptionsPath: 'cancellationConfirmationOptionsPath',
|
||||
cancellationConfirmationDate: 'cancellationConfirmationDate',
|
||||
cancellationConfirmationOptionsDate: 'cancellationConfirmationOptionsDate',
|
||||
wasSpecialCancellation: 'wasSpecialCancellation',
|
||||
portalUsername: 'portalUsername',
|
||||
portalPasswordEncrypted: 'portalPasswordEncrypted',
|
||||
stressfreiEmailId: 'stressfreiEmailId',
|
||||
notes: 'notes',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractTaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
title: 'title',
|
||||
description: 'description',
|
||||
status: 'status',
|
||||
visibleInPortal: 'visibleInPortal',
|
||||
createdBy: 'createdBy',
|
||||
completedAt: 'completedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractTaskSubtaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
taskId: 'taskId',
|
||||
title: 'title',
|
||||
status: 'status',
|
||||
createdBy: 'createdBy',
|
||||
completedAt: 'completedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EnergyContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
meterId: 'meterId',
|
||||
annualConsumption: 'annualConsumption',
|
||||
basePrice: 'basePrice',
|
||||
unitPrice: 'unitPrice',
|
||||
bonus: 'bonus',
|
||||
previousProviderName: 'previousProviderName',
|
||||
previousCustomerNumber: 'previousCustomerNumber'
|
||||
};
|
||||
|
||||
exports.Prisma.InternetContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
downloadSpeed: 'downloadSpeed',
|
||||
uploadSpeed: 'uploadSpeed',
|
||||
routerModel: 'routerModel',
|
||||
routerSerialNumber: 'routerSerialNumber',
|
||||
installationDate: 'installationDate',
|
||||
internetUsername: 'internetUsername',
|
||||
internetPasswordEncrypted: 'internetPasswordEncrypted',
|
||||
homeId: 'homeId',
|
||||
activationCode: 'activationCode'
|
||||
};
|
||||
|
||||
exports.Prisma.PhoneNumberScalarFieldEnum = {
|
||||
id: 'id',
|
||||
internetContractDetailsId: 'internetContractDetailsId',
|
||||
phoneNumber: 'phoneNumber',
|
||||
isMain: 'isMain',
|
||||
sipUsername: 'sipUsername',
|
||||
sipPasswordEncrypted: 'sipPasswordEncrypted',
|
||||
sipServer: 'sipServer'
|
||||
};
|
||||
|
||||
exports.Prisma.MobileContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
requiresMultisim: 'requiresMultisim',
|
||||
dataVolume: 'dataVolume',
|
||||
includedMinutes: 'includedMinutes',
|
||||
includedSMS: 'includedSMS',
|
||||
deviceModel: 'deviceModel',
|
||||
deviceImei: 'deviceImei',
|
||||
phoneNumber: 'phoneNumber',
|
||||
simCardNumber: 'simCardNumber'
|
||||
};
|
||||
|
||||
exports.Prisma.SimCardScalarFieldEnum = {
|
||||
id: 'id',
|
||||
mobileDetailsId: 'mobileDetailsId',
|
||||
phoneNumber: 'phoneNumber',
|
||||
simCardNumber: 'simCardNumber',
|
||||
pin: 'pin',
|
||||
puk: 'puk',
|
||||
isMultisim: 'isMultisim',
|
||||
isMain: 'isMain',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.TvContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
receiverModel: 'receiverModel',
|
||||
smartcardNumber: 'smartcardNumber',
|
||||
package: 'package'
|
||||
};
|
||||
|
||||
exports.Prisma.CarInsuranceDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
licensePlate: 'licensePlate',
|
||||
hsn: 'hsn',
|
||||
tsn: 'tsn',
|
||||
vin: 'vin',
|
||||
vehicleType: 'vehicleType',
|
||||
firstRegistration: 'firstRegistration',
|
||||
noClaimsClass: 'noClaimsClass',
|
||||
insuranceType: 'insuranceType',
|
||||
deductiblePartial: 'deductiblePartial',
|
||||
deductibleFull: 'deductibleFull',
|
||||
policyNumber: 'policyNumber',
|
||||
previousInsurer: 'previousInsurer'
|
||||
};
|
||||
|
||||
exports.Prisma.SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
};
|
||||
|
||||
exports.Prisma.NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
};
|
||||
exports.CustomerType = exports.$Enums.CustomerType = {
|
||||
PRIVATE: 'PRIVATE',
|
||||
BUSINESS: 'BUSINESS'
|
||||
};
|
||||
|
||||
exports.AddressType = exports.$Enums.AddressType = {
|
||||
DELIVERY_RESIDENCE: 'DELIVERY_RESIDENCE',
|
||||
BILLING: 'BILLING'
|
||||
};
|
||||
|
||||
exports.DocumentType = exports.$Enums.DocumentType = {
|
||||
ID_CARD: 'ID_CARD',
|
||||
PASSPORT: 'PASSPORT',
|
||||
DRIVERS_LICENSE: 'DRIVERS_LICENSE',
|
||||
OTHER: 'OTHER'
|
||||
};
|
||||
|
||||
exports.EmailProviderType = exports.$Enums.EmailProviderType = {
|
||||
PLESK: 'PLESK',
|
||||
CPANEL: 'CPANEL',
|
||||
DIRECTADMIN: 'DIRECTADMIN'
|
||||
};
|
||||
|
||||
exports.MeterType = exports.$Enums.MeterType = {
|
||||
ELECTRICITY: 'ELECTRICITY',
|
||||
GAS: 'GAS'
|
||||
};
|
||||
|
||||
exports.ContractType = exports.$Enums.ContractType = {
|
||||
ELECTRICITY: 'ELECTRICITY',
|
||||
GAS: 'GAS',
|
||||
DSL: 'DSL',
|
||||
CABLE: 'CABLE',
|
||||
FIBER: 'FIBER',
|
||||
MOBILE: 'MOBILE',
|
||||
TV: 'TV',
|
||||
CAR_INSURANCE: 'CAR_INSURANCE'
|
||||
};
|
||||
|
||||
exports.ContractStatus = exports.$Enums.ContractStatus = {
|
||||
DRAFT: 'DRAFT',
|
||||
PENDING: 'PENDING',
|
||||
ACTIVE: 'ACTIVE',
|
||||
CANCELLED: 'CANCELLED',
|
||||
EXPIRED: 'EXPIRED',
|
||||
DEACTIVATED: 'DEACTIVATED'
|
||||
};
|
||||
|
||||
exports.ContractTaskStatus = exports.$Enums.ContractTaskStatus = {
|
||||
OPEN: 'OPEN',
|
||||
COMPLETED: 'COMPLETED'
|
||||
};
|
||||
|
||||
exports.InsuranceType = exports.$Enums.InsuranceType = {
|
||||
LIABILITY: 'LIABILITY',
|
||||
PARTIAL: 'PARTIAL',
|
||||
FULL: 'FULL'
|
||||
};
|
||||
|
||||
exports.Prisma.ModelName = {
|
||||
AppSetting: 'AppSetting',
|
||||
User: 'User',
|
||||
Role: 'Role',
|
||||
Permission: 'Permission',
|
||||
RolePermission: 'RolePermission',
|
||||
UserRole: 'UserRole',
|
||||
Customer: 'Customer',
|
||||
CustomerRepresentative: 'CustomerRepresentative',
|
||||
Address: 'Address',
|
||||
BankCard: 'BankCard',
|
||||
IdentityDocument: 'IdentityDocument',
|
||||
EmailProviderConfig: 'EmailProviderConfig',
|
||||
StressfreiEmail: 'StressfreiEmail',
|
||||
Meter: 'Meter',
|
||||
MeterReading: 'MeterReading',
|
||||
SalesPlatform: 'SalesPlatform',
|
||||
CancellationPeriod: 'CancellationPeriod',
|
||||
ContractDuration: 'ContractDuration',
|
||||
Provider: 'Provider',
|
||||
Tariff: 'Tariff',
|
||||
ContractCategory: 'ContractCategory',
|
||||
Contract: 'Contract',
|
||||
ContractTask: 'ContractTask',
|
||||
ContractTaskSubtask: 'ContractTaskSubtask',
|
||||
EnergyContractDetails: 'EnergyContractDetails',
|
||||
InternetContractDetails: 'InternetContractDetails',
|
||||
PhoneNumber: 'PhoneNumber',
|
||||
MobileContractDetails: 'MobileContractDetails',
|
||||
SimCard: 'SimCard',
|
||||
TvContractDetails: 'TvContractDetails',
|
||||
CarInsuranceDetails: 'CarInsuranceDetails'
|
||||
};
|
||||
|
||||
/**
|
||||
* This is a stub Prisma Client that will error at runtime if called.
|
||||
*/
|
||||
class PrismaClient {
|
||||
constructor() {
|
||||
return new Proxy(this, {
|
||||
get(target, prop) {
|
||||
let message
|
||||
const runtime = getRuntime()
|
||||
if (runtime.isEdge) {
|
||||
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
|
||||
- Use Prisma Accelerate: https://pris.ly/d/accelerate
|
||||
- Use Driver Adapters: https://pris.ly/d/driver-adapters
|
||||
`;
|
||||
} else {
|
||||
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
|
||||
}
|
||||
|
||||
message += `
|
||||
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
|
||||
|
||||
throw new Error(message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
exports.PrismaClient = PrismaClient
|
||||
|
||||
Object.assign(exports, Prisma)
|
||||
+55487
File diff suppressed because it is too large
Load Diff
+673
File diff suppressed because one or more lines are too long
Generated
Vendored
Executable
BIN
Binary file not shown.
+97
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"name": "prisma-client-f3be941c86c0d933a2a09d69aafc49ad121411869df4ce4f365fdf53679b90db",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"browser": "index-browser.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"require": {
|
||||
"node": "./index.js",
|
||||
"edge-light": "./wasm.js",
|
||||
"workerd": "./wasm.js",
|
||||
"worker": "./wasm.js",
|
||||
"browser": "./index-browser.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"import": {
|
||||
"node": "./index.js",
|
||||
"edge-light": "./wasm.js",
|
||||
"workerd": "./wasm.js",
|
||||
"worker": "./wasm.js",
|
||||
"browser": "./index-browser.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./edge": {
|
||||
"types": "./edge.d.ts",
|
||||
"require": "./edge.js",
|
||||
"import": "./edge.js",
|
||||
"default": "./edge.js"
|
||||
},
|
||||
"./react-native": {
|
||||
"types": "./react-native.d.ts",
|
||||
"require": "./react-native.js",
|
||||
"import": "./react-native.js",
|
||||
"default": "./react-native.js"
|
||||
},
|
||||
"./extension": {
|
||||
"types": "./extension.d.ts",
|
||||
"require": "./extension.js",
|
||||
"import": "./extension.js",
|
||||
"default": "./extension.js"
|
||||
},
|
||||
"./index-browser": {
|
||||
"types": "./index.d.ts",
|
||||
"require": "./index-browser.js",
|
||||
"import": "./index-browser.js",
|
||||
"default": "./index-browser.js"
|
||||
},
|
||||
"./index": {
|
||||
"types": "./index.d.ts",
|
||||
"require": "./index.js",
|
||||
"import": "./index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./wasm": {
|
||||
"types": "./wasm.d.ts",
|
||||
"require": "./wasm.js",
|
||||
"import": "./wasm.js",
|
||||
"default": "./wasm.js"
|
||||
},
|
||||
"./runtime/library": {
|
||||
"types": "./runtime/library.d.ts",
|
||||
"require": "./runtime/library.js",
|
||||
"import": "./runtime/library.js",
|
||||
"default": "./runtime/library.js"
|
||||
},
|
||||
"./runtime/binary": {
|
||||
"types": "./runtime/binary.d.ts",
|
||||
"require": "./runtime/binary.js",
|
||||
"import": "./runtime/binary.js",
|
||||
"default": "./runtime/binary.js"
|
||||
},
|
||||
"./generator-build": {
|
||||
"require": "./generator-build/index.js",
|
||||
"import": "./generator-build/index.js",
|
||||
"default": "./generator-build/index.js"
|
||||
},
|
||||
"./sql": {
|
||||
"require": {
|
||||
"types": "./sql.d.ts",
|
||||
"node": "./sql.js",
|
||||
"default": "./sql.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./sql.d.ts",
|
||||
"node": "./sql.mjs",
|
||||
"default": "./sql.mjs"
|
||||
},
|
||||
"default": "./sql.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"version": "5.22.0",
|
||||
"sideEffects": false
|
||||
}
|
||||
+623
@@ -0,0 +1,623 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "mysql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
// ==================== APP SETTINGS ====================
|
||||
|
||||
model AppSetting {
|
||||
id Int @id @default(autoincrement())
|
||||
key String @unique
|
||||
value String @db.Text
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== USERS & AUTH ====================
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
password String
|
||||
firstName String
|
||||
lastName String
|
||||
isActive Boolean @default(true)
|
||||
customerId Int? @unique
|
||||
customer Customer? @relation(fields: [customerId], references: [id])
|
||||
roles UserRole[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Role {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
description String?
|
||||
permissions RolePermission[]
|
||||
users UserRole[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Permission {
|
||||
id Int @id @default(autoincrement())
|
||||
resource String
|
||||
action String
|
||||
roles RolePermission[]
|
||||
|
||||
@@unique([resource, action])
|
||||
}
|
||||
|
||||
model RolePermission {
|
||||
roleId Int
|
||||
permissionId Int
|
||||
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade)
|
||||
permission Permission @relation(fields: [permissionId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([roleId, permissionId])
|
||||
}
|
||||
|
||||
model UserRole {
|
||||
userId Int
|
||||
roleId Int
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([userId, roleId])
|
||||
}
|
||||
|
||||
// ==================== CUSTOMERS ====================
|
||||
|
||||
enum CustomerType {
|
||||
PRIVATE
|
||||
BUSINESS
|
||||
}
|
||||
|
||||
model Customer {
|
||||
id Int @id @default(autoincrement())
|
||||
customerNumber String @unique
|
||||
type CustomerType @default(PRIVATE)
|
||||
salutation String?
|
||||
firstName String
|
||||
lastName String
|
||||
companyName String?
|
||||
foundingDate DateTime? // Gründungsdatum (für Firmen)
|
||||
birthDate DateTime?
|
||||
birthPlace String?
|
||||
email String?
|
||||
phone String?
|
||||
mobile String?
|
||||
taxNumber String?
|
||||
businessRegistrationPath String? // PDF-Pfad zur Gewerbeanmeldung
|
||||
commercialRegisterPath String? // PDF-Pfad zum Handelsregisterauszug
|
||||
commercialRegisterNumber String? // Handelsregisternummer (Text)
|
||||
privacyPolicyPath String? // PDF-Pfad zur Datenschutzerklärung (für alle Kunden)
|
||||
notes String? @db.Text
|
||||
|
||||
// ===== Portal-Zugangsdaten =====
|
||||
portalEnabled Boolean @default(false) // Portal aktiviert?
|
||||
portalEmail String? @unique // Portal-Login E-Mail
|
||||
portalPasswordHash String? // Gehashtes Passwort (für Login)
|
||||
portalPasswordEncrypted String? // Verschlüsseltes Passwort (für Anzeige)
|
||||
portalLastLogin DateTime? // Letzte Anmeldung
|
||||
|
||||
user User?
|
||||
addresses Address[]
|
||||
bankCards BankCard[]
|
||||
identityDocuments IdentityDocument[]
|
||||
meters Meter[]
|
||||
stressfreiEmails StressfreiEmail[]
|
||||
contracts Contract[]
|
||||
|
||||
// Vertreter-Beziehungen (Kunde kann für andere Kunden handeln)
|
||||
representingFor CustomerRepresentative[] @relation("RepresentativeCustomer")
|
||||
representedBy CustomerRepresentative[] @relation("RepresentedCustomer")
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== CUSTOMER REPRESENTATIVES ====================
|
||||
// Vertretungsbeziehung: Ein Kunde kann die Verträge eines anderen Kunden einsehen
|
||||
// z.B. Sohn (representativeId) kann Verträge der Mutter (customerId) sehen
|
||||
|
||||
model CustomerRepresentative {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int // Der Kunde, dessen Verträge eingesehen werden (z.B. Mutter)
|
||||
customer Customer @relation("RepresentedCustomer", fields: [customerId], references: [id], onDelete: Cascade)
|
||||
representativeId Int // Der Kunde, der einsehen darf (z.B. Sohn)
|
||||
representative Customer @relation("RepresentativeCustomer", fields: [representativeId], references: [id], onDelete: Cascade)
|
||||
notes String? // Notizen zur Vertretung
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([customerId, representativeId]) // Keine doppelten Einträge
|
||||
}
|
||||
|
||||
// ==================== ADDRESSES ====================
|
||||
|
||||
enum AddressType {
|
||||
DELIVERY_RESIDENCE
|
||||
BILLING
|
||||
}
|
||||
|
||||
model Address {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
type AddressType @default(DELIVERY_RESIDENCE)
|
||||
street String
|
||||
houseNumber String
|
||||
postalCode String
|
||||
city String
|
||||
country String @default("Deutschland")
|
||||
isDefault Boolean @default(false)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== BANK CARDS ====================
|
||||
|
||||
model BankCard {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
accountHolder String
|
||||
iban String
|
||||
bic String?
|
||||
bankName String?
|
||||
expiryDate DateTime?
|
||||
documentPath String? // Pfad zur hochgeladenen PDF
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== IDENTITY DOCUMENTS ====================
|
||||
|
||||
enum DocumentType {
|
||||
ID_CARD
|
||||
PASSPORT
|
||||
DRIVERS_LICENSE
|
||||
OTHER
|
||||
}
|
||||
|
||||
model IdentityDocument {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
type DocumentType @default(ID_CARD)
|
||||
documentNumber String
|
||||
issuingAuthority String?
|
||||
issueDate DateTime?
|
||||
expiryDate DateTime?
|
||||
documentPath String? // Pfad zur hochgeladenen PDF
|
||||
isActive Boolean @default(true)
|
||||
// Führerschein-spezifische Felder
|
||||
licenseClasses String? // z.B. "B, BE, AM, L" - kommasepariert
|
||||
licenseIssueDate DateTime? // Datum des Führerscheinerwerbs (Klasse B)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== EMAIL PROVIDER CONFIG (Plesk, cPanel etc.) ====================
|
||||
|
||||
enum EmailProviderType {
|
||||
PLESK
|
||||
CPANEL
|
||||
DIRECTADMIN
|
||||
}
|
||||
|
||||
model EmailProviderConfig {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique // z.B. "Plesk Hauptserver"
|
||||
type EmailProviderType
|
||||
apiUrl String // API-URL (z.B. https://server.de:8443)
|
||||
apiKey String? // API-Key (verschlüsselt)
|
||||
username String? // Benutzername für API
|
||||
passwordEncrypted String? // Passwort (verschlüsselt)
|
||||
domain String // Domain für E-Mails (z.B. stressfrei-wechseln.de)
|
||||
defaultForwardEmail String? // Standard-Weiterleitungsadresse (unsere eigene)
|
||||
isActive Boolean @default(true)
|
||||
isDefault Boolean @default(false) // Standard-Provider
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== STRESSFREI-WECHSELN EMAIL ADDRESSES ====================
|
||||
|
||||
model StressfreiEmail {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
email String // Die Weiterleitungs-E-Mail-Adresse
|
||||
platform String? // Für welche Plattform (z.B. "Freenet", "Klarmobil")
|
||||
notes String? @db.Text // Optionale Notizen
|
||||
isActive Boolean @default(true)
|
||||
isProvisioned Boolean @default(false) // Wurde bei Provider angelegt?
|
||||
provisionedAt DateTime? // Wann wurde provisioniert?
|
||||
provisionError String? @db.Text // Fehlermeldung falls Provisionierung fehlschlug
|
||||
contracts Contract[] // Verträge die diese E-Mail als Benutzername verwenden
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== METERS (Energy) ====================
|
||||
|
||||
enum MeterType {
|
||||
ELECTRICITY
|
||||
GAS
|
||||
}
|
||||
|
||||
model Meter {
|
||||
id Int @id @default(autoincrement())
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
meterNumber String
|
||||
type MeterType
|
||||
location String?
|
||||
isActive Boolean @default(true)
|
||||
readings MeterReading[]
|
||||
energyDetails EnergyContractDetails[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model MeterReading {
|
||||
id Int @id @default(autoincrement())
|
||||
meterId Int
|
||||
meter Meter @relation(fields: [meterId], references: [id], onDelete: Cascade)
|
||||
readingDate DateTime
|
||||
value Float
|
||||
unit String @default("kWh")
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
// ==================== SALES PLATFORMS ====================
|
||||
|
||||
model SalesPlatform {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
contactInfo String? @db.Text
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== CANCELLATION PERIODS ====================
|
||||
|
||||
model CancellationPeriod {
|
||||
id Int @id @default(autoincrement())
|
||||
code String @unique // z.B. "14T", "1M", "3M", "12M", "1J"
|
||||
description String // z.B. "14 Tage", "1 Monat", "3 Monate"
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== CONTRACT DURATIONS ====================
|
||||
|
||||
model ContractDuration {
|
||||
id Int @id @default(autoincrement())
|
||||
code String @unique // z.B. "12M", "24M", "1J", "2J"
|
||||
description String // z.B. "12 Monate", "24 Monate", "1 Jahr"
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== PROVIDERS (Anbieter) ====================
|
||||
|
||||
model Provider {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique // Anbietername
|
||||
portalUrl String? // Kundenkontourl (Login-Seite)
|
||||
usernameFieldName String? // Benutzernamefeld (z.B. "email", "username")
|
||||
passwordFieldName String? // Kennwortfeld (z.B. "password", "pwd")
|
||||
isActive Boolean @default(true)
|
||||
tariffs Tariff[]
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== TARIFFS (Tarife) ====================
|
||||
|
||||
model Tariff {
|
||||
id Int @id @default(autoincrement())
|
||||
providerId Int
|
||||
provider Provider @relation(fields: [providerId], references: [id], onDelete: Cascade)
|
||||
name String // Tarifname
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([providerId, name]) // Eindeutiger Tarif pro Anbieter
|
||||
}
|
||||
|
||||
// ==================== CONTRACT CATEGORIES ====================
|
||||
|
||||
model ContractCategory {
|
||||
id Int @id @default(autoincrement())
|
||||
code String @unique // Technischer Code (z.B. ELECTRICITY, GAS)
|
||||
name String // Anzeigename (z.B. Strom, Gas)
|
||||
icon String? // Icon-Name für UI (z.B. "Zap", "Flame")
|
||||
color String? // Farbe für UI (z.B. "#FFC107")
|
||||
sortOrder Int @default(0)
|
||||
isActive Boolean @default(true)
|
||||
contracts Contract[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== CONTRACTS ====================
|
||||
|
||||
// Legacy Enum - wird durch ContractCategory ersetzt
|
||||
enum ContractType {
|
||||
ELECTRICITY
|
||||
GAS
|
||||
DSL
|
||||
CABLE
|
||||
FIBER
|
||||
MOBILE
|
||||
TV
|
||||
CAR_INSURANCE
|
||||
}
|
||||
|
||||
enum ContractStatus {
|
||||
DRAFT
|
||||
PENDING
|
||||
ACTIVE
|
||||
CANCELLED
|
||||
EXPIRED
|
||||
DEACTIVATED
|
||||
}
|
||||
|
||||
model Contract {
|
||||
id Int @id @default(autoincrement())
|
||||
contractNumber String @unique
|
||||
customerId Int
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
type ContractType
|
||||
status ContractStatus @default(DRAFT)
|
||||
|
||||
// Neue konfigurierbare Kategorie (ersetzt langfristig das type-Enum)
|
||||
contractCategoryId Int?
|
||||
contractCategory ContractCategory? @relation(fields: [contractCategoryId], references: [id])
|
||||
|
||||
addressId Int?
|
||||
address Address? @relation(fields: [addressId], references: [id])
|
||||
|
||||
bankCardId Int?
|
||||
bankCard BankCard? @relation(fields: [bankCardId], references: [id])
|
||||
|
||||
identityDocumentId Int?
|
||||
identityDocument IdentityDocument? @relation(fields: [identityDocumentId], references: [id])
|
||||
|
||||
salesPlatformId Int?
|
||||
salesPlatform SalesPlatform? @relation(fields: [salesPlatformId], references: [id])
|
||||
|
||||
cancellationPeriodId Int?
|
||||
cancellationPeriod CancellationPeriod? @relation(fields: [cancellationPeriodId], references: [id])
|
||||
|
||||
contractDurationId Int?
|
||||
contractDuration ContractDuration? @relation(fields: [contractDurationId], references: [id])
|
||||
|
||||
previousContractId Int? @unique
|
||||
previousContract Contract? @relation("ContractHistory", fields: [previousContractId], references: [id])
|
||||
followUpContract Contract? @relation("ContractHistory")
|
||||
|
||||
// Anbieter & Tarif (neue Verknüpfung)
|
||||
providerId Int?
|
||||
provider Provider? @relation(fields: [providerId], references: [id])
|
||||
tariffId Int?
|
||||
tariff Tariff? @relation(fields: [tariffId], references: [id])
|
||||
|
||||
// Legacy-Felder (für Abwärtskompatibilität)
|
||||
providerName String?
|
||||
tariffName String?
|
||||
customerNumberAtProvider String?
|
||||
priceFirst12Months String? // Preis erste 12 Monate
|
||||
priceFrom13Months String? // Preis ab 13. Monat
|
||||
priceAfter24Months String? // Preis nach 24 Monaten
|
||||
|
||||
startDate DateTime?
|
||||
endDate DateTime? // Wird aus startDate + contractDuration berechnet
|
||||
commission Float?
|
||||
|
||||
// Kündigungsdokumente
|
||||
cancellationLetterPath String? // Kündigungsschreiben PDF
|
||||
cancellationConfirmationPath String? // Kündigungsbestätigung PDF
|
||||
cancellationLetterOptionsPath String? // Kündigungsschreiben Optionen PDF
|
||||
cancellationConfirmationOptionsPath String? // Kündigungsbestätigung Optionen PDF
|
||||
|
||||
// Kündigungsdaten
|
||||
cancellationConfirmationDate DateTime? // Kündigungsbestätigungsdatum
|
||||
cancellationConfirmationOptionsDate DateTime? // Kündigungsbestätigungsoptionendatum
|
||||
wasSpecialCancellation Boolean @default(false) // Wurde sondergekündigt?
|
||||
|
||||
portalUsername String?
|
||||
portalPasswordEncrypted String?
|
||||
|
||||
// Stressfrei-Wechseln E-Mail als Benutzername (Alternative zu portalUsername)
|
||||
stressfreiEmailId Int?
|
||||
stressfreiEmail StressfreiEmail? @relation(fields: [stressfreiEmailId], references: [id])
|
||||
|
||||
notes String? @db.Text
|
||||
|
||||
energyDetails EnergyContractDetails?
|
||||
internetDetails InternetContractDetails?
|
||||
mobileDetails MobileContractDetails?
|
||||
tvDetails TvContractDetails?
|
||||
carInsuranceDetails CarInsuranceDetails?
|
||||
|
||||
tasks ContractTask[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== CONTRACT TASKS ====================
|
||||
|
||||
enum ContractTaskStatus {
|
||||
OPEN
|
||||
COMPLETED
|
||||
}
|
||||
|
||||
model ContractTask {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
title String
|
||||
description String? @db.Text
|
||||
status ContractTaskStatus @default(OPEN)
|
||||
visibleInPortal Boolean @default(false)
|
||||
createdBy String? // Name des Erstellers
|
||||
completedAt DateTime?
|
||||
subtasks ContractTaskSubtask[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ContractTaskSubtask {
|
||||
id Int @id @default(autoincrement())
|
||||
taskId Int
|
||||
task ContractTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
|
||||
title String
|
||||
status ContractTaskStatus @default(OPEN)
|
||||
createdBy String?
|
||||
completedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== ENERGY CONTRACT DETAILS ====================
|
||||
|
||||
model EnergyContractDetails {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int @unique
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
meterId Int?
|
||||
meter Meter? @relation(fields: [meterId], references: [id])
|
||||
annualConsumption Float?
|
||||
basePrice Float?
|
||||
unitPrice Float?
|
||||
bonus Float?
|
||||
previousProviderName String?
|
||||
previousCustomerNumber String?
|
||||
}
|
||||
|
||||
// ==================== INTERNET CONTRACT DETAILS ====================
|
||||
|
||||
model InternetContractDetails {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int @unique
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
downloadSpeed Int?
|
||||
uploadSpeed Int?
|
||||
routerModel String?
|
||||
routerSerialNumber String?
|
||||
installationDate DateTime?
|
||||
// Internet-Zugangsdaten
|
||||
internetUsername String?
|
||||
internetPasswordEncrypted String? // Verschlüsselt gespeichert
|
||||
// Glasfaser-spezifisch
|
||||
homeId String?
|
||||
// Vodafone DSL/Kabel spezifisch
|
||||
activationCode String?
|
||||
phoneNumbers PhoneNumber[]
|
||||
}
|
||||
|
||||
model PhoneNumber {
|
||||
id Int @id @default(autoincrement())
|
||||
internetContractDetailsId Int
|
||||
internetDetails InternetContractDetails @relation(fields: [internetContractDetailsId], references: [id], onDelete: Cascade)
|
||||
phoneNumber String
|
||||
isMain Boolean @default(false)
|
||||
// SIP-Zugangsdaten
|
||||
sipUsername String?
|
||||
sipPasswordEncrypted String? // Verschlüsselt gespeichert
|
||||
sipServer String?
|
||||
}
|
||||
|
||||
// ==================== MOBILE CONTRACT DETAILS ====================
|
||||
|
||||
model MobileContractDetails {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int @unique
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
requiresMultisim Boolean @default(false) // Multisim erforderlich?
|
||||
dataVolume Float?
|
||||
includedMinutes Int?
|
||||
includedSMS Int?
|
||||
deviceModel String?
|
||||
deviceImei String?
|
||||
simCards SimCard[]
|
||||
// Legacy-Felder (für Abwärtskompatibilität, werden durch simCards ersetzt)
|
||||
phoneNumber String?
|
||||
simCardNumber String?
|
||||
}
|
||||
|
||||
model SimCard {
|
||||
id Int @id @default(autoincrement())
|
||||
mobileDetailsId Int
|
||||
mobileDetails MobileContractDetails @relation(fields: [mobileDetailsId], references: [id], onDelete: Cascade)
|
||||
phoneNumber String? // Rufnummer
|
||||
simCardNumber String? // SIM-Kartennummer
|
||||
pin String? // PIN (verschlüsselt gespeichert)
|
||||
puk String? // PUK (verschlüsselt gespeichert)
|
||||
isMultisim Boolean @default(false) // Ist dies eine Multisim-Karte?
|
||||
isMain Boolean @default(false) // Ist dies die Hauptkarte?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ==================== TV CONTRACT DETAILS ====================
|
||||
|
||||
model TvContractDetails {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int @unique
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
receiverModel String?
|
||||
smartcardNumber String?
|
||||
package String?
|
||||
}
|
||||
|
||||
// ==================== CAR INSURANCE DETAILS ====================
|
||||
|
||||
enum InsuranceType {
|
||||
LIABILITY
|
||||
PARTIAL
|
||||
FULL
|
||||
}
|
||||
|
||||
model CarInsuranceDetails {
|
||||
id Int @id @default(autoincrement())
|
||||
contractId Int @unique
|
||||
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
|
||||
licensePlate String?
|
||||
hsn String?
|
||||
tsn String?
|
||||
vin String?
|
||||
vehicleType String?
|
||||
firstRegistration DateTime?
|
||||
noClaimsClass String?
|
||||
insuranceType InsuranceType @default(LIABILITY)
|
||||
deductiblePartial Float?
|
||||
deductibleFull Float?
|
||||
policyNumber String?
|
||||
previousInsurer String?
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from "./index"
|
||||
+644
@@ -0,0 +1,644 @@
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
const {
|
||||
Decimal,
|
||||
objectEnumValues,
|
||||
makeStrictEnum,
|
||||
Public,
|
||||
getRuntime,
|
||||
skip
|
||||
} = require('@prisma/client/runtime/index-browser.js')
|
||||
|
||||
|
||||
const Prisma = {}
|
||||
|
||||
exports.Prisma = Prisma
|
||||
exports.$Enums = {}
|
||||
|
||||
/**
|
||||
* Prisma Client JS version: 5.22.0
|
||||
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
|
||||
*/
|
||||
Prisma.prismaVersion = {
|
||||
client: "5.22.0",
|
||||
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
|
||||
}
|
||||
|
||||
Prisma.PrismaClientKnownRequestError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)};
|
||||
Prisma.PrismaClientUnknownRequestError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientRustPanicError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientInitializationError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.PrismaClientValidationError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.NotFoundError = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.Decimal = Decimal
|
||||
|
||||
/**
|
||||
* Re-export of sql-template-tag
|
||||
*/
|
||||
Prisma.sql = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.empty = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.join = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.raw = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.validator = Public.validator
|
||||
|
||||
/**
|
||||
* Extensions
|
||||
*/
|
||||
Prisma.getExtensionContext = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
Prisma.defineExtension = () => {
|
||||
const runtimeName = getRuntime().prettyName;
|
||||
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||
)}
|
||||
|
||||
/**
|
||||
* Shorthand utilities for JSON filtering
|
||||
*/
|
||||
Prisma.DbNull = objectEnumValues.instances.DbNull
|
||||
Prisma.JsonNull = objectEnumValues.instances.JsonNull
|
||||
Prisma.AnyNull = objectEnumValues.instances.AnyNull
|
||||
|
||||
Prisma.NullTypes = {
|
||||
DbNull: objectEnumValues.classes.DbNull,
|
||||
JsonNull: objectEnumValues.classes.JsonNull,
|
||||
AnyNull: objectEnumValues.classes.AnyNull
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enums
|
||||
*/
|
||||
|
||||
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
|
||||
ReadUncommitted: 'ReadUncommitted',
|
||||
ReadCommitted: 'ReadCommitted',
|
||||
RepeatableRead: 'RepeatableRead',
|
||||
Serializable: 'Serializable'
|
||||
});
|
||||
|
||||
exports.Prisma.AppSettingScalarFieldEnum = {
|
||||
id: 'id',
|
||||
key: 'key',
|
||||
value: 'value',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
email: 'email',
|
||||
password: 'password',
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
isActive: 'isActive',
|
||||
customerId: 'customerId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.RoleScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.PermissionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
resource: 'resource',
|
||||
action: 'action'
|
||||
};
|
||||
|
||||
exports.Prisma.RolePermissionScalarFieldEnum = {
|
||||
roleId: 'roleId',
|
||||
permissionId: 'permissionId'
|
||||
};
|
||||
|
||||
exports.Prisma.UserRoleScalarFieldEnum = {
|
||||
userId: 'userId',
|
||||
roleId: 'roleId'
|
||||
};
|
||||
|
||||
exports.Prisma.CustomerScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerNumber: 'customerNumber',
|
||||
type: 'type',
|
||||
salutation: 'salutation',
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
companyName: 'companyName',
|
||||
foundingDate: 'foundingDate',
|
||||
birthDate: 'birthDate',
|
||||
birthPlace: 'birthPlace',
|
||||
email: 'email',
|
||||
phone: 'phone',
|
||||
mobile: 'mobile',
|
||||
taxNumber: 'taxNumber',
|
||||
businessRegistrationPath: 'businessRegistrationPath',
|
||||
commercialRegisterPath: 'commercialRegisterPath',
|
||||
commercialRegisterNumber: 'commercialRegisterNumber',
|
||||
privacyPolicyPath: 'privacyPolicyPath',
|
||||
notes: 'notes',
|
||||
portalEnabled: 'portalEnabled',
|
||||
portalEmail: 'portalEmail',
|
||||
portalPasswordHash: 'portalPasswordHash',
|
||||
portalPasswordEncrypted: 'portalPasswordEncrypted',
|
||||
portalLastLogin: 'portalLastLogin',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.CustomerRepresentativeScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
representativeId: 'representativeId',
|
||||
notes: 'notes',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.AddressScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
street: 'street',
|
||||
houseNumber: 'houseNumber',
|
||||
postalCode: 'postalCode',
|
||||
city: 'city',
|
||||
country: 'country',
|
||||
isDefault: 'isDefault',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.BankCardScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
accountHolder: 'accountHolder',
|
||||
iban: 'iban',
|
||||
bic: 'bic',
|
||||
bankName: 'bankName',
|
||||
expiryDate: 'expiryDate',
|
||||
documentPath: 'documentPath',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.IdentityDocumentScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
documentNumber: 'documentNumber',
|
||||
issuingAuthority: 'issuingAuthority',
|
||||
issueDate: 'issueDate',
|
||||
expiryDate: 'expiryDate',
|
||||
documentPath: 'documentPath',
|
||||
isActive: 'isActive',
|
||||
licenseClasses: 'licenseClasses',
|
||||
licenseIssueDate: 'licenseIssueDate',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EmailProviderConfigScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
type: 'type',
|
||||
apiUrl: 'apiUrl',
|
||||
apiKey: 'apiKey',
|
||||
username: 'username',
|
||||
passwordEncrypted: 'passwordEncrypted',
|
||||
domain: 'domain',
|
||||
defaultForwardEmail: 'defaultForwardEmail',
|
||||
isActive: 'isActive',
|
||||
isDefault: 'isDefault',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.StressfreiEmailScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
email: 'email',
|
||||
platform: 'platform',
|
||||
notes: 'notes',
|
||||
isActive: 'isActive',
|
||||
isProvisioned: 'isProvisioned',
|
||||
provisionedAt: 'provisionedAt',
|
||||
provisionError: 'provisionError',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.MeterScalarFieldEnum = {
|
||||
id: 'id',
|
||||
customerId: 'customerId',
|
||||
meterNumber: 'meterNumber',
|
||||
type: 'type',
|
||||
location: 'location',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.MeterReadingScalarFieldEnum = {
|
||||
id: 'id',
|
||||
meterId: 'meterId',
|
||||
readingDate: 'readingDate',
|
||||
value: 'value',
|
||||
unit: 'unit',
|
||||
notes: 'notes',
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.SalesPlatformScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
contactInfo: 'contactInfo',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.CancellationPeriodScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
description: 'description',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractDurationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
description: 'description',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ProviderScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
portalUrl: 'portalUrl',
|
||||
usernameFieldName: 'usernameFieldName',
|
||||
passwordFieldName: 'passwordFieldName',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.TariffScalarFieldEnum = {
|
||||
id: 'id',
|
||||
providerId: 'providerId',
|
||||
name: 'name',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractCategoryScalarFieldEnum = {
|
||||
id: 'id',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
icon: 'icon',
|
||||
color: 'color',
|
||||
sortOrder: 'sortOrder',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractNumber: 'contractNumber',
|
||||
customerId: 'customerId',
|
||||
type: 'type',
|
||||
status: 'status',
|
||||
contractCategoryId: 'contractCategoryId',
|
||||
addressId: 'addressId',
|
||||
bankCardId: 'bankCardId',
|
||||
identityDocumentId: 'identityDocumentId',
|
||||
salesPlatformId: 'salesPlatformId',
|
||||
cancellationPeriodId: 'cancellationPeriodId',
|
||||
contractDurationId: 'contractDurationId',
|
||||
previousContractId: 'previousContractId',
|
||||
providerId: 'providerId',
|
||||
tariffId: 'tariffId',
|
||||
providerName: 'providerName',
|
||||
tariffName: 'tariffName',
|
||||
customerNumberAtProvider: 'customerNumberAtProvider',
|
||||
priceFirst12Months: 'priceFirst12Months',
|
||||
priceFrom13Months: 'priceFrom13Months',
|
||||
priceAfter24Months: 'priceAfter24Months',
|
||||
startDate: 'startDate',
|
||||
endDate: 'endDate',
|
||||
commission: 'commission',
|
||||
cancellationLetterPath: 'cancellationLetterPath',
|
||||
cancellationConfirmationPath: 'cancellationConfirmationPath',
|
||||
cancellationLetterOptionsPath: 'cancellationLetterOptionsPath',
|
||||
cancellationConfirmationOptionsPath: 'cancellationConfirmationOptionsPath',
|
||||
cancellationConfirmationDate: 'cancellationConfirmationDate',
|
||||
cancellationConfirmationOptionsDate: 'cancellationConfirmationOptionsDate',
|
||||
wasSpecialCancellation: 'wasSpecialCancellation',
|
||||
portalUsername: 'portalUsername',
|
||||
portalPasswordEncrypted: 'portalPasswordEncrypted',
|
||||
stressfreiEmailId: 'stressfreiEmailId',
|
||||
notes: 'notes',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractTaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
title: 'title',
|
||||
description: 'description',
|
||||
status: 'status',
|
||||
visibleInPortal: 'visibleInPortal',
|
||||
createdBy: 'createdBy',
|
||||
completedAt: 'completedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.ContractTaskSubtaskScalarFieldEnum = {
|
||||
id: 'id',
|
||||
taskId: 'taskId',
|
||||
title: 'title',
|
||||
status: 'status',
|
||||
createdBy: 'createdBy',
|
||||
completedAt: 'completedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EnergyContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
meterId: 'meterId',
|
||||
annualConsumption: 'annualConsumption',
|
||||
basePrice: 'basePrice',
|
||||
unitPrice: 'unitPrice',
|
||||
bonus: 'bonus',
|
||||
previousProviderName: 'previousProviderName',
|
||||
previousCustomerNumber: 'previousCustomerNumber'
|
||||
};
|
||||
|
||||
exports.Prisma.InternetContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
downloadSpeed: 'downloadSpeed',
|
||||
uploadSpeed: 'uploadSpeed',
|
||||
routerModel: 'routerModel',
|
||||
routerSerialNumber: 'routerSerialNumber',
|
||||
installationDate: 'installationDate',
|
||||
internetUsername: 'internetUsername',
|
||||
internetPasswordEncrypted: 'internetPasswordEncrypted',
|
||||
homeId: 'homeId',
|
||||
activationCode: 'activationCode'
|
||||
};
|
||||
|
||||
exports.Prisma.PhoneNumberScalarFieldEnum = {
|
||||
id: 'id',
|
||||
internetContractDetailsId: 'internetContractDetailsId',
|
||||
phoneNumber: 'phoneNumber',
|
||||
isMain: 'isMain',
|
||||
sipUsername: 'sipUsername',
|
||||
sipPasswordEncrypted: 'sipPasswordEncrypted',
|
||||
sipServer: 'sipServer'
|
||||
};
|
||||
|
||||
exports.Prisma.MobileContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
requiresMultisim: 'requiresMultisim',
|
||||
dataVolume: 'dataVolume',
|
||||
includedMinutes: 'includedMinutes',
|
||||
includedSMS: 'includedSMS',
|
||||
deviceModel: 'deviceModel',
|
||||
deviceImei: 'deviceImei',
|
||||
phoneNumber: 'phoneNumber',
|
||||
simCardNumber: 'simCardNumber'
|
||||
};
|
||||
|
||||
exports.Prisma.SimCardScalarFieldEnum = {
|
||||
id: 'id',
|
||||
mobileDetailsId: 'mobileDetailsId',
|
||||
phoneNumber: 'phoneNumber',
|
||||
simCardNumber: 'simCardNumber',
|
||||
pin: 'pin',
|
||||
puk: 'puk',
|
||||
isMultisim: 'isMultisim',
|
||||
isMain: 'isMain',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
};
|
||||
|
||||
exports.Prisma.TvContractDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
receiverModel: 'receiverModel',
|
||||
smartcardNumber: 'smartcardNumber',
|
||||
package: 'package'
|
||||
};
|
||||
|
||||
exports.Prisma.CarInsuranceDetailsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
contractId: 'contractId',
|
||||
licensePlate: 'licensePlate',
|
||||
hsn: 'hsn',
|
||||
tsn: 'tsn',
|
||||
vin: 'vin',
|
||||
vehicleType: 'vehicleType',
|
||||
firstRegistration: 'firstRegistration',
|
||||
noClaimsClass: 'noClaimsClass',
|
||||
insuranceType: 'insuranceType',
|
||||
deductiblePartial: 'deductiblePartial',
|
||||
deductibleFull: 'deductibleFull',
|
||||
policyNumber: 'policyNumber',
|
||||
previousInsurer: 'previousInsurer'
|
||||
};
|
||||
|
||||
exports.Prisma.SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
};
|
||||
|
||||
exports.Prisma.NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
};
|
||||
exports.CustomerType = exports.$Enums.CustomerType = {
|
||||
PRIVATE: 'PRIVATE',
|
||||
BUSINESS: 'BUSINESS'
|
||||
};
|
||||
|
||||
exports.AddressType = exports.$Enums.AddressType = {
|
||||
DELIVERY_RESIDENCE: 'DELIVERY_RESIDENCE',
|
||||
BILLING: 'BILLING'
|
||||
};
|
||||
|
||||
exports.DocumentType = exports.$Enums.DocumentType = {
|
||||
ID_CARD: 'ID_CARD',
|
||||
PASSPORT: 'PASSPORT',
|
||||
DRIVERS_LICENSE: 'DRIVERS_LICENSE',
|
||||
OTHER: 'OTHER'
|
||||
};
|
||||
|
||||
exports.EmailProviderType = exports.$Enums.EmailProviderType = {
|
||||
PLESK: 'PLESK',
|
||||
CPANEL: 'CPANEL',
|
||||
DIRECTADMIN: 'DIRECTADMIN'
|
||||
};
|
||||
|
||||
exports.MeterType = exports.$Enums.MeterType = {
|
||||
ELECTRICITY: 'ELECTRICITY',
|
||||
GAS: 'GAS'
|
||||
};
|
||||
|
||||
exports.ContractType = exports.$Enums.ContractType = {
|
||||
ELECTRICITY: 'ELECTRICITY',
|
||||
GAS: 'GAS',
|
||||
DSL: 'DSL',
|
||||
CABLE: 'CABLE',
|
||||
FIBER: 'FIBER',
|
||||
MOBILE: 'MOBILE',
|
||||
TV: 'TV',
|
||||
CAR_INSURANCE: 'CAR_INSURANCE'
|
||||
};
|
||||
|
||||
exports.ContractStatus = exports.$Enums.ContractStatus = {
|
||||
DRAFT: 'DRAFT',
|
||||
PENDING: 'PENDING',
|
||||
ACTIVE: 'ACTIVE',
|
||||
CANCELLED: 'CANCELLED',
|
||||
EXPIRED: 'EXPIRED',
|
||||
DEACTIVATED: 'DEACTIVATED'
|
||||
};
|
||||
|
||||
exports.ContractTaskStatus = exports.$Enums.ContractTaskStatus = {
|
||||
OPEN: 'OPEN',
|
||||
COMPLETED: 'COMPLETED'
|
||||
};
|
||||
|
||||
exports.InsuranceType = exports.$Enums.InsuranceType = {
|
||||
LIABILITY: 'LIABILITY',
|
||||
PARTIAL: 'PARTIAL',
|
||||
FULL: 'FULL'
|
||||
};
|
||||
|
||||
exports.Prisma.ModelName = {
|
||||
AppSetting: 'AppSetting',
|
||||
User: 'User',
|
||||
Role: 'Role',
|
||||
Permission: 'Permission',
|
||||
RolePermission: 'RolePermission',
|
||||
UserRole: 'UserRole',
|
||||
Customer: 'Customer',
|
||||
CustomerRepresentative: 'CustomerRepresentative',
|
||||
Address: 'Address',
|
||||
BankCard: 'BankCard',
|
||||
IdentityDocument: 'IdentityDocument',
|
||||
EmailProviderConfig: 'EmailProviderConfig',
|
||||
StressfreiEmail: 'StressfreiEmail',
|
||||
Meter: 'Meter',
|
||||
MeterReading: 'MeterReading',
|
||||
SalesPlatform: 'SalesPlatform',
|
||||
CancellationPeriod: 'CancellationPeriod',
|
||||
ContractDuration: 'ContractDuration',
|
||||
Provider: 'Provider',
|
||||
Tariff: 'Tariff',
|
||||
ContractCategory: 'ContractCategory',
|
||||
Contract: 'Contract',
|
||||
ContractTask: 'ContractTask',
|
||||
ContractTaskSubtask: 'ContractTaskSubtask',
|
||||
EnergyContractDetails: 'EnergyContractDetails',
|
||||
InternetContractDetails: 'InternetContractDetails',
|
||||
PhoneNumber: 'PhoneNumber',
|
||||
MobileContractDetails: 'MobileContractDetails',
|
||||
SimCard: 'SimCard',
|
||||
TvContractDetails: 'TvContractDetails',
|
||||
CarInsuranceDetails: 'CarInsuranceDetails'
|
||||
};
|
||||
|
||||
/**
|
||||
* This is a stub Prisma Client that will error at runtime if called.
|
||||
*/
|
||||
class PrismaClient {
|
||||
constructor() {
|
||||
return new Proxy(this, {
|
||||
get(target, prop) {
|
||||
let message
|
||||
const runtime = getRuntime()
|
||||
if (runtime.isEdge) {
|
||||
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
|
||||
- Use Prisma Accelerate: https://pris.ly/d/accelerate
|
||||
- Use Driver Adapters: https://pris.ly/d/driver-adapters
|
||||
`;
|
||||
} else {
|
||||
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
|
||||
}
|
||||
|
||||
message += `
|
||||
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
|
||||
|
||||
throw new Error(message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
exports.PrismaClient = PrismaClient
|
||||
|
||||
Object.assign(exports, Prisma)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
# esbuild
|
||||
|
||||
This is the Linux 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
|
||||
BIN
Binary file not shown.
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@esbuild/linux-x64",
|
||||
"version": "0.27.2",
|
||||
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/evanw/esbuild.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"preferUnplugged": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
# Prisma Client · [](https://www.npmjs.com/package/@prisma/client) [](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) [](https://github.com/prisma/prisma/blob/main/LICENSE) [](https://pris.ly/discord)
|
||||
|
||||
Prisma Client JS is an **auto-generated query builder** that enables **type-safe** database access and **reduces boilerplate**. You can use it as an alternative to traditional ORMs such as Sequelize, TypeORM or SQL query builders like knex.js.
|
||||
|
||||
It is part of the [Prisma](https://www.prisma.io/) ecosystem. Prisma provides database tools for data access, declarative data modeling, schema migrations and visual data management. Learn more in the main [`prisma`](https://github.com/prisma/prisma/) repository or read the [documentation](https://www.prisma.io/docs/).
|
||||
|
||||
## Getting started
|
||||
|
||||
Follow one of these guides to get started with Prisma Client JS:
|
||||
|
||||
- [Quickstart](https://www.prisma.io/docs/getting-started/quickstart) (5 min)
|
||||
- [Set up a new project with Prisma (SQL migrations)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-sql) (15 min)
|
||||
- [Set up a new project with Prisma (Prisma Migrate)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate) (15 min)
|
||||
- [Add Prisma to an existing project](https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project) (15 min)
|
||||
|
||||
Alternatively you can explore the ready-to-run [examples](https://github.com/prisma/prisma-examples/) (REST, GraphQL, gRPC, plain JavaScript and TypeScript demos, ...) or watch the [demo videos](https://www.youtube.com/watch?v=0RhtQgIs-TE&list=PLn2e1F9Rfr6k9PnR_figWOcSHgc_erDr5&index=1) (1-2 min per video).
|
||||
|
||||
## Contributing
|
||||
|
||||
Refer to our [contribution guidelines](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) and [Code of Conduct for contributors](https://github.com/prisma/prisma/blob/main/CODE_OF_CONDUCT.md).
|
||||
|
||||
## Tests Status
|
||||
|
||||
- Prisma Tests Status:
|
||||
[](https://github.com/prisma/prisma/actions/workflows/test.yml)
|
||||
- Ecosystem Tests Status:
|
||||
[](https://github.com/prisma/ecosystem-tests/actions)
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/default'
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
...require('.prisma/client/default'),
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/edge'
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
// https://github.com/prisma/prisma/pull/12907
|
||||
...require('.prisma/client/edge'),
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from './scripts/default-index'
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
// https://github.com/prisma/prisma/pull/12907
|
||||
...require('./scripts/default-index'),
|
||||
}
|
||||
+10351
File diff suppressed because it is too large
Load Diff
+3
@@ -0,0 +1,3 @@
|
||||
const prisma = require('.prisma/client/index-browser')
|
||||
|
||||
module.exports = prisma
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/default'
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
// https://github.com/prisma/prisma/pull/12907
|
||||
...require('.prisma/client/default'),
|
||||
}
|
||||
+280
@@ -0,0 +1,280 @@
|
||||
{
|
||||
"name": "@prisma/client",
|
||||
"version": "5.22.0",
|
||||
"description": "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",
|
||||
"keywords": [
|
||||
"ORM",
|
||||
"Prisma",
|
||||
"prisma2",
|
||||
"Prisma Client",
|
||||
"client",
|
||||
"query",
|
||||
"query-builder",
|
||||
"database",
|
||||
"db",
|
||||
"JavaScript",
|
||||
"JS",
|
||||
"TypeScript",
|
||||
"TS",
|
||||
"SQL",
|
||||
"SQLite",
|
||||
"pg",
|
||||
"Postgres",
|
||||
"PostgreSQL",
|
||||
"CockroachDB",
|
||||
"MySQL",
|
||||
"MariaDB",
|
||||
"MSSQL",
|
||||
"SQL Server",
|
||||
"SQLServer",
|
||||
"MongoDB",
|
||||
"react-native"
|
||||
],
|
||||
"main": "default.js",
|
||||
"types": "default.d.ts",
|
||||
"browser": "index-browser.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"require": {
|
||||
"types": "./default.d.ts",
|
||||
"node": "./default.js",
|
||||
"edge-light": "./default.js",
|
||||
"workerd": "./default.js",
|
||||
"worker": "./default.js",
|
||||
"browser": "./index-browser.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./default.d.ts",
|
||||
"node": "./default.js",
|
||||
"edge-light": "./default.js",
|
||||
"workerd": "./default.js",
|
||||
"worker": "./default.js",
|
||||
"browser": "./index-browser.js"
|
||||
},
|
||||
"default": "./default.js"
|
||||
},
|
||||
"./edge": {
|
||||
"types": "./edge.d.ts",
|
||||
"require": "./edge.js",
|
||||
"import": "./edge.js",
|
||||
"default": "./edge.js"
|
||||
},
|
||||
"./react-native": {
|
||||
"types": "./react-native.d.ts",
|
||||
"require": "./react-native.js",
|
||||
"import": "./react-native.js",
|
||||
"default": "./react-native.js"
|
||||
},
|
||||
"./extension": {
|
||||
"types": "./extension.d.ts",
|
||||
"require": "./extension.js",
|
||||
"import": "./extension.js",
|
||||
"default": "./extension.js"
|
||||
},
|
||||
"./index-browser": {
|
||||
"types": "./index.d.ts",
|
||||
"require": "./index-browser.js",
|
||||
"import": "./index-browser.js",
|
||||
"default": "./index-browser.js"
|
||||
},
|
||||
"./index": {
|
||||
"types": "./index.d.ts",
|
||||
"require": "./index.js",
|
||||
"import": "./index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./wasm": {
|
||||
"types": "./wasm.d.ts",
|
||||
"require": "./wasm.js",
|
||||
"import": "./wasm.js",
|
||||
"default": "./wasm.js"
|
||||
},
|
||||
"./runtime/library": {
|
||||
"types": "./runtime/library.d.ts",
|
||||
"require": "./runtime/library.js",
|
||||
"import": "./runtime/library.js",
|
||||
"default": "./runtime/library.js"
|
||||
},
|
||||
"./runtime/binary": {
|
||||
"types": "./runtime/binary.d.ts",
|
||||
"require": "./runtime/binary.js",
|
||||
"import": "./runtime/binary.js",
|
||||
"default": "./runtime/binary.js"
|
||||
},
|
||||
"./generator-build": {
|
||||
"require": "./generator-build/index.js",
|
||||
"import": "./generator-build/index.js",
|
||||
"default": "./generator-build/index.js"
|
||||
},
|
||||
"./sql": {
|
||||
"require": {
|
||||
"types": "./sql.d.ts",
|
||||
"node": "./sql.js",
|
||||
"default": "./sql.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./sql.d.ts",
|
||||
"node": "./sql.mjs",
|
||||
"default": "./sql.mjs"
|
||||
},
|
||||
"default": "./sql.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=16.13"
|
||||
},
|
||||
"homepage": "https://www.prisma.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/prisma/prisma.git",
|
||||
"directory": "packages/client"
|
||||
},
|
||||
"author": "Tim Suchanek <suchanek@prisma.io>",
|
||||
"bugs": "https://github.com/prisma/prisma/issues",
|
||||
"files": [
|
||||
"README.md",
|
||||
"runtime",
|
||||
"!runtime/*.map",
|
||||
"scripts",
|
||||
"generator-build",
|
||||
"edge.js",
|
||||
"edge.d.ts",
|
||||
"wasm.js",
|
||||
"wasm.d.ts",
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"react-native.js",
|
||||
"react-native.d.ts",
|
||||
"default.js",
|
||||
"default.d.ts",
|
||||
"index-browser.js",
|
||||
"extension.js",
|
||||
"extension.d.ts",
|
||||
"sql.d.ts",
|
||||
"sql.js",
|
||||
"sql.mjs"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "4.20240614.0",
|
||||
"@codspeed/benchmark.js-plugin": "3.1.1",
|
||||
"@faker-js/faker": "8.4.1",
|
||||
"@fast-check/jest": "1.8.2",
|
||||
"@inquirer/prompts": "5.0.5",
|
||||
"@jest/create-cache-key-function": "29.7.0",
|
||||
"@jest/globals": "29.7.0",
|
||||
"@jest/test-sequencer": "29.7.0",
|
||||
"@libsql/client": "0.8.0",
|
||||
"@neondatabase/serverless": "0.9.3",
|
||||
"@opentelemetry/api": "1.9.0",
|
||||
"@opentelemetry/context-async-hooks": "1.25.1",
|
||||
"@opentelemetry/instrumentation": "0.52.1",
|
||||
"@opentelemetry/resources": "1.25.1",
|
||||
"@opentelemetry/sdk-trace-base": "1.25.1",
|
||||
"@opentelemetry/semantic-conventions": "1.25.1",
|
||||
"@planetscale/database": "1.18.0",
|
||||
"@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
||||
"@prisma/mini-proxy": "0.9.5",
|
||||
"@prisma/query-engine-wasm": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
||||
"@snaplet/copycat": "0.17.3",
|
||||
"@swc-node/register": "1.10.9",
|
||||
"@swc/core": "1.6.13",
|
||||
"@swc/jest": "0.2.36",
|
||||
"@timsuchanek/copy": "1.4.5",
|
||||
"@types/debug": "4.1.12",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/js-levenshtein": "1.1.3",
|
||||
"@types/mssql": "9.1.5",
|
||||
"@types/node": "18.19.31",
|
||||
"@types/pg": "8.11.6",
|
||||
"arg": "5.0.2",
|
||||
"benchmark": "2.1.4",
|
||||
"ci-info": "4.0.0",
|
||||
"decimal.js": "10.4.3",
|
||||
"detect-runtime": "1.0.4",
|
||||
"env-paths": "2.2.1",
|
||||
"esbuild": "0.23.0",
|
||||
"execa": "5.1.1",
|
||||
"expect-type": "0.19.0",
|
||||
"flat-map-polyfill": "0.3.8",
|
||||
"fs-extra": "11.1.1",
|
||||
"get-stream": "6.0.1",
|
||||
"globby": "11.1.0",
|
||||
"indent-string": "4.0.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-extended": "4.0.2",
|
||||
"jest-junit": "16.0.0",
|
||||
"jest-serializer-ansi-escapes": "3.0.0",
|
||||
"jest-snapshot": "29.7.0",
|
||||
"js-levenshtein": "1.1.6",
|
||||
"kleur": "4.1.5",
|
||||
"klona": "2.0.6",
|
||||
"mariadb": "3.3.1",
|
||||
"memfs": "4.9.3",
|
||||
"mssql": "11.0.1",
|
||||
"new-github-issue-url": "0.2.1",
|
||||
"node-fetch": "3.3.2",
|
||||
"p-retry": "4.6.2",
|
||||
"pg": "8.11.5",
|
||||
"pkg-up": "3.1.0",
|
||||
"pluralize": "8.0.0",
|
||||
"resolve": "1.22.8",
|
||||
"rimraf": "3.0.2",
|
||||
"simple-statistics": "7.8.5",
|
||||
"sort-keys": "4.2.0",
|
||||
"source-map-support": "0.5.21",
|
||||
"sql-template-tag": "5.2.1",
|
||||
"stacktrace-parser": "0.1.10",
|
||||
"strip-ansi": "6.0.1",
|
||||
"strip-indent": "3.0.0",
|
||||
"ts-node": "10.9.2",
|
||||
"ts-pattern": "5.2.0",
|
||||
"tsd": "0.31.1",
|
||||
"typescript": "5.4.5",
|
||||
"undici": "5.28.4",
|
||||
"wrangler": "3.62.0",
|
||||
"zx": "7.2.3",
|
||||
"@prisma/adapter-d1": "5.22.0",
|
||||
"@prisma/adapter-libsql": "5.22.0",
|
||||
"@prisma/adapter-neon": "5.22.0",
|
||||
"@prisma/adapter-pg": "5.22.0",
|
||||
"@prisma/adapter-planetscale": "5.22.0",
|
||||
"@prisma/driver-adapter-utils": "5.22.0",
|
||||
"@prisma/adapter-pg-worker": "5.22.0",
|
||||
"@prisma/debug": "5.22.0",
|
||||
"@prisma/engines": "5.22.0",
|
||||
"@prisma/fetch-engine": "5.22.0",
|
||||
"@prisma/generator-helper": "5.22.0",
|
||||
"@prisma/get-platform": "5.22.0",
|
||||
"@prisma/instrumentation": "5.22.0",
|
||||
"@prisma/internals": "5.22.0",
|
||||
"@prisma/migrate": "5.22.0",
|
||||
"@prisma/pg-worker": "5.22.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"prisma": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"prisma": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"dev": "DEV=true tsx helpers/build.ts",
|
||||
"build": "tsx helpers/build.ts",
|
||||
"test": "dotenv -e ../../.db.env -- jest --silent",
|
||||
"test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
|
||||
"test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
|
||||
"test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
|
||||
"test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
|
||||
"test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
|
||||
"test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",
|
||||
"generate": "node scripts/postinstall.js",
|
||||
"postinstall": "node scripts/postinstall.js",
|
||||
"new-test": "tsx ./helpers/new-test/new-test.ts"
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/react-native'
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
...require('.prisma/client/react-native'),
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from "./library"
|
||||
+210
File diff suppressed because one or more lines are too long
+31
File diff suppressed because one or more lines are too long
+31
File diff suppressed because one or more lines are too long
+365
@@ -0,0 +1,365 @@
|
||||
declare class AnyNull extends NullTypesEnumValue {
|
||||
}
|
||||
|
||||
declare type Args<T, F extends Operation> = T extends {
|
||||
[K: symbol]: {
|
||||
types: {
|
||||
operations: {
|
||||
[K in F]: {
|
||||
args: any;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
} ? T[symbol]['types']['operations'][F]['args'] : any;
|
||||
|
||||
declare class DbNull extends NullTypesEnumValue {
|
||||
}
|
||||
|
||||
export declare namespace Decimal {
|
||||
export type Constructor = typeof Decimal;
|
||||
export type Instance = Decimal;
|
||||
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
||||
export type Modulo = Rounding | 9;
|
||||
export type Value = string | number | Decimal;
|
||||
|
||||
// http://mikemcl.github.io/decimal.js/#constructor-properties
|
||||
export interface Config {
|
||||
precision?: number;
|
||||
rounding?: Rounding;
|
||||
toExpNeg?: number;
|
||||
toExpPos?: number;
|
||||
minE?: number;
|
||||
maxE?: number;
|
||||
crypto?: boolean;
|
||||
modulo?: Modulo;
|
||||
defaults?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export declare class Decimal {
|
||||
readonly d: number[];
|
||||
readonly e: number;
|
||||
readonly s: number;
|
||||
|
||||
constructor(n: Decimal.Value);
|
||||
|
||||
absoluteValue(): Decimal;
|
||||
abs(): Decimal;
|
||||
|
||||
ceil(): Decimal;
|
||||
|
||||
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||
|
||||
comparedTo(n: Decimal.Value): number;
|
||||
cmp(n: Decimal.Value): number;
|
||||
|
||||
cosine(): Decimal;
|
||||
cos(): Decimal;
|
||||
|
||||
cubeRoot(): Decimal;
|
||||
cbrt(): Decimal;
|
||||
|
||||
decimalPlaces(): number;
|
||||
dp(): number;
|
||||
|
||||
dividedBy(n: Decimal.Value): Decimal;
|
||||
div(n: Decimal.Value): Decimal;
|
||||
|
||||
dividedToIntegerBy(n: Decimal.Value): Decimal;
|
||||
divToInt(n: Decimal.Value): Decimal;
|
||||
|
||||
equals(n: Decimal.Value): boolean;
|
||||
eq(n: Decimal.Value): boolean;
|
||||
|
||||
floor(): Decimal;
|
||||
|
||||
greaterThan(n: Decimal.Value): boolean;
|
||||
gt(n: Decimal.Value): boolean;
|
||||
|
||||
greaterThanOrEqualTo(n: Decimal.Value): boolean;
|
||||
gte(n: Decimal.Value): boolean;
|
||||
|
||||
hyperbolicCosine(): Decimal;
|
||||
cosh(): Decimal;
|
||||
|
||||
hyperbolicSine(): Decimal;
|
||||
sinh(): Decimal;
|
||||
|
||||
hyperbolicTangent(): Decimal;
|
||||
tanh(): Decimal;
|
||||
|
||||
inverseCosine(): Decimal;
|
||||
acos(): Decimal;
|
||||
|
||||
inverseHyperbolicCosine(): Decimal;
|
||||
acosh(): Decimal;
|
||||
|
||||
inverseHyperbolicSine(): Decimal;
|
||||
asinh(): Decimal;
|
||||
|
||||
inverseHyperbolicTangent(): Decimal;
|
||||
atanh(): Decimal;
|
||||
|
||||
inverseSine(): Decimal;
|
||||
asin(): Decimal;
|
||||
|
||||
inverseTangent(): Decimal;
|
||||
atan(): Decimal;
|
||||
|
||||
isFinite(): boolean;
|
||||
|
||||
isInteger(): boolean;
|
||||
isInt(): boolean;
|
||||
|
||||
isNaN(): boolean;
|
||||
|
||||
isNegative(): boolean;
|
||||
isNeg(): boolean;
|
||||
|
||||
isPositive(): boolean;
|
||||
isPos(): boolean;
|
||||
|
||||
isZero(): boolean;
|
||||
|
||||
lessThan(n: Decimal.Value): boolean;
|
||||
lt(n: Decimal.Value): boolean;
|
||||
|
||||
lessThanOrEqualTo(n: Decimal.Value): boolean;
|
||||
lte(n: Decimal.Value): boolean;
|
||||
|
||||
logarithm(n?: Decimal.Value): Decimal;
|
||||
log(n?: Decimal.Value): Decimal;
|
||||
|
||||
minus(n: Decimal.Value): Decimal;
|
||||
sub(n: Decimal.Value): Decimal;
|
||||
|
||||
modulo(n: Decimal.Value): Decimal;
|
||||
mod(n: Decimal.Value): Decimal;
|
||||
|
||||
naturalExponential(): Decimal;
|
||||
exp(): Decimal;
|
||||
|
||||
naturalLogarithm(): Decimal;
|
||||
ln(): Decimal;
|
||||
|
||||
negated(): Decimal;
|
||||
neg(): Decimal;
|
||||
|
||||
plus(n: Decimal.Value): Decimal;
|
||||
add(n: Decimal.Value): Decimal;
|
||||
|
||||
precision(includeZeros?: boolean): number;
|
||||
sd(includeZeros?: boolean): number;
|
||||
|
||||
round(): Decimal;
|
||||
|
||||
sine() : Decimal;
|
||||
sin() : Decimal;
|
||||
|
||||
squareRoot(): Decimal;
|
||||
sqrt(): Decimal;
|
||||
|
||||
tangent() : Decimal;
|
||||
tan() : Decimal;
|
||||
|
||||
times(n: Decimal.Value): Decimal;
|
||||
mul(n: Decimal.Value) : Decimal;
|
||||
|
||||
toBinary(significantDigits?: number): string;
|
||||
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||
|
||||
toDecimalPlaces(decimalPlaces?: number): Decimal;
|
||||
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
||||
toDP(decimalPlaces?: number): Decimal;
|
||||
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
||||
|
||||
toExponential(decimalPlaces?: number): string;
|
||||
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
||||
|
||||
toFixed(decimalPlaces?: number): string;
|
||||
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
||||
|
||||
toFraction(max_denominator?: Decimal.Value): Decimal[];
|
||||
|
||||
toHexadecimal(significantDigits?: number): string;
|
||||
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||
toHex(significantDigits?: number): string;
|
||||
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
|
||||
|
||||
toJSON(): string;
|
||||
|
||||
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
|
||||
|
||||
toNumber(): number;
|
||||
|
||||
toOctal(significantDigits?: number): string;
|
||||
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||
|
||||
toPower(n: Decimal.Value): Decimal;
|
||||
pow(n: Decimal.Value): Decimal;
|
||||
|
||||
toPrecision(significantDigits?: number): string;
|
||||
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||
|
||||
toSignificantDigits(significantDigits?: number): Decimal;
|
||||
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
||||
toSD(significantDigits?: number): Decimal;
|
||||
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
||||
|
||||
toString(): string;
|
||||
|
||||
truncated(): Decimal;
|
||||
trunc(): Decimal;
|
||||
|
||||
valueOf(): string;
|
||||
|
||||
static abs(n: Decimal.Value): Decimal;
|
||||
static acos(n: Decimal.Value): Decimal;
|
||||
static acosh(n: Decimal.Value): Decimal;
|
||||
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||
static asin(n: Decimal.Value): Decimal;
|
||||
static asinh(n: Decimal.Value): Decimal;
|
||||
static atan(n: Decimal.Value): Decimal;
|
||||
static atanh(n: Decimal.Value): Decimal;
|
||||
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
|
||||
static cbrt(n: Decimal.Value): Decimal;
|
||||
static ceil(n: Decimal.Value): Decimal;
|
||||
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||
static clone(object?: Decimal.Config): Decimal.Constructor;
|
||||
static config(object: Decimal.Config): Decimal.Constructor;
|
||||
static cos(n: Decimal.Value): Decimal;
|
||||
static cosh(n: Decimal.Value): Decimal;
|
||||
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||
static exp(n: Decimal.Value): Decimal;
|
||||
static floor(n: Decimal.Value): Decimal;
|
||||
static hypot(...n: Decimal.Value[]): Decimal;
|
||||
static isDecimal(object: any): object is Decimal;
|
||||
static ln(n: Decimal.Value): Decimal;
|
||||
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
|
||||
static log2(n: Decimal.Value): Decimal;
|
||||
static log10(n: Decimal.Value): Decimal;
|
||||
static max(...n: Decimal.Value[]): Decimal;
|
||||
static min(...n: Decimal.Value[]): Decimal;
|
||||
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||
static noConflict(): Decimal.Constructor; // Browser only
|
||||
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
|
||||
static random(significantDigits?: number): Decimal;
|
||||
static round(n: Decimal.Value): Decimal;
|
||||
static set(object: Decimal.Config): Decimal.Constructor;
|
||||
static sign(n: Decimal.Value): number;
|
||||
static sin(n: Decimal.Value): Decimal;
|
||||
static sinh(n: Decimal.Value): Decimal;
|
||||
static sqrt(n: Decimal.Value): Decimal;
|
||||
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||
static sum(...n: Decimal.Value[]): Decimal;
|
||||
static tan(n: Decimal.Value): Decimal;
|
||||
static tanh(n: Decimal.Value): Decimal;
|
||||
static trunc(n: Decimal.Value): Decimal;
|
||||
|
||||
static readonly default?: Decimal.Constructor;
|
||||
static readonly Decimal?: Decimal.Constructor;
|
||||
|
||||
static readonly precision: number;
|
||||
static readonly rounding: Decimal.Rounding;
|
||||
static readonly toExpNeg: number;
|
||||
static readonly toExpPos: number;
|
||||
static readonly minE: number;
|
||||
static readonly maxE: number;
|
||||
static readonly crypto: boolean;
|
||||
static readonly modulo: Decimal.Modulo;
|
||||
|
||||
static readonly ROUND_UP: 0;
|
||||
static readonly ROUND_DOWN: 1;
|
||||
static readonly ROUND_CEIL: 2;
|
||||
static readonly ROUND_FLOOR: 3;
|
||||
static readonly ROUND_HALF_UP: 4;
|
||||
static readonly ROUND_HALF_DOWN: 5;
|
||||
static readonly ROUND_HALF_EVEN: 6;
|
||||
static readonly ROUND_HALF_CEIL: 7;
|
||||
static readonly ROUND_HALF_FLOOR: 8;
|
||||
static readonly EUCLID: 9;
|
||||
}
|
||||
|
||||
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
||||
[K in keyof A]: Exact<A[K], W[K]>;
|
||||
} : W) : never) | (A extends Narrowable ? A : never);
|
||||
|
||||
export declare function getRuntime(): GetRuntimeOutput;
|
||||
|
||||
declare type GetRuntimeOutput = {
|
||||
id: Runtime;
|
||||
prettyName: string;
|
||||
isEdge: boolean;
|
||||
};
|
||||
|
||||
declare class JsonNull extends NullTypesEnumValue {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates more strict variant of an enum which, unlike regular enum,
|
||||
* throws on non-existing property access. This can be useful in following situations:
|
||||
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
|
||||
* - enum values are generated dynamically from DMMF.
|
||||
*
|
||||
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
|
||||
* will result in `undefined` value being used, which will be accepted. Using strict enum
|
||||
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
|
||||
*
|
||||
* Note: if you need to check for existence of a value in the enum you can still use either
|
||||
* `in` operator or `hasOwnProperty` function.
|
||||
*
|
||||
* @param definition
|
||||
* @returns
|
||||
*/
|
||||
export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
|
||||
|
||||
declare type Narrowable = string | number | bigint | boolean | [];
|
||||
|
||||
declare class NullTypesEnumValue extends ObjectEnumValue {
|
||||
_getNamespace(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for unique values of object-valued enums.
|
||||
*/
|
||||
declare abstract class ObjectEnumValue {
|
||||
constructor(arg?: symbol);
|
||||
abstract _getNamespace(): string;
|
||||
_getName(): string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare const objectEnumValues: {
|
||||
classes: {
|
||||
DbNull: typeof DbNull;
|
||||
JsonNull: typeof JsonNull;
|
||||
AnyNull: typeof AnyNull;
|
||||
};
|
||||
instances: {
|
||||
DbNull: DbNull;
|
||||
JsonNull: JsonNull;
|
||||
AnyNull: AnyNull;
|
||||
};
|
||||
};
|
||||
|
||||
declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
|
||||
|
||||
declare namespace Public {
|
||||
export {
|
||||
validator
|
||||
}
|
||||
}
|
||||
export { Public }
|
||||
|
||||
declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown";
|
||||
|
||||
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
|
||||
|
||||
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
|
||||
|
||||
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
|
||||
|
||||
export { }
|
||||
+13
File diff suppressed because one or more lines are too long
+3403
File diff suppressed because it is too large
Load Diff
+143
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+2
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+2
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
+3403
File diff suppressed because it is too large
Load Diff
+80
File diff suppressed because one or more lines are too long
+32
File diff suppressed because one or more lines are too long
+176
@@ -0,0 +1,176 @@
|
||||
'use strict'
|
||||
|
||||
const isObject = (val) => val !== null && typeof val === 'object' && !Array.isArray(val)
|
||||
|
||||
// this is a modified version of https://github.com/chalk/ansi-regex (MIT License)
|
||||
const ANSI_REGEX =
|
||||
/* eslint-disable-next-line no-control-regex */
|
||||
/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g
|
||||
|
||||
const create = () => {
|
||||
const colors = { enabled: true, visible: true, styles: {}, keys: {} }
|
||||
|
||||
if ('FORCE_COLOR' in process.env) {
|
||||
colors.enabled = process.env.FORCE_COLOR !== '0'
|
||||
}
|
||||
|
||||
const ansi = (style) => {
|
||||
let open = (style.open = `\u001b[${style.codes[0]}m`)
|
||||
let close = (style.close = `\u001b[${style.codes[1]}m`)
|
||||
let regex = (style.regex = new RegExp(`\\u001b\\[${style.codes[1]}m`, 'g'))
|
||||
style.wrap = (input, newline) => {
|
||||
if (input.includes(close)) input = input.replace(regex, close + open)
|
||||
let output = open + input + close
|
||||
// see https://github.com/chalk/chalk/pull/92, thanks to the
|
||||
// chalk contributors for this fix. However, we've confirmed that
|
||||
// this issue is also present in Windows terminals
|
||||
return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output
|
||||
}
|
||||
return style
|
||||
}
|
||||
|
||||
const wrap = (style, input, newline) => {
|
||||
return typeof style === 'function' ? style(input) : style.wrap(input, newline)
|
||||
}
|
||||
|
||||
const style = (input, stack) => {
|
||||
if (input === '' || input == null) return ''
|
||||
if (colors.enabled === false) return input
|
||||
if (colors.visible === false) return ''
|
||||
let str = '' + input
|
||||
let nl = str.includes('\n')
|
||||
let n = stack.length
|
||||
if (n > 0 && stack.includes('unstyle')) {
|
||||
stack = [...new Set(['unstyle', ...stack])].reverse()
|
||||
}
|
||||
while (n-- > 0) str = wrap(colors.styles[stack[n]], str, nl)
|
||||
return str
|
||||
}
|
||||
|
||||
const define = (name, codes, type) => {
|
||||
colors.styles[name] = ansi({ name, codes })
|
||||
let keys = colors.keys[type] || (colors.keys[type] = [])
|
||||
keys.push(name)
|
||||
|
||||
Reflect.defineProperty(colors, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
set(value) {
|
||||
colors.alias(name, value)
|
||||
},
|
||||
get() {
|
||||
let color = (input) => style(input, color.stack)
|
||||
Reflect.setPrototypeOf(color, colors)
|
||||
color.stack = this.stack ? this.stack.concat(name) : [name]
|
||||
return color
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
define('reset', [0, 0], 'modifier')
|
||||
define('bold', [1, 22], 'modifier')
|
||||
define('dim', [2, 22], 'modifier')
|
||||
define('italic', [3, 23], 'modifier')
|
||||
define('underline', [4, 24], 'modifier')
|
||||
define('inverse', [7, 27], 'modifier')
|
||||
define('hidden', [8, 28], 'modifier')
|
||||
define('strikethrough', [9, 29], 'modifier')
|
||||
|
||||
define('black', [30, 39], 'color')
|
||||
define('red', [31, 39], 'color')
|
||||
define('green', [32, 39], 'color')
|
||||
define('yellow', [33, 39], 'color')
|
||||
define('blue', [34, 39], 'color')
|
||||
define('magenta', [35, 39], 'color')
|
||||
define('cyan', [36, 39], 'color')
|
||||
define('white', [37, 39], 'color')
|
||||
define('gray', [90, 39], 'color')
|
||||
define('grey', [90, 39], 'color')
|
||||
|
||||
define('bgBlack', [40, 49], 'bg')
|
||||
define('bgRed', [41, 49], 'bg')
|
||||
define('bgGreen', [42, 49], 'bg')
|
||||
define('bgYellow', [43, 49], 'bg')
|
||||
define('bgBlue', [44, 49], 'bg')
|
||||
define('bgMagenta', [45, 49], 'bg')
|
||||
define('bgCyan', [46, 49], 'bg')
|
||||
define('bgWhite', [47, 49], 'bg')
|
||||
|
||||
define('blackBright', [90, 39], 'bright')
|
||||
define('redBright', [91, 39], 'bright')
|
||||
define('greenBright', [92, 39], 'bright')
|
||||
define('yellowBright', [93, 39], 'bright')
|
||||
define('blueBright', [94, 39], 'bright')
|
||||
define('magentaBright', [95, 39], 'bright')
|
||||
define('cyanBright', [96, 39], 'bright')
|
||||
define('whiteBright', [97, 39], 'bright')
|
||||
|
||||
define('bgBlackBright', [100, 49], 'bgBright')
|
||||
define('bgRedBright', [101, 49], 'bgBright')
|
||||
define('bgGreenBright', [102, 49], 'bgBright')
|
||||
define('bgYellowBright', [103, 49], 'bgBright')
|
||||
define('bgBlueBright', [104, 49], 'bgBright')
|
||||
define('bgMagentaBright', [105, 49], 'bgBright')
|
||||
define('bgCyanBright', [106, 49], 'bgBright')
|
||||
define('bgWhiteBright', [107, 49], 'bgBright')
|
||||
|
||||
colors.ansiRegex = ANSI_REGEX
|
||||
colors.hasColor = colors.hasAnsi = (str) => {
|
||||
colors.ansiRegex.lastIndex = 0
|
||||
return typeof str === 'string' && str !== '' && colors.ansiRegex.test(str)
|
||||
}
|
||||
|
||||
colors.alias = (name, color) => {
|
||||
let fn = typeof color === 'string' ? colors[color] : color
|
||||
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('Expected alias to be the name of an existing color (string) or a function')
|
||||
}
|
||||
|
||||
if (!fn.stack) {
|
||||
Reflect.defineProperty(fn, 'name', { value: name })
|
||||
colors.styles[name] = fn
|
||||
fn.stack = [name]
|
||||
}
|
||||
|
||||
Reflect.defineProperty(colors, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
set(value) {
|
||||
colors.alias(name, value)
|
||||
},
|
||||
get() {
|
||||
let color = (input) => style(input, color.stack)
|
||||
Reflect.setPrototypeOf(color, colors)
|
||||
color.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack
|
||||
return color
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
colors.theme = (custom) => {
|
||||
if (!isObject(custom)) throw new TypeError('Expected theme to be an object')
|
||||
for (let name of Object.keys(custom)) {
|
||||
colors.alias(name, custom[name])
|
||||
}
|
||||
return colors
|
||||
}
|
||||
|
||||
colors.alias('unstyle', (str) => {
|
||||
if (typeof str === 'string' && str !== '') {
|
||||
colors.ansiRegex.lastIndex = 0
|
||||
return str.replace(colors.ansiRegex, '')
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
colors.alias('noop', (str) => str)
|
||||
colors.none = colors.clear = colors.noop
|
||||
|
||||
colors.stripColor = colors.unstyle
|
||||
colors.define = define
|
||||
return colors
|
||||
}
|
||||
|
||||
module.exports = create()
|
||||
module.exports.create = create
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class PrismaClient {
|
||||
constructor() {
|
||||
throw new Error(
|
||||
'@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export { PrismaClient }
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import * as runtime from '@prisma/client/runtime/library'
|
||||
|
||||
/**
|
||||
* ## Prisma Client ʲˢ
|
||||
*
|
||||
* Type-safe database client for TypeScript & Node.js
|
||||
* @example
|
||||
* ```
|
||||
* const prisma = new Prisma()
|
||||
* // Fetch zero or more Users
|
||||
* const users = await prisma.user.findMany()
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
|
||||
*/
|
||||
export declare const PrismaClient: any
|
||||
|
||||
/**
|
||||
* ## Prisma Client ʲˢ
|
||||
*
|
||||
* Type-safe database client for TypeScript & Node.js
|
||||
* @example
|
||||
* ```
|
||||
* const prisma = new Prisma()
|
||||
* // Fetch zero or more Users
|
||||
* const users = await prisma.user.findMany()
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client).
|
||||
*/
|
||||
export declare type PrismaClient = any
|
||||
|
||||
export declare class PrismaClientExtends<
|
||||
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs,
|
||||
> {
|
||||
$extends: { extArgs: ExtArgs } & (<
|
||||
R extends runtime.Types.Extensions.UserArgs['result'] = {},
|
||||
M extends runtime.Types.Extensions.UserArgs['model'] = {},
|
||||
Q extends runtime.Types.Extensions.UserArgs['query'] = {},
|
||||
C extends runtime.Types.Extensions.UserArgs['client'] = {},
|
||||
Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs<R, M, {}, C>,
|
||||
>(
|
||||
args:
|
||||
| ((client: PrismaClientExtends<ExtArgs>) => { $extends: { extArgs: Args } })
|
||||
| { name?: string }
|
||||
| { result?: R & runtime.Types.Extensions.UserArgs['result'] }
|
||||
| { model?: M & runtime.Types.Extensions.UserArgs['model'] }
|
||||
| { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
|
||||
| { client?: C & runtime.Types.Extensions.UserArgs['client'] },
|
||||
) => PrismaClientExtends<Args & ExtArgs> & Args['client'])
|
||||
|
||||
$transaction<R>(
|
||||
fn: (prisma: Omit<this, runtime.ITXClientDenyList>) => Promise<R>,
|
||||
options?: { maxWait?: number; timeout?: number; isolationLevel?: string },
|
||||
): Promise<R>
|
||||
$transaction<P extends Prisma.PrismaPromise<any>[]>(
|
||||
arg: [...P],
|
||||
options?: { isolationLevel?: string },
|
||||
): Promise<runtime.Types.Utils.UnwrapTuple<P>>
|
||||
}
|
||||
|
||||
export declare const dmmf: any
|
||||
export declare type dmmf = any
|
||||
|
||||
/**
|
||||
* Get the type of the value, that the Promise holds.
|
||||
*/
|
||||
export declare type PromiseType<T extends PromiseLike<any>> = T extends PromiseLike<infer U> ? U : T
|
||||
|
||||
/**
|
||||
* Get the return type of a function which returns a Promise.
|
||||
*/
|
||||
export declare type PromiseReturnType<T extends (...args: any) => Promise<any>> = PromiseType<ReturnType<T>>
|
||||
|
||||
export namespace Prisma {
|
||||
export type TransactionClient = any
|
||||
|
||||
export function defineExtension<
|
||||
R extends runtime.Types.Extensions.UserArgs['result'] = {},
|
||||
M extends runtime.Types.Extensions.UserArgs['model'] = {},
|
||||
Q extends runtime.Types.Extensions.UserArgs['query'] = {},
|
||||
C extends runtime.Types.Extensions.UserArgs['client'] = {},
|
||||
Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs<R, M, {}, C>,
|
||||
>(
|
||||
args:
|
||||
| ((client: PrismaClientExtends) => { $extends: { extArgs: Args } })
|
||||
| { name?: string }
|
||||
| { result?: R & runtime.Types.Extensions.UserArgs['result'] }
|
||||
| { model?: M & runtime.Types.Extensions.UserArgs['model'] }
|
||||
| { query?: Q & runtime.Types.Extensions.UserArgs['query'] }
|
||||
| { client?: C & runtime.Types.Extensions.UserArgs['client'] },
|
||||
): (client: any) => PrismaClientExtends<Args>
|
||||
|
||||
export type Extension = runtime.Types.Extensions.UserArgs
|
||||
export import getExtensionContext = runtime.Extensions.getExtensionContext
|
||||
export import Args = runtime.Types.Public.Args
|
||||
export import Payload = runtime.Types.Public.Payload
|
||||
export import Result = runtime.Types.Public.Result
|
||||
export import Exact = runtime.Types.Public.Exact
|
||||
export import PrismaPromise = runtime.Types.Public.PrismaPromise
|
||||
|
||||
export const prismaVersion: {
|
||||
client: string
|
||||
engine: string
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/scripts/default-index.ts
|
||||
var default_index_exports = {};
|
||||
__export(default_index_exports, {
|
||||
Prisma: () => Prisma,
|
||||
PrismaClient: () => PrismaClient,
|
||||
default: () => default_index_default
|
||||
});
|
||||
module.exports = __toCommonJS(default_index_exports);
|
||||
|
||||
// ../../node_modules/.pnpm/@prisma+engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2/node_modules/@prisma/engines-version/package.json
|
||||
var prisma = {
|
||||
enginesVersion: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
|
||||
};
|
||||
|
||||
// package.json
|
||||
var version = "5.22.0";
|
||||
|
||||
// src/runtime/utils/clientVersion.ts
|
||||
var clientVersion = version;
|
||||
|
||||
// src/scripts/default-index.ts
|
||||
var PrismaClient = class {
|
||||
constructor() {
|
||||
throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
|
||||
}
|
||||
};
|
||||
function defineExtension(ext) {
|
||||
if (typeof ext === "function") {
|
||||
return ext;
|
||||
}
|
||||
return (client) => client.$extends(ext);
|
||||
}
|
||||
function getExtensionContext(that) {
|
||||
return that;
|
||||
}
|
||||
var Prisma = {
|
||||
defineExtension,
|
||||
getExtensionContext,
|
||||
prismaVersion: { client: clientVersion, engine: prisma.enginesVersion }
|
||||
};
|
||||
var default_index_default = { Prisma };
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Prisma,
|
||||
PrismaClient
|
||||
});
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export function getPostInstallTrigger(): string
|
||||
export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__EMPTY_STRING
|
||||
export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING
|
||||
export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR
|
||||
export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR
|
||||
+410
@@ -0,0 +1,410 @@
|
||||
// @ts-check
|
||||
const childProcess = require('child_process')
|
||||
const { promisify } = require('util')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const c = require('./colors')
|
||||
|
||||
const exec = promisify(childProcess.exec)
|
||||
|
||||
function debug(message, ...optionalParams) {
|
||||
if (process.env.DEBUG && process.env.DEBUG === 'prisma:postinstall') {
|
||||
console.log(message, ...optionalParams)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Adds `package.json` to the end of a path if it doesn't already exist'
|
||||
* @param {string} pth
|
||||
*/
|
||||
function addPackageJSON(pth) {
|
||||
if (pth.endsWith('package.json')) return pth
|
||||
return path.join(pth, 'package.json')
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up for a `package.json` which is not `@prisma/cli` or `prisma` and returns the directory of the package
|
||||
* @param {string | null} startPath - Path to Start At
|
||||
* @param {number} limit - Find Up limit
|
||||
* @returns {string | null}
|
||||
*/
|
||||
function findPackageRoot(startPath, limit = 10) {
|
||||
if (!startPath || !fs.existsSync(startPath)) return null
|
||||
let currentPath = startPath
|
||||
// Limit traversal
|
||||
for (let i = 0; i < limit; i++) {
|
||||
const pkgPath = addPackageJSON(currentPath)
|
||||
if (fs.existsSync(pkgPath)) {
|
||||
try {
|
||||
const pkg = require(pkgPath)
|
||||
if (pkg.name && !['@prisma/cli', 'prisma'].includes(pkg.name)) {
|
||||
return pkgPath.replace('package.json', '')
|
||||
}
|
||||
} catch {} // eslint-disable-line no-empty
|
||||
}
|
||||
currentPath = path.join(currentPath, '../')
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* The `postinstall` hook of client sets up the ground and env vars for the `prisma generate` command,
|
||||
* and runs it, showing a warning if the schema is not found.
|
||||
* - initializes the ./node_modules/.prisma/client folder with the default index(-browser).js/index.d.ts,
|
||||
* which define a `PrismaClient` class stub that throws an error if instantiated before the `prisma generate`
|
||||
* command is successfully executed.
|
||||
* - sets the path of the root of the project (TODO: to verify) to the `process.env.PRISMA_GENERATE_IN_POSTINSTALL`
|
||||
* variable, or `'true'` if the project root cannot be found.
|
||||
* - runs `prisma generate`, passing through additional information about the command that triggered the generation,
|
||||
* which is useful for debugging/telemetry. It tries to use the local `prisma` package if it is installed, otherwise it
|
||||
* falls back to the global `prisma` package. If neither options are available, it warns the user to install `prisma` first.
|
||||
*/
|
||||
async function main() {
|
||||
if (process.env.INIT_CWD) {
|
||||
process.chdir(process.env.INIT_CWD) // necessary, because npm chooses __dirname as process.cwd()
|
||||
// in the postinstall hook
|
||||
}
|
||||
|
||||
await createDefaultGeneratedThrowFiles()
|
||||
|
||||
// TODO: consider using the `which` package
|
||||
const localPath = getLocalPackagePath()
|
||||
|
||||
// Only execute if !localpath
|
||||
const installedGlobally = localPath ? undefined : await isInstalledGlobally()
|
||||
|
||||
// this is needed, so we can find the correct schemas in yarn workspace projects
|
||||
const root = findPackageRoot(localPath)
|
||||
|
||||
process.env.PRISMA_GENERATE_IN_POSTINSTALL = root ? root : 'true'
|
||||
|
||||
debug({
|
||||
localPath,
|
||||
installedGlobally,
|
||||
init_cwd: process.env.INIT_CWD,
|
||||
PRISMA_GENERATE_IN_POSTINSTALL: process.env.PRISMA_GENERATE_IN_POSTINSTALL,
|
||||
})
|
||||
try {
|
||||
if (localPath) {
|
||||
await run('node', [localPath, 'generate', '--postinstall', doubleQuote(getPostInstallTrigger())])
|
||||
return
|
||||
}
|
||||
if (installedGlobally) {
|
||||
await run('prisma', ['generate', '--postinstall', doubleQuote(getPostInstallTrigger())])
|
||||
return
|
||||
}
|
||||
} catch (e) {
|
||||
// if exit code = 1 do not print
|
||||
if (e && e !== 1) {
|
||||
console.error(e)
|
||||
}
|
||||
debug(e)
|
||||
}
|
||||
|
||||
if (!localPath && !installedGlobally) {
|
||||
console.error(
|
||||
`${c.yellow(
|
||||
'warning',
|
||||
)} In order to use "@prisma/client", please install Prisma CLI. You can install it with "npm add -D prisma".`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function getLocalPackagePath() {
|
||||
try {
|
||||
const packagePath = require.resolve('prisma/package.json')
|
||||
if (packagePath) {
|
||||
return require.resolve('prisma')
|
||||
}
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
// TODO: consider removing this
|
||||
try {
|
||||
const packagePath = require.resolve('@prisma/cli/package.json')
|
||||
if (packagePath) {
|
||||
return require.resolve('@prisma/cli')
|
||||
}
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
async function isInstalledGlobally() {
|
||||
try {
|
||||
const result = await exec('prisma -v')
|
||||
if (result.stdout.includes('@prisma/client')) {
|
||||
return true
|
||||
} else {
|
||||
console.error(`${c.yellow('warning')} You still have the ${c.bold('prisma')} cli (Prisma 1) installed globally.
|
||||
Please uninstall it with either ${c.green('npm remove -g prisma')} or ${c.green('yarn global remove prisma')}.`)
|
||||
}
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (!process.env.PRISMA_SKIP_POSTINSTALL_GENERATE) {
|
||||
main()
|
||||
.catch((e) => {
|
||||
if (e.stderr) {
|
||||
if (e.stderr.includes(`Can't find schema.prisma`)) {
|
||||
console.error(
|
||||
`${c.yellow('warning')} @prisma/client needs a ${c.bold('schema.prisma')} to function, but couldn't find it.
|
||||
Please either create one manually or use ${c.bold('prisma init')}.
|
||||
Once you created it, run ${c.bold('prisma generate')}.
|
||||
To keep Prisma related things separate, we recommend creating it in a subfolder called ${c.underline(
|
||||
'./prisma',
|
||||
)} like so: ${c.underline('./prisma/schema.prisma')}\n`,
|
||||
)
|
||||
} else {
|
||||
console.error(e.stderr)
|
||||
}
|
||||
} else {
|
||||
console.error(e)
|
||||
}
|
||||
process.exit(0)
|
||||
})
|
||||
.finally(() => {
|
||||
debug(`postinstall trigger: ${getPostInstallTrigger()}`)
|
||||
})
|
||||
}
|
||||
|
||||
function run(cmd, params, cwd = process.cwd()) {
|
||||
const child = childProcess.spawn(cmd, params, {
|
||||
stdio: ['pipe', 'inherit', 'inherit'],
|
||||
cwd,
|
||||
})
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
child.on('close', () => {
|
||||
resolve(undefined)
|
||||
})
|
||||
child.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
resolve(undefined)
|
||||
} else {
|
||||
reject(code)
|
||||
}
|
||||
})
|
||||
child.on('error', () => {
|
||||
reject()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies our default "throw" files into the default generation folder. These
|
||||
* files are dummy and informative because they just throw an error to let the
|
||||
* user know that they have forgotten to run `prisma generate` or that they
|
||||
* don't have a a schema file yet. We only add these files at the default
|
||||
* location `node_modules/.prisma/client`.
|
||||
*/
|
||||
async function createDefaultGeneratedThrowFiles() {
|
||||
try {
|
||||
const dotPrismaClientDir = path.join(__dirname, '../../../.prisma/client')
|
||||
const denoPrismaClientDir = path.join(__dirname, '../../../.prisma/client/deno')
|
||||
|
||||
await makeDir(dotPrismaClientDir)
|
||||
await makeDir(denoPrismaClientDir)
|
||||
|
||||
const defaultFileConfig = {
|
||||
js: path.join(__dirname, 'default-index.js'),
|
||||
ts: path.join(__dirname, 'default-index.d.ts'),
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Record<string, { js?: string; ts?: string } | undefined>}
|
||||
*/
|
||||
const defaultFiles = {
|
||||
index: defaultFileConfig,
|
||||
edge: defaultFileConfig,
|
||||
default: defaultFileConfig,
|
||||
wasm: defaultFileConfig,
|
||||
'index-browser': {
|
||||
js: path.join(__dirname, 'default-index.js'),
|
||||
ts: undefined,
|
||||
},
|
||||
'deno/edge': {
|
||||
js: undefined,
|
||||
ts: path.join(__dirname, 'default-deno-edge.ts'),
|
||||
},
|
||||
}
|
||||
|
||||
for (const file of Object.keys(defaultFiles)) {
|
||||
const { js, ts } = defaultFiles[file] ?? {}
|
||||
const dotPrismaJsFilePath = path.join(dotPrismaClientDir, `${file}.js`)
|
||||
const dotPrismaTsFilePath = path.join(dotPrismaClientDir, `${file}.d.ts`)
|
||||
|
||||
if (js && !fs.existsSync(dotPrismaJsFilePath) && fs.existsSync(js)) {
|
||||
await fs.promises.copyFile(js, dotPrismaJsFilePath)
|
||||
}
|
||||
|
||||
if (ts && !fs.existsSync(dotPrismaTsFilePath) && fs.existsSync(ts)) {
|
||||
await fs.promises.copyFile(ts, dotPrismaTsFilePath)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: can this be replaced some utility eg. mkdir
|
||||
function makeDir(input) {
|
||||
const make = async (pth) => {
|
||||
try {
|
||||
await fs.promises.mkdir(pth)
|
||||
|
||||
return pth
|
||||
} catch (error) {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw new Error(`operation not permitted, mkdir '${pth}'`)
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error
|
||||
}
|
||||
|
||||
await make(path.dirname(pth))
|
||||
|
||||
return make(pth)
|
||||
}
|
||||
|
||||
try {
|
||||
const stats = await fs.promises.stat(pth)
|
||||
if (!stats.isDirectory()) {
|
||||
throw new Error('The path is not a directory')
|
||||
}
|
||||
} catch (_) {
|
||||
throw error
|
||||
}
|
||||
|
||||
return pth
|
||||
}
|
||||
}
|
||||
|
||||
return make(path.resolve(input))
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command that triggered this postinstall script being run. If there is
|
||||
* an error while attempting to get this value then the string constant
|
||||
* 'ERROR_WHILE_FINDING_POSTINSTALL_TRIGGER' is returned.
|
||||
* This information is just necessary for telemetry.
|
||||
* This is passed to `prisma generate` as a string like `--postinstall value`.
|
||||
*/
|
||||
function getPostInstallTrigger() {
|
||||
/*
|
||||
npm_config_argv` is not officially documented so here are our research notes
|
||||
|
||||
`npm_config_argv` is available to the postinstall script when the containing package has been installed by npm into some project.
|
||||
|
||||
An example of its value:
|
||||
|
||||
```
|
||||
npm_config_argv: '{"remain":["../test"],"cooked":["add","../test"],"original":["add","../test"]}',
|
||||
```
|
||||
|
||||
We are interesting in the data contained in the "original" field.
|
||||
|
||||
Trivia/Note: `npm_config_argv` is not available when running e.g. `npm install` on the containing package itself (e.g. when working on it)
|
||||
|
||||
Yarn mimics this data and environment variable. Here is an example following `yarn add` for the same package:
|
||||
|
||||
```
|
||||
npm_config_argv: '{"remain":[],"cooked":["add"],"original":["add","../test"]}'
|
||||
```
|
||||
|
||||
Other package managers like `pnpm` have not been tested.
|
||||
*/
|
||||
|
||||
const maybe_npm_config_argv_string = process.env.npm_config_argv
|
||||
|
||||
if (maybe_npm_config_argv_string === undefined) {
|
||||
return UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING
|
||||
}
|
||||
|
||||
let npm_config_argv
|
||||
try {
|
||||
npm_config_argv = JSON.parse(maybe_npm_config_argv_string)
|
||||
} catch (e) {
|
||||
return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR}: ${maybe_npm_config_argv_string}`
|
||||
}
|
||||
|
||||
if (typeof npm_config_argv !== 'object' || npm_config_argv === null) {
|
||||
return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}`
|
||||
}
|
||||
|
||||
const npm_config_argv_original_arr = npm_config_argv.original
|
||||
|
||||
if (!Array.isArray(npm_config_argv_original_arr)) {
|
||||
return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}`
|
||||
}
|
||||
|
||||
const npm_config_argv_original = npm_config_argv_original_arr.filter((arg) => arg !== '').join(' ')
|
||||
|
||||
const command =
|
||||
npm_config_argv_original === ''
|
||||
? getPackageManagerName()
|
||||
: [getPackageManagerName(), npm_config_argv_original].join(' ')
|
||||
|
||||
return command
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap double quotes around the given string.
|
||||
*/
|
||||
function doubleQuote(x) {
|
||||
return `"${x}"`
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the package manager name currently being used. If parsing fails, then the following pattern is returned:
|
||||
* UNKNOWN_NPM_CONFIG_USER_AGENT(<string received>).
|
||||
*/
|
||||
function getPackageManagerName() {
|
||||
const userAgent = process.env.npm_config_user_agent
|
||||
if (!userAgent) return 'MISSING_NPM_CONFIG_USER_AGENT'
|
||||
|
||||
const name = parsePackageManagerName(userAgent)
|
||||
if (!name) return `UNKNOWN_NPM_CONFIG_USER_AGENT(${userAgent})`
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse package manager name from useragent. If parsing fails, `null` is returned.
|
||||
*/
|
||||
function parsePackageManagerName(userAgent) {
|
||||
let packageManager = null
|
||||
|
||||
// example: 'yarn/1.22.4 npm/? node/v13.11.0 darwin x64'
|
||||
// References:
|
||||
// - https://pnpm.io/only-allow-pnpm
|
||||
// - https://github.com/cameronhunter/npm-config-user-agent-parser
|
||||
if (userAgent) {
|
||||
const matchResult = userAgent.match(/^([^/]+)\/.+/)
|
||||
if (matchResult) {
|
||||
packageManager = matchResult[1].trim()
|
||||
}
|
||||
}
|
||||
|
||||
return packageManager
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING'
|
||||
// prettier-ignore
|
||||
const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR'
|
||||
// prettier-ignore
|
||||
const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR'
|
||||
|
||||
// expose for testing
|
||||
|
||||
exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING
|
||||
exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR
|
||||
exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR
|
||||
exports.getPostInstallTrigger = getPostInstallTrigger
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/sql'
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
...require('.prisma/client/sql'),
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '../../.prisma/client/sql/index.mjs'
|
||||
+1
@@ -0,0 +1 @@
|
||||
export * from '.prisma/client/wasm'
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
// https://github.com/prisma/prisma/pull/12907
|
||||
...require('.prisma/client/wasm'),
|
||||
}
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# @prisma/debug
|
||||
|
||||
A cached [`debug`](https://github.com/visionmedia/debug/).
|
||||
|
||||
---
|
||||
|
||||
⚠️ **Warning**: This package is intended for Prisma's internal use.
|
||||
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
|
||||
|
||||
If you are using this package, it would be helpful if you could help us gain an understanding where, how and why you are using it. Your feedback will be valuable to us to define a better API. Please share this information at https://github.com/prisma/prisma/discussions/13877 - Thanks!
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import Debug, { getLogs } from '@prisma/debug'
|
||||
|
||||
const debug = Debug('my-namespace')
|
||||
|
||||
try {
|
||||
debug('hello')
|
||||
debug(process.env)
|
||||
throw new Error('oops')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(`We just crashed. But no worries, here are the debug logs:`)
|
||||
// get 10 last lines of debug logs
|
||||
console.error(getLogs(10))
|
||||
}
|
||||
```
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Create a new debug instance with the given namespace.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import Debug from '@prisma/debug'
|
||||
* const debug = Debug('prisma:client')
|
||||
* debug('Hello World')
|
||||
* ```
|
||||
*/
|
||||
declare function debugCreate(namespace: string): ((...args: any[]) => void) & {
|
||||
color: string;
|
||||
enabled: boolean;
|
||||
namespace: string;
|
||||
log: (...args: string[]) => void;
|
||||
extend: () => void;
|
||||
};
|
||||
declare const Debug: typeof debugCreate & {
|
||||
enable(namespace: any): void;
|
||||
disable(): any;
|
||||
enabled(namespace: string): boolean;
|
||||
log: (...args: string[]) => void;
|
||||
formatters: {};
|
||||
};
|
||||
/**
|
||||
* We can get the logs for all the last {@link MAX_ARGS_HISTORY} ${@link debugCall} that
|
||||
* have happened in the different packages. Useful to generate error report links.
|
||||
* @see https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
|
||||
* @param numChars
|
||||
* @returns
|
||||
*/
|
||||
export declare function getLogs(numChars?: number): string;
|
||||
export declare function clearLogs(): void;
|
||||
export { Debug };
|
||||
export default Debug;
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
Debug: () => Debug,
|
||||
clearLogs: () => clearLogs,
|
||||
default: () => src_default,
|
||||
getLogs: () => getLogs
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
|
||||
var colors_exports = {};
|
||||
__export(colors_exports, {
|
||||
$: () => $,
|
||||
bgBlack: () => bgBlack,
|
||||
bgBlue: () => bgBlue,
|
||||
bgCyan: () => bgCyan,
|
||||
bgGreen: () => bgGreen,
|
||||
bgMagenta: () => bgMagenta,
|
||||
bgRed: () => bgRed,
|
||||
bgWhite: () => bgWhite,
|
||||
bgYellow: () => bgYellow,
|
||||
black: () => black,
|
||||
blue: () => blue,
|
||||
bold: () => bold,
|
||||
cyan: () => cyan,
|
||||
dim: () => dim,
|
||||
gray: () => gray,
|
||||
green: () => green,
|
||||
grey: () => grey,
|
||||
hidden: () => hidden,
|
||||
inverse: () => inverse,
|
||||
italic: () => italic,
|
||||
magenta: () => magenta,
|
||||
red: () => red,
|
||||
reset: () => reset,
|
||||
strikethrough: () => strikethrough,
|
||||
underline: () => underline,
|
||||
white: () => white,
|
||||
yellow: () => yellow
|
||||
});
|
||||
var FORCE_COLOR;
|
||||
var NODE_DISABLE_COLORS;
|
||||
var NO_COLOR;
|
||||
var TERM;
|
||||
var isTTY = true;
|
||||
if (typeof process !== "undefined") {
|
||||
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
|
||||
isTTY = process.stdout && process.stdout.isTTY;
|
||||
}
|
||||
var $ = {
|
||||
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
|
||||
};
|
||||
function init(x, y) {
|
||||
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
||||
let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
|
||||
return function(txt) {
|
||||
if (!$.enabled || txt == null) return txt;
|
||||
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
||||
};
|
||||
}
|
||||
var reset = init(0, 0);
|
||||
var bold = init(1, 22);
|
||||
var dim = init(2, 22);
|
||||
var italic = init(3, 23);
|
||||
var underline = init(4, 24);
|
||||
var inverse = init(7, 27);
|
||||
var hidden = init(8, 28);
|
||||
var strikethrough = init(9, 29);
|
||||
var black = init(30, 39);
|
||||
var red = init(31, 39);
|
||||
var green = init(32, 39);
|
||||
var yellow = init(33, 39);
|
||||
var blue = init(34, 39);
|
||||
var magenta = init(35, 39);
|
||||
var cyan = init(36, 39);
|
||||
var white = init(37, 39);
|
||||
var gray = init(90, 39);
|
||||
var grey = init(90, 39);
|
||||
var bgBlack = init(40, 49);
|
||||
var bgRed = init(41, 49);
|
||||
var bgGreen = init(42, 49);
|
||||
var bgYellow = init(43, 49);
|
||||
var bgBlue = init(44, 49);
|
||||
var bgMagenta = init(45, 49);
|
||||
var bgCyan = init(46, 49);
|
||||
var bgWhite = init(47, 49);
|
||||
|
||||
// src/index.ts
|
||||
var MAX_ARGS_HISTORY = 100;
|
||||
var COLORS = ["green", "yellow", "blue", "magenta", "cyan", "red"];
|
||||
var argsHistory = [];
|
||||
var lastTimestamp = Date.now();
|
||||
var lastColor = 0;
|
||||
var processEnv = typeof process !== "undefined" ? process.env : {};
|
||||
globalThis.DEBUG ??= processEnv.DEBUG ?? "";
|
||||
globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
|
||||
var topProps = {
|
||||
enable(namespace) {
|
||||
if (typeof namespace === "string") {
|
||||
globalThis.DEBUG = namespace;
|
||||
}
|
||||
},
|
||||
disable() {
|
||||
const prev = globalThis.DEBUG;
|
||||
globalThis.DEBUG = "";
|
||||
return prev;
|
||||
},
|
||||
// this is the core logic to check if logging should happen or not
|
||||
enabled(namespace) {
|
||||
const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => {
|
||||
return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
||||
});
|
||||
const isListened = listenedNamespaces.some((listenedNamespace) => {
|
||||
if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
|
||||
return namespace.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
|
||||
});
|
||||
const isExcluded = listenedNamespaces.some((listenedNamespace) => {
|
||||
if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
|
||||
return namespace.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
|
||||
});
|
||||
return isListened && !isExcluded;
|
||||
},
|
||||
log: (...args) => {
|
||||
const [namespace, format, ...rest] = args;
|
||||
const logWithFormatting = console.warn ?? console.log;
|
||||
logWithFormatting(`${namespace} ${format}`, ...rest);
|
||||
},
|
||||
formatters: {}
|
||||
// not implemented
|
||||
};
|
||||
function debugCreate(namespace) {
|
||||
const instanceProps = {
|
||||
color: COLORS[lastColor++ % COLORS.length],
|
||||
enabled: topProps.enabled(namespace),
|
||||
namespace,
|
||||
log: topProps.log,
|
||||
extend: () => {
|
||||
}
|
||||
// not implemented
|
||||
};
|
||||
const debugCall = (...args) => {
|
||||
const { enabled, namespace: namespace2, color, log } = instanceProps;
|
||||
if (args.length !== 0) {
|
||||
argsHistory.push([namespace2, ...args]);
|
||||
}
|
||||
if (argsHistory.length > MAX_ARGS_HISTORY) {
|
||||
argsHistory.shift();
|
||||
}
|
||||
if (topProps.enabled(namespace2) || enabled) {
|
||||
const stringArgs = args.map((arg) => {
|
||||
if (typeof arg === "string") {
|
||||
return arg;
|
||||
}
|
||||
return safeStringify(arg);
|
||||
});
|
||||
const ms = `+${Date.now() - lastTimestamp}ms`;
|
||||
lastTimestamp = Date.now();
|
||||
if (globalThis.DEBUG_COLORS) {
|
||||
log(colors_exports[color](bold(namespace2)), ...stringArgs, colors_exports[color](ms));
|
||||
} else {
|
||||
log(namespace2, ...stringArgs, ms);
|
||||
}
|
||||
}
|
||||
};
|
||||
return new Proxy(debugCall, {
|
||||
get: (_, prop) => instanceProps[prop],
|
||||
set: (_, prop, value) => instanceProps[prop] = value
|
||||
});
|
||||
}
|
||||
var Debug = new Proxy(debugCreate, {
|
||||
get: (_, prop) => topProps[prop],
|
||||
set: (_, prop, value) => topProps[prop] = value
|
||||
});
|
||||
function safeStringify(value, indent = 2) {
|
||||
const cache = /* @__PURE__ */ new Set();
|
||||
return JSON.stringify(
|
||||
value,
|
||||
(key, value2) => {
|
||||
if (typeof value2 === "object" && value2 !== null) {
|
||||
if (cache.has(value2)) {
|
||||
return `[Circular *]`;
|
||||
}
|
||||
cache.add(value2);
|
||||
} else if (typeof value2 === "bigint") {
|
||||
return value2.toString();
|
||||
}
|
||||
return value2;
|
||||
},
|
||||
indent
|
||||
);
|
||||
}
|
||||
function getLogs(numChars = 7500) {
|
||||
const logs = argsHistory.map(([namespace, ...args]) => {
|
||||
return `${namespace} ${args.map((arg) => {
|
||||
if (typeof arg === "string") {
|
||||
return arg;
|
||||
} else {
|
||||
return JSON.stringify(arg);
|
||||
}
|
||||
}).join(" ")}`;
|
||||
}).join("\n");
|
||||
if (logs.length < numChars) {
|
||||
return logs;
|
||||
}
|
||||
return logs.slice(-numChars);
|
||||
}
|
||||
function clearLogs() {
|
||||
argsHistory.length = 0;
|
||||
}
|
||||
var src_default = Debug;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Debug,
|
||||
clearLogs,
|
||||
getLogs
|
||||
});
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export declare function removeISODate(str: string): string;
|
||||
export declare function sanitizeTestLogs(str: string): string;
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
|
||||
var require_ansi_regex = __commonJS({
|
||||
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports2, module2) {
|
||||
"use strict";
|
||||
module2.exports = ({ onlyFirst = false } = {}) => {
|
||||
const pattern = [
|
||||
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
||||
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
||||
].join("|");
|
||||
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
||||
var require_strip_ansi = __commonJS({
|
||||
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var ansiRegex = require_ansi_regex();
|
||||
module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
|
||||
}
|
||||
});
|
||||
|
||||
// src/util.ts
|
||||
var util_exports = {};
|
||||
__export(util_exports, {
|
||||
removeISODate: () => removeISODate,
|
||||
sanitizeTestLogs: () => sanitizeTestLogs
|
||||
});
|
||||
module.exports = __toCommonJS(util_exports);
|
||||
var import_strip_ansi = __toESM(require_strip_ansi());
|
||||
function removeISODate(str) {
|
||||
return str.replace(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/gim, "");
|
||||
}
|
||||
function sanitizeTestLogs(str) {
|
||||
return (0, import_strip_ansi.default)(str).split("\n").map((l) => removeISODate(l.replace(/\+\d+ms$/, "")).trim()).join("\n");
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
removeISODate,
|
||||
sanitizeTestLogs
|
||||
});
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@prisma/debug",
|
||||
"version": "5.22.0",
|
||||
"description": "This package is intended for Prisma's internal use",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Tim Suchanek <suchanek@prisma.io>",
|
||||
"homepage": "https://www.prisma.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/prisma/prisma.git",
|
||||
"directory": "packages/debug"
|
||||
},
|
||||
"bugs": "https://github.com/prisma/prisma/issues",
|
||||
"devDependencies": {
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/node": "18.19.31",
|
||||
"esbuild": "0.23.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-junit": "16.0.0",
|
||||
"strip-ansi": "6.0.1",
|
||||
"kleur": "4.1.5",
|
||||
"typescript": "5.4.5"
|
||||
},
|
||||
"files": [
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"dev": "DEV=true tsx helpers/build.ts",
|
||||
"build": "tsx helpers/build.ts",
|
||||
"test": "jest"
|
||||
}
|
||||
}
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# `@prisma/engines-version`
|
||||
|
||||
This package exports the Prisma Engines version to be downloaded from Prisma CDN.
|
||||
|
||||
⚠️ **Warning**: This package is intended for Prisma's internal use.
|
||||
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
|
||||
|
||||
See its companion, [`@prisma/engines` npm package](https://www.npmjs.com/package/@prisma/engines).
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare const enginesVersion: string;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.enginesVersion = void 0;
|
||||
exports.enginesVersion = require('./package.json').prisma.enginesVersion;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@prisma/engines-version",
|
||||
"version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Tim Suchanek <suchanek@prisma.io>",
|
||||
"prisma": {
|
||||
"enginesVersion": "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/prisma/engines-wrapper.git",
|
||||
"directory": "packages/engines-version"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.19.34",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -d"
|
||||
}
|
||||
}
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# `@prisma/engines`
|
||||
|
||||
⚠️ **Warning**: This package is intended for Prisma's internal use.
|
||||
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
|
||||
|
||||
The postinstall hook of this package downloads all Prisma engines available for the current platform, namely the Query Engine and the Schema Engine from the Prisma CDN.
|
||||
|
||||
The engines version to be downloaded is directly determined by the version of its `@prisma/engines-version` dependency.
|
||||
|
||||
You should probably not use this package directly, but instead use one of these:
|
||||
|
||||
- [`prisma` CLI](https://www.npmjs.com/package/prisma)
|
||||
- [`@prisma/client`](https://www.npmjs.com/package/@prisma/client)
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { BinaryType as BinaryType_2 } from '@prisma/fetch-engine';
|
||||
import { enginesVersion } from '@prisma/engines-version';
|
||||
|
||||
export declare const DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = BinaryType.QueryEngineLibrary;
|
||||
|
||||
export { enginesVersion }
|
||||
|
||||
export declare function ensureBinariesExist(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Checks if the env override `PRISMA_CLI_QUERY_ENGINE_TYPE` is set to `library` or `binary`
|
||||
* Otherwise returns the default
|
||||
*/
|
||||
export declare function getCliQueryEngineBinaryType(): BinaryType_2;
|
||||
|
||||
export declare function getEnginesPath(): string;
|
||||
|
||||
export { }
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE: () => DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
|
||||
enginesVersion: () => import_engines_version2.enginesVersion,
|
||||
ensureBinariesExist: () => ensureBinariesExist,
|
||||
getCliQueryEngineBinaryType: () => getCliQueryEngineBinaryType,
|
||||
getEnginesPath: () => getEnginesPath
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
var import_debug = __toESM(require("@prisma/debug"));
|
||||
var import_engines_version = require("@prisma/engines-version");
|
||||
var import_fetch_engine = require("@prisma/fetch-engine");
|
||||
var import_path = __toESM(require("path"));
|
||||
var import_engines_version2 = require("@prisma/engines-version");
|
||||
var debug = (0, import_debug.default)("prisma:engines");
|
||||
function getEnginesPath() {
|
||||
return import_path.default.join(__dirname, "../");
|
||||
}
|
||||
var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
|
||||
function getCliQueryEngineBinaryType() {
|
||||
const envCliQueryEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE;
|
||||
if (envCliQueryEngineType) {
|
||||
if (envCliQueryEngineType === "binary") {
|
||||
return import_fetch_engine.BinaryType.QueryEngineBinary;
|
||||
}
|
||||
if (envCliQueryEngineType === "library") {
|
||||
return import_fetch_engine.BinaryType.QueryEngineLibrary;
|
||||
}
|
||||
}
|
||||
return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
|
||||
}
|
||||
async function ensureBinariesExist() {
|
||||
const binaryDir = import_path.default.join(__dirname, "../");
|
||||
let binaryTargets;
|
||||
if (process.env.PRISMA_CLI_BINARY_TARGETS) {
|
||||
binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS.split(",");
|
||||
}
|
||||
const cliQueryEngineBinaryType = getCliQueryEngineBinaryType();
|
||||
const binaries = {
|
||||
[cliQueryEngineBinaryType]: binaryDir,
|
||||
[import_fetch_engine.BinaryType.SchemaEngineBinary]: binaryDir
|
||||
};
|
||||
debug(`binaries to download ${Object.keys(binaries).join(", ")}`);
|
||||
await (0, import_fetch_engine.download)({
|
||||
binaries,
|
||||
showProgress: true,
|
||||
version: import_engines_version.enginesVersion,
|
||||
failSilent: false,
|
||||
binaryTargets
|
||||
});
|
||||
}
|
||||
import_path.default.join(__dirname, "../query-engine-darwin");
|
||||
import_path.default.join(__dirname, "../query-engine-darwin-arm64");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-1.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-1.1.x");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-3.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-linux-static-x64");
|
||||
import_path.default.join(__dirname, "../query-engine-linux-static-arm64");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.1.x");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-3.0.x");
|
||||
import_path.default.join(__dirname, "../libquery_engine-darwin.dylib.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-darwin-arm64.dylib.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-musl.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-musl-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../query_engine-windows.dll.node");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE,
|
||||
enginesVersion,
|
||||
ensureBinariesExist,
|
||||
getCliQueryEngineBinaryType,
|
||||
getEnginesPath
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2048
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// src/scripts/postinstall.ts
|
||||
var import_debug2 = __toESM(require("@prisma/debug"));
|
||||
var import_engines_version3 = require("@prisma/engines-version");
|
||||
var import_fetch_engine2 = require("@prisma/fetch-engine");
|
||||
var import_fs = __toESM(require("fs"));
|
||||
var import_path2 = __toESM(require("path"));
|
||||
|
||||
// src/index.ts
|
||||
var import_debug = __toESM(require("@prisma/debug"));
|
||||
var import_engines_version = require("@prisma/engines-version");
|
||||
var import_fetch_engine = require("@prisma/fetch-engine");
|
||||
var import_path = __toESM(require("path"));
|
||||
var import_engines_version2 = require("@prisma/engines-version");
|
||||
var debug = (0, import_debug.default)("prisma:engines");
|
||||
var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = import_fetch_engine.BinaryType.QueryEngineLibrary;
|
||||
function getCliQueryEngineBinaryType() {
|
||||
const envCliQueryEngineType = process.env.PRISMA_CLI_QUERY_ENGINE_TYPE;
|
||||
if (envCliQueryEngineType) {
|
||||
if (envCliQueryEngineType === "binary") {
|
||||
return import_fetch_engine.BinaryType.QueryEngineBinary;
|
||||
}
|
||||
if (envCliQueryEngineType === "library") {
|
||||
return import_fetch_engine.BinaryType.QueryEngineLibrary;
|
||||
}
|
||||
}
|
||||
return DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE;
|
||||
}
|
||||
import_path.default.join(__dirname, "../query-engine-darwin");
|
||||
import_path.default.join(__dirname, "../query-engine-darwin-arm64");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-1.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-1.1.x");
|
||||
import_path.default.join(__dirname, "../query-engine-debian-openssl-3.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-linux-static-x64");
|
||||
import_path.default.join(__dirname, "../query-engine-linux-static-arm64");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.0.x");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.1.x");
|
||||
import_path.default.join(__dirname, "../query-engine-rhel-openssl-3.0.x");
|
||||
import_path.default.join(__dirname, "../libquery_engine-darwin.dylib.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-darwin-arm64.dylib.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-debian-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-musl.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-linux-musl-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.1.x.so.node");
|
||||
import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-3.0.x.so.node");
|
||||
import_path.default.join(__dirname, "../query_engine-windows.dll.node");
|
||||
|
||||
// src/scripts/postinstall.ts
|
||||
var debug2 = (0, import_debug2.default)("prisma:download");
|
||||
var baseDir = import_path2.default.join(__dirname, "../../");
|
||||
var lockFile = import_path2.default.join(baseDir, "download-lock");
|
||||
var createdLockFile = false;
|
||||
async function main() {
|
||||
if (import_fs.default.existsSync(lockFile) && parseInt(import_fs.default.readFileSync(lockFile, "utf-8"), 10) > Date.now() - 2e4) {
|
||||
debug2(`Lock file already exists, so we're skipping the download of the prisma binaries`);
|
||||
} else {
|
||||
createLockFile();
|
||||
let binaryTargets;
|
||||
if (process.env.PRISMA_CLI_BINARY_TARGETS) {
|
||||
binaryTargets = process.env.PRISMA_CLI_BINARY_TARGETS.split(",");
|
||||
}
|
||||
const cliQueryEngineBinaryType = getCliQueryEngineBinaryType();
|
||||
const binaries = {
|
||||
[cliQueryEngineBinaryType]: baseDir,
|
||||
[import_fetch_engine2.BinaryType.SchemaEngineBinary]: baseDir
|
||||
};
|
||||
await (0, import_fetch_engine2.download)({
|
||||
binaries,
|
||||
version: import_engines_version3.enginesVersion,
|
||||
showProgress: true,
|
||||
failSilent: true,
|
||||
binaryTargets
|
||||
}).catch((e) => debug2(e));
|
||||
cleanupLockFile();
|
||||
}
|
||||
}
|
||||
function createLockFile() {
|
||||
createdLockFile = true;
|
||||
import_fs.default.writeFileSync(lockFile, Date.now().toString());
|
||||
}
|
||||
function cleanupLockFile() {
|
||||
if (createdLockFile) {
|
||||
try {
|
||||
if (import_fs.default.existsSync(lockFile)) {
|
||||
import_fs.default.unlinkSync(lockFile);
|
||||
}
|
||||
} catch (e) {
|
||||
debug2(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
main().catch((e) => debug2(e));
|
||||
process.on("beforeExit", () => {
|
||||
cleanupLockFile();
|
||||
});
|
||||
process.once("SIGINT", () => {
|
||||
cleanupLockFile();
|
||||
process.exit();
|
||||
});
|
||||
Generated
Vendored
Executable
BIN
Binary file not shown.
+41
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@prisma/engines",
|
||||
"version": "5.22.0",
|
||||
"description": "This package is intended for Prisma's internal use",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/prisma/prisma.git",
|
||||
"directory": "packages/engines"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"author": "Tim Suchanek <suchanek@prisma.io>",
|
||||
"devDependencies": {
|
||||
"@swc/core": "1.6.13",
|
||||
"@swc/jest": "0.2.36",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/node": "18.19.31",
|
||||
"execa": "5.1.1",
|
||||
"jest": "29.7.0",
|
||||
"typescript": "5.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
||||
"@prisma/debug": "5.22.0",
|
||||
"@prisma/fetch-engine": "5.22.0",
|
||||
"@prisma/get-platform": "5.22.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"download",
|
||||
"scripts"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"dev": "DEV=true tsx helpers/build.ts",
|
||||
"build": "tsx helpers/build.ts",
|
||||
"test": "jest --passWithNoTests",
|
||||
"postinstall": "node scripts/postinstall.js"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
Executable
BIN
Binary file not shown.
+28
@@ -0,0 +1,28 @@
|
||||
const path = require('path')
|
||||
|
||||
const postInstallScriptPath = path.join(__dirname, '..', 'dist', 'scripts', 'postinstall.js')
|
||||
const localInstallScriptPath = path.join(__dirname, '..', 'dist', 'scripts', 'localinstall.js')
|
||||
|
||||
try {
|
||||
// that's when we develop in the monorepo, `dist` does not exist yet
|
||||
// so we compile postinstall script and trigger it immediately after
|
||||
if (require('../package.json').version === '0.0.0') {
|
||||
const execa = require('execa')
|
||||
const buildScriptPath = path.join(__dirname, '..', 'helpers', 'build.ts')
|
||||
|
||||
execa.sync('pnpm', ['tsx', buildScriptPath], {
|
||||
// for the sake of simplicity, we IGNORE_EXTERNALS in our own setup
|
||||
// ie. when the monorepo installs, the postinstall is self-contained
|
||||
env: { DEV: true, IGNORE_EXTERNALS: true },
|
||||
stdio: 'inherit',
|
||||
})
|
||||
|
||||
// if enabled, it will install engine overrides into the cache dir
|
||||
execa.sync('node', [localInstallScriptPath], {
|
||||
stdio: 'inherit',
|
||||
})
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// that's the normal path, when users get this package ready/installed
|
||||
require(postInstallScriptPath)
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# @prisma/fetch-engine
|
||||
|
||||
Responsible for downloading and caching the latest Rust binary
|
||||
|
||||
⚠️ **Warning**: This package is intended for Prisma's internal use.
|
||||
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
|
||||
|
||||
If you are using this package, it would be helpful if you could help us gain an understanding where, how and why you are using it. Your feedback will be valuable to us to define a better API. Please share this information at https://github.com/prisma/prisma/discussions/13877 - Thanks!
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export declare enum BinaryType {
|
||||
QueryEngineBinary = "query-engine",
|
||||
QueryEngineLibrary = "libquery-engine",
|
||||
SchemaEngineBinary = "schema-engine"
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var BinaryType_exports = {};
|
||||
__export(BinaryType_exports, {
|
||||
BinaryType: () => import_chunk_X37PZICB.BinaryType
|
||||
});
|
||||
module.exports = __toCommonJS(BinaryType_exports);
|
||||
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
|
||||
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function chmodPlusX(file: string): void;
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var chmodPlusX_exports = {};
|
||||
__export(chmodPlusX_exports, {
|
||||
chmodPlusX: () => import_chunk_MX3HXAU2.chmodPlusX
|
||||
});
|
||||
module.exports = __toCommonJS(chmodPlusX_exports);
|
||||
var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
|
||||
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
|
||||
+2385
File diff suppressed because it is too large
Load Diff
+161
@@ -0,0 +1,161 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var chunk_4LX3XBNY_exports = {};
|
||||
__export(chunk_4LX3XBNY_exports, {
|
||||
getBar: () => getBar
|
||||
});
|
||||
module.exports = __toCommonJS(chunk_4LX3XBNY_exports);
|
||||
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
|
||||
var require_node_progress = (0, import_chunk_AH6QHEOA.__commonJS)({
|
||||
"../../node_modules/.pnpm/progress@2.0.3/node_modules/progress/lib/node-progress.js"(exports, module2) {
|
||||
"use strict";
|
||||
exports = module2.exports = ProgressBar;
|
||||
function ProgressBar(fmt, options) {
|
||||
this.stream = options.stream || process.stderr;
|
||||
if (typeof options == "number") {
|
||||
var total = options;
|
||||
options = {};
|
||||
options.total = total;
|
||||
} else {
|
||||
options = options || {};
|
||||
if ("string" != typeof fmt) throw new Error("format required");
|
||||
if ("number" != typeof options.total) throw new Error("total required");
|
||||
}
|
||||
this.fmt = fmt;
|
||||
this.curr = options.curr || 0;
|
||||
this.total = options.total;
|
||||
this.width = options.width || this.total;
|
||||
this.clear = options.clear;
|
||||
this.chars = {
|
||||
complete: options.complete || "=",
|
||||
incomplete: options.incomplete || "-",
|
||||
head: options.head || (options.complete || "=")
|
||||
};
|
||||
this.renderThrottle = options.renderThrottle !== 0 ? options.renderThrottle || 16 : 0;
|
||||
this.lastRender = -Infinity;
|
||||
this.callback = options.callback || function() {
|
||||
};
|
||||
this.tokens = {};
|
||||
this.lastDraw = "";
|
||||
}
|
||||
ProgressBar.prototype.tick = function(len, tokens) {
|
||||
if (len !== 0)
|
||||
len = len || 1;
|
||||
if ("object" == typeof len) tokens = len, len = 1;
|
||||
if (tokens) this.tokens = tokens;
|
||||
if (0 == this.curr) this.start = /* @__PURE__ */ new Date();
|
||||
this.curr += len;
|
||||
this.render();
|
||||
if (this.curr >= this.total) {
|
||||
this.render(void 0, true);
|
||||
this.complete = true;
|
||||
this.terminate();
|
||||
this.callback(this);
|
||||
return;
|
||||
}
|
||||
};
|
||||
ProgressBar.prototype.render = function(tokens, force) {
|
||||
force = force !== void 0 ? force : false;
|
||||
if (tokens) this.tokens = tokens;
|
||||
if (!this.stream.isTTY) return;
|
||||
var now = Date.now();
|
||||
var delta = now - this.lastRender;
|
||||
if (!force && delta < this.renderThrottle) {
|
||||
return;
|
||||
} else {
|
||||
this.lastRender = now;
|
||||
}
|
||||
var ratio = this.curr / this.total;
|
||||
ratio = Math.min(Math.max(ratio, 0), 1);
|
||||
var percent = Math.floor(ratio * 100);
|
||||
var incomplete, complete, completeLength;
|
||||
var elapsed = /* @__PURE__ */ new Date() - this.start;
|
||||
var eta = percent == 100 ? 0 : elapsed * (this.total / this.curr - 1);
|
||||
var rate = this.curr / (elapsed / 1e3);
|
||||
var str = this.fmt.replace(":current", this.curr).replace(":total", this.total).replace(":elapsed", isNaN(elapsed) ? "0.0" : (elapsed / 1e3).toFixed(1)).replace(":eta", isNaN(eta) || !isFinite(eta) ? "0.0" : (eta / 1e3).toFixed(1)).replace(":percent", percent.toFixed(0) + "%").replace(":rate", Math.round(rate));
|
||||
var availableSpace = Math.max(0, this.stream.columns - str.replace(":bar", "").length);
|
||||
if (availableSpace && process.platform === "win32") {
|
||||
availableSpace = availableSpace - 1;
|
||||
}
|
||||
var width = Math.min(this.width, availableSpace);
|
||||
completeLength = Math.round(width * ratio);
|
||||
complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete);
|
||||
incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete);
|
||||
if (completeLength > 0)
|
||||
complete = complete.slice(0, -1) + this.chars.head;
|
||||
str = str.replace(":bar", complete + incomplete);
|
||||
if (this.tokens) for (var key in this.tokens) str = str.replace(":" + key, this.tokens[key]);
|
||||
if (this.lastDraw !== str) {
|
||||
this.stream.cursorTo(0);
|
||||
this.stream.write(str);
|
||||
this.stream.clearLine(1);
|
||||
this.lastDraw = str;
|
||||
}
|
||||
};
|
||||
ProgressBar.prototype.update = function(ratio, tokens) {
|
||||
var goal = Math.floor(ratio * this.total);
|
||||
var delta = goal - this.curr;
|
||||
this.tick(delta, tokens);
|
||||
};
|
||||
ProgressBar.prototype.interrupt = function(message) {
|
||||
this.stream.clearLine();
|
||||
this.stream.cursorTo(0);
|
||||
this.stream.write(message);
|
||||
this.stream.write("\n");
|
||||
this.stream.write(this.lastDraw);
|
||||
};
|
||||
ProgressBar.prototype.terminate = function() {
|
||||
if (this.clear) {
|
||||
if (this.stream.clearLine) {
|
||||
this.stream.clearLine();
|
||||
this.stream.cursorTo(0);
|
||||
}
|
||||
} else {
|
||||
this.stream.write("\n");
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
var require_progress = (0, import_chunk_AH6QHEOA.__commonJS)({
|
||||
"../../node_modules/.pnpm/progress@2.0.3/node_modules/progress/index.js"(exports, module2) {
|
||||
"use strict";
|
||||
module2.exports = require_node_progress();
|
||||
}
|
||||
});
|
||||
var import_progress = (0, import_chunk_AH6QHEOA.__toESM)(require_progress());
|
||||
function getBar(text) {
|
||||
return new import_progress.default(`> ${text} [:bar] :percent`, {
|
||||
stream: process.stdout,
|
||||
width: 20,
|
||||
complete: "=",
|
||||
incomplete: " ",
|
||||
total: 100,
|
||||
head: "",
|
||||
clear: true
|
||||
});
|
||||
}
|
||||
/*! Bundled license information:
|
||||
|
||||
progress/lib/node-progress.js:
|
||||
(*!
|
||||
* node-progress
|
||||
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
* MIT Licensed
|
||||
*)
|
||||
*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user