@frigear-nu/crew 0.0.0-stage → 0.0.0

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 (149) hide show
  1. package/README.md +39 -2
  2. package/dist/module.d.mts +244 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +155 -0
  5. package/dist/runtime/access.d.ts +1 -0
  6. package/dist/runtime/access.js +45 -0
  7. package/dist/runtime/app/components/CrewAddMemberSlideover.d.vue.ts +18 -0
  8. package/dist/runtime/app/components/CrewAddMemberSlideover.vue +198 -0
  9. package/dist/runtime/app/components/CrewAddMemberSlideover.vue.d.ts +18 -0
  10. package/dist/runtime/app/components/CrewInviteSlideover.d.vue.ts +14 -0
  11. package/dist/runtime/app/components/CrewInviteSlideover.vue +147 -0
  12. package/dist/runtime/app/components/CrewInviteSlideover.vue.d.ts +14 -0
  13. package/dist/runtime/app/components/CrewMemberSlideover.d.vue.ts +14 -0
  14. package/dist/runtime/app/components/CrewMemberSlideover.vue +126 -0
  15. package/dist/runtime/app/components/CrewMemberSlideover.vue.d.ts +14 -0
  16. package/dist/runtime/app/composables/index.d.ts +4 -0
  17. package/dist/runtime/app/composables/index.js +3 -0
  18. package/dist/runtime/app/composables/useCrewActions.d.ts +45 -0
  19. package/dist/runtime/app/composables/useCrewActions.js +122 -0
  20. package/dist/runtime/app/composables/useCrewLinks.d.ts +9 -0
  21. package/dist/runtime/app/composables/useCrewLinks.js +6 -0
  22. package/dist/runtime/app/composables/useCrewTranslate.d.ts +7 -0
  23. package/dist/runtime/app/composables/useCrewTranslate.js +15 -0
  24. package/dist/runtime/app/dashboard/CrewStatus.d.vue.ts +3 -0
  25. package/dist/runtime/app/dashboard/CrewStatus.vue +78 -0
  26. package/dist/runtime/app/dashboard/CrewStatus.vue.d.ts +3 -0
  27. package/dist/runtime/app/pages/apply.d.vue.ts +3 -0
  28. package/dist/runtime/app/pages/apply.vue +95 -0
  29. package/dist/runtime/app/pages/apply.vue.d.ts +3 -0
  30. package/dist/runtime/app/pages/home.d.vue.ts +3 -0
  31. package/dist/runtime/app/pages/home.vue +21 -0
  32. package/dist/runtime/app/pages/home.vue.d.ts +3 -0
  33. package/dist/runtime/app/pages/invite.d.vue.ts +3 -0
  34. package/dist/runtime/app/pages/invite.vue +86 -0
  35. package/dist/runtime/app/pages/invite.vue.d.ts +3 -0
  36. package/dist/runtime/app/pages/status.d.vue.ts +3 -0
  37. package/dist/runtime/app/pages/status.vue +82 -0
  38. package/dist/runtime/app/pages/status.vue.d.ts +3 -0
  39. package/dist/runtime/app/tabs/Crew.d.vue.ts +9 -0
  40. package/dist/runtime/app/tabs/Crew.vue +590 -0
  41. package/dist/runtime/app/tabs/Crew.vue.d.ts +9 -0
  42. package/dist/runtime/app/utils/admin-crew.d.ts +48 -0
  43. package/dist/runtime/app/utils/admin-crew.js +23 -0
  44. package/dist/runtime/app/widgets/InboxAddToCrew.d.vue.ts +13 -0
  45. package/dist/runtime/app/widgets/InboxAddToCrew.vue +34 -0
  46. package/dist/runtime/app/widgets/InboxAddToCrew.vue.d.ts +13 -0
  47. package/dist/runtime/dashboard.d.ts +8 -0
  48. package/dist/runtime/dashboard.js +14 -0
  49. package/dist/runtime/emails/crew-status-applied.d.vue.ts +16 -0
  50. package/dist/runtime/emails/crew-status-applied.vue +40 -0
  51. package/dist/runtime/emails/crew-status-applied.vue.d.ts +16 -0
  52. package/dist/runtime/emails/crew-status-approved.d.vue.ts +16 -0
  53. package/dist/runtime/emails/crew-status-approved.vue +40 -0
  54. package/dist/runtime/emails/crew-status-approved.vue.d.ts +16 -0
  55. package/dist/runtime/emails/crew-status-rejected.d.vue.ts +15 -0
  56. package/dist/runtime/emails/crew-status-rejected.vue +33 -0
  57. package/dist/runtime/emails/crew-status-rejected.vue.d.ts +15 -0
  58. package/dist/runtime/emails/crew-status-waitlisted.d.vue.ts +16 -0
  59. package/dist/runtime/emails/crew-status-waitlisted.vue +40 -0
  60. package/dist/runtime/emails/crew-status-waitlisted.vue.d.ts +16 -0
  61. package/dist/runtime/emails/crew-status-withdrawn.d.vue.ts +16 -0
  62. package/dist/runtime/emails/crew-status-withdrawn.vue +40 -0
  63. package/dist/runtime/emails/crew-status-withdrawn.vue.d.ts +16 -0
  64. package/dist/runtime/i18n/lang/da.json +237 -0
  65. package/dist/runtime/i18n/lang/en.json +237 -0
  66. package/dist/runtime/menus.d.ts +2 -0
  67. package/dist/runtime/menus.js +17 -0
  68. package/dist/runtime/notifications.d.ts +5 -0
  69. package/dist/runtime/notifications.js +10 -0
  70. package/dist/runtime/server/db/schema.postgresql.d.ts +433 -0
  71. package/dist/runtime/server/db/schema.postgresql.js +43 -0
  72. package/dist/runtime/server/db/schema.sqlite.d.ts +451 -0
  73. package/dist/runtime/server/db/schema.sqlite.js +43 -0
  74. package/dist/runtime/server/db/team-members.postgresql.d.ts +143 -0
  75. package/dist/runtime/server/db/team-members.postgresql.js +20 -0
  76. package/dist/runtime/server/db/team-members.sqlite.d.ts +151 -0
  77. package/dist/runtime/server/db/team-members.sqlite.js +20 -0
  78. package/dist/runtime/server/plugins/forms.d.ts +2 -0
  79. package/dist/runtime/server/plugins/forms.js +27 -0
  80. package/dist/runtime/server/plugins/participation.d.ts +2 -0
  81. package/dist/runtime/server/plugins/participation.js +16 -0
  82. package/dist/runtime/server/policies.d.ts +2 -0
  83. package/dist/runtime/server/policies.js +10 -0
  84. package/dist/runtime/server/routes/admin/forms.get.d.ts +2 -0
  85. package/dist/runtime/server/routes/admin/forms.get.js +8 -0
  86. package/dist/runtime/server/routes/admin/invite.delete.d.ts +2 -0
  87. package/dist/runtime/server/routes/admin/invite.delete.js +13 -0
  88. package/dist/runtime/server/routes/admin/invites.get.d.ts +2 -0
  89. package/dist/runtime/server/routes/admin/invites.get.js +14 -0
  90. package/dist/runtime/server/routes/admin/invites.post.d.ts +2 -0
  91. package/dist/runtime/server/routes/admin/invites.post.js +31 -0
  92. package/dist/runtime/server/routes/admin/member-approve.post.d.ts +2 -0
  93. package/dist/runtime/server/routes/admin/member-approve.post.js +10 -0
  94. package/dist/runtime/server/routes/admin/member-reject.post.d.ts +2 -0
  95. package/dist/runtime/server/routes/admin/member-reject.post.js +9 -0
  96. package/dist/runtime/server/routes/admin/member-submission.get.d.ts +2 -0
  97. package/dist/runtime/server/routes/admin/member-submission.get.js +17 -0
  98. package/dist/runtime/server/routes/admin/member-waitlist.post.d.ts +2 -0
  99. package/dist/runtime/server/routes/admin/member-waitlist.post.js +9 -0
  100. package/dist/runtime/server/routes/admin/member-withdraw.post.d.ts +2 -0
  101. package/dist/runtime/server/routes/admin/member-withdraw.post.js +9 -0
  102. package/dist/runtime/server/routes/admin/member.patch.d.ts +2 -0
  103. package/dist/runtime/server/routes/admin/member.patch.js +10 -0
  104. package/dist/runtime/server/routes/admin/members-approve.post.d.ts +2 -0
  105. package/dist/runtime/server/routes/admin/members-approve.post.js +12 -0
  106. package/dist/runtime/server/routes/admin/members.get.d.ts +2 -0
  107. package/dist/runtime/server/routes/admin/members.get.js +10 -0
  108. package/dist/runtime/server/routes/admin/members.post.d.ts +2 -0
  109. package/dist/runtime/server/routes/admin/members.post.js +30 -0
  110. package/dist/runtime/server/routes/admin/settings.get.d.ts +2 -0
  111. package/dist/runtime/server/routes/admin/settings.get.js +9 -0
  112. package/dist/runtime/server/routes/admin/settings.put.d.ts +2 -0
  113. package/dist/runtime/server/routes/admin/settings.put.js +12 -0
  114. package/dist/runtime/server/routes/admin/users.get.d.ts +2 -0
  115. package/dist/runtime/server/routes/admin/users.get.js +8 -0
  116. package/dist/runtime/server/routes/me/crew.get.d.ts +2 -0
  117. package/dist/runtime/server/routes/me/crew.get.js +5 -0
  118. package/dist/runtime/server/routes/public/apply.get.d.ts +2 -0
  119. package/dist/runtime/server/routes/public/apply.get.js +9 -0
  120. package/dist/runtime/server/routes/public/invite-accept.post.d.ts +2 -0
  121. package/dist/runtime/server/routes/public/invite-accept.post.js +7 -0
  122. package/dist/runtime/server/routes/public/member.get.d.ts +2 -0
  123. package/dist/runtime/server/routes/public/member.get.js +9 -0
  124. package/dist/runtime/server/routes/public/members.get.d.ts +2 -0
  125. package/dist/runtime/server/routes/public/members.get.js +11 -0
  126. package/dist/runtime/server/utils/crew-dto.d.ts +46 -0
  127. package/dist/runtime/server/utils/crew-dto.js +80 -0
  128. package/dist/runtime/server/utils/crew-emails.d.ts +43 -0
  129. package/dist/runtime/server/utils/crew-emails.js +139 -0
  130. package/dist/runtime/server/utils/crew-schemas.d.ts +121 -0
  131. package/dist/runtime/server/utils/crew-schemas.js +69 -0
  132. package/dist/runtime/server/utils/crew-send.d.ts +19 -0
  133. package/dist/runtime/server/utils/crew-send.js +20 -0
  134. package/dist/runtime/server/utils/crew-settings.d.ts +52 -0
  135. package/dist/runtime/server/utils/crew-settings.js +100 -0
  136. package/dist/runtime/server/utils/crew-tokens.d.ts +8 -0
  137. package/dist/runtime/server/utils/crew-tokens.js +9 -0
  138. package/dist/runtime/server/utils/crew.d.ts +172 -0
  139. package/dist/runtime/server/utils/crew.js +502 -0
  140. package/dist/runtime/utils/api.d.ts +44 -0
  141. package/dist/runtime/utils/api.js +47 -0
  142. package/dist/runtime/utils/index.d.ts +8 -0
  143. package/dist/runtime/utils/index.js +6 -0
  144. package/dist/runtime/utils/links.d.ts +25 -0
  145. package/dist/runtime/utils/links.js +14 -0
  146. package/dist/runtime/utils/status.d.ts +36 -0
  147. package/dist/runtime/utils/status.js +39 -0
  148. package/dist/types.d.mts +5 -0
  149. package/package.json +118 -3
