jansathi-community-schema 0.45.0 → 0.47.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.
- package/dist/create-form-config.d.ts +51 -0
- package/dist/create-form-config.d.ts.map +1 -0
- package/dist/create-form-config.js +44 -0
- package/dist/create-form-config.js.map +1 -0
- package/dist/crowdfunding.d.ts +7 -0
- package/dist/crowdfunding.d.ts.map +1 -1
- package/dist/crowdfunding.js +12 -0
- package/dist/crowdfunding.js.map +1 -1
- package/dist/donate-item.d.ts +10 -0
- package/dist/donate-item.d.ts.map +1 -1
- package/dist/donate-item.js +67 -0
- package/dist/donate-item.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/lost-found.d.ts +10 -0
- package/dist/lost-found.d.ts.map +1 -1
- package/dist/lost-found.js +33 -0
- package/dist/lost-found.js.map +1 -1
- package/dist/suggestions-complaints.d.ts +13 -0
- package/dist/suggestions-complaints.d.ts.map +1 -1
- package/dist/suggestions-complaints.js +29 -0
- package/dist/suggestions-complaints.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared create-composer field configuration.
|
|
3
|
+
* =============================================
|
|
4
|
+
* Single source of truth for the per-step metadata that drives the reusable
|
|
5
|
+
* `StepForm` create composers (donate-item, lost-found, suggestions-complaints,
|
|
6
|
+
* crowdfunding). Mirrors `dating-schema`'s `OnboardingFieldConfig`: the schema
|
|
7
|
+
* package owns the STRUCTURE (step order, which options, required flags) and
|
|
8
|
+
* i18n KEY strings — the frontend resolves the keys via
|
|
9
|
+
* `useTranslations(<namespace>)` → `t(config.title)`.
|
|
10
|
+
*
|
|
11
|
+
* IMPORTANT: every string property here is an i18n KEY, not display text.
|
|
12
|
+
*
|
|
13
|
+
* @module community-schema/create-form-config
|
|
14
|
+
*/
|
|
15
|
+
/** Per-step config for a StepForm composer. All string props are i18n KEYS. */
|
|
16
|
+
export interface CreateFieldConfig {
|
|
17
|
+
/** i18n key for the question title. */
|
|
18
|
+
title: string;
|
|
19
|
+
/** i18n key for the help text shown under the title. */
|
|
20
|
+
help?: string;
|
|
21
|
+
/** i18n key for a text/textarea input placeholder. */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** i18n key for the short ChipStepper label (defaults to the title). */
|
|
24
|
+
stepper?: string;
|
|
25
|
+
/** Whether the step must be filled before the form can be submitted. */
|
|
26
|
+
required: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** A selectable option (chip) with i18n label + optional description keys. */
|
|
29
|
+
export interface CreateFieldOption {
|
|
30
|
+
value: string;
|
|
31
|
+
/** i18n key for the option label. */
|
|
32
|
+
label: string;
|
|
33
|
+
/** i18n key for the option's short description (shown under the label in the
|
|
34
|
+
* big "stack" chip layout). */
|
|
35
|
+
description?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Slugify a human-readable enum value into an i18n-safe key segment, e.g.
|
|
39
|
+
* `"Road & Transport"` → `"road_and_transport"`. Used when the enum VALUE is
|
|
40
|
+
* display text (suggestions/complaints categories) rather than a code.
|
|
41
|
+
*/
|
|
42
|
+
export declare function slugifyKey(value: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Build option configs from an enum value list using a key prefix, yielding
|
|
45
|
+
* `<prefix>.<key>.label` + `<prefix>.<key>.help` for each value. Keeps the
|
|
46
|
+
* option i18n keys mechanical and in lockstep with the enum. `keyOf` maps a
|
|
47
|
+
* value to its key segment (defaults to the value itself; pass `slugifyKey`
|
|
48
|
+
* for human-string enums).
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildFieldOptions(values: readonly string[], prefix: string, keyOf?: (value: string) => string): CreateFieldOption[];
|
|
51
|
+
//# sourceMappingURL=create-form-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-form-config.d.ts","sourceRoot":"","sources":["../src/create-form-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd;oCACgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAiB,GAC1C,iBAAiB,EAAE,CASrB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared create-composer field configuration.
|
|
3
|
+
* =============================================
|
|
4
|
+
* Single source of truth for the per-step metadata that drives the reusable
|
|
5
|
+
* `StepForm` create composers (donate-item, lost-found, suggestions-complaints,
|
|
6
|
+
* crowdfunding). Mirrors `dating-schema`'s `OnboardingFieldConfig`: the schema
|
|
7
|
+
* package owns the STRUCTURE (step order, which options, required flags) and
|
|
8
|
+
* i18n KEY strings — the frontend resolves the keys via
|
|
9
|
+
* `useTranslations(<namespace>)` → `t(config.title)`.
|
|
10
|
+
*
|
|
11
|
+
* IMPORTANT: every string property here is an i18n KEY, not display text.
|
|
12
|
+
*
|
|
13
|
+
* @module community-schema/create-form-config
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Slugify a human-readable enum value into an i18n-safe key segment, e.g.
|
|
17
|
+
* `"Road & Transport"` → `"road_and_transport"`. Used when the enum VALUE is
|
|
18
|
+
* display text (suggestions/complaints categories) rather than a code.
|
|
19
|
+
*/
|
|
20
|
+
export function slugifyKey(value) {
|
|
21
|
+
return value
|
|
22
|
+
.toLowerCase()
|
|
23
|
+
.replace(/&/g, ' and ')
|
|
24
|
+
.replace(/[^a-z0-9]+/g, '_')
|
|
25
|
+
.replace(/^_+|_+$/g, '');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build option configs from an enum value list using a key prefix, yielding
|
|
29
|
+
* `<prefix>.<key>.label` + `<prefix>.<key>.help` for each value. Keeps the
|
|
30
|
+
* option i18n keys mechanical and in lockstep with the enum. `keyOf` maps a
|
|
31
|
+
* value to its key segment (defaults to the value itself; pass `slugifyKey`
|
|
32
|
+
* for human-string enums).
|
|
33
|
+
*/
|
|
34
|
+
export function buildFieldOptions(values, prefix, keyOf = (v) => v) {
|
|
35
|
+
return values.map((value) => {
|
|
36
|
+
const key = keyOf(value);
|
|
37
|
+
return {
|
|
38
|
+
value,
|
|
39
|
+
label: `${prefix}.${key}.label`,
|
|
40
|
+
description: `${prefix}.${key}.help`,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=create-form-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-form-config.js","sourceRoot":"","sources":["../src/create-form-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA0BH;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAyB,EACzB,MAAc,EACd,QAAmC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO;YACL,KAAK;YACL,KAAK,EAAE,GAAG,MAAM,IAAI,GAAG,QAAQ;YAC/B,WAAW,EAAE,GAAG,MAAM,IAAI,GAAG,OAAO;SACrC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Shared create-composer field configuration.\n * =============================================\n * Single source of truth for the per-step metadata that drives the reusable\n * `StepForm` create composers (donate-item, lost-found, suggestions-complaints,\n * crowdfunding). Mirrors `dating-schema`'s `OnboardingFieldConfig`: the schema\n * package owns the STRUCTURE (step order, which options, required flags) and\n * i18n KEY strings — the frontend resolves the keys via\n * `useTranslations(<namespace>)` → `t(config.title)`.\n *\n * IMPORTANT: every string property here is an i18n KEY, not display text.\n *\n * @module community-schema/create-form-config\n */\n\n/** Per-step config for a StepForm composer. All string props are i18n KEYS. */\nexport interface CreateFieldConfig {\n /** i18n key for the question title. */\n title: string;\n /** i18n key for the help text shown under the title. */\n help?: string;\n /** i18n key for a text/textarea input placeholder. */\n placeholder?: string;\n /** i18n key for the short ChipStepper label (defaults to the title). */\n stepper?: string;\n /** Whether the step must be filled before the form can be submitted. */\n required: boolean;\n}\n\n/** A selectable option (chip) with i18n label + optional description keys. */\nexport interface CreateFieldOption {\n value: string;\n /** i18n key for the option label. */\n label: string;\n /** i18n key for the option's short description (shown under the label in the\n * big \"stack\" chip layout). */\n description?: string;\n}\n\n/**\n * Slugify a human-readable enum value into an i18n-safe key segment, e.g.\n * `\"Road & Transport\"` → `\"road_and_transport\"`. Used when the enum VALUE is\n * display text (suggestions/complaints categories) rather than a code.\n */\nexport function slugifyKey(value: string): string {\n return value\n .toLowerCase()\n .replace(/&/g, ' and ')\n .replace(/[^a-z0-9]+/g, '_')\n .replace(/^_+|_+$/g, '');\n}\n\n/**\n * Build option configs from an enum value list using a key prefix, yielding\n * `<prefix>.<key>.label` + `<prefix>.<key>.help` for each value. Keeps the\n * option i18n keys mechanical and in lockstep with the enum. `keyOf` maps a\n * value to its key segment (defaults to the value itself; pass `slugifyKey`\n * for human-string enums).\n */\nexport function buildFieldOptions(\n values: readonly string[],\n prefix: string,\n keyOf: (value: string) => string = (v) => v,\n): CreateFieldOption[] {\n return values.map((value) => {\n const key = keyOf(value);\n return {\n value,\n label: `${prefix}.${key}.label`,\n description: `${prefix}.${key}.help`,\n };\n });\n}\n"]}
|
package/dist/crowdfunding.d.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* @module community-schema/crowdfunding
|
|
30
30
|
*/
|
|
31
31
|
import { z } from 'zod';
|
|
32
|
+
import { type CreateFieldOption } from './create-form-config.js';
|
|
32
33
|
/**
|
|
33
34
|
* Top-level categories — drives the chip + icon on the card and the
|
|
34
35
|
* verifier's per-category supporting-doc requirements (medical needs
|
|
@@ -85,6 +86,12 @@ export declare const crowdfundingCategorySchema: z.ZodEnum<{
|
|
|
85
86
|
startup_prototype: "startup_prototype";
|
|
86
87
|
}>;
|
|
87
88
|
export type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;
|
|
89
|
+
/** Category chip options (label + description keys under `crowdfunding`). */
|
|
90
|
+
export declare const CROWDFUNDING_CATEGORY_OPTIONS: CreateFieldOption[];
|
|
91
|
+
/** Audience chip options (who the campaign is for). */
|
|
92
|
+
export declare const CROWDFUNDING_AUDIENCE_OPTIONS: CreateFieldOption[];
|
|
93
|
+
/** Organization-kind chip options (only when audience === 'organization'). */
|
|
94
|
+
export declare const CROWDFUNDING_ORG_KIND_OPTIONS: CreateFieldOption[];
|
|
88
95
|
/**
|
|
89
96
|
* Visibility — where the campaign appears.
|
|
90
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crowdfunding.d.ts","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"crowdfunding.d.ts","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAwBpF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,2PAwB/B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,oEAM/B,CAAC;AACX,eAAO,MAAM,0BAA0B;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,4DAM/B,CAAC;AACX,eAAO,MAAM,yBAAyB;;;;;;EAAuC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAQ9E,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,EAG5D,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,EAG5D,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,EAAE,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H,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,mCAAmC;;iBAE9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAIhG,eAAO,MAAM,oCAAoC;;;;;;;;iBAI/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;iBAIjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC"}
|
package/dist/crowdfunding.js
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
import { z } from 'zod';
|
|
32
32
|
import { areaLineageSnapshotSchema } from './area.js';
|
|
33
|
+
import { buildFieldOptions } from './create-form-config.js';
|
|
33
34
|
import { CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_PROOF_DOCS, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, } from './constants.js';
|
|
34
35
|
import { voteValueSchema } from './engagement.js';
|
|
35
36
|
import { postAuthorSnapshotSchema } from './post.js';
|
|
@@ -93,6 +94,17 @@ export const CROWDFUNDING_ORG_KIND_VALUES = [
|
|
|
93
94
|
];
|
|
94
95
|
export const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);
|
|
95
96
|
export const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);
|
|
97
|
+
// ─── Create-composer chip options (schema-driven StepForm) ────────────────────
|
|
98
|
+
// i18n KEYS under the `crowdfunding` namespace. The crowdfunding composer's
|
|
99
|
+
// step metadata already lives as i18n keys in its frontend sub-step config; the
|
|
100
|
+
// chip OPTION metadata (category / audience / org-kind) is centralized here so
|
|
101
|
+
// the option pickers are schema-driven + i18n like the other composers.
|
|
102
|
+
/** Category chip options (label + description keys under `crowdfunding`). */
|
|
103
|
+
export const CROWDFUNDING_CATEGORY_OPTIONS = buildFieldOptions(CROWDFUNDING_CATEGORY_VALUES, 'create.categories');
|
|
104
|
+
/** Audience chip options (who the campaign is for). */
|
|
105
|
+
export const CROWDFUNDING_AUDIENCE_OPTIONS = buildFieldOptions(CROWDFUNDING_AUDIENCE_VALUES, 'create.audiences');
|
|
106
|
+
/** Organization-kind chip options (only when audience === 'organization'). */
|
|
107
|
+
export const CROWDFUNDING_ORG_KIND_OPTIONS = buildFieldOptions(CROWDFUNDING_ORG_KIND_VALUES, 'create.orgKinds');
|
|
96
108
|
/**
|
|
97
109
|
* Visibility — where the campaign appears.
|
|
98
110
|
*
|
package/dist/crowdfunding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,uCAAuC,EACvC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CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / suggestions-complaints / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_PROOF_DOCS,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n/**\n * Visibility — where the campaign appears.\n *\n * v0.34 dropped the per-campaign area scope entirely. Instead the\n * creator picks one or more communities they're a member of, AND/OR\n * flips a \"show in global feed\" toggle. The campaign appears in those\n * surfaces and ONLY those surfaces (no geographic cascade).\n *\n * communityIds list of community ids the campaign is published into.\n * Empty array means \"no community-scoped publication\".\n * includesGlobal when true the campaign also appears in the global\n * feed (cross-community discovery surface).\n *\n * The Zod schema enforces at-least-one-publication at parse time so a\n * caller can't accidentally create an orphan campaign. The composer's\n * VisibilityPicker enforces the same on the UI side.\n *\n * HotScore (already present on the model) drives RANKING within these\n * feeds. The recompute job runs every few minutes and the higher-\n * scoring campaigns surface to the top of each feed surface they\n * appear in.\n */\n/**\n * v0.36: the global feed is ALWAYS selected. A campaign is implicitly\n * published to the global home feed, and the creator can optionally\n * additionally pick communities they're a member of to also publish\n * into. `includesGlobal` is kept on the wire shape for forward\n * compatibility but is forced to `true` at parse time — the creator\n * doesn't see a toggle in the composer.\n */\nexport const crowdfundingVisibilitySchema = z.object({\n communityIds: z.array(z.string()).default([]),\n includesGlobal: z\n .boolean()\n .default(true)\n // Force to true regardless of input. The field stays on the wire\n // so consumers can still pivot UI based on it (e.g. legacy rows\n // that explicitly opted out are still readable).\n .transform(() => true),\n});\nexport type CrowdfundingVisibility = z.infer<typeof crowdfundingVisibilitySchema>;\n\n/**\n * Lifecycle state.\n *\n * draft creator is filling the composer\n * submitted creator has accepted T&C and submitted; sits in\n * the area-leader verifier queue\n * awaiting_bank_link area leader has approved; creator must complete\n * Razorpay Linked Account KYC before the campaign\n * goes live. Inserted between `submitted` and\n * `active` so the post-approval payment-setup gate\n * is a first-class state, not a flag-on-active. A\n * `bankLinkDeadlineAt` countdown auto-reverts the\n * campaign to `rejected` if KYC isn't completed\n * in time.\n * rejected area leader rejected, OR bank-link deadline\n * passed, OR Razorpay KYC failed permanently.\n * Creator can edit + resubmit.\n * active publishable in the feed; donations open\n * closed_* terminal end-states with different reasons\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'awaiting_bank_link',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Proof document types — drives the doc-picker UI in the composer's\n * Proof Documents step (added in v0.33) AND the verifier's per-category\n * expected-doc checklist. The composer narrows the picker by category;\n * the verifier sees the full list with the user-supplied type label so\n * they can match the doc to the cause narrative.\n *\n * Per-category required-minimum mapping lives in the composer (frontend)\n * and is enforced at submit by the backend. The set here is the union of\n * what the renderer can offer across categories; some types (e.g.\n * 12a_certificate) are only useful when audience === organization, and\n * the renderer hides them otherwise.\n */\nexport const CROWDFUNDING_PROOF_DOC_TYPE_VALUES = [\n // Medical\n 'hospital_bill',\n 'diagnosis_report',\n 'doctor_letter',\n 'prescription',\n 'insurance_denial',\n // Education\n 'admission_letter',\n 'fee_schedule',\n 'scholarship_letter',\n // Community / civic / supporter-backed\n 'supporters_signed_letter',\n 'project_proposal',\n 'beneficiaries_list',\n // Disaster\n 'relief_org_letter',\n 'affected_area_photos',\n 'government_notification',\n // Organization (when audience === 'organization')\n 'org_registration_certificate',\n 'certificate_12a',\n 'certificate_80g',\n 'certificate_fcra',\n // Generic / cross-cutting\n 'identity_proof',\n 'address_proof',\n 'photo',\n 'video',\n 'other',\n] as const;\nexport const crowdfundingProofDocTypeSchema = z.enum(CROWDFUNDING_PROOF_DOC_TYPE_VALUES);\nexport type CrowdfundingProofDocType = z.infer<typeof crowdfundingProofDocTypeSchema>;\n\n/**\n * Razorpay Linked Account onboarding state, mirrored onto the campaign.\n *\n * not_started - default; creator hasn't started bank-linking yet\n * created - linked account created via Razorpay API; KYC URL\n * has been issued to the creator\n * under_review - creator has submitted KYC; Razorpay is reviewing\n * (typically 1-3 business days)\n * activated - KYC approved; campaign moves to `active`\n * rejected - KYC rejected; creator must update documents and\n * retry\n * suspended - account was activated but later suspended (fraud,\n * ToS violation, etc.); campaign halted pending review\n */\nexport const CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES = [\n 'not_started',\n 'created',\n 'under_review',\n 'activated',\n 'rejected',\n 'suspended',\n] as const;\nexport const crowdfundingRazorpayAccountStatusSchema = z.enum(\n CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES,\n);\nexport type CrowdfundingRazorpayAccountStatus = z.infer<\n typeof crowdfundingRazorpayAccountStatusSchema\n>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n// v0.34 dropped the fee-billing mode types entirely. The new flow uses\n// a flat 5 % commission via Razorpay Route at donation-disbursement\n// time — there is no creator-side billing choice to capture.\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * One stage of the two-leader verification flow. v0.35 split the old\n * single-stage `verification` block into TWO stages: `district` (the\n * district leader for the creator's district vets authenticity) and\n * `state` (the state leader for the creator's state cosigns). Both\n * stages must be `approved` before the campaign can move on to bank\n * linking. Either stage going to `rejected` is terminal for the\n * submission — the creator edits + resubmits, which resets both\n * stages back to `pending`.\n */\nexport const crowdfundingVerificationStageSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this stage (display name — live-joined\n * from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerificationStage = z.infer<typeof crowdfundingVerificationStageSchema>;\n\n/**\n * Two-stage verification block. Sequential: state leader can only act\n * after district leader has approved (the queue UI hides un-vetted\n * campaigns from the state queue). Either rejection sends the whole\n * campaign to `rejected` at the campaign level.\n */\nexport const crowdfundingVerificationSchema = z.object({\n district: crowdfundingVerificationStageSchema,\n state: crowdfundingVerificationStageSchema,\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n *\n * In v0.33 the platform shifted from \"direct UPI to creator\" to\n * \"Razorpay Linked Account split-payment\", so every field on this\n * shape is now OPTIONAL — a Linked-Account campaign carries an\n * activated `razorpayLinkedAccountId` (on the campaign root) and\n * surfaces a Razorpay-hosted checkout, not a UPI QR. Legacy campaigns\n * created before v0.33 still carry these fields; the donor card\n * renders the QR + bank info when present, the Razorpay flow when not.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url().optional(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4).optional(),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string().optional(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n/**\n * A single proof document attached by the creator. Multiple instances\n * carried in `proofDocuments` on the campaign; each one has its own\n * type label + free-text description so the verifier sees \"Hospital\n * bill: AIIMS Delhi, June 2026 — ₹1.2L\" not just \"doc-1.pdf\".\n */\nexport const crowdfundingProofDocumentWireSchema = z.object({\n /** GCS signed URL of the uploaded document. */\n url: z.string().url(),\n /** What kind of proof this is. Drives the verifier's per-category\n * expected-doc checklist. */\n type: crowdfundingProofDocTypeSchema,\n /** Creator's own one-line description of the document. Surfaced\n * next to the type label on the verifier surface so they can match\n * the doc to the campaign narrative without opening every PDF. */\n description: z.string().trim().min(3).max(200),\n /** When the upload completed. Useful for the verifier to see the\n * sequence of uploads. */\n uploadedAt: z.string().datetime(),\n});\nexport type CrowdfundingProofDocumentWire = z.infer<typeof crowdfundingProofDocumentWireSchema>;\n\n/**\n * Razorpay Linked Account surface mirrored onto the campaign. Set by\n * the post-approval bank-linking flow; absent while the campaign is in\n * `draft` / `submitted` / `rejected`.\n *\n * Only the STATUS metadata surfaces on the wire — the linked-account\n * id itself stays server-side (used to route disbursements via\n * Razorpay Route, never needed by clients).\n */\nexport const crowdfundingRazorpayAccountWireSchema = z.object({\n /** Current state of the linked-account onboarding. */\n status: crowdfundingRazorpayAccountStatusSchema,\n /** ISO timestamp of when the account moved to `activated`. The\n * campaign flips to `active` at this point. */\n activatedAt: z.string().datetime().nullable().optional(),\n /** Reason Razorpay rejected the KYC submission. Surfaced to the\n * creator so they can fix and retry. */\n rejectionReason: z.string().nullable().optional(),\n /** Razorpay-hosted KYC onboarding URL. Set when status moves to\n * `created`; the creator opens this in a webview to complete KYC. */\n onboardingUrl: z.string().url().nullable().optional(),\n /** Deadline for the creator to finish bank linking. After this\n * date a scheduled job reverts the campaign to `rejected` with a\n * \"bank link deadline missed\" reason. */\n deadlineAt: z.string().datetime().nullable().optional(),\n});\nexport type CrowdfundingRazorpayAccountWire = z.infer<typeof crowdfundingRazorpayAccountWireSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Visibility (v0.34+) ─────────────────────────────────────────\n /**\n * Where the campaign appears. v0.34 replaced the per-campaign area\n * scope with this explicit user choice — pick communities you're a\n * member of and/or flip the global-feed toggle. See\n * `crowdfundingVisibilitySchema` for the contract + the at-least-one-\n * publication constraint.\n */\n visibility: crowdfundingVisibilitySchema,\n\n // ─── Verification surface ────────────────────────────────────────\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Razorpay Linked Account state (creator-facing post-approval) ─\n /**\n * Razorpay Linked Account onboarding state. Absent on `draft` /\n * `submitted` / `rejected` campaigns (nothing to link yet). Present\n * on `awaiting_bank_link` / `active` / closed campaigns. Only the\n * creator's own view of their campaign carries the full record;\n * other donors see at most a public \"verified payee\" badge derived\n * from `status === 'activated'`.\n */\n razorpayAccount: crowdfundingRazorpayAccountWireSchema.optional(),\n\n // ─── Proof documents (verifier + creator view only) ───────────────\n /**\n * Server-side attached proof documents. Surfaced to:\n * - the campaign creator (to remind them what they uploaded)\n * - the verifier on the review queue\n * - admin / moderators on the audit surface\n * Scrubbed for all other viewers (donors, feed readers).\n */\n proofDocuments: z.array(crowdfundingProofDocumentWireSchema).optional(),\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n /**\n * When the creator accepted the campaign Terms & Conditions. Stamped\n * at submit time. Surfaced so the My Campaigns surface can show\n * \"Agreed to Terms v2 on …\" copy.\n */\n termsAcceptedAt: z.string().datetime().nullable().optional(),\n /**\n * Version string of the T&C the creator accepted. Lets us re-prompt\n * acceptance if the T&C are amended materially.\n */\n termsVersion: z.string().nullable().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n /**\n * Denormalised creator location at the time the campaign was\n * created. Kept on the wire (despite v0.34 dropping the area-scope\n * concept) so the verifier surface and creator's \"My Campaigns\"\n * row can show \"from <village>, <district>\" context without a live\n * join. NOT used for visibility filtering — that lives entirely on\n * `visibility` now.\n */\n areaLineage: areaLineageSnapshotSchema,\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n /**\n * Where the campaign should appear. Pick communities you're a\n * member of and/or flip the global-feed toggle. Server rejects an\n * empty/global-false combination at create time.\n */\n visibility: crowdfundingVisibilitySchema,\n\n // v0.37: dropped composer-side identity collection. Razorpay's\n // hosted onboarding (on the bank-link step) handles PAN, Aadhaar,\n // bank account verification, and address proof for every payee —\n // doing it ourselves was redundant and weakened the privacy story\n // (we held copies of regulatory-sensitive data we didn't need to).\n //\n // ─── Proof documents (v0.33+ — required at submit time) ──────────\n /**\n * Typed + described proof documents the verifier reviews. Optional\n * on the create/update body so an in-progress draft can be saved\n * without docs; the submit-for-review handler enforces a non-empty\n * list (the per-category minimum is enforced server-side via the\n * `CROWDFUNDING_REQUIRED_PROOF_TYPES_BY_CATEGORY` matrix).\n */\n proofDocuments: z\n .array(\n z.object({\n url: z.string().url(),\n type: crowdfundingProofDocTypeSchema,\n description: z.string().trim().min(3).max(200),\n /** Optional on the body; server stamps `now` if absent. */\n uploadedAt: z.string().datetime().optional(),\n }),\n )\n .max(CROWDFUNDING_MAX_PROOF_DOCS)\n .optional(),\n\n // ─── Terms & Conditions acceptance ───────────────────────────────\n /**\n * Version of the T&C the creator agreed to. Set by the composer's\n * T&C step; the submit-for-review handler rejects the campaign if\n * this isn't equal to the current `CROWDFUNDING_TERMS_VERSION`.\n */\n termsVersion: z.string().optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. v0.35 introduced the two-\n * stage flow (district leader then state leader); the stage being\n * acted on is INFERRED from the leader's jurisdiction at the service\n * layer, not claimed in the body. The body stays an empty strict\n * object so transports that always POST a JSON body continue to work\n * and future fields can be added without a wire-shape change.\n */\nexport const approveCrowdfundingBodySchema = z.object({}).strict();\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit. Either the district or the\n * state stage can reject; the stage is inferred from the leader's\n * jurisdiction.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n/**\n * Rerun a closed-timeout campaign. The creator opens an edit flow\n * with extended duration (+ optional goal/story tweaks) and re-\n * submits; the resubmit resets BOTH verification stages to pending,\n * and the campaign re-enters the district queue from scratch.\n *\n * Body carries only the new duration — the rest of the edits ride\n * the normal `updateCrowdfundingBodySchema` path that runs alongside\n * the rerun action. Duration is required; without it the rerun makes\n * no sense (the campaign would close immediately again).\n */\nexport const requestRerunCrowdfundingBodySchema = z.object({\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n});\nexport type RequestRerunCrowdfundingBody = z.infer<typeof requestRerunCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EACL,uCAAuC,EACvC,2CAA2C,EAC3C,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EA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IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / suggestions-complaints / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport { buildFieldOptions, type CreateFieldOption } from './create-form-config.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_PROOF_DOCS,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n// ─── Create-composer chip options (schema-driven StepForm) ────────────────────\n// i18n KEYS under the `crowdfunding` namespace. The crowdfunding composer's\n// step metadata already lives as i18n keys in its frontend sub-step config; the\n// chip OPTION metadata (category / audience / org-kind) is centralized here so\n// the option pickers are schema-driven + i18n like the other composers.\n\n/** Category chip options (label + description keys under `crowdfunding`). */\nexport const CROWDFUNDING_CATEGORY_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n CROWDFUNDING_CATEGORY_VALUES,\n 'create.categories',\n);\n\n/** Audience chip options (who the campaign is for). */\nexport const CROWDFUNDING_AUDIENCE_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n CROWDFUNDING_AUDIENCE_VALUES,\n 'create.audiences',\n);\n\n/** Organization-kind chip options (only when audience === 'organization'). */\nexport const CROWDFUNDING_ORG_KIND_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n CROWDFUNDING_ORG_KIND_VALUES,\n 'create.orgKinds',\n);\n\n/**\n * Visibility — where the campaign appears.\n *\n * v0.34 dropped the per-campaign area scope entirely. Instead the\n * creator picks one or more communities they're a member of, AND/OR\n * flips a \"show in global feed\" toggle. The campaign appears in those\n * surfaces and ONLY those surfaces (no geographic cascade).\n *\n * communityIds list of community ids the campaign is published into.\n * Empty array means \"no community-scoped publication\".\n * includesGlobal when true the campaign also appears in the global\n * feed (cross-community discovery surface).\n *\n * The Zod schema enforces at-least-one-publication at parse time so a\n * caller can't accidentally create an orphan campaign. The composer's\n * VisibilityPicker enforces the same on the UI side.\n *\n * HotScore (already present on the model) drives RANKING within these\n * feeds. The recompute job runs every few minutes and the higher-\n * scoring campaigns surface to the top of each feed surface they\n * appear in.\n */\n/**\n * v0.36: the global feed is ALWAYS selected. A campaign is implicitly\n * published to the global home feed, and the creator can optionally\n * additionally pick communities they're a member of to also publish\n * into. `includesGlobal` is kept on the wire shape for forward\n * compatibility but is forced to `true` at parse time — the creator\n * doesn't see a toggle in the composer.\n */\nexport const crowdfundingVisibilitySchema = z.object({\n communityIds: z.array(z.string()).default([]),\n includesGlobal: z\n .boolean()\n .default(true)\n // Force to true regardless of input. The field stays on the wire\n // so consumers can still pivot UI based on it (e.g. legacy rows\n // that explicitly opted out are still readable).\n .transform(() => true),\n});\nexport type CrowdfundingVisibility = z.infer<typeof crowdfundingVisibilitySchema>;\n\n/**\n * Lifecycle state.\n *\n * draft creator is filling the composer\n * submitted creator has accepted T&C and submitted; sits in\n * the area-leader verifier queue\n * awaiting_bank_link area leader has approved; creator must complete\n * Razorpay Linked Account KYC before the campaign\n * goes live. Inserted between `submitted` and\n * `active` so the post-approval payment-setup gate\n * is a first-class state, not a flag-on-active. A\n * `bankLinkDeadlineAt` countdown auto-reverts the\n * campaign to `rejected` if KYC isn't completed\n * in time.\n * rejected area leader rejected, OR bank-link deadline\n * passed, OR Razorpay KYC failed permanently.\n * Creator can edit + resubmit.\n * active publishable in the feed; donations open\n * closed_* terminal end-states with different reasons\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'awaiting_bank_link',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Proof document types — drives the doc-picker UI in the composer's\n * Proof Documents step (added in v0.33) AND the verifier's per-category\n * expected-doc checklist. The composer narrows the picker by category;\n * the verifier sees the full list with the user-supplied type label so\n * they can match the doc to the cause narrative.\n *\n * Per-category required-minimum mapping lives in the composer (frontend)\n * and is enforced at submit by the backend. The set here is the union of\n * what the renderer can offer across categories; some types (e.g.\n * 12a_certificate) are only useful when audience === organization, and\n * the renderer hides them otherwise.\n */\nexport const CROWDFUNDING_PROOF_DOC_TYPE_VALUES = [\n // Medical\n 'hospital_bill',\n 'diagnosis_report',\n 'doctor_letter',\n 'prescription',\n 'insurance_denial',\n // Education\n 'admission_letter',\n 'fee_schedule',\n 'scholarship_letter',\n // Community / civic / supporter-backed\n 'supporters_signed_letter',\n 'project_proposal',\n 'beneficiaries_list',\n // Disaster\n 'relief_org_letter',\n 'affected_area_photos',\n 'government_notification',\n // Organization (when audience === 'organization')\n 'org_registration_certificate',\n 'certificate_12a',\n 'certificate_80g',\n 'certificate_fcra',\n // Generic / cross-cutting\n 'identity_proof',\n 'address_proof',\n 'photo',\n 'video',\n 'other',\n] as const;\nexport const crowdfundingProofDocTypeSchema = z.enum(CROWDFUNDING_PROOF_DOC_TYPE_VALUES);\nexport type CrowdfundingProofDocType = z.infer<typeof crowdfundingProofDocTypeSchema>;\n\n/**\n * Razorpay Linked Account onboarding state, mirrored onto the campaign.\n *\n * not_started - default; creator hasn't started bank-linking yet\n * created - linked account created via Razorpay API; KYC URL\n * has been issued to the creator\n * under_review - creator has submitted KYC; Razorpay is reviewing\n * (typically 1-3 business days)\n * activated - KYC approved; campaign moves to `active`\n * rejected - KYC rejected; creator must update documents and\n * retry\n * suspended - account was activated but later suspended (fraud,\n * ToS violation, etc.); campaign halted pending review\n */\nexport const CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES = [\n 'not_started',\n 'created',\n 'under_review',\n 'activated',\n 'rejected',\n 'suspended',\n] as const;\nexport const crowdfundingRazorpayAccountStatusSchema = z.enum(\n CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES,\n);\nexport type CrowdfundingRazorpayAccountStatus = z.infer<\n typeof crowdfundingRazorpayAccountStatusSchema\n>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n// v0.34 dropped the fee-billing mode types entirely. The new flow uses\n// a flat 5 % commission via Razorpay Route at donation-disbursement\n// time — there is no creator-side billing choice to capture.\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * One stage of the two-leader verification flow. v0.35 split the old\n * single-stage `verification` block into TWO stages: `district` (the\n * district leader for the creator's district vets authenticity) and\n * `state` (the state leader for the creator's state cosigns). Both\n * stages must be `approved` before the campaign can move on to bank\n * linking. Either stage going to `rejected` is terminal for the\n * submission — the creator edits + resubmits, which resets both\n * stages back to `pending`.\n */\nexport const crowdfundingVerificationStageSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this stage (display name — live-joined\n * from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerificationStage = z.infer<typeof crowdfundingVerificationStageSchema>;\n\n/**\n * Two-stage verification block. Sequential: state leader can only act\n * after district leader has approved (the queue UI hides un-vetted\n * campaigns from the state queue). Either rejection sends the whole\n * campaign to `rejected` at the campaign level.\n */\nexport const crowdfundingVerificationSchema = z.object({\n district: crowdfundingVerificationStageSchema,\n state: crowdfundingVerificationStageSchema,\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n *\n * In v0.33 the platform shifted from \"direct UPI to creator\" to\n * \"Razorpay Linked Account split-payment\", so every field on this\n * shape is now OPTIONAL — a Linked-Account campaign carries an\n * activated `razorpayLinkedAccountId` (on the campaign root) and\n * surfaces a Razorpay-hosted checkout, not a UPI QR. Legacy campaigns\n * created before v0.33 still carry these fields; the donor card\n * renders the QR + bank info when present, the Razorpay flow when not.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url().optional(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4).optional(),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string().optional(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n/**\n * A single proof document attached by the creator. Multiple instances\n * carried in `proofDocuments` on the campaign; each one has its own\n * type label + free-text description so the verifier sees \"Hospital\n * bill: AIIMS Delhi, June 2026 — ₹1.2L\" not just \"doc-1.pdf\".\n */\nexport const crowdfundingProofDocumentWireSchema = z.object({\n /** GCS signed URL of the uploaded document. */\n url: z.string().url(),\n /** What kind of proof this is. Drives the verifier's per-category\n * expected-doc checklist. */\n type: crowdfundingProofDocTypeSchema,\n /** Creator's own one-line description of the document. Surfaced\n * next to the type label on the verifier surface so they can match\n * the doc to the campaign narrative without opening every PDF. */\n description: z.string().trim().min(3).max(200),\n /** When the upload completed. Useful for the verifier to see the\n * sequence of uploads. */\n uploadedAt: z.string().datetime(),\n});\nexport type CrowdfundingProofDocumentWire = z.infer<typeof crowdfundingProofDocumentWireSchema>;\n\n/**\n * Razorpay Linked Account surface mirrored onto the campaign. Set by\n * the post-approval bank-linking flow; absent while the campaign is in\n * `draft` / `submitted` / `rejected`.\n *\n * Only the STATUS metadata surfaces on the wire — the linked-account\n * id itself stays server-side (used to route disbursements via\n * Razorpay Route, never needed by clients).\n */\nexport const crowdfundingRazorpayAccountWireSchema = z.object({\n /** Current state of the linked-account onboarding. */\n status: crowdfundingRazorpayAccountStatusSchema,\n /** ISO timestamp of when the account moved to `activated`. The\n * campaign flips to `active` at this point. */\n activatedAt: z.string().datetime().nullable().optional(),\n /** Reason Razorpay rejected the KYC submission. Surfaced to the\n * creator so they can fix and retry. */\n rejectionReason: z.string().nullable().optional(),\n /** Razorpay-hosted KYC onboarding URL. Set when status moves to\n * `created`; the creator opens this in a webview to complete KYC. */\n onboardingUrl: z.string().url().nullable().optional(),\n /** Deadline for the creator to finish bank linking. After this\n * date a scheduled job reverts the campaign to `rejected` with a\n * \"bank link deadline missed\" reason. */\n deadlineAt: z.string().datetime().nullable().optional(),\n});\nexport type CrowdfundingRazorpayAccountWire = z.infer<typeof crowdfundingRazorpayAccountWireSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Visibility (v0.34+) ─────────────────────────────────────────\n /**\n * Where the campaign appears. v0.34 replaced the per-campaign area\n * scope with this explicit user choice — pick communities you're a\n * member of and/or flip the global-feed toggle. See\n * `crowdfundingVisibilitySchema` for the contract + the at-least-one-\n * publication constraint.\n */\n visibility: crowdfundingVisibilitySchema,\n\n // ─── Verification surface ────────────────────────────────────────\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Razorpay Linked Account state (creator-facing post-approval) ─\n /**\n * Razorpay Linked Account onboarding state. Absent on `draft` /\n * `submitted` / `rejected` campaigns (nothing to link yet). Present\n * on `awaiting_bank_link` / `active` / closed campaigns. Only the\n * creator's own view of their campaign carries the full record;\n * other donors see at most a public \"verified payee\" badge derived\n * from `status === 'activated'`.\n */\n razorpayAccount: crowdfundingRazorpayAccountWireSchema.optional(),\n\n // ─── Proof documents (verifier + creator view only) ───────────────\n /**\n * Server-side attached proof documents. Surfaced to:\n * - the campaign creator (to remind them what they uploaded)\n * - the verifier on the review queue\n * - admin / moderators on the audit surface\n * Scrubbed for all other viewers (donors, feed readers).\n */\n proofDocuments: z.array(crowdfundingProofDocumentWireSchema).optional(),\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n /**\n * When the creator accepted the campaign Terms & Conditions. Stamped\n * at submit time. Surfaced so the My Campaigns surface can show\n * \"Agreed to Terms v2 on …\" copy.\n */\n termsAcceptedAt: z.string().datetime().nullable().optional(),\n /**\n * Version string of the T&C the creator accepted. Lets us re-prompt\n * acceptance if the T&C are amended materially.\n */\n termsVersion: z.string().nullable().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n /**\n * Denormalised creator location at the time the campaign was\n * created. Kept on the wire (despite v0.34 dropping the area-scope\n * concept) so the verifier surface and creator's \"My Campaigns\"\n * row can show \"from <village>, <district>\" context without a live\n * join. NOT used for visibility filtering — that lives entirely on\n * `visibility` now.\n */\n areaLineage: areaLineageSnapshotSchema,\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n /**\n * Where the campaign should appear. Pick communities you're a\n * member of and/or flip the global-feed toggle. Server rejects an\n * empty/global-false combination at create time.\n */\n visibility: crowdfundingVisibilitySchema,\n\n // v0.37: dropped composer-side identity collection. Razorpay's\n // hosted onboarding (on the bank-link step) handles PAN, Aadhaar,\n // bank account verification, and address proof for every payee —\n // doing it ourselves was redundant and weakened the privacy story\n // (we held copies of regulatory-sensitive data we didn't need to).\n //\n // ─── Proof documents (v0.33+ — required at submit time) ──────────\n /**\n * Typed + described proof documents the verifier reviews. Optional\n * on the create/update body so an in-progress draft can be saved\n * without docs; the submit-for-review handler enforces a non-empty\n * list (the per-category minimum is enforced server-side via the\n * `CROWDFUNDING_REQUIRED_PROOF_TYPES_BY_CATEGORY` matrix).\n */\n proofDocuments: z\n .array(\n z.object({\n url: z.string().url(),\n type: crowdfundingProofDocTypeSchema,\n description: z.string().trim().min(3).max(200),\n /** Optional on the body; server stamps `now` if absent. */\n uploadedAt: z.string().datetime().optional(),\n }),\n )\n .max(CROWDFUNDING_MAX_PROOF_DOCS)\n .optional(),\n\n // ─── Terms & Conditions acceptance ───────────────────────────────\n /**\n * Version of the T&C the creator agreed to. Set by the composer's\n * T&C step; the submit-for-review handler rejects the campaign if\n * this isn't equal to the current `CROWDFUNDING_TERMS_VERSION`.\n */\n termsVersion: z.string().optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. v0.35 introduced the two-\n * stage flow (district leader then state leader); the stage being\n * acted on is INFERRED from the leader's jurisdiction at the service\n * layer, not claimed in the body. The body stays an empty strict\n * object so transports that always POST a JSON body continue to work\n * and future fields can be added without a wire-shape change.\n */\nexport const approveCrowdfundingBodySchema = z.object({}).strict();\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit. Either the district or the\n * state stage can reject; the stage is inferred from the leader's\n * jurisdiction.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n/**\n * Rerun a closed-timeout campaign. The creator opens an edit flow\n * with extended duration (+ optional goal/story tweaks) and re-\n * submits; the resubmit resets BOTH verification stages to pending,\n * and the campaign re-enters the district queue from scratch.\n *\n * Body carries only the new duration — the rest of the edits ride\n * the normal `updateCrowdfundingBodySchema` path that runs alongside\n * the rerun action. Duration is required; without it the rerun makes\n * no sense (the campaign would close immediately again).\n */\nexport const requestRerunCrowdfundingBodySchema = z.object({\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n});\nexport type RequestRerunCrowdfundingBody = z.infer<typeof requestRerunCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
|
package/dist/donate-item.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @module community-schema/donate-item
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
+
import { type CreateFieldConfig, type CreateFieldOption } from './create-form-config.js';
|
|
16
17
|
import { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema } from './feed.js';
|
|
17
18
|
export declare const DONATE_ITEM_CATEGORY_VALUES: readonly ["CLOTHING", "ELECTRONICS", "FURNITURE", "BOOKS_EDUCATION", "KITCHENWARE", "TOYS_GAMES", "FOOD_GROCERIES", "MEDICINES_MEDICAL", "SPORTS_EQUIPMENT", "TOOLS_EQUIPMENT", "STATIONERY", "OTHER"];
|
|
18
19
|
export declare const donateItemCategorySchema: z.ZodEnum<{
|
|
@@ -94,4 +95,13 @@ export declare const donateItemStepValid: {
|
|
|
94
95
|
readonly itemName: (d: DonateItemDraft) => boolean;
|
|
95
96
|
readonly category: (d: DonateItemDraft) => boolean;
|
|
96
97
|
};
|
|
98
|
+
/** Ordered step keys for the donate-item create composer. */
|
|
99
|
+
export declare const DONATE_ITEM_CREATE_STEP_ORDER: readonly ["itemName", "category", "condition", "photos", "worth", "description", "pickup"];
|
|
100
|
+
export type DonateItemCreateStepKey = (typeof DONATE_ITEM_CREATE_STEP_ORDER)[number];
|
|
101
|
+
/** Per-step field config (i18n keys resolved under the `donate` namespace). */
|
|
102
|
+
export declare const DONATE_ITEM_CREATE_FIELDS: Record<DonateItemCreateStepKey, CreateFieldConfig>;
|
|
103
|
+
/** Category chip options (i18n label + description keys under `donate`). */
|
|
104
|
+
export declare const DONATE_ITEM_CATEGORY_OPTIONS: CreateFieldOption[];
|
|
105
|
+
/** Condition chip options (i18n label + description keys under `donate`). */
|
|
106
|
+
export declare const DONATE_ITEM_CONDITION_OPTIONS: CreateFieldOption[];
|
|
97
107
|
//# sourceMappingURL=donate-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"donate-item.d.ts","sourceRoot":"","sources":["../src/donate-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAGpF,eAAO,MAAM,2BAA2B,wMAa9B,CAAC;AACX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;EAAsC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,CAAC;AAInE,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAKlF,eAAO,MAAM,6BAA6B;;;;;iBAI1B,CAAC;AACjB,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAGpF,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,0BAA0B,MAA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6BAA6B,CAAC,CAAC;AAGpF,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,+BAA+B,WAAa,CAAC;AAS1D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAarC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAK5D,eAAO,MAAM,mBAAmB;2BAChB,eAAe,KAAG,OAAO;2BACzB,eAAe,KAAG,OAAO;CAG/B,CAAC;AAQX,6DAA6D;AAC7D,eAAO,MAAM,6BAA6B,4FAQhC,CAAC;AACX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,uBAAuB,EAAE,iBAAiB,CA6CxF,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,EAG3D,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,EAG5D,CAAC"}
|
package/dist/donate-item.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @module community-schema/donate-item
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
+
import { buildFieldOptions, } from './create-form-config.js';
|
|
16
17
|
import { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema } from './feed.js';
|
|
17
18
|
// ─── Category ────────────────────────────────────────────────────────────────
|
|
18
19
|
export const DONATE_ITEM_CATEGORY_VALUES = [
|
|
@@ -81,4 +82,70 @@ export const donateItemStepValid = {
|
|
|
81
82
|
category: (d) => typeof d.category === 'string' &&
|
|
82
83
|
DONATE_ITEM_CATEGORY_VALUES.includes(d.category),
|
|
83
84
|
};
|
|
85
|
+
// ─── Create-composer config (schema-driven StepForm) ──────────────────────────
|
|
86
|
+
// The StepForm composer reads its step order + per-step question/help/option
|
|
87
|
+
// metadata from here (i18n KEYS under the `donate` namespace), so questions,
|
|
88
|
+
// help text, and chip options stay schema-driven + i18n — never hardcoded in
|
|
89
|
+
// the form component. Mirrors dating-schema's ONBOARDING_FIELDS.
|
|
90
|
+
/** Ordered step keys for the donate-item create composer. */
|
|
91
|
+
export const DONATE_ITEM_CREATE_STEP_ORDER = [
|
|
92
|
+
'itemName',
|
|
93
|
+
'category',
|
|
94
|
+
'condition',
|
|
95
|
+
'photos',
|
|
96
|
+
'worth',
|
|
97
|
+
'description',
|
|
98
|
+
'pickup',
|
|
99
|
+
];
|
|
100
|
+
/** Per-step field config (i18n keys resolved under the `donate` namespace). */
|
|
101
|
+
export const DONATE_ITEM_CREATE_FIELDS = {
|
|
102
|
+
itemName: {
|
|
103
|
+
title: 'create.fields.itemName.title',
|
|
104
|
+
help: 'create.fields.itemName.help',
|
|
105
|
+
placeholder: 'create.fields.itemName.placeholder',
|
|
106
|
+
stepper: 'create.fields.itemName.stepper',
|
|
107
|
+
required: true,
|
|
108
|
+
},
|
|
109
|
+
category: {
|
|
110
|
+
title: 'create.fields.category.title',
|
|
111
|
+
help: 'create.fields.category.help',
|
|
112
|
+
stepper: 'create.fields.category.stepper',
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
condition: {
|
|
116
|
+
title: 'create.fields.condition.title',
|
|
117
|
+
help: 'create.fields.condition.help',
|
|
118
|
+
stepper: 'create.fields.condition.stepper',
|
|
119
|
+
required: false,
|
|
120
|
+
},
|
|
121
|
+
photos: {
|
|
122
|
+
title: 'create.fields.photos.title',
|
|
123
|
+
help: 'create.fields.photos.help',
|
|
124
|
+
stepper: 'create.fields.photos.stepper',
|
|
125
|
+
required: false,
|
|
126
|
+
},
|
|
127
|
+
worth: {
|
|
128
|
+
title: 'create.fields.worth.title',
|
|
129
|
+
help: 'create.fields.worth.help',
|
|
130
|
+
stepper: 'create.fields.worth.stepper',
|
|
131
|
+
required: false,
|
|
132
|
+
},
|
|
133
|
+
description: {
|
|
134
|
+
title: 'create.fields.description.title',
|
|
135
|
+
help: 'create.fields.description.help',
|
|
136
|
+
placeholder: 'create.fields.description.placeholder',
|
|
137
|
+
stepper: 'create.fields.description.stepper',
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
pickup: {
|
|
141
|
+
title: 'create.fields.pickup.title',
|
|
142
|
+
help: 'create.fields.pickup.help',
|
|
143
|
+
stepper: 'create.fields.pickup.stepper',
|
|
144
|
+
required: false,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
/** Category chip options (i18n label + description keys under `donate`). */
|
|
148
|
+
export const DONATE_ITEM_CATEGORY_OPTIONS = buildFieldOptions(DONATE_ITEM_CATEGORY_VALUES, 'create.categories');
|
|
149
|
+
/** Condition chip options (i18n label + description keys under `donate`). */
|
|
150
|
+
export const DONATE_ITEM_CONDITION_OPTIONS = buildFieldOptions(DONATE_ITEM_CONDITION_VALUES, 'create.conditions');
|
|
84
151
|
//# sourceMappingURL=donate-item.js.map
|
package/dist/donate-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"donate-item.js","sourceRoot":"","sources":["../src/donate-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEpF,gFAAgF;AAChF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,UAAU;IACV,aAAa;IACb,WAAW;IACX,iBAAiB;IACjB,aA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AC,QAAQ,KAAK,QAAQ;QAC7B,2BAAiD,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;CACjE,CAAC","sourcesContent":["/**\n * Donate Item — create-flow schema (community kind).\n * ===================================================\n * Single source of truth for the WRITE path of the donate-item surface.\n * Mirrors `crowdfunding.ts` / `suggestions-complaints.ts`: this module owns\n * the create body + categories + per-step completeness validators; the\n * display/feed shapes (+ `DONATE_ITEM_CONDITION_VALUES`) stay in `feed.ts`.\n *\n * Consumed by reform-backend (controller validation) + the product frontends\n * (the multi-step `StepForm` config delegates its `isFilled` predicates to\n * `donateItemStepValid`).\n *\n * @module community-schema/donate-item\n */\n\nimport { z } from 'zod';\nimport { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema } from './feed.js';\n\n// ─── Category ────────────────────────────────────────────────────────────────\nexport const DONATE_ITEM_CATEGORY_VALUES = [\n 'CLOTHING',\n 'ELECTRONICS',\n 'FURNITURE',\n 'BOOKS_EDUCATION',\n 'KITCHENWARE',\n 'TOYS_GAMES',\n 'FOOD_GROCERIES',\n 'MEDICINES_MEDICAL',\n 'SPORTS_EQUIPMENT',\n 'TOOLS_EQUIPMENT',\n 'STATIONERY',\n 'OTHER',\n] as const;\nexport const donateItemCategorySchema = z.enum(DONATE_ITEM_CATEGORY_VALUES);\nexport type DonateItemCategory = z.infer<typeof donateItemCategorySchema>;\n\n// Re-export the condition values (defined in feed.ts) under this module so the\n// create flow has one canonical import.\nexport { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema };\n\n// ─── Pickup address ──────────────────────────────────────────────────────────\n// A GeoJSON point. Mirrors the reform-backend pickup coords.\nexport const donateItemPickupCoordsSchema = z.object({\n type: z.literal('Point'),\n coordinates: z.tuple([z.number().min(-180).max(180), z.number().min(-90).max(90)]),\n});\nexport type DonateItemPickupCoords = z.infer<typeof donateItemPickupCoordsSchema>;\n\n// The structured area-hierarchy pickup address. Loosely typed (passthrough) —\n// the frontend carries the full area lineage; only `coords` is validated here,\n// matching the backend's `pickupAddressZodSchema`.\nexport const donateItemPickupAddressSchema = z\n .object({\n coords: donateItemPickupCoordsSchema.optional(),\n })\n .passthrough();\nexport type DonateItemPickupAddress = z.infer<typeof donateItemPickupAddressSchema>;\n\n// ─── Field constraints ───────────────────────────────────────────────────────\nexport const DONATE_ITEM_NAME_MIN_CHARS = 2;\nexport const DONATE_ITEM_NAME_MAX_CHARS = 100;\nexport const DONATE_ITEM_DESCRIPTION_MAX_CHARS = 500;\nexport const DONATE_ITEM_MAX_PHOTOS = 3;\nexport const DONATE_ITEM_MAX_ESTIMATED_WORTH = 10_000_000;\n\nconst itemNameSchema = z\n .string()\n .trim()\n .min(DONATE_ITEM_NAME_MIN_CHARS, 'Item name must be at least 2 characters')\n .max(DONATE_ITEM_NAME_MAX_CHARS, 'Item name must not exceed 100 characters');\n\n// ─── Create body ─────────────────────────────────────────────────────────────\nexport const createDonateItemBodySchema = z.object({\n itemName: itemNameSchema,\n description: z.string().trim().max(DONATE_ITEM_DESCRIPTION_MAX_CHARS).optional(),\n category: donateItemCategorySchema,\n condition: donateItemConditionSchema.optional(),\n estimatedWorth: z.number().min(0).max(DONATE_ITEM_MAX_ESTIMATED_WORTH).optional(),\n photos: z.array(z.string()).max(DONATE_ITEM_MAX_PHOTOS, 'Maximum 3 photos').default([]),\n /** Donor id — the current user in self-mode; a chosen donor in surveyor (behalf) mode. */\n donorId: z.string().min(1, 'Donor is required'),\n isAnonymous: z.boolean().default(false),\n pickupAddress: donateItemPickupAddressSchema.optional(),\n /** Surveyor-only: mark as already collected/verified at creation. */\n markVerifiedOnCreate: z.boolean().default(false),\n});\n\nexport type CreateDonateItemBody = z.infer<typeof createDonateItemBodySchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type DonateItemDraft = Partial<CreateDonateItemBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to). Only itemName + category are required for\n// the wire; the rest are optional steps. ──────────────────────────────────\nexport const donateItemStepValid = {\n itemName: (d: DonateItemDraft): boolean => itemNameSchema.safeParse(d.itemName).success,\n category: (d: DonateItemDraft): boolean =>\n typeof d.category === 'string' &&\n (DONATE_ITEM_CATEGORY_VALUES as readonly string[]).includes(d.category),\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"donate-item.js","sourceRoot":"","sources":["../src/donate-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEpF,gFAAgF;AAChF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,UAAU;IACV,aAAa;IACb,WAAW;IACX,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,YAAY;IACZ,OAAO;CACC,CAAC;AACX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;AAG5E,+EAA+E;AAC/E,wCAAwC;AACxC,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,CAAC;AAEnE,gFAAgF;AAChF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;CACnF,CAAC,CAAC;AA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,+BAA+B;QACtC,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,iCAAiC;QAC1C,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,8BAA8B;QACvC,QAAQ,EAAE,KAAK;KAChB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,6BAA6B;QACtC,QAAQ,EAAE,KAAK;KAChB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,mCAAmC;QAC5C,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,8BAA8B;QACvC,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAwB,iBAAiB,CAChF,2BAA2B,EAC3B,mBAAmB,CACpB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,6BAA6B,GAAwB,iBAAiB,CACjF,4BAA4B,EAC5B,mBAAmB,CACpB,CAAC","sourcesContent":["/**\n * Donate Item — create-flow schema (community kind).\n * ===================================================\n * Single source of truth for the WRITE path of the donate-item surface.\n * Mirrors `crowdfunding.ts` / `suggestions-complaints.ts`: this module owns\n * the create body + categories + per-step completeness validators; the\n * display/feed shapes (+ `DONATE_ITEM_CONDITION_VALUES`) stay in `feed.ts`.\n *\n * Consumed by reform-backend (controller validation) + the product frontends\n * (the multi-step `StepForm` config delegates its `isFilled` predicates to\n * `donateItemStepValid`).\n *\n * @module community-schema/donate-item\n */\n\nimport { z } from 'zod';\nimport {\n buildFieldOptions,\n type CreateFieldConfig,\n type CreateFieldOption,\n} from './create-form-config.js';\nimport { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema } from './feed.js';\n\n// ─── Category ────────────────────────────────────────────────────────────────\nexport const DONATE_ITEM_CATEGORY_VALUES = [\n 'CLOTHING',\n 'ELECTRONICS',\n 'FURNITURE',\n 'BOOKS_EDUCATION',\n 'KITCHENWARE',\n 'TOYS_GAMES',\n 'FOOD_GROCERIES',\n 'MEDICINES_MEDICAL',\n 'SPORTS_EQUIPMENT',\n 'TOOLS_EQUIPMENT',\n 'STATIONERY',\n 'OTHER',\n] as const;\nexport const donateItemCategorySchema = z.enum(DONATE_ITEM_CATEGORY_VALUES);\nexport type DonateItemCategory = z.infer<typeof donateItemCategorySchema>;\n\n// Re-export the condition values (defined in feed.ts) under this module so the\n// create flow has one canonical import.\nexport { DONATE_ITEM_CONDITION_VALUES, donateItemConditionSchema };\n\n// ─── Pickup address ──────────────────────────────────────────────────────────\n// A GeoJSON point. Mirrors the reform-backend pickup coords.\nexport const donateItemPickupCoordsSchema = z.object({\n type: z.literal('Point'),\n coordinates: z.tuple([z.number().min(-180).max(180), z.number().min(-90).max(90)]),\n});\nexport type DonateItemPickupCoords = z.infer<typeof donateItemPickupCoordsSchema>;\n\n// The structured area-hierarchy pickup address. Loosely typed (passthrough) —\n// the frontend carries the full area lineage; only `coords` is validated here,\n// matching the backend's `pickupAddressZodSchema`.\nexport const donateItemPickupAddressSchema = z\n .object({\n coords: donateItemPickupCoordsSchema.optional(),\n })\n .passthrough();\nexport type DonateItemPickupAddress = z.infer<typeof donateItemPickupAddressSchema>;\n\n// ─── Field constraints ───────────────────────────────────────────────────────\nexport const DONATE_ITEM_NAME_MIN_CHARS = 2;\nexport const DONATE_ITEM_NAME_MAX_CHARS = 100;\nexport const DONATE_ITEM_DESCRIPTION_MAX_CHARS = 500;\nexport const DONATE_ITEM_MAX_PHOTOS = 3;\nexport const DONATE_ITEM_MAX_ESTIMATED_WORTH = 10_000_000;\n\nconst itemNameSchema = z\n .string()\n .trim()\n .min(DONATE_ITEM_NAME_MIN_CHARS, 'Item name must be at least 2 characters')\n .max(DONATE_ITEM_NAME_MAX_CHARS, 'Item name must not exceed 100 characters');\n\n// ─── Create body ─────────────────────────────────────────────────────────────\nexport const createDonateItemBodySchema = z.object({\n itemName: itemNameSchema,\n description: z.string().trim().max(DONATE_ITEM_DESCRIPTION_MAX_CHARS).optional(),\n category: donateItemCategorySchema,\n condition: donateItemConditionSchema.optional(),\n estimatedWorth: z.number().min(0).max(DONATE_ITEM_MAX_ESTIMATED_WORTH).optional(),\n photos: z.array(z.string()).max(DONATE_ITEM_MAX_PHOTOS, 'Maximum 3 photos').default([]),\n /** Donor id — the current user in self-mode; a chosen donor in surveyor (behalf) mode. */\n donorId: z.string().min(1, 'Donor is required'),\n isAnonymous: z.boolean().default(false),\n pickupAddress: donateItemPickupAddressSchema.optional(),\n /** Surveyor-only: mark as already collected/verified at creation. */\n markVerifiedOnCreate: z.boolean().default(false),\n});\n\nexport type CreateDonateItemBody = z.infer<typeof createDonateItemBodySchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type DonateItemDraft = Partial<CreateDonateItemBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to). Only itemName + category are required for\n// the wire; the rest are optional steps. ──────────────────────────────────\nexport const donateItemStepValid = {\n itemName: (d: DonateItemDraft): boolean => itemNameSchema.safeParse(d.itemName).success,\n category: (d: DonateItemDraft): boolean =>\n typeof d.category === 'string' &&\n (DONATE_ITEM_CATEGORY_VALUES as readonly string[]).includes(d.category),\n} as const;\n\n// ─── Create-composer config (schema-driven StepForm) ──────────────────────────\n// The StepForm composer reads its step order + per-step question/help/option\n// metadata from here (i18n KEYS under the `donate` namespace), so questions,\n// help text, and chip options stay schema-driven + i18n — never hardcoded in\n// the form component. Mirrors dating-schema's ONBOARDING_FIELDS.\n\n/** Ordered step keys for the donate-item create composer. */\nexport const DONATE_ITEM_CREATE_STEP_ORDER = [\n 'itemName',\n 'category',\n 'condition',\n 'photos',\n 'worth',\n 'description',\n 'pickup',\n] as const;\nexport type DonateItemCreateStepKey = (typeof DONATE_ITEM_CREATE_STEP_ORDER)[number];\n\n/** Per-step field config (i18n keys resolved under the `donate` namespace). */\nexport const DONATE_ITEM_CREATE_FIELDS: Record<DonateItemCreateStepKey, CreateFieldConfig> = {\n itemName: {\n title: 'create.fields.itemName.title',\n help: 'create.fields.itemName.help',\n placeholder: 'create.fields.itemName.placeholder',\n stepper: 'create.fields.itemName.stepper',\n required: true,\n },\n category: {\n title: 'create.fields.category.title',\n help: 'create.fields.category.help',\n stepper: 'create.fields.category.stepper',\n required: true,\n },\n condition: {\n title: 'create.fields.condition.title',\n help: 'create.fields.condition.help',\n stepper: 'create.fields.condition.stepper',\n required: false,\n },\n photos: {\n title: 'create.fields.photos.title',\n help: 'create.fields.photos.help',\n stepper: 'create.fields.photos.stepper',\n required: false,\n },\n worth: {\n title: 'create.fields.worth.title',\n help: 'create.fields.worth.help',\n stepper: 'create.fields.worth.stepper',\n required: false,\n },\n description: {\n title: 'create.fields.description.title',\n help: 'create.fields.description.help',\n placeholder: 'create.fields.description.placeholder',\n stepper: 'create.fields.description.stepper',\n required: false,\n },\n pickup: {\n title: 'create.fields.pickup.title',\n help: 'create.fields.pickup.help',\n stepper: 'create.fields.pickup.stepper',\n required: false,\n },\n};\n\n/** Category chip options (i18n label + description keys under `donate`). */\nexport const DONATE_ITEM_CATEGORY_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n DONATE_ITEM_CATEGORY_VALUES,\n 'create.categories',\n);\n\n/** Condition chip options (i18n label + description keys under `donate`). */\nexport const DONATE_ITEM_CONDITION_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n DONATE_ITEM_CONDITION_VALUES,\n 'create.conditions',\n);\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,14 +18,15 @@ export { type AreaLineageSnapshot, areaLineageSnapshotSchema, } from './area.js'
|
|
|
18
18
|
export { type CommunityCommentWire, type CreateCommentBody, communityCommentWireSchema, createCommentBodySchema, type UpdateCommentBody, updateCommentBodySchema, } from './comment.js';
|
|
19
19
|
export { type AddOfficialModeratorBody, AREA_PICKER_LEVEL_VALUES, type AreaPickerItem, type AreaPickerLevel, type AreaPickerQuery, type AreaPickerResponse, addOfficialModeratorBodySchema, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_KIND_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, type CommunityCategory, type CommunityCenterCoords, type CommunityDesignation, type CommunityDesignationPreset, type CommunityDiscoverSort, type CommunityKind, type CommunityListQuery, type CommunityListResponse, type CommunityMembershipStatus, type CommunityMembersListResponse, type CommunityMemberWire, type CommunityReach, type CommunityRole, type CommunityTag, type CommunityType, type CommunityVerifiedScope, type CommunityWire, type CreateCommunityBody, type CreateOfficialCommunityBody, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityKindSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, createOfficialCommunityBodySchema, type HidePostBody, hidePostBodySchema, type JoinCommunityResponse, joinCommunityResponseSchema, OFFICIAL_COMMUNITY_AREA_KIND_VALUES, type OfficialCommunityAreaKind, officialCommunityAreaKindSchema, type SetMemberDesignationBody, type SetOfficialRepresentativeBody, setMemberDesignationBodySchema, setOfficialRepresentativeBodySchema, type UpdateCommunityBody, type UpdateMemberRoleBody, updateCommunityBodySchema, updateMemberRoleBodySchema, type VerifyCommunityBody, verifyCommunityBodySchema, } from './community.js';
|
|
20
20
|
export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, CROWDFUNDING_BANK_LINK_DEADLINE_DAYS, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_PROOF_DOCS, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_MIN_PROOF_DOCS, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_PROOF_DOC_DESCRIPTION_MAX_CHARS, CROWDFUNDING_PROOF_DOC_DESCRIPTION_MIN_CHARS, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TERMS_VERSION, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
|
|
21
|
-
export {
|
|
22
|
-
export { type
|
|
21
|
+
export { buildFieldOptions, type CreateFieldConfig, type CreateFieldOption, } from './create-form-config.js';
|
|
22
|
+
export { type ApproveCrowdfundingBody, type AttestCrowdfundingDonationBody, approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, type CommunityCrowdfundingWire, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_PROOF_DOC_TYPE_VALUES, CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES, CROWDFUNDING_STATUS_VALUES, type CreateCrowdfundingBody, type CrowdfundingAudience, type CrowdfundingCategory, type CrowdfundingDonationState, type CrowdfundingDonationWire, type CrowdfundingFeedItem, type CrowdfundingOrgKind, type CrowdfundingPayment, type CrowdfundingProofDocType, type CrowdfundingProofDocumentWire, type CrowdfundingRazorpayAccountStatus, type CrowdfundingRazorpayAccountWire, type CrowdfundingStatus, type CrowdfundingVerification, type CrowdfundingVerificationStage, type CrowdfundingVisibility, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingProofDocTypeSchema, crowdfundingProofDocumentWireSchema, crowdfundingRazorpayAccountStatusSchema, crowdfundingRazorpayAccountWireSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, crowdfundingVerificationStageSchema, crowdfundingVisibilitySchema, type ListCrowdfundingDonationsQuery, type ListMyCrowdfundingDonationsQuery, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, type RejectCrowdfundingBody, type RequestRerunCrowdfundingBody, rejectCrowdfundingBodySchema, requestRerunCrowdfundingBodySchema, type UpdateCrowdfundingBody, type UploadCrowdfundingReceiptBody, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, CROWDFUNDING_CATEGORY_OPTIONS, CROWDFUNDING_AUDIENCE_OPTIONS, CROWDFUNDING_ORG_KIND_OPTIONS, } from './crowdfunding.js';
|
|
23
|
+
export { type CreateDonateItemBody, createDonateItemBodySchema, DONATE_ITEM_CATEGORY_OPTIONS, DONATE_ITEM_CATEGORY_VALUES, DONATE_ITEM_CONDITION_OPTIONS, DONATE_ITEM_CREATE_FIELDS, DONATE_ITEM_CREATE_STEP_ORDER, DONATE_ITEM_DESCRIPTION_MAX_CHARS, DONATE_ITEM_MAX_ESTIMATED_WORTH, DONATE_ITEM_MAX_PHOTOS, DONATE_ITEM_NAME_MAX_CHARS, DONATE_ITEM_NAME_MIN_CHARS, type DonateItemCategory, type DonateItemCreateStepKey, type DonateItemDraft, type DonateItemPickupAddress, type DonateItemPickupCoords, donateItemCategorySchema, donateItemPickupAddressSchema, donateItemPickupCoordsSchema, donateItemStepValid, } from './donate-item.js';
|
|
23
24
|
export { type SetReactionBody, type SetReactionResponse, type SetVoteBody, type SetVoteResponse, setReactionBodySchema, setReactionResponseSchema, setVoteBodySchema, setVoteResponseSchema, type ToggleBookmarkResponse, toggleBookmarkResponseSchema, VOTE_VALUES, type VoteValue, voteValueSchema, } from './engagement.js';
|
|
24
25
|
export { CONTENT_KIND_VALUES, type ContentKind, contentKindSchema, FEED_SORT_VALUES, type FeedSort, feedSortSchema, PROFILE_PRIVACY_VALUES, type ProfilePrivacy, profilePrivacySchema, REACTION_TYPE_VALUES, REPORT_REASON_VALUES, REPORT_STATUS_VALUES, type ReactionType, type ReportReason, type ReportStatus, reactionTypeSchema, reportReasonSchema, reportStatusSchema, VISIBILITY_LEVEL_RANK, VISIBILITY_LEVEL_VALUES, type VisibilityLevel, visibilityLevelSchema, } from './enums.js';
|
|
25
26
|
export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, type DonateItemCondition, type DonateItemFeedItem, type DonateItemStatus, donateAuditAtSchema, donateAuditByAtSchema, donateDonatedToSchema, donateItemConditionSchema, donateItemFeedItemSchema, donateItemStatusSchema, type FeedItem, type FeedQueryParams, type FeedResponse, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, LOST_FOUND_CATEGORY_VALUES, LOST_FOUND_STATUS_VALUES, type LostFoundCategory, type LostFoundFeedItem, type LostFoundLocation, type LostFoundStatus, type LostFoundTimeRange, lostFoundCategorySchema, lostFoundFeedItemSchema, lostFoundLocationSchema, lostFoundStatusSchema, lostFoundTimeRangeSchema, SUGGESTIONS_COMPLAINTS_PRIORITY_VALUES, SUGGESTIONS_COMPLAINTS_STATUS_VALUES, type SuggestionsComplaintsFeedItem, type SuggestionsComplaintsLocation, type SuggestionsComplaintsPriority, type SuggestionsComplaintsStatus, suggestionsComplaintsAudioSchema, suggestionsComplaintsFeedItemSchema, suggestionsComplaintsLocationSchema, suggestionsComplaintsOfficerResponseSchema, suggestionsComplaintsPrioritySchema, suggestionsComplaintsStatusSchema, suggestionsComplaintsVideoSchema, } from './feed.js';
|
|
26
27
|
export { type AddGroupMembersBody, addGroupMembersBodySchema, type CommunityGroupWire, type CommunityGroupWithMembers, type CreateGroupBody, communityGroupWireSchema, communityGroupWithMembersSchema, createGroupBodySchema, type GroupMembersListResponse, type GroupMemberWire, type GroupRole, type GroupsListResponse, groupMembersListResponseSchema, groupMemberWireSchema, groupRoleSchema, groupsListResponseSchema, type UpdateGroupBody, updateGroupBodySchema, } from './group.js';
|
|
27
28
|
export { LINK_PREVIEW_KIND_VALUES, type LinkPreview, type LinkPreviewKind, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
|
|
28
|
-
export { type CreateLostFoundReportBody, createLostFoundReportBodySchema, LOST_FOUND_COLLECTION_POINT_MAX_CHARS, LOST_FOUND_CONTACT_PHONE_MAX_CHARS, LOST_FOUND_DESCRIPTION_MAX_CHARS, LOST_FOUND_DESCRIPTION_MIN_CHARS, LOST_FOUND_MAX_IMAGES, LOST_FOUND_REWARD_MAX_CHARS, LOST_FOUND_TITLE_MAX_CHARS, LOST_FOUND_TITLE_MIN_CHARS, LOST_FOUND_TYPE_VALUES, type LostFoundDraft, type LostFoundType, lostFoundStepValid, lostFoundTypeSchema, } from './lost-found.js';
|
|
29
|
+
export { type CreateLostFoundReportBody, createLostFoundReportBodySchema, LOST_FOUND_COLLECTION_POINT_MAX_CHARS, LOST_FOUND_CONTACT_PHONE_MAX_CHARS, LOST_FOUND_DESCRIPTION_MAX_CHARS, LOST_FOUND_DESCRIPTION_MIN_CHARS, LOST_FOUND_MAX_IMAGES, LOST_FOUND_REWARD_MAX_CHARS, LOST_FOUND_TITLE_MAX_CHARS, LOST_FOUND_TITLE_MIN_CHARS, LOST_FOUND_TYPE_VALUES, LOST_FOUND_CREATE_FIELDS, LOST_FOUND_CREATE_STEP_ORDER, LOST_FOUND_TYPE_OPTIONS, LOST_FOUND_CATEGORY_OPTIONS, type LostFoundCreateStepKey, type LostFoundDraft, type LostFoundType, lostFoundStepValid, lostFoundTypeSchema, } from './lost-found.js';
|
|
29
30
|
export { type PostImage, type PostVideo, postImageSchema, postVideoSchema, } from './media.js';
|
|
30
31
|
export { type ListNotificationsQuery, type ListNotificationsResponse, listNotificationsQuerySchema, listNotificationsResponseSchema, type MarkAllNotificationsReadBody, markAllNotificationsReadBodySchema, NOTIFICATION_CATEGORY_VALUES, NOTIFICATION_CHANNEL_VALUES, NOTIFICATION_PRIORITY_VALUES, NOTIFICATION_SOURCE_REF_KIND_VALUES, type NotificationActor, type NotificationCategory, type NotificationChannel, type NotificationPriority, type NotificationReadAllEvent, type NotificationReadEvent, type NotificationSourceRef, type NotificationSourceRefKind, type NotificationUnreadCount, type NotificationWire, notificationActorSchema, notificationCategorySchema, notificationChannelSchema, notificationPrioritySchema, notificationReadAllEventSchema, notificationReadEventSchema, notificationSourceRefKindSchema, notificationSourceRefSchema, notificationUnreadCountSchema, notificationWireSchema, REFORM_NOTIFICATION_SOCKET_EVENTS, type ReformNotificationSocketEvent, } from './notification.js';
|
|
31
32
|
export { type CastVoteBody, type CommunityPollFeedItem, type CommunityPollWire, type CreatePollBody, castVoteBodySchema, communityPollFeedItemSchema, communityPollWireSchema, createPollBodySchema, POLL_RESULTS_VISIBILITY_VALUES, type PollOptionInput, type PollOptionWire, type PollResultsVisibility, pollOptionInputSchema, pollOptionWireSchema, pollResultsVisibilitySchema, type VoteResponse, voteResponseSchema, } from './poll.js';
|
|
@@ -36,6 +37,6 @@ export { type CreateRepostBody, type CreateRepostResponse, createRepostBodySchem
|
|
|
36
37
|
export { type BlockedUsersListResponse, type BlockedUserWire, blockedUsersListResponseSchema, blockedUserWireSchema, COMMUNITY_SETTINGS_DEFAULTS, type CommunitySettingsWire, communitySettingsWireSchema, type UpdateCommunitySettingsBody, updateCommunitySettingsBodySchema, } from './settings.js';
|
|
37
38
|
export { type ToggleFollowResponse, toggleFollowResponseSchema, type ViewerSocialState, viewerSocialStateSchema, } from './social.js';
|
|
38
39
|
export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, type SocialScoreTier, type SocialScoreTierName, tierFromSocialScore, } from './social-score.js';
|
|
39
|
-
export { COMPLAINT_CATEGORY_VALUES, type ComplaintCategory, type CreateSuggestionsComplaintsBody, complaintCategorySchema, createSuggestionsComplaintsBodySchema, SUGGESTION_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS, SUGGESTIONS_COMPLAINTS_MAX_IMAGES, SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS, SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TYPE_VALUES, type SuggestionCategory, type SuggestionsComplaintsDraft, type SuggestionsComplaintsType, suggestionCategorySchema, suggestionsComplaintsBodyObjectSchema, suggestionsComplaintsStepValid, suggestionsComplaintsTypeSchema, type UploadedMediaPath, uploadedMediaPathSchema, } from './suggestions-complaints.js';
|
|
40
|
+
export { COMPLAINT_CATEGORY_VALUES, type ComplaintCategory, type CreateSuggestionsComplaintsBody, complaintCategorySchema, createSuggestionsComplaintsBodySchema, SUGGESTION_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS, SUGGESTIONS_COMPLAINTS_MAX_IMAGES, SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS, SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TYPE_VALUES, SUGGESTIONS_COMPLAINTS_CREATE_FIELDS, SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER, SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS, COMPLAINT_CATEGORY_OPTIONS, SUGGESTION_CATEGORY_OPTIONS, type SuggestionCategory, type SuggestionsComplaintsCreateStepKey, type SuggestionsComplaintsDraft, type SuggestionsComplaintsType, suggestionCategorySchema, suggestionsComplaintsBodyObjectSchema, suggestionsComplaintsStepValid, suggestionsComplaintsTypeSchema, type UploadedMediaPath, uploadedMediaPathSchema, } from './suggestions-complaints.js';
|
|
40
41
|
export { type CurrentUsernameState, currentUsernameStateSchema, type UpdateUsernameBody, type UpdateUsernameResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN, USERNAME_UNAVAILABLE_REASONS, type Username, type UsernameAvailabilityResponse, type UsernameUnavailableReason, updateUsernameBodySchema, updateUsernameResponseSchema, usernameAvailabilityResponseSchema, usernameSchema, usernameUnavailableReasonSchema, } from './username.js';
|
|
41
42
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,KAAK,wBAAwB,EAC7B,wBAAwB,EACxB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA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,EAC1B,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,+BAA+B,EACpC,uBAAuB,EACvB,qCAAqC,EACrC,0BAA0B,EAC1B,sCAAsC,EACtC,4CAA4C,EAC5C,iCAAiC,EACjC,sCAAsC,EACtC,uDAAuD,EACvD,sCAAsC,EACtC,sCAAsC,EACtC,kCAAkC,EAClC,oCAAoC,EACpC,wCAAwC,EACxC,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,wBAAwB,EACxB,qCAAqC,EACrC,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,QAAQ,EACb,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,10 +22,12 @@ export { communityCommentWireSchema, createCommentBodySchema, updateCommentBodyS
|
|
|
22
22
|
export { AREA_PICKER_LEVEL_VALUES, addOfficialModeratorBodySchema, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_KIND_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityKindSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, createOfficialCommunityBodySchema, hidePostBodySchema, joinCommunityResponseSchema, OFFICIAL_COMMUNITY_AREA_KIND_VALUES, officialCommunityAreaKindSchema, setMemberDesignationBodySchema, setOfficialRepresentativeBodySchema, updateCommunityBodySchema, updateMemberRoleBodySchema, verifyCommunityBodySchema, } from './community.js';
|
|
23
23
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
24
24
|
export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, CROWDFUNDING_BANK_LINK_DEADLINE_DAYS, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_PROOF_DOCS, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_MIN_PROOF_DOCS, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_PROOF_DOC_DESCRIPTION_MAX_CHARS, CROWDFUNDING_PROOF_DOC_DESCRIPTION_MIN_CHARS, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TERMS_VERSION, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
|
|
25
|
+
// ─── Create-composer config (shared types) ────────────────────────────────────
|
|
26
|
+
export { buildFieldOptions, } from './create-form-config.js';
|
|
25
27
|
// ─── Crowdfunding ──────────────────────────────────────────────────────────
|
|
26
|
-
export { approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_PROOF_DOC_TYPE_VALUES, CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES, CROWDFUNDING_STATUS_VALUES, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingProofDocTypeSchema, crowdfundingProofDocumentWireSchema, crowdfundingRazorpayAccountStatusSchema, crowdfundingRazorpayAccountWireSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, crowdfundingVerificationStageSchema, crowdfundingVisibilitySchema, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, rejectCrowdfundingBodySchema, requestRerunCrowdfundingBodySchema, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, } from './crowdfunding.js';
|
|
28
|
+
export { approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_PROOF_DOC_TYPE_VALUES, CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES, CROWDFUNDING_STATUS_VALUES, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingProofDocTypeSchema, crowdfundingProofDocumentWireSchema, crowdfundingRazorpayAccountStatusSchema, crowdfundingRazorpayAccountWireSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, crowdfundingVerificationStageSchema, crowdfundingVisibilitySchema, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, rejectCrowdfundingBodySchema, requestRerunCrowdfundingBodySchema, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, CROWDFUNDING_CATEGORY_OPTIONS, CROWDFUNDING_AUDIENCE_OPTIONS, CROWDFUNDING_ORG_KIND_OPTIONS, } from './crowdfunding.js';
|
|
27
29
|
// ─── Donate Item (create) ────────────────────────────────────────────────────
|
|
28
|
-
export { createDonateItemBodySchema, DONATE_ITEM_CATEGORY_VALUES, DONATE_ITEM_DESCRIPTION_MAX_CHARS, DONATE_ITEM_MAX_ESTIMATED_WORTH, DONATE_ITEM_MAX_PHOTOS, DONATE_ITEM_NAME_MAX_CHARS, DONATE_ITEM_NAME_MIN_CHARS, donateItemCategorySchema, donateItemPickupAddressSchema, donateItemPickupCoordsSchema, donateItemStepValid, } from './donate-item.js';
|
|
30
|
+
export { createDonateItemBodySchema, DONATE_ITEM_CATEGORY_OPTIONS, DONATE_ITEM_CATEGORY_VALUES, DONATE_ITEM_CONDITION_OPTIONS, DONATE_ITEM_CREATE_FIELDS, DONATE_ITEM_CREATE_STEP_ORDER, DONATE_ITEM_DESCRIPTION_MAX_CHARS, DONATE_ITEM_MAX_ESTIMATED_WORTH, DONATE_ITEM_MAX_PHOTOS, DONATE_ITEM_NAME_MAX_CHARS, DONATE_ITEM_NAME_MIN_CHARS, donateItemCategorySchema, donateItemPickupAddressSchema, donateItemPickupCoordsSchema, donateItemStepValid, } from './donate-item.js';
|
|
29
31
|
// ─── Engagement (vote + reactions + bookmark) ─────────────────────────────
|
|
30
32
|
export { setReactionBodySchema, setReactionResponseSchema, setVoteBodySchema, setVoteResponseSchema, toggleBookmarkResponseSchema, VOTE_VALUES, voteValueSchema, } from './engagement.js';
|
|
31
33
|
// ─── Enums ─────────────────────────────────────────────────────────────────
|
|
@@ -37,7 +39,7 @@ export { addGroupMembersBodySchema, communityGroupWireSchema, communityGroupWith
|
|
|
37
39
|
// ─── Link preview (auto-extracted URL embed) ──────────────────────────────
|
|
38
40
|
export { LINK_PREVIEW_KIND_VALUES, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
|
|
39
41
|
// ─── Lost & Found (create) ───────────────────────────────────────────────────
|
|
40
|
-
export { createLostFoundReportBodySchema, LOST_FOUND_COLLECTION_POINT_MAX_CHARS, LOST_FOUND_CONTACT_PHONE_MAX_CHARS, LOST_FOUND_DESCRIPTION_MAX_CHARS, LOST_FOUND_DESCRIPTION_MIN_CHARS, LOST_FOUND_MAX_IMAGES, LOST_FOUND_REWARD_MAX_CHARS, LOST_FOUND_TITLE_MAX_CHARS, LOST_FOUND_TITLE_MIN_CHARS, LOST_FOUND_TYPE_VALUES, lostFoundStepValid, lostFoundTypeSchema, } from './lost-found.js';
|
|
42
|
+
export { createLostFoundReportBodySchema, LOST_FOUND_COLLECTION_POINT_MAX_CHARS, LOST_FOUND_CONTACT_PHONE_MAX_CHARS, LOST_FOUND_DESCRIPTION_MAX_CHARS, LOST_FOUND_DESCRIPTION_MIN_CHARS, LOST_FOUND_MAX_IMAGES, LOST_FOUND_REWARD_MAX_CHARS, LOST_FOUND_TITLE_MAX_CHARS, LOST_FOUND_TITLE_MIN_CHARS, LOST_FOUND_TYPE_VALUES, LOST_FOUND_CREATE_FIELDS, LOST_FOUND_CREATE_STEP_ORDER, LOST_FOUND_TYPE_OPTIONS, LOST_FOUND_CATEGORY_OPTIONS, lostFoundStepValid, lostFoundTypeSchema, } from './lost-found.js';
|
|
41
43
|
// ─── Media ─────────────────────────────────────────────────────────────────
|
|
42
44
|
export { postImageSchema, postVideoSchema, } from './media.js';
|
|
43
45
|
// ─── Notifications ─────────────────────────────────────────────────────────
|
|
@@ -59,7 +61,7 @@ export { toggleFollowResponseSchema, viewerSocialStateSchema, } from './social.j
|
|
|
59
61
|
// ─── Social score (shared tier table) ─────────────────────────────────────
|
|
60
62
|
export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, tierFromSocialScore, } from './social-score.js';
|
|
61
63
|
// ─── Suggestions & Complaints (create) ──────────────────────────────────────
|
|
62
|
-
export { COMPLAINT_CATEGORY_VALUES, complaintCategorySchema, createSuggestionsComplaintsBodySchema, SUGGESTION_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS, SUGGESTIONS_COMPLAINTS_MAX_IMAGES, SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS, SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TYPE_VALUES, suggestionCategorySchema, suggestionsComplaintsBodyObjectSchema, suggestionsComplaintsStepValid, suggestionsComplaintsTypeSchema, uploadedMediaPathSchema, } from './suggestions-complaints.js';
|
|
64
|
+
export { COMPLAINT_CATEGORY_VALUES, complaintCategorySchema, createSuggestionsComplaintsBodySchema, SUGGESTION_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES, SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS, SUGGESTIONS_COMPLAINTS_MAX_IMAGES, SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS, SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, SUGGESTIONS_COMPLAINTS_TYPE_VALUES, SUGGESTIONS_COMPLAINTS_CREATE_FIELDS, SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER, SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS, COMPLAINT_CATEGORY_OPTIONS, SUGGESTION_CATEGORY_OPTIONS, suggestionCategorySchema, suggestionsComplaintsBodyObjectSchema, suggestionsComplaintsStepValid, suggestionsComplaintsTypeSchema, uploadedMediaPathSchema, } from './suggestions-complaints.js';
|
|
63
65
|
// ─── Username (URL handle + change / availability) ────────────────────────
|
|
64
66
|
export { currentUsernameStateSchema, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN, USERNAME_UNAVAILABLE_REASONS, updateUsernameBodySchema, updateUsernameResponseSchema, usernameAvailabilityResponseSchema, usernameSchema, usernameUnavailableReasonSchema, } from './username.js';
|
|
65
67
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAoB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,kCAAkC,EACl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AuD,EACvD,sCAAsC,EACtC,sCAAsC,EACtC,kCAAkC,EAIlC,wBAAwB,EACxB,qCAAqC,EACrC,8BAA8B,EAC9B,+BAA+B,EAE/B,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAErC,6EAA6E;AAC7E,OAAO,EAEL,0BAA0B,EAG1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAI5B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityKind,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n type VerifyCommunityBody,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n CROWDFUNDING_BANK_LINK_DEADLINE_DAYS,\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_PROOF_DOCS,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_MIN_PROOF_DOCS,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_PROOF_DOC_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_PROOF_DOC_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TERMS_VERSION,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_PROOF_DOC_TYPE_VALUES,\n CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeedItem,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingProofDocType,\n type CrowdfundingProofDocumentWire,\n type CrowdfundingRazorpayAccountStatus,\n type CrowdfundingRazorpayAccountWire,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n type CrowdfundingVerificationStage,\n type CrowdfundingVisibility,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeedItemSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingProofDocTypeSchema,\n crowdfundingProofDocumentWireSchema,\n crowdfundingRazorpayAccountStatusSchema,\n crowdfundingRazorpayAccountWireSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n crowdfundingVerificationStageSchema,\n crowdfundingVisibilitySchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n type RequestRerunCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n requestRerunCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n} from './crowdfunding.js';\n// ─── Donate Item (create) ────────────────────────────────────────────────────\nexport {\n type CreateDonateItemBody,\n createDonateItemBodySchema,\n DONATE_ITEM_CATEGORY_VALUES,\n DONATE_ITEM_DESCRIPTION_MAX_CHARS,\n DONATE_ITEM_MAX_ESTIMATED_WORTH,\n DONATE_ITEM_MAX_PHOTOS,\n DONATE_ITEM_NAME_MAX_CHARS,\n DONATE_ITEM_NAME_MIN_CHARS,\n type DonateItemCategory,\n type DonateItemDraft,\n type DonateItemPickupAddress,\n type DonateItemPickupCoords,\n donateItemCategorySchema,\n donateItemPickupAddressSchema,\n donateItemPickupCoordsSchema,\n donateItemStepValid,\n} from './donate-item.js';\n// ─── Engagement (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n type SetVoteBody,\n type SetVoteResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n setVoteBodySchema,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\n} from './engagement.js';\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n type DonateItemCondition,\n type DonateItemFeedItem,\n type DonateItemStatus,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n type LostFoundFeedItem,\n type LostFoundLocation,\n type LostFoundStatus,\n type LostFoundTimeRange,\n lostFoundCategorySchema,\n lostFoundFeedItemSchema,\n lostFoundLocationSchema,\n lostFoundStatusSchema,\n lostFoundTimeRangeSchema,\n SUGGESTIONS_COMPLAINTS_PRIORITY_VALUES,\n SUGGESTIONS_COMPLAINTS_STATUS_VALUES,\n type SuggestionsComplaintsFeedItem,\n type SuggestionsComplaintsLocation,\n type SuggestionsComplaintsPriority,\n type SuggestionsComplaintsStatus,\n suggestionsComplaintsAudioSchema,\n suggestionsComplaintsFeedItemSchema,\n suggestionsComplaintsLocationSchema,\n suggestionsComplaintsOfficerResponseSchema,\n suggestionsComplaintsPrioritySchema,\n suggestionsComplaintsStatusSchema,\n suggestionsComplaintsVideoSchema,\n} from './feed.js';\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n// ─── Link preview (auto-extracted URL embed) ──────────────────────────────\nexport {\n LINK_PREVIEW_KIND_VALUES,\n type LinkPreview,\n type LinkPreviewKind,\n linkPreviewKindSchema,\n linkPreviewSchema,\n} from './link-preview.js';\n// ─── Lost & Found (create) ───────────────────────────────────────────────────\nexport {\n type CreateLostFoundReportBody,\n createLostFoundReportBodySchema,\n LOST_FOUND_COLLECTION_POINT_MAX_CHARS,\n LOST_FOUND_CONTACT_PHONE_MAX_CHARS,\n LOST_FOUND_DESCRIPTION_MAX_CHARS,\n LOST_FOUND_DESCRIPTION_MIN_CHARS,\n LOST_FOUND_MAX_IMAGES,\n LOST_FOUND_REWARD_MAX_CHARS,\n LOST_FOUND_TITLE_MAX_CHARS,\n LOST_FOUND_TITLE_MIN_CHARS,\n LOST_FOUND_TYPE_VALUES,\n type LostFoundDraft,\n type LostFoundType,\n lostFoundStepValid,\n lostFoundTypeSchema,\n} from './lost-found.js';\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Notifications ─────────────────────────────────────────────────────────\nexport {\n type ListNotificationsQuery,\n type ListNotificationsResponse,\n listNotificationsQuerySchema,\n listNotificationsResponseSchema,\n type MarkAllNotificationsReadBody,\n markAllNotificationsReadBodySchema,\n NOTIFICATION_CATEGORY_VALUES,\n NOTIFICATION_CHANNEL_VALUES,\n NOTIFICATION_PRIORITY_VALUES,\n NOTIFICATION_SOURCE_REF_KIND_VALUES,\n type NotificationActor,\n type NotificationCategory,\n type NotificationChannel,\n type NotificationPriority,\n type NotificationReadAllEvent,\n type NotificationReadEvent,\n type NotificationSourceRef,\n type NotificationSourceRefKind,\n type NotificationUnreadCount,\n type NotificationWire,\n notificationActorSchema,\n notificationCategorySchema,\n notificationChannelSchema,\n notificationPrioritySchema,\n notificationReadAllEventSchema,\n notificationReadEventSchema,\n notificationSourceRefKindSchema,\n notificationSourceRefSchema,\n notificationUnreadCountSchema,\n notificationWireSchema,\n REFORM_NOTIFICATION_SOCKET_EVENTS,\n type ReformNotificationSocketEvent,\n} from './notification.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.js';\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.js';\n\n// ─── Suggestions & Complaints (create) ──────────────────────────────────────\nexport {\n COMPLAINT_CATEGORY_VALUES,\n type ComplaintCategory,\n type CreateSuggestionsComplaintsBody,\n complaintCategorySchema,\n createSuggestionsComplaintsBodySchema,\n SUGGESTION_CATEGORY_VALUES,\n SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES,\n SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS,\n SUGGESTIONS_COMPLAINTS_MAX_IMAGES,\n SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS,\n SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS,\n SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS,\n SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS,\n SUGGESTIONS_COMPLAINTS_TYPE_VALUES,\n type SuggestionCategory,\n type SuggestionsComplaintsDraft,\n type SuggestionsComplaintsType,\n suggestionCategorySchema,\n suggestionsComplaintsBodyObjectSchema,\n suggestionsComplaintsStepValid,\n suggestionsComplaintsTypeSchema,\n type UploadedMediaPath,\n uploadedMediaPathSchema,\n} from './suggestions-complaints.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAoB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCA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,eAAe,CAAC;AACvB,8EAA8E;AAC9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,6EAA6E;AAC7E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAGlB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,+EAA+E;AAC/E,OAAO,EACL,yBAAyB,EAGzB,uBAAuB,EACvB,qCAAqC,EACrC,0BAA0B,EAC1B,sCAAsC,EACtC,4CAA4C,EAC5C,iCAAiC,EACjC,sCAAsC,EACtC,uDAAuD,EACvD,sCAAsC,EACtC,sCAAsC,EACtC,kCAAkC,EAClC,oCAAoC,EACpC,wCAAwC,EACxC,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAK3B,wBAAwB,EACxB,qCAAqC,EACrC,8BAA8B,EAC9B,+BAA+B,EAE/B,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAErC,6EAA6E;AAC7E,OAAO,EAEL,0BAA0B,EAG1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAI5B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityKind,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n type VerifyCommunityBody,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n CROWDFUNDING_BANK_LINK_DEADLINE_DAYS,\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_PROOF_DOCS,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_MIN_PROOF_DOCS,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_PROOF_DOC_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_PROOF_DOC_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TERMS_VERSION,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n// ─── Create-composer config (shared types) ────────────────────────────────────\nexport {\n buildFieldOptions,\n type CreateFieldConfig,\n type CreateFieldOption,\n} from './create-form-config.js';\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_PROOF_DOC_TYPE_VALUES,\n CROWDFUNDING_RAZORPAY_ACCOUNT_STATUS_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeedItem,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingProofDocType,\n type CrowdfundingProofDocumentWire,\n type CrowdfundingRazorpayAccountStatus,\n type CrowdfundingRazorpayAccountWire,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n type CrowdfundingVerificationStage,\n type CrowdfundingVisibility,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeedItemSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingProofDocTypeSchema,\n crowdfundingProofDocumentWireSchema,\n crowdfundingRazorpayAccountStatusSchema,\n crowdfundingRazorpayAccountWireSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n crowdfundingVerificationStageSchema,\n crowdfundingVisibilitySchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n type RequestRerunCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n requestRerunCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n CROWDFUNDING_CATEGORY_OPTIONS,\n CROWDFUNDING_AUDIENCE_OPTIONS,\n CROWDFUNDING_ORG_KIND_OPTIONS,\n} from './crowdfunding.js';\n// ─── Donate Item (create) ────────────────────────────────────────────────────\nexport {\n type CreateDonateItemBody,\n createDonateItemBodySchema,\n DONATE_ITEM_CATEGORY_OPTIONS,\n DONATE_ITEM_CATEGORY_VALUES,\n DONATE_ITEM_CONDITION_OPTIONS,\n DONATE_ITEM_CREATE_FIELDS,\n DONATE_ITEM_CREATE_STEP_ORDER,\n DONATE_ITEM_DESCRIPTION_MAX_CHARS,\n DONATE_ITEM_MAX_ESTIMATED_WORTH,\n DONATE_ITEM_MAX_PHOTOS,\n DONATE_ITEM_NAME_MAX_CHARS,\n DONATE_ITEM_NAME_MIN_CHARS,\n type DonateItemCategory,\n type DonateItemCreateStepKey,\n type DonateItemDraft,\n type DonateItemPickupAddress,\n type DonateItemPickupCoords,\n donateItemCategorySchema,\n donateItemPickupAddressSchema,\n donateItemPickupCoordsSchema,\n donateItemStepValid,\n} from './donate-item.js';\n// ─── Engagement (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n type SetVoteBody,\n type SetVoteResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n setVoteBodySchema,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\n} from './engagement.js';\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n type DonateItemCondition,\n type DonateItemFeedItem,\n type DonateItemStatus,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n type LostFoundFeedItem,\n type LostFoundLocation,\n type LostFoundStatus,\n type LostFoundTimeRange,\n lostFoundCategorySchema,\n lostFoundFeedItemSchema,\n lostFoundLocationSchema,\n lostFoundStatusSchema,\n lostFoundTimeRangeSchema,\n SUGGESTIONS_COMPLAINTS_PRIORITY_VALUES,\n SUGGESTIONS_COMPLAINTS_STATUS_VALUES,\n type SuggestionsComplaintsFeedItem,\n type SuggestionsComplaintsLocation,\n type SuggestionsComplaintsPriority,\n type SuggestionsComplaintsStatus,\n suggestionsComplaintsAudioSchema,\n suggestionsComplaintsFeedItemSchema,\n suggestionsComplaintsLocationSchema,\n suggestionsComplaintsOfficerResponseSchema,\n suggestionsComplaintsPrioritySchema,\n suggestionsComplaintsStatusSchema,\n suggestionsComplaintsVideoSchema,\n} from './feed.js';\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n// ─── Link preview (auto-extracted URL embed) ──────────────────────────────\nexport {\n LINK_PREVIEW_KIND_VALUES,\n type LinkPreview,\n type LinkPreviewKind,\n linkPreviewKindSchema,\n linkPreviewSchema,\n} from './link-preview.js';\n// ─── Lost & Found (create) ───────────────────────────────────────────────────\nexport {\n type CreateLostFoundReportBody,\n createLostFoundReportBodySchema,\n LOST_FOUND_COLLECTION_POINT_MAX_CHARS,\n LOST_FOUND_CONTACT_PHONE_MAX_CHARS,\n LOST_FOUND_DESCRIPTION_MAX_CHARS,\n LOST_FOUND_DESCRIPTION_MIN_CHARS,\n LOST_FOUND_MAX_IMAGES,\n LOST_FOUND_REWARD_MAX_CHARS,\n LOST_FOUND_TITLE_MAX_CHARS,\n LOST_FOUND_TITLE_MIN_CHARS,\n LOST_FOUND_TYPE_VALUES,\n LOST_FOUND_CREATE_FIELDS,\n LOST_FOUND_CREATE_STEP_ORDER,\n LOST_FOUND_TYPE_OPTIONS,\n LOST_FOUND_CATEGORY_OPTIONS,\n type LostFoundCreateStepKey,\n type LostFoundDraft,\n type LostFoundType,\n lostFoundStepValid,\n lostFoundTypeSchema,\n} from './lost-found.js';\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Notifications ─────────────────────────────────────────────────────────\nexport {\n type ListNotificationsQuery,\n type ListNotificationsResponse,\n listNotificationsQuerySchema,\n listNotificationsResponseSchema,\n type MarkAllNotificationsReadBody,\n markAllNotificationsReadBodySchema,\n NOTIFICATION_CATEGORY_VALUES,\n NOTIFICATION_CHANNEL_VALUES,\n NOTIFICATION_PRIORITY_VALUES,\n NOTIFICATION_SOURCE_REF_KIND_VALUES,\n type NotificationActor,\n type NotificationCategory,\n type NotificationChannel,\n type NotificationPriority,\n type NotificationReadAllEvent,\n type NotificationReadEvent,\n type NotificationSourceRef,\n type NotificationSourceRefKind,\n type NotificationUnreadCount,\n type NotificationWire,\n notificationActorSchema,\n notificationCategorySchema,\n notificationChannelSchema,\n notificationPrioritySchema,\n notificationReadAllEventSchema,\n notificationReadEventSchema,\n notificationSourceRefKindSchema,\n notificationSourceRefSchema,\n notificationUnreadCountSchema,\n notificationWireSchema,\n REFORM_NOTIFICATION_SOCKET_EVENTS,\n type ReformNotificationSocketEvent,\n} from './notification.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.js';\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.js';\n\n// ─── Suggestions & Complaints (create) ──────────────────────────────────────\nexport {\n COMPLAINT_CATEGORY_VALUES,\n type ComplaintCategory,\n type CreateSuggestionsComplaintsBody,\n complaintCategorySchema,\n createSuggestionsComplaintsBodySchema,\n SUGGESTION_CATEGORY_VALUES,\n SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES,\n SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS,\n SUGGESTIONS_COMPLAINTS_MAX_IMAGES,\n SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS,\n SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS,\n SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS,\n SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS,\n SUGGESTIONS_COMPLAINTS_TYPE_VALUES,\n SUGGESTIONS_COMPLAINTS_CREATE_FIELDS,\n SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER,\n SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS,\n COMPLAINT_CATEGORY_OPTIONS,\n SUGGESTION_CATEGORY_OPTIONS,\n type SuggestionCategory,\n type SuggestionsComplaintsCreateStepKey,\n type SuggestionsComplaintsDraft,\n type SuggestionsComplaintsType,\n suggestionCategorySchema,\n suggestionsComplaintsBodyObjectSchema,\n suggestionsComplaintsStepValid,\n suggestionsComplaintsTypeSchema,\n type UploadedMediaPath,\n uploadedMediaPathSchema,\n} from './suggestions-complaints.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
|
package/dist/lost-found.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module community-schema/lost-found
|
|
13
13
|
*/
|
|
14
|
+
import { type CreateFieldConfig, type CreateFieldOption } from './create-form-config.js';
|
|
14
15
|
import { z } from 'zod';
|
|
15
16
|
export declare const LOST_FOUND_TYPE_VALUES: readonly ["lost", "found"];
|
|
16
17
|
export declare const lostFoundTypeSchema: z.ZodEnum<{
|
|
@@ -155,4 +156,13 @@ export declare const lostFoundStepValid: {
|
|
|
155
156
|
readonly location: (d: LostFoundDraft) => boolean;
|
|
156
157
|
readonly date: (d: LostFoundDraft) => boolean;
|
|
157
158
|
};
|
|
159
|
+
/** Ordered step keys for the lost-found create composer. */
|
|
160
|
+
export declare const LOST_FOUND_CREATE_STEP_ORDER: readonly ["type", "category", "title", "description", "location", "when", "photos", "collectionPoint", "contactPhone", "rewardOffered"];
|
|
161
|
+
export type LostFoundCreateStepKey = (typeof LOST_FOUND_CREATE_STEP_ORDER)[number];
|
|
162
|
+
/** Per-step field config (i18n keys under `lostAndFoundPage`). */
|
|
163
|
+
export declare const LOST_FOUND_CREATE_FIELDS: Record<LostFoundCreateStepKey, CreateFieldConfig>;
|
|
164
|
+
/** Type chip options (lost | found). */
|
|
165
|
+
export declare const LOST_FOUND_TYPE_OPTIONS: CreateFieldOption[];
|
|
166
|
+
/** Category chip options. */
|
|
167
|
+
export declare const LOST_FOUND_CATEGORY_OPTIONS: CreateFieldOption[];
|
|
158
168
|
//# sourceMappingURL=lost-found.d.ts.map
|
package/dist/lost-found.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lost-found.d.ts","sourceRoot":"","sources":["../src/lost-found.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,sBAAsB,4BAA6B,CAAC;AACjE,eAAO,MAAM,mBAAmB;;;EAAiC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AACrD,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,qCAAqC,MAAM,CAAC;AACzD,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAcrD,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,oEAAoE;AACpE,MAAM,MAAM,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F,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAKhE,eAAO,MAAM,kBAAkB;uBACnB,cAAc,KAAG,OAAO;2BACpB,cAAc,KAAG,OAAO;wBAG3B,cAAc,KAAG,OAAO;8BAClB,cAAc,KAAG,OAAO;IACzC,uEAAuE;2BACzD,cAAc,KAAG,OAAO;uBAC5B,cAAc,KAAG,OAAO;CAC1B,CAAC;AAKX,4DAA4D;AAC5D,eAAO,MAAM,4BAA4B,yIAW/B,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,sBAAsB,EAAE,iBAAiB,CAWtF,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,EAGtD,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,EAG1D,CAAC"}
|
package/dist/lost-found.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module community-schema/lost-found
|
|
13
13
|
*/
|
|
14
|
+
import { buildFieldOptions, } from './create-form-config.js';
|
|
14
15
|
import { z } from 'zod';
|
|
15
16
|
import { LOST_FOUND_CATEGORY_VALUES, lostFoundCategorySchema, lostFoundLocationSchema, lostFoundTimeRangeSchema, } from './feed.js';
|
|
16
17
|
// ─── Type (lost | found) ─────────────────────────────────────────────────────
|
|
@@ -65,4 +66,36 @@ export const lostFoundStepValid = {
|
|
|
65
66
|
location: (d) => !!(d.location?.state && d.location?.district),
|
|
66
67
|
date: (d) => typeof d.date === 'string' && d.date.length > 0,
|
|
67
68
|
};
|
|
69
|
+
// ─── Create-composer config (schema-driven StepForm) ──────────────────────────
|
|
70
|
+
// i18n KEYS under the `lostAndFoundPage` namespace. Mirrors donate-item.
|
|
71
|
+
/** Ordered step keys for the lost-found create composer. */
|
|
72
|
+
export const LOST_FOUND_CREATE_STEP_ORDER = [
|
|
73
|
+
'type',
|
|
74
|
+
'category',
|
|
75
|
+
'title',
|
|
76
|
+
'description',
|
|
77
|
+
'location',
|
|
78
|
+
'when',
|
|
79
|
+
'photos',
|
|
80
|
+
'collectionPoint',
|
|
81
|
+
'contactPhone',
|
|
82
|
+
'rewardOffered',
|
|
83
|
+
];
|
|
84
|
+
/** Per-step field config (i18n keys under `lostAndFoundPage`). */
|
|
85
|
+
export const LOST_FOUND_CREATE_FIELDS = {
|
|
86
|
+
type: { title: 'create.fields.type.title', help: 'create.fields.type.help', stepper: 'create.fields.type.stepper', required: true },
|
|
87
|
+
category: { title: 'create.fields.category.title', help: 'create.fields.category.help', stepper: 'create.fields.category.stepper', required: true },
|
|
88
|
+
title: { title: 'create.fields.title.title', help: 'create.fields.title.help', placeholder: 'create.fields.title.placeholder', stepper: 'create.fields.title.stepper', required: true },
|
|
89
|
+
description: { title: 'create.fields.description.title', help: 'create.fields.description.help', placeholder: 'create.fields.description.placeholder', stepper: 'create.fields.description.stepper', required: true },
|
|
90
|
+
location: { title: 'create.fields.location.title', help: 'create.fields.location.help', stepper: 'create.fields.location.stepper', required: true },
|
|
91
|
+
when: { title: 'create.fields.when.title', help: 'create.fields.when.help', stepper: 'create.fields.when.stepper', required: true },
|
|
92
|
+
photos: { title: 'create.fields.photos.title', help: 'create.fields.photos.help', stepper: 'create.fields.photos.stepper', required: false },
|
|
93
|
+
collectionPoint: { title: 'create.fields.collectionPoint.title', help: 'create.fields.collectionPoint.help', placeholder: 'create.fields.collectionPoint.placeholder', stepper: 'create.fields.collectionPoint.stepper', required: false },
|
|
94
|
+
contactPhone: { title: 'create.fields.contactPhone.title', help: 'create.fields.contactPhone.help', placeholder: 'create.fields.contactPhone.placeholder', stepper: 'create.fields.contactPhone.stepper', required: false },
|
|
95
|
+
rewardOffered: { title: 'create.fields.rewardOffered.title', help: 'create.fields.rewardOffered.help', placeholder: 'create.fields.rewardOffered.placeholder', stepper: 'create.fields.rewardOffered.stepper', required: false },
|
|
96
|
+
};
|
|
97
|
+
/** Type chip options (lost | found). */
|
|
98
|
+
export const LOST_FOUND_TYPE_OPTIONS = buildFieldOptions(LOST_FOUND_TYPE_VALUES, 'create.types');
|
|
99
|
+
/** Category chip options. */
|
|
100
|
+
export const LOST_FOUND_CATEGORY_OPTIONS = buildFieldOptions(LOST_FOUND_CATEGORY_VALUES, 'create.categories');
|
|
68
101
|
//# sourceMappingURL=lost-found.js.map
|
package/dist/lost-found.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lost-found.js","sourceRoot":"","sources":["../src/lost-found.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAEnB,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AAGlE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC;AACrD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAC9C,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAG,CAAC;AACzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAC;AAErD,MA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CAAC,CAAC;AAOH,+EAA+E;AAC/E,sEAAsE;AACtE,gFAAgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,CAAC,CAAiB,EAAW,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO;IACnF,QAAQ,EAAE,CAAC,CAAiB,EAAW,EAAE,CACvC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ;QAC7B,0BAAgD,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxE,KAAK,EAAE,CAAC,CAAiB,EAAW,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO;IAC7E,WAAW,EAAE,CAAC,CAAiB,EAAW,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO;IAC/F,uEAAuE;IACvE,QAAQ,EAAE,CAAC,CAAiB,EAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACvF,IAAI,EAAE,CAAC,CAAiB,EAAW,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;CAC7E,CAAC","sourcesContent":["/**\n * Lost & Found — create-flow schema (community kind).\n * ===================================================\n * Single source of truth for the WRITE path. Mirrors `crowdfunding.ts` /\n * `donate-item.ts` / `suggestions-complaints.ts`: this module owns the create\n * body + per-step completeness validators, reusing the category / location /\n * time-range schemas already defined in `feed.ts`.\n *\n * Consumed by reform-backend (controller validation) + the product frontends\n * (the multi-step `StepForm` config delegates `isFilled` to `lostFoundStepValid`).\n *\n * @module community-schema/lost-found\n */\n\nimport { z } from 'zod';\nimport {\n LOST_FOUND_CATEGORY_VALUES,\n lostFoundCategorySchema,\n lostFoundLocationSchema,\n lostFoundTimeRangeSchema,\n} from './feed.js';\n\n// ─── Type (lost | found) ─────────────────────────────────────────────────────\nexport const LOST_FOUND_TYPE_VALUES = ['lost', 'found'] as const;\nexport const lostFoundTypeSchema = z.enum(LOST_FOUND_TYPE_VALUES);\nexport type LostFoundType = z.infer<typeof lostFoundTypeSchema>;\n\n// ─── Field constraints ───────────────────────────────────────────────────────\nexport const LOST_FOUND_TITLE_MIN_CHARS = 3;\nexport const LOST_FOUND_TITLE_MAX_CHARS = 120;\nexport const LOST_FOUND_DESCRIPTION_MIN_CHARS = 10;\nexport const LOST_FOUND_DESCRIPTION_MAX_CHARS = 1000;\nexport const LOST_FOUND_MAX_IMAGES = 5;\nexport const LOST_FOUND_REWARD_MAX_CHARS = 40;\nexport const LOST_FOUND_COLLECTION_POINT_MAX_CHARS = 200;\nexport const LOST_FOUND_CONTACT_PHONE_MAX_CHARS = 15;\n\nconst titleSchema = z\n .string()\n .trim()\n .min(LOST_FOUND_TITLE_MIN_CHARS, 'Title must be at least 3 characters')\n .max(LOST_FOUND_TITLE_MAX_CHARS, 'Title must not exceed 120 characters');\nconst descriptionSchema = z\n .string()\n .trim()\n .min(LOST_FOUND_DESCRIPTION_MIN_CHARS, 'Description must be at least 10 characters')\n .max(LOST_FOUND_DESCRIPTION_MAX_CHARS, 'Description must not exceed 1000 characters');\n\n// ─── Create body ─────────────────────────────────────────────────────────────\nexport const createLostFoundReportBodySchema = z.object({\n type: lostFoundTypeSchema,\n title: titleSchema,\n description: descriptionSchema,\n category: lostFoundCategorySchema,\n images: z.array(z.string().url()).max(LOST_FOUND_MAX_IMAGES).optional().default([]),\n location: lostFoundLocationSchema,\n /** ISO 8601 date-time. The form converts its date picker value to ISO. */\n date: z.string().datetime(),\n timeRange: lostFoundTimeRangeSchema.optional(),\n /** \"Found\" reports only — where the item can be collected. */\n collectionPoint: z.string().trim().max(LOST_FOUND_COLLECTION_POINT_MAX_CHARS).optional(),\n contactPhone: z.string().trim().max(LOST_FOUND_CONTACT_PHONE_MAX_CHARS).optional(),\n /** \"Lost\" reports only — optional reward note. */\n rewardOffered: z.string().trim().min(1).max(LOST_FOUND_REWARD_MAX_CHARS).optional(),\n});\n\nexport type CreateLostFoundReportBody = z.infer<typeof createLostFoundReportBodySchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type LostFoundDraft = Partial<CreateLostFoundReportBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to). Required: type, category, title,\n// description, location, date. Everything else is an optional step. ───────\nexport const lostFoundStepValid = {\n type: (d: LostFoundDraft): boolean => lostFoundTypeSchema.safeParse(d.type).success,\n category: (d: LostFoundDraft): boolean =>\n typeof d.category === 'string' &&\n (LOST_FOUND_CATEGORY_VALUES as readonly string[]).includes(d.category),\n title: (d: LostFoundDraft): boolean => titleSchema.safeParse(d.title).success,\n description: (d: LostFoundDraft): boolean => descriptionSchema.safeParse(d.description).success,\n /** Lost & Found needs at least state + district for the civic feed. */\n location: (d: LostFoundDraft): boolean => !!(d.location?.state && d.location?.district),\n date: (d: LostFoundDraft): boolean => typeof d.date === 'string' && d.date.length > 0,\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"lost-found.js","sourceRoot":"","sources":["../src/lost-found.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAEnB,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AAGlE,gFAAgF;AA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B,EAAE,OAAO,EAAE,8BAA8B,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC5I,eAAe,EAAE,EAAE,KAAK,EAAE,qCAAqC,EAAE,IAAI,EAAE,oCAAoC,EAAE,WAAW,EAAE,2CAA2C,EAAE,OAAO,EAAE,uCAAuC,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC1O,YAAY,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,IAAI,EAAE,iCAAiC,EAAE,WAAW,EAAE,wCAAwC,EAAE,OAAO,EAAE,oCAAoC,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC3N,aAAa,EAAE,EAAE,KAAK,EAAE,mCAAmC,EAAE,IAAI,EAAE,kCAAkC,EAAE,WAAW,EAAE,yCAAyC,EAAE,OAAO,EAAE,qCAAqC,EAAE,QAAQ,EAAE,KAAK,EAAE;CACjO,CAAC;AAEF,wCAAwC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAwB,iBAAiB,CAC3E,sBAAsB,EACtB,cAAc,CACf,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,2BAA2B,GAAwB,iBAAiB,CAC/E,0BAA0B,EAC1B,mBAAmB,CACpB,CAAC","sourcesContent":["/**\n * Lost & Found — create-flow schema (community kind).\n * ===================================================\n * Single source of truth for the WRITE path. Mirrors `crowdfunding.ts` /\n * `donate-item.ts` / `suggestions-complaints.ts`: this module owns the create\n * body + per-step completeness validators, reusing the category / location /\n * time-range schemas already defined in `feed.ts`.\n *\n * Consumed by reform-backend (controller validation) + the product frontends\n * (the multi-step `StepForm` config delegates `isFilled` to `lostFoundStepValid`).\n *\n * @module community-schema/lost-found\n */\n\nimport {\n buildFieldOptions,\n type CreateFieldConfig,\n type CreateFieldOption,\n} from './create-form-config.js';\nimport { z } from 'zod';\nimport {\n LOST_FOUND_CATEGORY_VALUES,\n lostFoundCategorySchema,\n lostFoundLocationSchema,\n lostFoundTimeRangeSchema,\n} from './feed.js';\n\n// ─── Type (lost | found) ─────────────────────────────────────────────────────\nexport const LOST_FOUND_TYPE_VALUES = ['lost', 'found'] as const;\nexport const lostFoundTypeSchema = z.enum(LOST_FOUND_TYPE_VALUES);\nexport type LostFoundType = z.infer<typeof lostFoundTypeSchema>;\n\n// ─── Field constraints ───────────────────────────────────────────────────────\nexport const LOST_FOUND_TITLE_MIN_CHARS = 3;\nexport const LOST_FOUND_TITLE_MAX_CHARS = 120;\nexport const LOST_FOUND_DESCRIPTION_MIN_CHARS = 10;\nexport const LOST_FOUND_DESCRIPTION_MAX_CHARS = 1000;\nexport const LOST_FOUND_MAX_IMAGES = 5;\nexport const LOST_FOUND_REWARD_MAX_CHARS = 40;\nexport const LOST_FOUND_COLLECTION_POINT_MAX_CHARS = 200;\nexport const LOST_FOUND_CONTACT_PHONE_MAX_CHARS = 15;\n\nconst titleSchema = z\n .string()\n .trim()\n .min(LOST_FOUND_TITLE_MIN_CHARS, 'Title must be at least 3 characters')\n .max(LOST_FOUND_TITLE_MAX_CHARS, 'Title must not exceed 120 characters');\nconst descriptionSchema = z\n .string()\n .trim()\n .min(LOST_FOUND_DESCRIPTION_MIN_CHARS, 'Description must be at least 10 characters')\n .max(LOST_FOUND_DESCRIPTION_MAX_CHARS, 'Description must not exceed 1000 characters');\n\n// ─── Create body ─────────────────────────────────────────────────────────────\nexport const createLostFoundReportBodySchema = z.object({\n type: lostFoundTypeSchema,\n title: titleSchema,\n description: descriptionSchema,\n category: lostFoundCategorySchema,\n images: z.array(z.string().url()).max(LOST_FOUND_MAX_IMAGES).optional().default([]),\n location: lostFoundLocationSchema,\n /** ISO 8601 date-time. The form converts its date picker value to ISO. */\n date: z.string().datetime(),\n timeRange: lostFoundTimeRangeSchema.optional(),\n /** \"Found\" reports only — where the item can be collected. */\n collectionPoint: z.string().trim().max(LOST_FOUND_COLLECTION_POINT_MAX_CHARS).optional(),\n contactPhone: z.string().trim().max(LOST_FOUND_CONTACT_PHONE_MAX_CHARS).optional(),\n /** \"Lost\" reports only — optional reward note. */\n rewardOffered: z.string().trim().min(1).max(LOST_FOUND_REWARD_MAX_CHARS).optional(),\n});\n\nexport type CreateLostFoundReportBody = z.infer<typeof createLostFoundReportBodySchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type LostFoundDraft = Partial<CreateLostFoundReportBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to). Required: type, category, title,\n// description, location, date. Everything else is an optional step. ───────\nexport const lostFoundStepValid = {\n type: (d: LostFoundDraft): boolean => lostFoundTypeSchema.safeParse(d.type).success,\n category: (d: LostFoundDraft): boolean =>\n typeof d.category === 'string' &&\n (LOST_FOUND_CATEGORY_VALUES as readonly string[]).includes(d.category),\n title: (d: LostFoundDraft): boolean => titleSchema.safeParse(d.title).success,\n description: (d: LostFoundDraft): boolean => descriptionSchema.safeParse(d.description).success,\n /** Lost & Found needs at least state + district for the civic feed. */\n location: (d: LostFoundDraft): boolean => !!(d.location?.state && d.location?.district),\n date: (d: LostFoundDraft): boolean => typeof d.date === 'string' && d.date.length > 0,\n} as const;\n\n// ─── Create-composer config (schema-driven StepForm) ──────────────────────────\n// i18n KEYS under the `lostAndFoundPage` namespace. Mirrors donate-item.\n\n/** Ordered step keys for the lost-found create composer. */\nexport const LOST_FOUND_CREATE_STEP_ORDER = [\n 'type',\n 'category',\n 'title',\n 'description',\n 'location',\n 'when',\n 'photos',\n 'collectionPoint',\n 'contactPhone',\n 'rewardOffered',\n] as const;\nexport type LostFoundCreateStepKey = (typeof LOST_FOUND_CREATE_STEP_ORDER)[number];\n\n/** Per-step field config (i18n keys under `lostAndFoundPage`). */\nexport const LOST_FOUND_CREATE_FIELDS: Record<LostFoundCreateStepKey, CreateFieldConfig> = {\n type: { title: 'create.fields.type.title', help: 'create.fields.type.help', stepper: 'create.fields.type.stepper', required: true },\n category: { title: 'create.fields.category.title', help: 'create.fields.category.help', stepper: 'create.fields.category.stepper', required: true },\n title: { title: 'create.fields.title.title', help: 'create.fields.title.help', placeholder: 'create.fields.title.placeholder', stepper: 'create.fields.title.stepper', required: true },\n description: { title: 'create.fields.description.title', help: 'create.fields.description.help', placeholder: 'create.fields.description.placeholder', stepper: 'create.fields.description.stepper', required: true },\n location: { title: 'create.fields.location.title', help: 'create.fields.location.help', stepper: 'create.fields.location.stepper', required: true },\n when: { title: 'create.fields.when.title', help: 'create.fields.when.help', stepper: 'create.fields.when.stepper', required: true },\n photos: { title: 'create.fields.photos.title', help: 'create.fields.photos.help', stepper: 'create.fields.photos.stepper', required: false },\n collectionPoint: { title: 'create.fields.collectionPoint.title', help: 'create.fields.collectionPoint.help', placeholder: 'create.fields.collectionPoint.placeholder', stepper: 'create.fields.collectionPoint.stepper', required: false },\n contactPhone: { title: 'create.fields.contactPhone.title', help: 'create.fields.contactPhone.help', placeholder: 'create.fields.contactPhone.placeholder', stepper: 'create.fields.contactPhone.stepper', required: false },\n rewardOffered: { title: 'create.fields.rewardOffered.title', help: 'create.fields.rewardOffered.help', placeholder: 'create.fields.rewardOffered.placeholder', stepper: 'create.fields.rewardOffered.stepper', required: false },\n};\n\n/** Type chip options (lost | found). */\nexport const LOST_FOUND_TYPE_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n LOST_FOUND_TYPE_VALUES,\n 'create.types',\n);\n\n/** Category chip options. */\nexport const LOST_FOUND_CATEGORY_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n LOST_FOUND_CATEGORY_VALUES,\n 'create.categories',\n);\n"]}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @module community-schema/suggestions-complaints
|
|
17
17
|
*/
|
|
18
|
+
import { type CreateFieldConfig, type CreateFieldOption } from './create-form-config.js';
|
|
18
19
|
import { z } from 'zod';
|
|
19
20
|
export declare const SUGGESTIONS_COMPLAINTS_TYPE_VALUES: readonly ["complaint", "suggestion"];
|
|
20
21
|
export declare const suggestionsComplaintsTypeSchema: z.ZodEnum<{
|
|
@@ -317,4 +318,16 @@ export declare const suggestionsComplaintsStepValid: {
|
|
|
317
318
|
* useful for the civic feed when at least the state is known). */
|
|
318
319
|
readonly location: (d: SuggestionsComplaintsDraft) => boolean;
|
|
319
320
|
};
|
|
321
|
+
/** Ordered step keys for the suggestions-complaints create composer. */
|
|
322
|
+
export declare const SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER: readonly ["type", "category", "title", "description", "location", "attachments"];
|
|
323
|
+
export type SuggestionsComplaintsCreateStepKey = (typeof SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER)[number];
|
|
324
|
+
/** Per-step field config (i18n keys under `suggestionsComplaints`). `description`
|
|
325
|
+
* is required only for suggestions — the frontend toggles `optional` by type. */
|
|
326
|
+
export declare const SUGGESTIONS_COMPLAINTS_CREATE_FIELDS: Record<SuggestionsComplaintsCreateStepKey, CreateFieldConfig>;
|
|
327
|
+
/** Type chip options (complaint | suggestion). */
|
|
328
|
+
export declare const SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS: CreateFieldOption[];
|
|
329
|
+
/** Complaint category chip options (slugified keys; values stay display text). */
|
|
330
|
+
export declare const COMPLAINT_CATEGORY_OPTIONS: CreateFieldOption[];
|
|
331
|
+
/** Suggestion category chip options (slugified keys; values stay display text). */
|
|
332
|
+
export declare const SUGGESTION_CATEGORY_OPTIONS: CreateFieldOption[];
|
|
320
333
|
//# sourceMappingURL=suggestions-complaints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-complaints.d.ts","sourceRoot":"","sources":["../src/suggestions-complaints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,kCAAkC,sCAAuC,CAAC;AACvF,eAAO,MAAM,+BAA+B;;;EAA6C,CAAC;AAC1F,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAGxF,eA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AC;AAEF,kDAAkD;AAClD,eAAO,MAAM,mCAAmC,EAAE,iBAAiB,EAGlE,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,EAIzD,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,EAI1D,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @module community-schema/suggestions-complaints
|
|
17
17
|
*/
|
|
18
|
+
import { buildFieldOptions, slugifyKey, } from './create-form-config.js';
|
|
18
19
|
import { z } from 'zod';
|
|
19
20
|
import { suggestionsComplaintsLocationSchema } from './feed.js';
|
|
20
21
|
// ─── Location ────────────────────────────────────────────────────────────────
|
|
@@ -139,4 +140,32 @@ export const suggestionsComplaintsStepValid = {
|
|
|
139
140
|
* useful for the civic feed when at least the state is known). */
|
|
140
141
|
location: (d) => !!d.location?.state,
|
|
141
142
|
};
|
|
143
|
+
// ─── Create-composer config (schema-driven StepForm) ──────────────────────────
|
|
144
|
+
// i18n KEYS under the `suggestionsComplaints` namespace. Mirrors donate-item.
|
|
145
|
+
// Category enum VALUES are display strings, so option keys are slugified.
|
|
146
|
+
/** Ordered step keys for the suggestions-complaints create composer. */
|
|
147
|
+
export const SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER = [
|
|
148
|
+
'type',
|
|
149
|
+
'category',
|
|
150
|
+
'title',
|
|
151
|
+
'description',
|
|
152
|
+
'location',
|
|
153
|
+
'attachments',
|
|
154
|
+
];
|
|
155
|
+
/** Per-step field config (i18n keys under `suggestionsComplaints`). `description`
|
|
156
|
+
* is required only for suggestions — the frontend toggles `optional` by type. */
|
|
157
|
+
export const SUGGESTIONS_COMPLAINTS_CREATE_FIELDS = {
|
|
158
|
+
type: { title: 'create.fields.type.title', help: 'create.fields.type.help', stepper: 'create.fields.type.stepper', required: true },
|
|
159
|
+
category: { title: 'create.fields.category.title', help: 'create.fields.category.help', stepper: 'create.fields.category.stepper', required: true },
|
|
160
|
+
title: { title: 'create.fields.title.title', help: 'create.fields.title.help', placeholder: 'create.fields.title.placeholder', stepper: 'create.fields.title.stepper', required: true },
|
|
161
|
+
description: { title: 'create.fields.description.title', help: 'create.fields.description.help', placeholder: 'create.fields.description.placeholder', stepper: 'create.fields.description.stepper', required: false },
|
|
162
|
+
location: { title: 'create.fields.location.title', help: 'create.fields.location.help', stepper: 'create.fields.location.stepper', required: true },
|
|
163
|
+
attachments: { title: 'create.fields.attachments.title', help: 'create.fields.attachments.help', stepper: 'create.fields.attachments.stepper', required: false },
|
|
164
|
+
};
|
|
165
|
+
/** Type chip options (complaint | suggestion). */
|
|
166
|
+
export const SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS = buildFieldOptions(SUGGESTIONS_COMPLAINTS_TYPE_VALUES, 'create.types');
|
|
167
|
+
/** Complaint category chip options (slugified keys; values stay display text). */
|
|
168
|
+
export const COMPLAINT_CATEGORY_OPTIONS = buildFieldOptions(COMPLAINT_CATEGORY_VALUES, 'create.complaintCategories', slugifyKey);
|
|
169
|
+
/** Suggestion category chip options (slugified keys; values stay display text). */
|
|
170
|
+
export const SUGGESTION_CATEGORY_OPTIONS = buildFieldOptions(SUGGESTION_CATEGORY_VALUES, 'create.suggestionCategories', slugifyKey);
|
|
142
171
|
//# sourceMappingURL=suggestions-complaints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-complaints.js","sourceRoot":"","sources":["../src/suggestions-complaints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,mCAAmC,EAAE,MAAM,WAAW,CAAC;AAEpG,gFAAgF;AAChF,wEAAwE;AACxE,8EAA8E;AAC9E,2EAA2E;AAC3E,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,WAAW,EAAE,YAAY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EAAE,CAAC,CAA6B,EAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK;CACjE,CAAC","sourcesContent":["/**\n * Suggestions & Complaints — create-flow schema (community kind).\n * ===============================================================\n * Single source of truth for the WRITE path of the suggestions/complaints\n * surface. Mirrors the\n * `crowdfunding.ts` module shape: this file owns the create body + the\n * categories + per-step completeness validators; the display/feed shapes\n * stay in `feed.ts`.\n *\n * Consumed by:\n * - reform-backend (controller validation) — replaces the duplicated\n * local `issue-report.schema.ts` categories + body schema.\n * - the product frontends (the multi-step `StepForm` config delegates\n * its `isFilled` predicates to `suggestionsComplaintsStepValid`).\n *\n * @module community-schema/suggestions-complaints\n */\n\nimport { z } from 'zod';\nimport { type SuggestionsComplaintsLocation, suggestionsComplaintsLocationSchema } from './feed.js';\n\n// ─── Location ────────────────────────────────────────────────────────────────\n// The structured area-hierarchy location lives canonically in `feed.ts`\n// (`suggestionsComplaintsLocationSchema`). It's imported above for the create\n// body below and re-exported from the package root via the feed barrel, so\n// the create flow and the display flow share one definition.\n\n// ─── Type (complaint | suggestion) ──────────────────────────────────────────\nexport const SUGGESTIONS_COMPLAINTS_TYPE_VALUES = ['complaint', 'suggestion'] as const;\nexport const suggestionsComplaintsTypeSchema = z.enum(SUGGESTIONS_COMPLAINTS_TYPE_VALUES);\nexport type SuggestionsComplaintsType = z.infer<typeof suggestionsComplaintsTypeSchema>;\n\n// ─── Categories ──────────────────────────────────────────────────────────────\nexport const COMPLAINT_CATEGORY_VALUES = [\n 'Road & Transport',\n 'Water Supply',\n 'Electricity',\n 'Drainage & Sewage',\n 'Healthcare',\n 'Education',\n 'Sanitation',\n 'Waste Management',\n 'Street Lighting',\n 'Crime & Safety',\n 'Traffic Issues',\n 'Corruption',\n 'Unemployment',\n 'Poverty & Hunger',\n 'Child Labor',\n 'Air Pollution',\n 'Water Pollution',\n 'Noise Pollution',\n 'Deforestation',\n 'Illegal Dumping',\n 'Government Services',\n 'Documentation Issues',\n 'Public Grievances',\n 'Other Issues',\n] as const;\nexport const complaintCategorySchema = z.enum(COMPLAINT_CATEGORY_VALUES);\nexport type ComplaintCategory = z.infer<typeof complaintCategorySchema>;\n\nexport const SUGGESTION_CATEGORY_VALUES = [\n 'Infrastructure',\n 'Healthcare',\n 'Education',\n 'Environment',\n 'Public Safety',\n 'Government Services',\n 'Community Development',\n 'Youth & Employment',\n 'Women & Child Welfare',\n 'Technology & Innovation',\n 'Other',\n] as const;\nexport const suggestionCategorySchema = z.enum(SUGGESTION_CATEGORY_VALUES);\nexport type SuggestionCategory = z.infer<typeof suggestionCategorySchema>;\n\n/** All categories accepted on the wire (complaint ∪ suggestion). */\nexport const SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES = [\n ...COMPLAINT_CATEGORY_VALUES,\n ...SUGGESTION_CATEGORY_VALUES,\n] as const;\n\n// ─── Field constraints (exported so callers never hard-code numbers) ─────────\nexport const SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS = 10;\nexport const SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS = 200;\nexport const SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS = 2000;\n/** Suggestions must explain themselves; complaints may leave it blank. */\nexport const SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS = 20;\nexport const SUGGESTIONS_COMPLAINTS_MAX_IMAGES = 3;\nexport const SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS = 5;\n\nconst titleSchema = z\n .string()\n .trim()\n .min(SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, 'Title must be at least 10 characters')\n .max(SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, 'Title must not exceed 200 characters');\n\n// ─── Uploaded media (signed-URL path) ────────────────────────────────────────\n/** A file already uploaded to GCS via a signed URL. Shared across the\n * community create flows that use signed-URL uploads. */\nexport const uploadedMediaPathSchema = z.object({\n url: z.string().min(1),\n gcpPath: z.string().min(1),\n});\nexport type UploadedMediaPath = z.infer<typeof uploadedMediaPathSchema>;\n\n// ─── Create body ─────────────────────────────────────────────────────────────\n// Base object (pickable — used for per-field slice validation) ...\nexport const suggestionsComplaintsBodyObjectSchema = z.object({\n location: suggestionsComplaintsLocationSchema,\n type: suggestionsComplaintsTypeSchema.default('complaint'),\n category: z.enum(SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES as unknown as [string, ...string[]], {\n message: 'Invalid category selected',\n }),\n title: titleSchema,\n description: z\n .string()\n .trim()\n .max(\n SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS,\n 'Description must not exceed 2000 characters',\n )\n .optional()\n .or(z.literal('')),\n images: z.array(uploadedMediaPathSchema).max(SUGGESTIONS_COMPLAINTS_MAX_IMAGES).optional(),\n video: uploadedMediaPathSchema.optional(),\n videoLinks: z.array(z.string().url()).max(SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS).optional(),\n audio: uploadedMediaPathSchema.optional(),\n /** When true, the reporter's identity is hidden on the public wire.\n * Server-enforced: only an identity-verified user may set this. */\n isAnonymous: z.boolean().default(false),\n});\n\n// ... and the full create schema with the cross-field rule (suggestions need\n// a real description). Use the BASE object for `.pick()`/`.extend()`; use this\n// refined one for the final whole-body validation.\nexport const createSuggestionsComplaintsBodySchema = suggestionsComplaintsBodyObjectSchema.refine(\n (d) =>\n d.type !== 'suggestion' ||\n (typeof d.description === 'string' &&\n d.description.trim().length >= SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS),\n {\n message: 'Please describe your suggestion in at least 20 characters',\n path: ['description'],\n },\n);\n\nexport type CreateSuggestionsComplaintsBody = z.infer<typeof suggestionsComplaintsBodyObjectSchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type SuggestionsComplaintsDraft = Partial<CreateSuggestionsComplaintsBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to — so no validation rule is duplicated in\n// the frontend). Each returns whether that step is complete. ──────────────\nexport const suggestionsComplaintsStepValid = {\n type: (d: SuggestionsComplaintsDraft): boolean =>\n suggestionsComplaintsTypeSchema.safeParse(d.type).success,\n category: (d: SuggestionsComplaintsDraft): boolean =>\n typeof d.category === 'string' &&\n (SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES as readonly string[]).includes(d.category),\n title: (d: SuggestionsComplaintsDraft): boolean => titleSchema.safeParse(d.title).success,\n description: (d: SuggestionsComplaintsDraft): boolean =>\n d.type !== 'suggestion' ||\n (typeof d.description === 'string' &&\n d.description.trim().length >= SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS),\n /** Location is \"set\" once the state is chosen (the area hierarchy is only\n * useful for the civic feed when at least the state is known). */\n location: (d: SuggestionsComplaintsDraft): boolean => !!d.location?.state,\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"suggestions-complaints.js","sourceRoot":"","sources":["../src/suggestions-complaints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,iBAAiB,EAGjB,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsC,mCAAmC,EAAE,MAAM,WAAW,CAAC;AAEpG,gFAAgF;AAChF,wEAAwE;AACxE,8EAA8E;AAC9E,2EAA2E;AAC3E,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAU,CAAC;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;AAG1F,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,iBAAiB;IACjB,gBAAgB;I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Suggestions & Complaints — create-flow schema (community kind).\n * ===============================================================\n * Single source of truth for the WRITE path of the suggestions/complaints\n * surface. Mirrors the\n * `crowdfunding.ts` module shape: this file owns the create body + the\n * categories + per-step completeness validators; the display/feed shapes\n * stay in `feed.ts`.\n *\n * Consumed by:\n * - reform-backend (controller validation) — replaces the duplicated\n * local `issue-report.schema.ts` categories + body schema.\n * - the product frontends (the multi-step `StepForm` config delegates\n * its `isFilled` predicates to `suggestionsComplaintsStepValid`).\n *\n * @module community-schema/suggestions-complaints\n */\n\nimport {\n buildFieldOptions,\n type CreateFieldConfig,\n type CreateFieldOption,\n slugifyKey,\n} from './create-form-config.js';\nimport { z } from 'zod';\nimport { type SuggestionsComplaintsLocation, suggestionsComplaintsLocationSchema } from './feed.js';\n\n// ─── Location ────────────────────────────────────────────────────────────────\n// The structured area-hierarchy location lives canonically in `feed.ts`\n// (`suggestionsComplaintsLocationSchema`). It's imported above for the create\n// body below and re-exported from the package root via the feed barrel, so\n// the create flow and the display flow share one definition.\n\n// ─── Type (complaint | suggestion) ──────────────────────────────────────────\nexport const SUGGESTIONS_COMPLAINTS_TYPE_VALUES = ['complaint', 'suggestion'] as const;\nexport const suggestionsComplaintsTypeSchema = z.enum(SUGGESTIONS_COMPLAINTS_TYPE_VALUES);\nexport type SuggestionsComplaintsType = z.infer<typeof suggestionsComplaintsTypeSchema>;\n\n// ─── Categories ──────────────────────────────────────────────────────────────\nexport const COMPLAINT_CATEGORY_VALUES = [\n 'Road & Transport',\n 'Water Supply',\n 'Electricity',\n 'Drainage & Sewage',\n 'Healthcare',\n 'Education',\n 'Sanitation',\n 'Waste Management',\n 'Street Lighting',\n 'Crime & Safety',\n 'Traffic Issues',\n 'Corruption',\n 'Unemployment',\n 'Poverty & Hunger',\n 'Child Labor',\n 'Air Pollution',\n 'Water Pollution',\n 'Noise Pollution',\n 'Deforestation',\n 'Illegal Dumping',\n 'Government Services',\n 'Documentation Issues',\n 'Public Grievances',\n 'Other Issues',\n] as const;\nexport const complaintCategorySchema = z.enum(COMPLAINT_CATEGORY_VALUES);\nexport type ComplaintCategory = z.infer<typeof complaintCategorySchema>;\n\nexport const SUGGESTION_CATEGORY_VALUES = [\n 'Infrastructure',\n 'Healthcare',\n 'Education',\n 'Environment',\n 'Public Safety',\n 'Government Services',\n 'Community Development',\n 'Youth & Employment',\n 'Women & Child Welfare',\n 'Technology & Innovation',\n 'Other',\n] as const;\nexport const suggestionCategorySchema = z.enum(SUGGESTION_CATEGORY_VALUES);\nexport type SuggestionCategory = z.infer<typeof suggestionCategorySchema>;\n\n/** All categories accepted on the wire (complaint ∪ suggestion). */\nexport const SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES = [\n ...COMPLAINT_CATEGORY_VALUES,\n ...SUGGESTION_CATEGORY_VALUES,\n] as const;\n\n// ─── Field constraints (exported so callers never hard-code numbers) ─────────\nexport const SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS = 10;\nexport const SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS = 200;\nexport const SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS = 2000;\n/** Suggestions must explain themselves; complaints may leave it blank. */\nexport const SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS = 20;\nexport const SUGGESTIONS_COMPLAINTS_MAX_IMAGES = 3;\nexport const SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS = 5;\n\nconst titleSchema = z\n .string()\n .trim()\n .min(SUGGESTIONS_COMPLAINTS_TITLE_MIN_CHARS, 'Title must be at least 10 characters')\n .max(SUGGESTIONS_COMPLAINTS_TITLE_MAX_CHARS, 'Title must not exceed 200 characters');\n\n// ─── Uploaded media (signed-URL path) ────────────────────────────────────────\n/** A file already uploaded to GCS via a signed URL. Shared across the\n * community create flows that use signed-URL uploads. */\nexport const uploadedMediaPathSchema = z.object({\n url: z.string().min(1),\n gcpPath: z.string().min(1),\n});\nexport type UploadedMediaPath = z.infer<typeof uploadedMediaPathSchema>;\n\n// ─── Create body ─────────────────────────────────────────────────────────────\n// Base object (pickable — used for per-field slice validation) ...\nexport const suggestionsComplaintsBodyObjectSchema = z.object({\n location: suggestionsComplaintsLocationSchema,\n type: suggestionsComplaintsTypeSchema.default('complaint'),\n category: z.enum(SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES as unknown as [string, ...string[]], {\n message: 'Invalid category selected',\n }),\n title: titleSchema,\n description: z\n .string()\n .trim()\n .max(\n SUGGESTIONS_COMPLAINTS_DESCRIPTION_MAX_CHARS,\n 'Description must not exceed 2000 characters',\n )\n .optional()\n .or(z.literal('')),\n images: z.array(uploadedMediaPathSchema).max(SUGGESTIONS_COMPLAINTS_MAX_IMAGES).optional(),\n video: uploadedMediaPathSchema.optional(),\n videoLinks: z.array(z.string().url()).max(SUGGESTIONS_COMPLAINTS_MAX_VIDEO_LINKS).optional(),\n audio: uploadedMediaPathSchema.optional(),\n /** When true, the reporter's identity is hidden on the public wire.\n * Server-enforced: only an identity-verified user may set this. */\n isAnonymous: z.boolean().default(false),\n});\n\n// ... and the full create schema with the cross-field rule (suggestions need\n// a real description). Use the BASE object for `.pick()`/`.extend()`; use this\n// refined one for the final whole-body validation.\nexport const createSuggestionsComplaintsBodySchema = suggestionsComplaintsBodyObjectSchema.refine(\n (d) =>\n d.type !== 'suggestion' ||\n (typeof d.description === 'string' &&\n d.description.trim().length >= SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS),\n {\n message: 'Please describe your suggestion in at least 20 characters',\n path: ['description'],\n },\n);\n\nexport type CreateSuggestionsComplaintsBody = z.infer<typeof suggestionsComplaintsBodyObjectSchema>;\n\n/** A partially-filled draft as the multi-step form builds it up. */\nexport type SuggestionsComplaintsDraft = Partial<CreateSuggestionsComplaintsBody>;\n\n// ─── Per-step completeness validators (the SSOT the StepForm config delegates\n// its `isFilled` predicates to — so no validation rule is duplicated in\n// the frontend). Each returns whether that step is complete. ──────────────\nexport const suggestionsComplaintsStepValid = {\n type: (d: SuggestionsComplaintsDraft): boolean =>\n suggestionsComplaintsTypeSchema.safeParse(d.type).success,\n category: (d: SuggestionsComplaintsDraft): boolean =>\n typeof d.category === 'string' &&\n (SUGGESTIONS_COMPLAINTS_CATEGORY_VALUES as readonly string[]).includes(d.category),\n title: (d: SuggestionsComplaintsDraft): boolean => titleSchema.safeParse(d.title).success,\n description: (d: SuggestionsComplaintsDraft): boolean =>\n d.type !== 'suggestion' ||\n (typeof d.description === 'string' &&\n d.description.trim().length >= SUGGESTIONS_COMPLAINTS_SUGGESTION_DESCRIPTION_MIN_CHARS),\n /** Location is \"set\" once the state is chosen (the area hierarchy is only\n * useful for the civic feed when at least the state is known). */\n location: (d: SuggestionsComplaintsDraft): boolean => !!d.location?.state,\n} as const;\n\n// ─── Create-composer config (schema-driven StepForm) ──────────────────────────\n// i18n KEYS under the `suggestionsComplaints` namespace. Mirrors donate-item.\n// Category enum VALUES are display strings, so option keys are slugified.\n\n/** Ordered step keys for the suggestions-complaints create composer. */\nexport const SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER = [\n 'type',\n 'category',\n 'title',\n 'description',\n 'location',\n 'attachments',\n] as const;\nexport type SuggestionsComplaintsCreateStepKey =\n (typeof SUGGESTIONS_COMPLAINTS_CREATE_STEP_ORDER)[number];\n\n/** Per-step field config (i18n keys under `suggestionsComplaints`). `description`\n * is required only for suggestions — the frontend toggles `optional` by type. */\nexport const SUGGESTIONS_COMPLAINTS_CREATE_FIELDS: Record<\n SuggestionsComplaintsCreateStepKey,\n CreateFieldConfig\n> = {\n type: { title: 'create.fields.type.title', help: 'create.fields.type.help', stepper: 'create.fields.type.stepper', required: true },\n category: { title: 'create.fields.category.title', help: 'create.fields.category.help', stepper: 'create.fields.category.stepper', required: true },\n title: { title: 'create.fields.title.title', help: 'create.fields.title.help', placeholder: 'create.fields.title.placeholder', stepper: 'create.fields.title.stepper', required: true },\n description: { title: 'create.fields.description.title', help: 'create.fields.description.help', placeholder: 'create.fields.description.placeholder', stepper: 'create.fields.description.stepper', required: false },\n location: { title: 'create.fields.location.title', help: 'create.fields.location.help', stepper: 'create.fields.location.stepper', required: true },\n attachments: { title: 'create.fields.attachments.title', help: 'create.fields.attachments.help', stepper: 'create.fields.attachments.stepper', required: false },\n};\n\n/** Type chip options (complaint | suggestion). */\nexport const SUGGESTIONS_COMPLAINTS_TYPE_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n SUGGESTIONS_COMPLAINTS_TYPE_VALUES,\n 'create.types',\n);\n\n/** Complaint category chip options (slugified keys; values stay display text). */\nexport const COMPLAINT_CATEGORY_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n COMPLAINT_CATEGORY_VALUES,\n 'create.complaintCategories',\n slugifyKey,\n);\n\n/** Suggestion category chip options (slugified keys; values stay display text). */\nexport const SUGGESTION_CATEGORY_OPTIONS: CreateFieldOption[] = buildFieldOptions(\n SUGGESTION_CATEGORY_VALUES,\n 'create.suggestionCategories',\n slugifyKey,\n);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jansathi-community-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Shared Zod schemas + TypeScript types for the Jansathi hyperlocal community feature (feed, posts, engagement, social graph, groups, communities).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|