@happyvertical/smrt-human-resources 0.0.0-stage → 0.53.5

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.
Files changed (64) hide show
  1. package/AGENTS.md +297 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +291 -2
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/dates.d.ts +25 -0
  8. package/dist/dates.d.ts.map +1 -0
  9. package/dist/employment/index.d.ts +3 -0
  10. package/dist/employment/index.d.ts.map +1 -0
  11. package/dist/employment/models.d.ts +73 -0
  12. package/dist/employment/models.d.ts.map +1 -0
  13. package/dist/employment/queries.d.ts +12 -0
  14. package/dist/employment/queries.d.ts.map +1 -0
  15. package/dist/employment/service.d.ts +277 -0
  16. package/dist/employment/service.d.ts.map +1 -0
  17. package/dist/index.d.ts +18 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +2068 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/manifest.json +2424 -0
  22. package/dist/qualifications/index.d.ts +3 -0
  23. package/dist/qualifications/index.d.ts.map +1 -0
  24. package/dist/qualifications/internal.d.ts +24 -0
  25. package/dist/qualifications/internal.d.ts.map +1 -0
  26. package/dist/qualifications/models.d.ts +77 -0
  27. package/dist/qualifications/models.d.ts.map +1 -0
  28. package/dist/qualifications/service.d.ts +381 -0
  29. package/dist/qualifications/service.d.ts.map +1 -0
  30. package/dist/service-base.d.ts +47 -0
  31. package/dist/service-base.d.ts.map +1 -0
  32. package/dist/smrt-knowledge.json +902 -0
  33. package/dist/svelte/components/EmployeeForm.svelte +369 -0
  34. package/dist/svelte/components/EmployeeForm.svelte.d.ts +28 -0
  35. package/dist/svelte/components/EmployeeForm.svelte.d.ts.map +1 -0
  36. package/dist/svelte/components/EmployeeList.svelte +158 -0
  37. package/dist/svelte/components/EmployeeList.svelte.d.ts +13 -0
  38. package/dist/svelte/components/EmployeeList.svelte.d.ts.map +1 -0
  39. package/dist/svelte/components/ExpiringQualificationsList.svelte +126 -0
  40. package/dist/svelte/components/ExpiringQualificationsList.svelte.d.ts +13 -0
  41. package/dist/svelte/components/ExpiringQualificationsList.svelte.d.ts.map +1 -0
  42. package/dist/svelte/components/PersonQualifications.svelte +156 -0
  43. package/dist/svelte/components/PersonQualifications.svelte.d.ts +15 -0
  44. package/dist/svelte/components/PersonQualifications.svelte.d.ts.map +1 -0
  45. package/dist/svelte/i18n.d.ts +67 -0
  46. package/dist/svelte/i18n.d.ts.map +1 -0
  47. package/dist/svelte/i18n.js +67 -0
  48. package/dist/svelte/index.d.ts +23 -0
  49. package/dist/svelte/index.d.ts.map +1 -0
  50. package/dist/svelte/index.js +25 -0
  51. package/dist/svelte/types.d.ts +225 -0
  52. package/dist/svelte/types.d.ts.map +1 -0
  53. package/dist/svelte/types.js +257 -0
  54. package/dist/types.d.ts +119 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +23 -0
  57. package/dist/types.js.map +1 -0
  58. package/dist/ui.d.ts +17 -0
  59. package/dist/ui.d.ts.map +1 -0
  60. package/dist/ui.js +65 -0
  61. package/dist/ui.js.map +1 -0
  62. package/dist/write.d.ts +22 -0
  63. package/dist/write.d.ts.map +1 -0
  64. package/package.json +86 -3