@@ -0,0 +1,36 @@
1
+ import type { CrewStatus } from '../../types.js';
2
+ /** Every crew status, in the order they usually happen. */
3
+ export declare const CREW_STATUSES: readonly ["applied", "waitlisted", "approved", "rejected", "withdrawn"];
4
+ export declare const CREW_STATUS_LABELS: Record<CrewStatus, string>;
5
+ export declare const isCrewStatus: (value: unknown) => value is CrewStatus;
6
+ /** The `status` crew stores on the team membership for a crew status: only an approved person is `active`. */
7
+ export declare function teamStatusOf(status: CrewStatus): 'pending' | 'active' | 'inactive';
8
+ /** Whether a crew status holds the team role (the teams membership rule: `active` grants, anything else is listed only). */
9
+ export declare const crewStatusGrants: (status: CrewStatus | null | undefined) => status is "approved";
10
+ /**
11
+ * The moves staff can make, by current status. Volunteers do not withdraw themselves: staff mark a person who stepped
12
+ * down as withdrawn. A withdrawn person has left: only they can come back, by applying again (or staff add them).
13
+ */
14
+ export declare const CREW_TRANSITIONS: Record<CrewStatus, readonly CrewStatus[]>;
15
+ export declare const canMoveCrew: (from: CrewStatus, to: CrewStatus) => boolean;
16
+ /** Statuses that count as "has applied and is still in the running". */
17
+ export declare const OPEN_CREW_STATUSES: readonly ["applied", "waitlisted", "approved"];
18
+ /** An i18n key of the crew namespace and its English fallback. */
19
+ export type CrewText = {
20
+ key: string;
21
+ fallback: string;
22
+ };
23
+ /** How the apply page tells a person who has applied where they stand (`CrewApplyDto` state `applied`). */
24
+ export type CrewApplyNotice = {
25
+ icon: string;
26
+ color: 'success' | 'neutral';
27
+ title: CrewText;
28
+ description: CrewText;
29
+ };
30
+ /**
31
+ * The apply page's notice for the person's crew status when the state is `applied`. Waitlisted people get their own
32
+ * heading, in the neutral colour of their status badge; applied and approved people get the green "applied" notice.
33
+ * Crew sends a status message on each change the texts promise (approved, rejected, waitlisted, and approved again
34
+ * when a place opens up), unless an operation turns that status's message off. `submitted`: the form was sent just now.
35
+ */
36
+ export declare function crewApplyNotice(status: CrewStatus | null, submitted?: boolean): CrewApplyNotice;
@@ -0,0 +1,39 @@
1
+ export const CREW_STATUSES = ["applied", "waitlisted", "approved", "rejected", "withdrawn"];
2
+ export const CREW_STATUS_LABELS = {
3
+ applied: "Applied",
4
+ waitlisted: "Waiting list",
5
+ approved: "Approved",
6
+ rejected: "Rejected",
7
+ withdrawn: "Withdrawn"
8
+ };
9
+ export const isCrewStatus = (value) => typeof value === "string" && CREW_STATUSES.includes(value);
10
+ export function teamStatusOf(status) {
11
+ if (status === "approved") return "active";
12
+ return status === "applied" || status === "waitlisted" ? "pending" : "inactive";
13
+ }
14
+ export const crewStatusGrants = (status) => status === "approved";
15
+ export const CREW_TRANSITIONS = {
16
+ applied: ["approved", "rejected", "waitlisted", "withdrawn"],
17
+ waitlisted: ["approved", "rejected", "withdrawn"],
18
+ approved: ["rejected", "waitlisted", "withdrawn"],
19
+ rejected: ["approved", "waitlisted"],
20
+ withdrawn: []
21
+ };
22
+ export const canMoveCrew = (from, to) => CREW_TRANSITIONS[from].includes(to);
23
+ export const OPEN_CREW_STATUSES = ["applied", "waitlisted", "approved"];
24
+ export function crewApplyNotice(status, submitted = false) {
25
+ if (status === "waitlisted") {
26
+ return {
27
+ icon: "i-lucide-hourglass",
28
+ color: "neutral",
29
+ title: { key: "apply.waitlisted", fallback: "You're on the waiting list" },
30
+ description: { key: "apply.waitlistedDescription", fallback: "We will email you if a place opens up." }
31
+ };
32
+ }
33
+ return {
34
+ icon: "i-lucide-circle-check",
35
+ color: "success",
36
+ title: submitted ? { key: "apply.thanks", fallback: "Thank you for applying" } : { key: "apply.alreadyApplied", fallback: "You have applied already" },
37
+ description: status === "approved" ? { key: "apply.approved", fallback: "You are on the crew." } : { key: "apply.receivedDescription", fallback: "We have received your application. We will email you when something changes." }
38
+ };
39
+ }
@@ -0,0 +1,5 @@
1
+ export { type Translated } from '@frigear-nu/ui/translated'
2
+
3
+ export { default } from './module.mjs'
4
+
5
+ export { type CreatedCrewInviteDto, type CrewApplyDto, type CrewFormOptionDto, type CrewInviteDto, type CrewMemberContext, type CrewMemberDto, type CrewRolePreset, type CrewRuntimeConfig, type CrewSettingsDto, type CrewStatus, type CrewStatusEmail, type CrewStatusEmails, type CrewSubmissionDto, type CrewUserLookupDto, type ModuleOptions, type MyCrewDto, type PublicModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,121 @@
1
1
  {
2
2
  "name": "@frigear-nu/crew",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "Crew for the frigear ecosystem: applications, approvals and invites that turn people into an operation's crew, built on teams.",
5
+ "homepage": "https://docs.frigear.dev/modules/volunteering/crew",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Frigear-nu/frigear-nu.git",
9
+ "directory": "packages/crew"
10
+ },
11
+ "license": "MIT",
12
+ "type": "module",
13
+ "main": "./dist/module.mjs",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/types.d.mts",
17
+ "import": "./dist/module.mjs",
18
+ "default": "./dist/module.mjs"
19
+ },
20
+ "./utils": {
21
+ "types": "./dist/runtime/utils/index.d.ts",
22
+ "import": "./dist/runtime/utils/index.js",
23
+ "default": "./dist/runtime/utils/index.js"
24
+ },
25
+ "./api": {
26
+ "types": "./dist/runtime/utils/api.d.ts",
27
+ "import": "./dist/runtime/utils/api.js",
28
+ "default": "./dist/runtime/utils/api.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "workspaces": [
35
+ "playground"
36
+ ],
37
+ "dependencies": {
38
+ "@frigear-nu/auth": "^0.6.4",
39
+ "@frigear-nu/dashboard": "^0.0.0",
40
+ "@frigear-nu/forms": "^0.5.0",
41
+ "@frigear-nu/module-kit": "^1.3.7",
42
+ "@frigear-nu/notify": "^0.2.6",
43
+ "@frigear-nu/operations": "^0.0.0",
44
+ "@frigear-nu/teams": "^0.0.0",
45
+ "@frigear-nu/ui": "^0.2.7",
46
+ "@frigear-nu/users": "^3.1.2",
47
+ "@libsql/client": "^0.18.0",
48
+ "@nuxt/kit": "^4.6.4",
49
+ "@vueuse/core": "^15.0.0",
50
+ "drizzle-kit": "^0.31.11",
51
+ "drizzle-orm": "^0.45.4",
52
+ "h3": "^1.15.11",
53
+ "zod": "^4.6.7"
54
+ },
55
+ "peerDependencies": {
56
+ "@frigear-nu/admin": "^0.5.0",
57
+ "@frigear-nu/email-templates": "^0.1.1",
58
+ "@frigear-nu/menu": "^0.4.0",
59
+ "@frigear-nu/mobile": "^0.6.2",
60
+ "@frigear-nu/widget": "^0.4.0",
61
+ "@nuxt/ui": "^4.12.0",
62
+ "@nuxthub/core": "^0.10.12"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "@frigear-nu/admin": {
66
+ "optional": true
67
+ },
68
+ "@frigear-nu/email-templates": {
69
+ "optional": true
70
+ },
71
+ "@frigear-nu/menu": {
72
+ "optional": true
73
+ },
74
+ "@frigear-nu/mobile": {
75
+ "optional": true
76
+ },
77
+ "@nuxt/ui": {
78
+ "optional": true
79
+ }
80
+ },
81
+ "devDependencies": {
82
+ "@frigear-nu/admin": "^0.5.0",
83
+ "@frigear-nu/email-templates": "^0.1.1",
84
+ "@frigear-nu/menu": "^0.4.0",
85
+ "@frigear-nu/mobile": "^0.6.2",
86
+ "@frigear-nu/widget": "^0.4.0",
87
+ "@nuxt/devtools": "^4.2.0",
88
+ "@nuxt/eslint-config": "^1.17.0",
89
+ "@nuxt/module-builder": "^1.0.4",
90
+ "@nuxt/schema": "^4.6.4",
91
+ "@nuxt/test-utils": "^4.4.0",
92
+ "@nuxt/ui": "^4.12.0",
93
+ "@nuxthub/core": "^0.10.12",
94
+ "@types/node": "^26.6.6",
95
+ "eslint": "^10.15.0",
96
+ "nuxt": "^4.6.4",
97
+ "typescript": "^6.0.3",
98
+ "unstorage": "^1.17.5",
99
+ "vitest": "^5.1.0",
100
+ "vue-tsc": "^3.3.14"
101
+ },
102
+ "scripts": {
103
+ "dev:stub": "nuxt-module-build build --stub && nuxt prepare",
104
+ "build": "nuxt-module-build build",
105
+ "dev": "npm run dev:prepare && nuxt dev playground",
106
+ "dev:build": "nuxt build playground",
107
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
108
+ "lint": "eslint .",
109
+ "lint:fix": "eslint . --fix",
110
+ "test": "vitest run",
111
+ "test:watch": "vitest watch",
112
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
113
+ },
114
+ "typesVersions": {
115
+ "*": {
116
+ ".": [
117
+ "./dist/types.d.mts"
118
+ ]
119
+ }
120
+ }
6
121
  }