@rentman/rm-core 59.2.6 → 59.3.1

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.
@@ -11,10 +11,12 @@ export type ChildCollectionResources = {
11
11
  items: any[];
12
12
  };
13
13
  };
14
- export type ItemResourceComputedSignalFunction<ItemResourceType extends ItemResource<any, any, any>, ReturnValue = unknown> = ItemResourceType extends ItemResource<infer ItemTypeType, infer RequestColumns> ? (itemResource: {
14
+ export type ItemResourceComputedSignalFunction<ItemTypeType extends ApiItemType, RequestColumns extends ApiRequestColumns<ItemTypeType>, ReturnValue = unknown> = (itemResource: {
15
+ transaction: TransactionCache;
16
+ entry: ItemEntry<ItemTypeType>;
15
17
  fieldSignals: Readonly<RequestColumnsSignalFieldMap<ItemTypeType, RequestColumns>>;
16
18
  getDerivedSignal: <GetDerivedSignalPath extends readonly string[] | string, DefaultValue = unknown>(pathInput: GetDerivedSignalPath, defaultValue?: DefaultValue) => Signal<MaybeDefaultValue<ResolveDerivedValue<ItemTypeType, GetDerivedSignalPath extends string ? DerivedStringToRequestColumnPath<GetDerivedSignalPath> : GetDerivedSignalPath>, DefaultValue>>;
17
- }) => ReturnValue : never;
19
+ }) => ReturnValue;
18
20
  type MaybeDefaultValue<T, DefaultValue> = DefaultValue extends number | bigint | string | boolean | null | object ? DefaultValue | T : T;
19
21
  export declare class ItemResource<ItemTypeType extends ApiItemType = ApiItemType, RequestColumns extends ApiRequestColumns<ItemTypeType> = ItemTypeColumnIds<ItemTypeType>, Children extends ChildCollectionResources | undefined = undefined> {
20
22
  protected readonly factory: ItemResourceFactory;
@@ -35,7 +37,7 @@ export declare class ItemResource<ItemTypeType extends ApiItemType = ApiItemType
35
37
  private __computedFunctions;
36
38
  constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, transaction: TransactionCache, _isNew: boolean, abortSignal?: AbortSignal | null);
37
39
  onConstruct(): void;
38
- computedSignal<FunctionReference extends ItemResourceComputedSignalFunction<this>>(functionReference: FunctionReference): Signal<ReturnType<FunctionReference>>;
40
+ computedSignal<FunctionReference extends ItemResourceComputedSignalFunction<ItemTypeType, RequestColumns>>(functionReference: FunctionReference): Signal<ReturnType<FunctionReference>>;
39
41
  /**
40
42
  * We type this loosely to prevent TypeScript inferring a complex type when comparing item resources.
41
43
  * @internal
@@ -1,6 +1,7 @@
1
1
  import moment from 'moment';
2
- import { RmCore } from '../internal';
2
+ import { CollectionResource, RmCore } from '../internal';
3
3
  export declare const HOLIDAY_ICON = "beach_access";
4
+ declare const holidayColumns: readonly ["id", "date", "name", "yearly"];
4
5
  export type HolidayFields = {
5
6
  uid: `hol-${number}` | `hol-${number}-${number}`;
6
7
  name: string;
@@ -17,12 +18,14 @@ export type HolidayFields = {
17
18
  * an exception otherwise.
18
19
  */
19
20
  export declare class RmHolidaysService {
20
- private holidaysCachedQueryMap;
21
- getFirstHolidayOnDate(date: Date, rmCoreInstance?: RmCore): string | null;
21
+ private holidayCollectionResourcesMap;
22
+ rangeContainsHoliday$(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): boolean;
23
+ getHolidaysInDateRange$(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): HolidayFields[];
22
24
  rangeContainsHoliday(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): boolean;
23
25
  getHolidaysInDateRange(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): HolidayFields[];
24
26
  initialize(rmCoreInstance: RmCore): Promise<void>;
25
- clear(rmCoreInstance: RmCore): void;
26
- getHolidaysInDateRangeIterator(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): Generator<HolidayFields>;
27
- private getHolidayItemEntries;
27
+ clear(rmCoreInstance: RmCore): boolean;
28
+ getHolidaysInDateRangeIterator$(start: moment.Moment, end: moment.Moment, rmCoreInstance?: RmCore): Generator<HolidayFields>;
29
+ getHolidaysCollection(rmCoreInstance?: RmCore): CollectionResource<'Holiday', typeof holidayColumns>;
28
30
  }