package/dist/ui.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Human Resources Module UI Slot Declarations
3
+ *
4
+ * UI extension points for the HR module. Components are implemented in the
5
+ * ./svelte subpath and are props-driven: hosts load records through the
6
+ * services and pass plain view objects.
7
+ */
8
+ import type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
9
+ /**
10
+ * Human resources module UI slots
11
+ */
12
+ export declare const HUMAN_RESOURCES_UI_SLOTS: Record<string, ModuleUISlot>;
13
+ /**
14
+ * Human resources module metadata
15
+ */
16
+ export declare const HUMAN_RESOURCES_MODULE_META: SmrtModuleMeta;
17
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAsCjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,cAsBzC,CAAC"}
package/dist/ui.js ADDED
@@ -0,0 +1,65 @@
1
+ //#region src/ui.ts
2
+ var HUMAN_RESOURCES_UI_SLOTS = {
3
+ "employee-list": {
4
+ id: "employee-list",
5
+ label: "Employee List",
6
+ description: "Table of employees with position, worker type, status and start date",
7
+ icon: "list",
8
+ category: "list",
9
+ order: 1,
10
+ propsInterface: "EmployeeListProps"
11
+ },
12
+ "employee-form": {
13
+ id: "employee-form",
14
+ label: "Employee Form",
15
+ description: "Hire or edit form for the employment fields a host manages",
16
+ icon: "edit",
17
+ category: "form",
18
+ order: 2,
19
+ propsInterface: "EmployeeFormProps"
20
+ },
21
+ "person-qualifications": {
22
+ id: "person-qualifications",
23
+ label: "Person Qualifications",
24
+ description: "One person's qualifications with their expiry state",
25
+ icon: "badge",
26
+ category: "display",
27
+ order: 3,
28
+ propsInterface: "PersonQualificationsProps"
29
+ },
30
+ "expiring-qualifications-list": {
31
+ id: "expiring-qualifications-list",
32
+ label: "Expiring Qualifications List",
33
+ description: "Qualifications expiring soon across people, soonest first",
34
+ icon: "clock",
35
+ category: "list",
36
+ order: 4,
37
+ propsInterface: "ExpiringQualificationsListProps"
38
+ }
39
+ };
40
+ var HUMAN_RESOURCES_MODULE_META = {
41
+ name: "@happyvertical/smrt-human-resources",
42
+ displayName: "Human Resources",
43
+ description: "Employment records with dated terms, and qualifications with expiry",
44
+ uiSlots: HUMAN_RESOURCES_UI_SLOTS,
45
+ models: [
46
+ "Employment",
47
+ "EmploymentTerm",
48
+ "EmploymentChange",
49
+ "Qualification",
50
+ "HeldQualification",
51
+ "HeldQualificationChange"
52
+ ],
53
+ collections: [
54
+ "EmploymentCollection",
55
+ "EmploymentTermCollection",
56
+ "EmploymentChangeCollection",
57
+ "QualificationCollection",
58
+ "HeldQualificationCollection",
59
+ "HeldQualificationChangeCollection"
60
+ ]
61
+ };
62
+ //#endregion
63
+ export { HUMAN_RESOURCES_MODULE_META, HUMAN_RESOURCES_UI_SLOTS };
64
+
65
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","names":[],"sources":["../src/ui.ts"],"sourcesContent":["/**\n * Human Resources Module UI Slot Declarations\n *\n * UI extension points for the HR module. Components are implemented in the\n * ./svelte subpath and are props-driven: hosts load records through the\n * services and pass plain view objects.\n */\n\nimport type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';\n\n/**\n * Human resources module UI slots\n */\nexport const HUMAN_RESOURCES_UI_SLOTS: Record<string, ModuleUISlot> = {\n 'employee-list': {\n id: 'employee-list',\n label: 'Employee List',\n description:\n 'Table of employees with position, worker type, status and start date',\n icon: 'list',\n category: 'list',\n order: 1,\n propsInterface: 'EmployeeListProps',\n },\n 'employee-form': {\n id: 'employee-form',\n label: 'Employee Form',\n description: 'Hire or edit form for the employment fields a host manages',\n icon: 'edit',\n category: 'form',\n order: 2,\n propsInterface: 'EmployeeFormProps',\n },\n 'person-qualifications': {\n id: 'person-qualifications',\n label: 'Person Qualifications',\n description: \"One person's qualifications with their expiry state\",\n icon: 'badge',\n category: 'display',\n order: 3,\n propsInterface: 'PersonQualificationsProps',\n },\n 'expiring-qualifications-list': {\n id: 'expiring-qualifications-list',\n label: 'Expiring Qualifications List',\n description: 'Qualifications expiring soon across people, soonest first',\n icon: 'clock',\n category: 'list',\n order: 4,\n propsInterface: 'ExpiringQualificationsListProps',\n },\n};\n\n/**\n * Human resources module metadata\n */\nexport const HUMAN_RESOURCES_MODULE_META: SmrtModuleMeta = {\n name: '@happyvertical/smrt-human-resources',\n displayName: 'Human Resources',\n description:\n 'Employment records with dated terms, and qualifications with expiry',\n uiSlots: HUMAN_RESOURCES_UI_SLOTS,\n models: [\n 'Employment',\n 'EmploymentTerm',\n 'EmploymentChange',\n 'Qualification',\n 'HeldQualification',\n 'HeldQualificationChange',\n ],\n collections: [\n 'EmploymentCollection',\n 'EmploymentTermCollection',\n 'EmploymentChangeCollection',\n 'QualificationCollection',\n 'HeldQualificationCollection',\n 'HeldQualificationChangeCollection',\n ],\n};\n"],"mappings":";AAaO,IAAM,2BAAyD;CACpE,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aACE;EACF,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,iBAAiB;EACf,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,yBAAyB;EACvB,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;CACA,gCAAgC;EAC9B,IAAI;EACJ,OAAO;EACP,aAAa;EACb,MAAM;EACN,UAAU;EACV,OAAO;EACP,gBAAgB;CAClB;AACF;AAKO,IAAM,8BAA8C;CACzD,MAAM;CACN,aAAa;CACb,aACE;CACF,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -0,0 +1,22 @@
1
+ import type { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import type { DatabaseInterface } from '@happyvertical/sql';
3
+ /** Whether a service is saving this instance right now. */
4
+ export declare function hasHrWrite(object: SmrtObject): boolean;
5
+ /**
6
+ * Guard for a model's `save()`.
7
+ *
8
+ * @throws HrError `HR_WRITE_FORBIDDEN` outside a service write
9
+ */
10
+ export declare function assertHrWrite(object: SmrtObject): void;
11
+ /** Save one instance under the write capability; services only. */
12
+ export declare function persistHr<T extends SmrtObject>(object: T): Promise<T>;
13
+ /**
14
+ * The one way a service inserts an HR row. `collection.create()` saves
15
+ * outside the write capability (so it always throws for HR models), and a
16
+ * plain first `save()` would upsert onto an existing natural key. This builds
17
+ * the instance through the model's public constructor and `initialize()`,
18
+ * requires a real INSERT (`requireInsertOnSave()`), and saves it under the
19
+ * capability. It uses no protected collection API.
20
+ */
21
+ export declare function insertHr<T extends SmrtObject>(Model: new (options: SmrtObjectOptions) => T, db: DatabaseInterface, values: Record<string, unknown>): Promise<T>;
22
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM5D,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAMtD;AAED,mEAAmE;AACnE,wBAAsB,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQ3E;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,CAAC,SAAS,UAAU,EACjD,KAAK,EAAE,KAAK,OAAO,EAAE,iBAAiB,KAAK,CAAC,EAC5C,EAAE,EAAE,iBAAiB,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,CAAC,CAAC,CAIZ"}
package/package.json CHANGED
@@ -1,6 +1,89 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-human-resources",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.53.5",
4
+ "smrtJsdoc": "strict",
5
+ "description": "HR records for the SMRT framework: who works for an organization, as what, and with what standing — employment with dated terms, and qualifications with expiry",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "smrtRawPrimitives": "strict",
10
+ "files": [
11
+ "dist",
12
+ "CLAUDE.md",
13
+ "AGENTS.md"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./ui": {
21
+ "types": "./dist/ui.d.ts",
22
+ "import": "./dist/ui.js"
23
+ },
24
+ "./svelte": {
25
+ "types": "./dist/svelte/index.d.ts",
26
+ "svelte": "./dist/svelte/index.js",
27
+ "import": "./dist/svelte/index.js"
28
+ },
29
+ "./manifest": "./dist/manifest.json",
30
+ "./manifest.json": "./dist/manifest.json"
31
+ },
32
+ "dependencies": {
33
+ "@happyvertical/logger": "^0.100.3",
34
+ "@happyvertical/smrt-core": "0.53.5",
35
+ "@happyvertical/smrt-tenancy": "0.53.5",
36
+ "@happyvertical/smrt-types": "0.53.5",
37
+ "@happyvertical/smrt-ui": "0.53.5",
38
+ "@happyvertical/sql": "^0.100.3"
39
+ },
40
+ "peerDependencies": {
41
+ "svelte": "^5.57.0"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "svelte": {
45
+ "optional": true
46
+ }
47
+ },
48
+ "devDependencies": {
49
+ "@happyvertical/smrt-vitest": "0.53.5",
50
+ "@sveltejs/package": "^2.5.8",
51
+ "@sveltejs/vite-plugin-svelte": "^7.3.0",
52
+ "@types/node": "24.13.6",
53
+ "svelte": "^5.57.1",
54
+ "svelte-check": "^4.7.6",
55
+ "typescript": "6.0.3",
56
+ "vite": "8.1.4",
57
+ "vitest": "4.1.10"
58
+ },
59
+ "keywords": [
60
+ "smrt",
61
+ "human-resources",
62
+ "employment",
63
+ "qualifications",
64
+ "certifications",
65
+ "multi-tenant"
66
+ ],
67
+ "author": "HappyVertical",
68
+ "license": "MIT",
69
+ "publishConfig": {
70
+ "registry": "https://registry.npmjs.org",
71
+ "access": "public"
72
+ },
73
+ "repository": {
74
+ "type": "git",
75
+ "url": "https://github.com/happyvertical/smrt.git",
76
+ "directory": "packages/human-resources"
77
+ },
78
+ "scripts": {
79
+ "build": "vite build --mode library && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json && node ../../scripts/prune-svelte-package-artifacts.js dist",
80
+ "build:watch": "vite build --mode library --watch",
81
+ "clean": "rm -rf dist",
82
+ "dev": "vite dev",
83
+ "test": "vitest run",
84
+ "test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run optional.test.ts",
85
+ "test:watch": "vitest",
86
+ "typecheck": "tsc --noEmit -p tsconfig.json && node ../../scripts/svelte-check-a11y.mjs --tsconfig ./tsconfig.svelte.json",
87
+ "verify:pack": "node ../../scripts/verify-package-types-exports.js ."
88
+ }
6
89
  }