@vulog/aima-document 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js ADDED
@@ -0,0 +1,112 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ // Indicates the location of the TypeScript configuration file
5
+ project: 'tsconfig.json',
6
+ // Sets the root directory for the TypeScript configuration
7
+ tsconfigRootDir: __dirname,
8
+ // Specifies the version of ECMAScript syntax to be used
9
+ ecmaVersion: 'latest',
10
+ // Indicates the type of source code (script or module)
11
+ sourceType: 'module',
12
+ },
13
+ plugins: ['@typescript-eslint', 'prettier', 'import'],
14
+ extends: [
15
+ 'airbnb-base',
16
+ 'airbnb-typescript/base',
17
+ 'plugin:@typescript-eslint/recommended',
18
+ 'prettier',
19
+ 'plugin:prettier/recommended',
20
+ ],
21
+ root: true,
22
+ env: {
23
+ es6: true,
24
+ node: true,
25
+ },
26
+ ignorePatterns: [
27
+ '/dist/**/*', // Ignore built files.
28
+ '.eslintrc.js',
29
+ '**/*.test.ts',
30
+ ],
31
+ rules: {
32
+ // Configures the Prettier integration with ESLint
33
+ 'prettier/prettier': ['error', { endOfLine: 'auto' }],
34
+ // Disables the rule requiring an 'I' prefix for interfaces
35
+ '@typescript-eslint/interface-name-prefix': 'off',
36
+ // Configures the naming conventions for various code constructs
37
+ '@typescript-eslint/naming-convention': [
38
+ // ... various naming convention configurations ...
39
+ 'error',
40
+ // Allows any naming format for destructured variables
41
+ {
42
+ selector: 'variable',
43
+ modifiers: ['destructured'],
44
+ format: null,
45
+ },
46
+ // Requires strict camelCase for function names
47
+ {
48
+ selector: 'function',
49
+ format: ['strictCamelCase'],
50
+ },
51
+ // Requires boolean variables to have one of the specified prefixes
52
+ {
53
+ selector: 'variable',
54
+ format: null,
55
+ types: ['boolean'],
56
+ prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
57
+ },
58
+ // Requires enum names to have a strict PascalCase format
59
+ {
60
+ selector: 'enum',
61
+ format: ['StrictPascalCase'],
62
+ },
63
+ ],
64
+ 'import/extensions': 'off',
65
+ // Disables the rule requiring explicit return types for functions
66
+ '@typescript-eslint/explicit-function-return-type': 'off',
67
+ // Disables the rule requiring explicit boundary types for modules
68
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
69
+ // Disables the rule prohibiting the use of 'any' type
70
+ '@typescript-eslint/no-explicit-any': 'off',
71
+ // Disables the rule detecting unused variables
72
+ 'no-unused-vars': 0,
73
+ // Disables the rule disallowing named exports used as a default export
74
+ 'import/no-named-as-default': 0,
75
+ // Configures the order and formatting of import statements
76
+ 'import/order': [
77
+ // ... import order configuration ...
78
+ 'error',
79
+ {
80
+ // Configure the alphabetization settings
81
+ alphabetize: {
82
+ // Enforce ascending alphabetical order
83
+ order: 'asc',
84
+ // Do not ignore the case while sorting
85
+ caseInsensitive: false,
86
+ },
87
+ // Enforce newlines between different groups and inside groups of imports
88
+ 'newlines-between': 'always-and-inside-groups',
89
+ // Warn when there is an import statement that is not part of any group
90
+ warnOnUnassignedImports: true,
91
+ },
92
+ ],
93
+ // Configures the rule detecting extraneous dependencies
94
+ 'import/no-extraneous-dependencies': [
95
+ // ... extraneous dependencies configuration ...
96
+ 'error',
97
+ {
98
+ // Specify the file patterns where devDependencies imports are allowed
99
+ devDependencies: [
100
+ // Allow devDependencies imports in test and spec files
101
+ '**/*.test.{ts,js}',
102
+ '**/*.spec.{ts,js}',
103
+ // Allow devDependencies imports in the 'test' folder
104
+ './test/**.{ts,js}',
105
+ // Allow devDependencies imports in the 'scripts' folder
106
+ './scripts/**/*.{ts,js}',
107
+ ],
108
+ },
109
+ ],
110
+ 'import/prefer-default-export': 'off',
111
+ },
112
+ };
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @vulog/aima-pricing
@@ -0,0 +1,57 @@
1
+ import { Client } from '@vulog/aima-client';
2
+
3
+ type DocumentType = {
4
+ id: number;
5
+ fleetId: string;
6
+ type: string;
7
+ name: string;
8
+ mandatory: boolean;
9
+ hasNumber: boolean;
10
+ hasExpirationDate: boolean;
11
+ numberUploadUrl: number;
12
+ hasIssuingCountry: boolean;
13
+ hasIssuingOffice: boolean;
14
+ hasIssuingDate: boolean;
15
+ hasDlClass: boolean;
16
+ };
17
+ type FileUrl = {
18
+ id: number;
19
+ url: string;
20
+ name: string;
21
+ };
22
+ type DocumentFull = {
23
+ id: number;
24
+ fleetId: string;
25
+ userId: string;
26
+ documentType: DocumentType;
27
+ documentNumber?: string;
28
+ expirationDate?: string;
29
+ files: FileUrl[];
30
+ uploadUrls: FileUrl[];
31
+ status: string;
32
+ reviewer?: string;
33
+ issuingCountry?: 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW';
34
+ issuingOffice: string;
35
+ issuingDate: string;
36
+ dlClass: string;
37
+ };
38
+ type DocumentByService = {
39
+ serviceId: string;
40
+ areMandatoryPresent: boolean;
41
+ mandatoryDocumentTypeId: number[];
42
+ };
43
+ type DocumentByFranchise = {
44
+ fleetId: string;
45
+ serviceId: string;
46
+ mandatoryDocumentTypeId: number[];
47
+ };
48
+ type DocumentSummary = {
49
+ documentTypes: DocumentType[];
50
+ documents: DocumentFull[];
51
+ documentByService: DocumentByService[];
52
+ documentByFranchise: DocumentByFranchise[] | null;
53
+ };
54
+
55
+ declare const getUserDocuments: (client: Client, userId: string) => Promise<DocumentSummary>;
56
+
57
+ export { type DocumentByFranchise, type DocumentByService, type DocumentFull, type DocumentSummary, type DocumentType, type FileUrl, getUserDocuments };
@@ -0,0 +1,57 @@
1
+ import { Client } from '@vulog/aima-client';
2
+
3
+ type DocumentType = {
4
+ id: number;
5
+ fleetId: string;
6
+ type: string;
7
+ name: string;
8
+ mandatory: boolean;
9
+ hasNumber: boolean;
10
+ hasExpirationDate: boolean;
11
+ numberUploadUrl: number;
12
+ hasIssuingCountry: boolean;
13
+ hasIssuingOffice: boolean;
14
+ hasIssuingDate: boolean;
15
+ hasDlClass: boolean;
16
+ };
17
+ type FileUrl = {
18
+ id: number;
19
+ url: string;
20
+ name: string;
21
+ };
22
+ type DocumentFull = {
23
+ id: number;
24
+ fleetId: string;
25
+ userId: string;
26
+ documentType: DocumentType;
27
+ documentNumber?: string;
28
+ expirationDate?: string;
29
+ files: FileUrl[];
30
+ uploadUrls: FileUrl[];
31
+ status: string;
32
+ reviewer?: string;
33
+ issuingCountry?: 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW';
34
+ issuingOffice: string;
35
+ issuingDate: string;
36
+ dlClass: string;
37
+ };
38
+ type DocumentByService = {
39
+ serviceId: string;
40
+ areMandatoryPresent: boolean;
41
+ mandatoryDocumentTypeId: number[];
42
+ };
43
+ type DocumentByFranchise = {
44
+ fleetId: string;
45
+ serviceId: string;
46
+ mandatoryDocumentTypeId: number[];
47
+ };
48
+ type DocumentSummary = {
49
+ documentTypes: DocumentType[];
50
+ documents: DocumentFull[];
51
+ documentByService: DocumentByService[];
52
+ documentByFranchise: DocumentByFranchise[] | null;
53
+ };
54
+
55
+ declare const getUserDocuments: (client: Client, userId: string) => Promise<DocumentSummary>;
56
+
57
+ export { type DocumentByFranchise, type DocumentByService, type DocumentFull, type DocumentSummary, type DocumentType, type FileUrl, getUserDocuments };
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ getUserDocuments: () => getUserDocuments
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/getUserDocuments.ts
28
+ var import_zod = require("zod");
29
+ var schema = import_zod.z.object({
30
+ userId: import_zod.z.string().trim().nonempty().uuid()
31
+ });
32
+ var getUserDocuments = async (client, userId) => {
33
+ const result = schema.safeParse({ userId });
34
+ if (!result.success) {
35
+ throw new TypeError("Invalid args", {
36
+ cause: result.error.issues
37
+ });
38
+ }
39
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users/${userId}/documents`).then(({ data }) => data);
40
+ };
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ getUserDocuments
44
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ // src/getUserDocuments.ts
2
+ import { z } from "zod";
3
+ var schema = z.object({
4
+ userId: z.string().trim().nonempty().uuid()
5
+ });
6
+ var getUserDocuments = async (client, userId) => {
7
+ const result = schema.safeParse({ userId });
8
+ if (!result.success) {
9
+ throw new TypeError("Invalid args", {
10
+ cause: result.error.issues
11
+ });
12
+ }
13
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users/${userId}/documents`).then(({ data }) => data);
14
+ };
15
+ export {
16
+ getUserDocuments
17
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@vulog/aima-document",
3
+ "version": "1.1.20",
4
+ "main": "dist/index.js",
5
+ "module": "dist/index.mjs",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsup",
9
+ "dev": "tsup --watch",
10
+ "test": "vitest run",
11
+ "test:watch": "vitest",
12
+ "lint": "eslint src/**/* --ext .ts"
13
+ },
14
+ "keywords": [
15
+ "AIMA",
16
+ "VULOG",
17
+ "DOCUMENT"
18
+ ],
19
+ "author": "Vulog",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@vulog/aima-client": "1.1.20",
23
+ "@vulog/aima-core": "1.1.20"
24
+ },
25
+ "peerDependencies": {
26
+ "zod": "^3.24.1"
27
+ },
28
+ "description": ""
29
+ }
@@ -0,0 +1,21 @@
1
+ import { Client } from '@vulog/aima-client';
2
+ import { z } from 'zod';
3
+
4
+ import { DocumentSummary } from './types';
5
+
6
+ const schema = z.object({
7
+ userId: z.string().trim().nonempty().uuid(),
8
+ });
9
+
10
+ export const getUserDocuments = async (client: Client, userId: string): Promise<DocumentSummary> => {
11
+ const result = schema.safeParse({ userId });
12
+ if (!result.success) {
13
+ throw new TypeError('Invalid args', {
14
+ cause: result.error.issues,
15
+ });
16
+ }
17
+
18
+ return client
19
+ .get<DocumentSummary>(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users/${userId}/documents`)
20
+ .then(({ data }) => data);
21
+ };
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './getUserDocuments';
2
+ export * from './types';
package/src/types.ts ADDED
@@ -0,0 +1,306 @@
1
+ export type DocumentType = {
2
+ id: number;
3
+ fleetId: string;
4
+ type: string;
5
+ name: string;
6
+ mandatory: boolean;
7
+ hasNumber: boolean;
8
+ hasExpirationDate: boolean;
9
+ numberUploadUrl: number;
10
+ hasIssuingCountry: boolean;
11
+ hasIssuingOffice: boolean;
12
+ hasIssuingDate: boolean;
13
+ hasDlClass: boolean;
14
+ };
15
+
16
+ export type FileUrl = {
17
+ id: number;
18
+ url: string;
19
+ name: string;
20
+ };
21
+
22
+ export type DocumentFull = {
23
+ id: number;
24
+ fleetId: string;
25
+ userId: string;
26
+ documentType: DocumentType;
27
+ documentNumber?: string;
28
+ expirationDate?: string;
29
+ files: FileUrl[];
30
+ uploadUrls: FileUrl[];
31
+ status: string;
32
+ reviewer?: string;
33
+ issuingCountry?:
34
+ | 'AD'
35
+ | 'AE'
36
+ | 'AF'
37
+ | 'AG'
38
+ | 'AI'
39
+ | 'AL'
40
+ | 'AM'
41
+ | 'AN'
42
+ | 'AO'
43
+ | 'AQ'
44
+ | 'AR'
45
+ | 'AS'
46
+ | 'AT'
47
+ | 'AU'
48
+ | 'AW'
49
+ | 'AX'
50
+ | 'AZ'
51
+ | 'BA'
52
+ | 'BB'
53
+ | 'BD'
54
+ | 'BE'
55
+ | 'BF'
56
+ | 'BG'
57
+ | 'BH'
58
+ | 'BI'
59
+ | 'BJ'
60
+ | 'BL'
61
+ | 'BM'
62
+ | 'BN'
63
+ | 'BO'
64
+ | 'BQ'
65
+ | 'BR'
66
+ | 'BS'
67
+ | 'BT'
68
+ | 'BV'
69
+ | 'BW'
70
+ | 'BY'
71
+ | 'BZ'
72
+ | 'CA'
73
+ | 'CC'
74
+ | 'CD'
75
+ | 'CF'
76
+ | 'CG'
77
+ | 'CH'
78
+ | 'CI'
79
+ | 'CK'
80
+ | 'CL'
81
+ | 'CM'
82
+ | 'CN'
83
+ | 'CO'
84
+ | 'CR'
85
+ | 'CU'
86
+ | 'CV'
87
+ | 'CW'
88
+ | 'CX'
89
+ | 'CY'
90
+ | 'CZ'
91
+ | 'DE'
92
+ | 'DJ'
93
+ | 'DK'
94
+ | 'DM'
95
+ | 'DO'
96
+ | 'DZ'
97
+ | 'EC'
98
+ | 'EE'
99
+ | 'EG'
100
+ | 'EH'
101
+ | 'ER'
102
+ | 'ES'
103
+ | 'ET'
104
+ | 'FI'
105
+ | 'FJ'
106
+ | 'FK'
107
+ | 'FM'
108
+ | 'FO'
109
+ | 'FR'
110
+ | 'GA'
111
+ | 'GB'
112
+ | 'GD'
113
+ | 'GE'
114
+ | 'GF'
115
+ | 'GG'
116
+ | 'GH'
117
+ | 'GI'
118
+ | 'GL'
119
+ | 'GM'
120
+ | 'GN'
121
+ | 'GP'
122
+ | 'GQ'
123
+ | 'GR'
124
+ | 'GS'
125
+ | 'GT'
126
+ | 'GU'
127
+ | 'GW'
128
+ | 'GY'
129
+ | 'HK'
130
+ | 'HM'
131
+ | 'HN'
132
+ | 'HR'
133
+ | 'HT'
134
+ | 'HU'
135
+ | 'ID'
136
+ | 'IE'
137
+ | 'IL'
138
+ | 'IM'
139
+ | 'IN'
140
+ | 'IO'
141
+ | 'IQ'
142
+ | 'IR'
143
+ | 'IS'
144
+ | 'IT'
145
+ | 'JE'
146
+ | 'JM'
147
+ | 'JO'
148
+ | 'JP'
149
+ | 'KE'
150
+ | 'KG'
151
+ | 'KH'
152
+ | 'KI'
153
+ | 'KM'
154
+ | 'KN'
155
+ | 'KP'
156
+ | 'KR'
157
+ | 'KW'
158
+ | 'KY'
159
+ | 'KZ'
160
+ | 'LA'
161
+ | 'LB'
162
+ | 'LC'
163
+ | 'LI'
164
+ | 'LK'
165
+ | 'LR'
166
+ | 'LS'
167
+ | 'LT'
168
+ | 'LU'
169
+ | 'LV'
170
+ | 'LY'
171
+ | 'MA'
172
+ | 'MC'
173
+ | 'MD'
174
+ | 'ME'
175
+ | 'MF'
176
+ | 'MG'
177
+ | 'MH'
178
+ | 'MK'
179
+ | 'ML'
180
+ | 'MM'
181
+ | 'MN'
182
+ | 'MO'
183
+ | 'MP'
184
+ | 'MQ'
185
+ | 'MR'
186
+ | 'MS'
187
+ | 'MT'
188
+ | 'MU'
189
+ | 'MV'
190
+ | 'MW'
191
+ | 'MX'
192
+ | 'MY'
193
+ | 'MZ'
194
+ | 'NA'
195
+ | 'NC'
196
+ | 'NE'
197
+ | 'NF'
198
+ | 'NG'
199
+ | 'NI'
200
+ | 'NL'
201
+ | 'NO'
202
+ | 'NP'
203
+ | 'NR'
204
+ | 'NU'
205
+ | 'NZ'
206
+ | 'OM'
207
+ | 'PA'
208
+ | 'PE'
209
+ | 'PF'
210
+ | 'PG'
211
+ | 'PH'
212
+ | 'PK'
213
+ | 'PL'
214
+ | 'PM'
215
+ | 'PN'
216
+ | 'PR'
217
+ | 'PS'
218
+ | 'PT'
219
+ | 'PW'
220
+ | 'PY'
221
+ | 'QA'
222
+ | 'RE'
223
+ | 'RO'
224
+ | 'RS'
225
+ | 'RU'
226
+ | 'RW'
227
+ | 'SA'
228
+ | 'SB'
229
+ | 'SC'
230
+ | 'SD'
231
+ | 'SE'
232
+ | 'SG'
233
+ | 'SH'
234
+ | 'SI'
235
+ | 'SJ'
236
+ | 'SK'
237
+ | 'SL'
238
+ | 'SM'
239
+ | 'SN'
240
+ | 'SO'
241
+ | 'SR'
242
+ | 'SS'
243
+ | 'ST'
244
+ | 'SV'
245
+ | 'SX'
246
+ | 'SY'
247
+ | 'SZ'
248
+ | 'TC'
249
+ | 'TD'
250
+ | 'TF'
251
+ | 'TG'
252
+ | 'TH'
253
+ | 'TJ'
254
+ | 'TK'
255
+ | 'TL'
256
+ | 'TM'
257
+ | 'TN'
258
+ | 'TO'
259
+ | 'TR'
260
+ | 'TT'
261
+ | 'TV'
262
+ | 'TW'
263
+ | 'TZ'
264
+ | 'UA'
265
+ | 'UG'
266
+ | 'UM'
267
+ | 'US'
268
+ | 'UY'
269
+ | 'UZ'
270
+ | 'VA'
271
+ | 'VC'
272
+ | 'VE'
273
+ | 'VG'
274
+ | 'VI'
275
+ | 'VN'
276
+ | 'VU'
277
+ | 'WF'
278
+ | 'WS'
279
+ | 'YE'
280
+ | 'YT'
281
+ | 'ZA'
282
+ | 'ZM'
283
+ | 'ZW';
284
+ issuingOffice: string;
285
+ issuingDate: string;
286
+ dlClass: string;
287
+ };
288
+
289
+ export type DocumentByService = {
290
+ serviceId: string;
291
+ areMandatoryPresent: boolean;
292
+ mandatoryDocumentTypeId: number[];
293
+ };
294
+
295
+ export type DocumentByFranchise = {
296
+ fleetId: string;
297
+ serviceId: string;
298
+ mandatoryDocumentTypeId: number[];
299
+ };
300
+
301
+ export type DocumentSummary = {
302
+ documentTypes: DocumentType[];
303
+ documents: DocumentFull[];
304
+ documentByService: DocumentByService[];
305
+ documentByFranchise: DocumentByFranchise[] | null;
306
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "include": ["src"],
3
+ "exclude": ["**/*.test.ts"],
4
+ "compilerOptions": {
5
+ "module": "esnext",
6
+ "target": "esnext",
7
+ "lib": ["esnext"],
8
+ "declaration": true,
9
+ "strict": true,
10
+ "moduleResolution": "node",
11
+ "skipLibCheck": true,
12
+ "esModuleInterop": true,
13
+ "outDir": "dist",
14
+ "rootDir": "src"
15
+ }
16
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ clean: true,
6
+ format: ['cjs', 'esm'],
7
+ dts: true,
8
+ });
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'node',
7
+ },
8
+ });