31
+ export {};
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "@rentman/rm-core",
3
- "version": "59.2.6",
4
- "description": "Rentman core functionalities",
5
- "main": "./dist/rm-core.js",
6
- "types": "./dist/types/src/index.d.ts",
7
- "engines": {
8
- "node": ">= 22.9.x <= 22.13.x",
9
- "npm": ">= 10.8.x <= 10.9.x"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/rentmanpublic/frontend-core"
14
- },
15
- "devDependencies": {
16
- "@angular/core": "^20",
17
- "@eslint/js": "^9.8.0",
18
- "@rentman/backend-types": "4.796.0-60-gf11b0b4e33",
19
- "@stylistic/eslint-plugin-ts": "^2.7.2",
20
- "@types/eslint__js": "^8.42.3",
21
- "clean-webpack-plugin": "^0.1.19",
22
- "eslint": "^9.8.0",
23
- "jsdom": "^26.1.0",
24
- "moment": "^2.30.1",
25
- "rxjs": "^7",
26
- "terser-webpack-plugin": "^4.2.3",
27
- "ts-loader": "^9.3.1",
28
- "typescript": "5.5.4",
29
- "typescript-eslint": "^8.4.0",
30
- "vitest": "^3.2.3",
31
- "webpack": "^5.74.0",
32
- "webpack-cli": "^5.1.4",
33
- "webpack-merge": "^6.0.1"
34
- },
35
- "peerDependencies": {
36
- "@angular/core": "^20",
37
- "@rentman/backend-types": ">=4.786.0-47-g4a3c77a5db",
38
- "moment": "^2.30.1",
39
- "rxjs": "^7"
40
- },
41
- "files": [
42
- "dist"
43
- ],
44
- "scripts": {
45
- "prepublishOnly": "npm run bundle",
46
- "bundle-dev": "webpack --config webpack.dev.js",
47
- "bundle": "webpack --config webpack.prod.js",
48
- "type-check": "tsc --noEmit -p ./tsconfig.json && tsc --noEmit -p ./tests/tsconfig.test.json",
49
- "lint": "eslint src/**/*.ts tests/**/*.ts --quiet",
50
- "test": "vitest --pool forks --poolOptions.forks.isolate",
51
- "vitest-watch": "vitest --watch",
52
- "coverage": "vitest --coverage"
53
- },
54
- "author": "Martijn Welker <martijn@rentman.nl>",
55
- "license": "UNLICENSED"
56
- }
1
+ {
2
+ "name": "@rentman/rm-core",
3
+ "version": "59.3.1",
4
+ "description": "Rentman core functionalities",
5
+ "main": "./dist/rm-core.js",
6
+ "types": "./dist/types/src/index.d.ts",
7
+ "engines": {
8
+ "node": ">= 22.9.x <= 22.13.x",
9
+ "npm": ">= 10.8.x <= 10.9.x"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/rentmanpublic/frontend-core"
14
+ },
15
+ "devDependencies": {
16
+ "@angular/core": "^20",
17
+ "@eslint/js": "^9.8.0",
18
+ "@rentman/backend-types": "4.796.0-60-gf11b0b4e33",
19
+ "@stylistic/eslint-plugin-ts": "^2.7.2",
20
+ "@types/eslint__js": "^8.42.3",
21
+ "clean-webpack-plugin": "^0.1.19",
22
+ "eslint": "^9.8.0",
23
+ "jsdom": "^26.1.0",
24
+ "moment": "^2.30.1",
25
+ "rxjs": "^7",
26
+ "terser-webpack-plugin": "^4.2.3",
27
+ "ts-loader": "^9.3.1",
28
+ "typescript": "5.5.4",
29
+ "typescript-eslint": "^8.4.0",
30
+ "vitest": "^3.2.3",
31
+ "webpack": "^5.74.0",
32
+ "webpack-cli": "^5.1.4",
33
+ "webpack-merge": "^6.0.1"
34
+ },
35
+ "peerDependencies": {
36
+ "@angular/core": "^20",
37
+ "@rentman/backend-types": ">=4.786.0-47-g4a3c77a5db",
38
+ "moment": "^2.30.1",
39
+ "rxjs": "^7"
40
+ },
41
+ "files": [
42
+ "dist"
43
+ ],
44
+ "scripts": {
45
+ "prepublishOnly": "npm run bundle",
46
+ "bundle-dev": "webpack --config webpack.dev.js",
47
+ "bundle": "webpack --config webpack.prod.js",
48
+ "type-check": "tsc --noEmit -p ./tsconfig.json && tsc --noEmit -p ./tests/tsconfig.test.json",
49
+ "lint": "eslint src/**/*.ts tests/**/*.ts --quiet",
50
+ "test": "vitest --pool forks --poolOptions.forks.isolate",
51
+ "vitest-watch": "vitest --watch",
52
+ "coverage": "vitest --coverage"
53
+ },
54
+ "author": "Martijn Welker <martijn@rentman.nl>",
55
+ "license": "UNLICENSED"
56
+ }
package/readme.md CHANGED
@@ -1,49 +1,49 @@
1
- # Running a local test version
2
- 1. Make changes
3
- 2. run `npm run bundle-dev`
4
- 3. copy `dist` folder to
5
- - Frontend: `<project>/bower_components/rentman-rm-core/`
6
- - App: `<project>/node_modules/@rentman/rm-core/`
7
-
8
- # Publishing your local version
9
-
10
- (You have to be logged in as rentman-user on npm, run `npm whoami` to see who you are logged in as)
11
-
12
- 1. Make changes
13
- 2. Report changes in changelog
14
- 3. Commit your changes
15
- 4. Update version in package.json and core.ts
16
- - Note! For consistency consider using `npm version` with appropriate flags and options
17
- 5. Push commits and tags
18
- 6. run `npm publish`
19
-
20
- ## How to use `npm version` command
21
-
22
- `npm version <options>` command automatically creates
23
- - commit
24
- - version tag
25
- - modifies both the `package.json` and `package-lock.json`
26
-
27
- > Note! You cannot have uncommited changes in your repo for this
28
- > otherwise you'll get `npm error Git working directory not clean` error.
29
-
30
- ### Production versions
31
-
32
- According to the standard semantic versioning principles [↗️](https://semver.org/)
33
-
34
- - `major` – incompatible / breaking changes
35
- - `minor` – adding functionality in a backward compatible manner
36
- - `patch` – backward compatible changes / bug fixes
37
-
38
- > **To create a patch version**
39
- > Run `npm version patch -m "Bump version to %s"`
40
- > where the %s will be replaced with the version number created
41
-
42
- ### Testing / PoC versions
43
-
44
- `npm version prerelease --preid="<YOUR_ISSUE_NUMBER>"`
45
-
46
- > **Example**
47
- > Running `npm version prerelease --preid="RM4-00000"` on version `43.2.0`
48
- > would create the tag and version `43.2.1-RM4-00000.0`
1
+ # Running a local test version
2
+ 1. Make changes
3
+ 2. run `npm run bundle-dev`
4
+ 3. copy `dist` folder to
5
+ - Frontend: `<project>/bower_components/rentman-rm-core/`
6
+ - App: `<project>/node_modules/@rentman/rm-core/`
7
+
8
+ # Publishing your local version
9
+
10
+ (You have to be logged in as rentman-user on npm, run `npm whoami` to see who you are logged in as)
11
+
12
+ 1. Make changes
13
+ 2. Report changes in changelog
14
+ 3. Commit your changes
15
+ 4. Update version in package.json and core.ts
16
+ - Note! For consistency consider using `npm version` with appropriate flags and options
17
+ 5. Push commits and tags
18
+ 6. run `npm publish`
19
+
20
+ ## How to use `npm version` command
21
+
22
+ `npm version <options>` command automatically creates
23
+ - commit
24
+ - version tag
25
+ - modifies both the `package.json` and `package-lock.json`
26
+
27
+ > Note! You cannot have uncommited changes in your repo for this
28
+ > otherwise you'll get `npm error Git working directory not clean` error.
29
+
30
+ ### Production versions
31
+
32
+ According to the standard semantic versioning principles [↗️](https://semver.org/)
33
+
34
+ - `major` – incompatible / breaking changes
35
+ - `minor` – adding functionality in a backward compatible manner
36
+ - `patch` – backward compatible changes / bug fixes
37
+
38
+ > **To create a patch version**
39
+ > Run `npm version patch -m "Bump version to %s"`
40
+ > where the %s will be replaced with the version number created
41
+
42
+ ### Testing / PoC versions
43
+
44
+ `npm version prerelease --preid="<YOUR_ISSUE_NUMBER>"`
45
+
46
+ > **Example**
47
+ > Running `npm version prerelease --preid="RM4-00000"` on version `43.2.0`
48
+ > would create the tag and version `43.2.1-RM4-00000.0`
49
49
  >