@vulog/aima-booking 1.2.35 → 1.2.37

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/dist/index.cjs CHANGED
@@ -470,7 +470,11 @@ const getAdditionalDrivers = async (client, parentId) => {
470
470
  //#region src/getSlaves.ts
471
471
  const schema$2 = zod.z.object({
472
472
  parentId: zod.z.string().trim().min(1),
473
- status: zod.z.enum(["ONGOING, COMPLETED", "UPCOMING"])
473
+ status: zod.z.enum([
474
+ "ONGOING",
475
+ "COMPLETED",
476
+ "UPCOMING"
477
+ ])
474
478
  });
475
479
  const getSlaves = async (client, parentId, status) => {
476
480
  const result = schema$2.safeParse({
package/dist/index.mjs CHANGED
@@ -446,7 +446,11 @@ const getAdditionalDrivers = async (client, parentId) => {
446
446
  //#region src/getSlaves.ts
447
447
  const schema$2 = z.object({
448
448
  parentId: z.string().trim().min(1),
449
- status: z.enum(["ONGOING, COMPLETED", "UPCOMING"])
449
+ status: z.enum([
450
+ "ONGOING",
451
+ "COMPLETED",
452
+ "UPCOMING"
453
+ ])
450
454
  });
451
455
  const getSlaves = async (client, parentId, status) => {
452
456
  const result = schema$2.safeParse({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vulog/aima-booking",
3
3
  "type": "module",
4
- "version": "1.2.35",
4
+ "version": "1.2.37",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.cts",
@@ -22,7 +22,7 @@
22
22
  "dev": "tsdown --watch",
23
23
  "test": "vitest run",
24
24
  "test:watch": "vitest",
25
- "lint": "eslint src/**/* --ext .ts"
25
+ "lint": "eslint src/"
26
26
  },
27
27
  "keywords": [
28
28
  "AIMA",
@@ -32,8 +32,8 @@
32
32
  "author": "Vulog",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@vulog/aima-client": "1.2.35",
36
- "@vulog/aima-core": "1.2.35"
35
+ "@vulog/aima-client": "1.2.37",
36
+ "@vulog/aima-core": "1.2.37"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "es-toolkit": "^1.39.9",
@@ -57,4 +57,18 @@ describe('getSlaves', () => {
57
57
  expect(result).toEqual(slaves);
58
58
  expect(result).toHaveLength(1);
59
59
  });
60
+
61
+ test('accepts COMPLETED status and calls GET with correct URL', async () => {
62
+ const parentId = '87438128-2e44-4255-8a37-660af7d66de5';
63
+ const slaves: BookingRequestSlave[] = [];
64
+ getMock.mockResolvedValueOnce({ data: slaves });
65
+
66
+ const result = await getSlaves(client, parentId, 'COMPLETED');
67
+
68
+ expect(getMock).toHaveBeenCalledTimes(1);
69
+ expect(getMock).toHaveBeenCalledWith(
70
+ `/boapi/proxy/user/scheduledBooking/fleets/FLEET_ID/subscription/bookingRequests/${parentId}/bookingRequestsSlave?bookingStatus=COMPLETED`
71
+ );
72
+ expect(result).toEqual([]);
73
+ });
60
74
  });
package/src/getSlaves.ts CHANGED
@@ -5,7 +5,7 @@ import { BookingRequestSlave } from './types';
5
5
 
6
6
  const schema = z.object({
7
7
  parentId: z.string().trim().min(1),
8
- status: z.enum(['ONGOING, COMPLETED', 'UPCOMING']),
8
+ status: z.enum(['ONGOING', 'COMPLETED', 'UPCOMING']),
9
9
  });
10
10
 
11
11
  export const getSlaves = async (client: Client, parentId: string, status: string): Promise<BookingRequestSlave[]> => {
package/src/getStation.ts CHANGED
@@ -30,7 +30,6 @@ export const getStationById = async (
30
30
  alwaysOpen: data.stationTimetableDTO.alwaysOpen,
31
31
  timetable: Object.keys(data.stationTimetableDTO.timetable).reduce<Timetable>(
32
32
  (timetable, val) => {
33
- // eslint-disable-next-line no-param-reassign
34
33
  timetable[val as Days] = data.stationTimetableDTO.timetable[val].map(
35
34
  (day: any) => ({
36
35
  id: day.id,
@@ -34,7 +34,6 @@ export const getStations = async (client: Client, includes: Include[] = []): Pro
34
34
  alwaysOpen: station.stationTimetableDTO.alwaysOpen,
35
35
  timetable: Object.keys(station.stationTimetableDTO.timetable).reduce<Timetable>(
36
36
  (timetable, val) => {
37
- // eslint-disable-next-line no-param-reassign
38
37
  timetable[val as Days] = station.stationTimetableDTO.timetable[val].map(
39
38
  (day: any) => ({
40
39
  id: day.id,
package/.eslintrc.cjs DELETED
@@ -1,112 +0,0 @@
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
- };