@voyantjs/crm 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -20,10 +20,12 @@ export declare const crmHonoModule: HonoModule;
20
20
  export { crmBookingExtension } from "./booking-extension.js";
21
21
  export type { CrmRouteRuntime, CrmRouteRuntimeOptions, ResolveCrmKmsProvider, } from "./route-runtime.js";
22
22
  export { buildCrmRouteRuntime, CRM_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
23
- export type { Activity, ActivityLink, ActivityParticipant, CommunicationLogEntry, CustomFieldDefinition, CustomFieldValue, NewActivity, NewActivityLink, NewActivityParticipant, NewCommunicationLogEntry, NewCustomFieldDefinition, NewCustomFieldValue, NewOpportunity, NewOpportunityParticipant, NewOpportunityProduct, NewOrganization, NewOrganizationNote, NewPerson, NewPersonDocument, NewPersonNote, NewPipeline, NewQuote, NewQuoteLine, NewSegment, NewSegmentMember, NewStage, Opportunity, OpportunityParticipant, OpportunityProduct, Organization, OrganizationNote, Person, PersonDocument, PersonNote, Pipeline, Quote, QuoteLine, Segment, SegmentMember, Stage, } from "./schema.js";
24
- export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
23
+ export type { Activity, ActivityLink, ActivityParticipant, CommunicationLogEntry, CustomFieldDefinition, CustomFieldValue, NewActivity, NewActivityLink, NewActivityParticipant, NewCommunicationLogEntry, NewCustomFieldDefinition, NewCustomFieldValue, NewOpportunity, NewOpportunityParticipant, NewOpportunityProduct, NewOrganization, NewOrganizationNote, NewPerson, NewPersonDocument, NewPersonNote, NewPersonRelationship, NewPipeline, NewQuote, NewQuoteLine, NewSegment, NewSegmentMember, NewStage, Opportunity, OpportunityParticipant, OpportunityProduct, Organization, OrganizationNote, Person, PersonDocument, PersonNote, PersonRelationship, Pipeline, Quote, QuoteLine, Segment, SegmentMember, Stage, } from "./schema.js";
24
+ export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, personRelationshipKindEnum, personRelationships, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
25
25
  export type { CreatePersonDocumentInput, PersonDocumentListQuery, PersonDocumentType, PersonTravelSnapshot, UpdatePersonDocumentInput, } from "./service/person-documents.js";
26
26
  export { personDocumentNumberPlaintextSchema, personDocumentsService, personPiiBlobPlaintextSchema, } from "./service/person-documents.js";
27
- export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
27
+ export type { CreatePersonRelationshipInput, PersonRelationshipKind, PersonRelationshipListQuery, UpdatePersonRelationshipInput, } from "./service/person-relationships.js";
28
+ export { personRelationshipsService } from "./service/person-relationships.js";
29
+ export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonRelationshipSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, personRelationshipKindSchema, personRelationshipListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonRelationshipSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
28
30
  export { crmService };
29
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,YAAY,EAAE,SA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,MAAM,EACN,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,cAAc,EACd,QAAQ,EACR,MAAM,GACP,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,mCAAmC,EACnC,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,EAC5B,oCAAoC,EACpC,+BAA+B,EAC/B,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,uCAAuC,EACvC,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,uCAAuC,EACvC,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAA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B,EAC5B,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,uCAAuC,EACvC,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,CAAA"}
package/dist/index.js CHANGED
@@ -42,7 +42,8 @@ export function createCrmHonoModule(options = {}) {
42
42
  export const crmHonoModule = createCrmHonoModule();
43
43
  export { crmBookingExtension } from "./booking-extension.js";
44
44
  export { buildCrmRouteRuntime, CRM_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
45
- export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
45
+ export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, personRelationshipKindEnum, personRelationships, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
46
46
  export { personDocumentNumberPlaintextSchema, personDocumentsService, personPiiBlobPlaintextSchema, } from "./service/person-documents.js";
47
- export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
47
+ export { personRelationshipsService } from "./service/person-relationships.js";
48
+ export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonRelationshipSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, personRelationshipKindSchema, personRelationshipListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonRelationshipSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
48
49
  export { crmService };
@@ -1796,6 +1796,185 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
1796
1796
  status: import("hono/utils/http-status").ContentfulStatusCode;
1797
1797
  };
1798
1798
  };
1799
+ }, "/"> | import("hono/types").MergeSchemaPath<{
1800
+ "/people/:id/relationships": {
1801
+ $get: {
1802
+ input: {
1803
+ param: {
1804
+ id: string;
1805
+ };
1806
+ };
1807
+ output: {
1808
+ data: {
1809
+ id: string;
1810
+ fromPersonId: string;
1811
+ toPersonId: string;
1812
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
1813
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
1814
+ startDate: string | null;
1815
+ endDate: string | null;
1816
+ isPrimary: boolean;
1817
+ notes: string | null;
1818
+ metadata: {
1819
+ [x: string]: import("hono/utils/types").JSONValue;
1820
+ } | null;
1821
+ createdAt: string;
1822
+ updatedAt: string;
1823
+ }[];
1824
+ };
1825
+ outputFormat: "json";
1826
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1827
+ };
1828
+ };
1829
+ } & {
1830
+ "/people/:id/relationships": {
1831
+ $post: {
1832
+ input: {
1833
+ param: {
1834
+ id: string;
1835
+ };
1836
+ };
1837
+ output: {
1838
+ error: string;
1839
+ };
1840
+ outputFormat: "json";
1841
+ status: 400;
1842
+ } | {
1843
+ input: {
1844
+ param: {
1845
+ id: string;
1846
+ };
1847
+ };
1848
+ output: {
1849
+ data: {
1850
+ metadata: {
1851
+ [x: string]: import("hono/utils/types").JSONValue;
1852
+ } | null;
1853
+ id: string;
1854
+ createdAt: string;
1855
+ updatedAt: string;
1856
+ startDate: string | null;
1857
+ endDate: string | null;
1858
+ notes: string | null;
1859
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
1860
+ isPrimary: boolean;
1861
+ fromPersonId: string;
1862
+ toPersonId: string;
1863
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
1864
+ };
1865
+ };
1866
+ outputFormat: "json";
1867
+ status: 201;
1868
+ };
1869
+ };
1870
+ } & {
1871
+ "/person-relationships/:id": {
1872
+ $get: {
1873
+ input: {
1874
+ param: {
1875
+ id: string;
1876
+ };
1877
+ };
1878
+ output: {
1879
+ error: string;
1880
+ };
1881
+ outputFormat: "json";
1882
+ status: 404;
1883
+ } | {
1884
+ input: {
1885
+ param: {
1886
+ id: string;
1887
+ };
1888
+ };
1889
+ output: {
1890
+ data: {
1891
+ id: string;
1892
+ fromPersonId: string;
1893
+ toPersonId: string;
1894
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
1895
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
1896
+ startDate: string | null;
1897
+ endDate: string | null;
1898
+ isPrimary: boolean;
1899
+ notes: string | null;
1900
+ metadata: {
1901
+ [x: string]: import("hono/utils/types").JSONValue;
1902
+ } | null;
1903
+ createdAt: string;
1904
+ updatedAt: string;
1905
+ };
1906
+ };
1907
+ outputFormat: "json";
1908
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1909
+ };
1910
+ };
1911
+ } & {
1912
+ "/person-relationships/:id": {
1913
+ $patch: {
1914
+ input: {
1915
+ param: {
1916
+ id: string;
1917
+ };
1918
+ };
1919
+ output: {
1920
+ error: string;
1921
+ };
1922
+ outputFormat: "json";
1923
+ status: 404;
1924
+ } | {
1925
+ input: {
1926
+ param: {
1927
+ id: string;
1928
+ };
1929
+ };
1930
+ output: {
1931
+ data: {
1932
+ id: string;
1933
+ fromPersonId: string;
1934
+ toPersonId: string;
1935
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
1936
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
1937
+ startDate: string | null;
1938
+ endDate: string | null;
1939
+ isPrimary: boolean;
1940
+ notes: string | null;
1941
+ metadata: {
1942
+ [x: string]: import("hono/utils/types").JSONValue;
1943
+ } | null;
1944
+ createdAt: string;
1945
+ updatedAt: string;
1946
+ };
1947
+ };
1948
+ outputFormat: "json";
1949
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1950
+ };
1951
+ };
1952
+ } & {
1953
+ "/person-relationships/:id": {
1954
+ $delete: {
1955
+ input: {
1956
+ param: {
1957
+ id: string;
1958
+ };
1959
+ };
1960
+ output: {
1961
+ error: string;
1962
+ };
1963
+ outputFormat: "json";
1964
+ status: 404;
1965
+ } | {
1966
+ input: {
1967
+ param: {
1968
+ id: string;
1969
+ };
1970
+ };
1971
+ output: {
1972
+ success: true;
1973
+ };
1974
+ outputFormat: "json";
1975
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1976
+ };
1977
+ };
1799
1978
  }, "/"> | import("hono/types").MergeSchemaPath<{
1800
1979
  "/pipelines": {
1801
1980
  $get: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAWjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQU,CAAA;AAEhC,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAA"}
@@ -4,11 +4,13 @@ import { activityRoutes } from "./activities.js";
4
4
  import { customFieldRoutes } from "./custom-fields.js";
5
5
  import { opportunityRoutes } from "./opportunities.js";
6
6
  import { personDocumentRoutes } from "./person-documents.js";
7
+ import { personRelationshipRoutes } from "./person-relationships.js";
7
8
  import { pipelineRoutes } from "./pipelines.js";
8
9
  import { quoteRoutes } from "./quotes.js";
9
10
  export const crmRoutes = new Hono()
10
11
  .route("/", accountRoutes)
11
12
  .route("/", personDocumentRoutes)
13
+ .route("/", personRelationshipRoutes)
12
14
  .route("/", pipelineRoutes)
13
15
  .route("/", opportunityRoutes)
14
16
  .route("/", quoteRoutes)
@@ -0,0 +1,189 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ type Env = {
3
+ Variables: {
4
+ db: PostgresJsDatabase;
5
+ userId?: string;
6
+ };
7
+ };
8
+ export declare const personRelationshipRoutes: import("hono/hono-base").HonoBase<Env, {
9
+ "/people/:id/relationships": {
10
+ $get: {
11
+ input: {
12
+ param: {
13
+ id: string;
14
+ };
15
+ };
16
+ output: {
17
+ data: {
18
+ id: string;
19
+ fromPersonId: string;
20
+ toPersonId: string;
21
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
22
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
23
+ startDate: string | null;
24
+ endDate: string | null;
25
+ isPrimary: boolean;
26
+ notes: string | null;
27
+ metadata: {
28
+ [x: string]: import("hono/utils/types").JSONValue;
29
+ } | null;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ }[];
33
+ };
34
+ outputFormat: "json";
35
+ status: import("hono/utils/http-status").ContentfulStatusCode;
36
+ };
37
+ };
38
+ } & {
39
+ "/people/:id/relationships": {
40
+ $post: {
41
+ input: {
42
+ param: {
43
+ id: string;
44
+ };
45
+ };
46
+ output: {
47
+ error: string;
48
+ };
49
+ outputFormat: "json";
50
+ status: 400;
51
+ } | {
52
+ input: {
53
+ param: {
54
+ id: string;
55
+ };
56
+ };
57
+ output: {
58
+ data: {
59
+ metadata: {
60
+ [x: string]: import("hono/utils/types").JSONValue;
61
+ } | null;
62
+ id: string;
63
+ createdAt: string;
64
+ updatedAt: string;
65
+ startDate: string | null;
66
+ endDate: string | null;
67
+ notes: string | null;
68
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
69
+ isPrimary: boolean;
70
+ fromPersonId: string;
71
+ toPersonId: string;
72
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
73
+ };
74
+ };
75
+ outputFormat: "json";
76
+ status: 201;
77
+ };
78
+ };
79
+ } & {
80
+ "/person-relationships/:id": {
81
+ $get: {
82
+ input: {
83
+ param: {
84
+ id: string;
85
+ };
86
+ };
87
+ output: {
88
+ error: string;
89
+ };
90
+ outputFormat: "json";
91
+ status: 404;
92
+ } | {
93
+ input: {
94
+ param: {
95
+ id: string;
96
+ };
97
+ };
98
+ output: {
99
+ data: {
100
+ id: string;
101
+ fromPersonId: string;
102
+ toPersonId: string;
103
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
104
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
105
+ startDate: string | null;
106
+ endDate: string | null;
107
+ isPrimary: boolean;
108
+ notes: string | null;
109
+ metadata: {
110
+ [x: string]: import("hono/utils/types").JSONValue;
111
+ } | null;
112
+ createdAt: string;
113
+ updatedAt: string;
114
+ };
115
+ };
116
+ outputFormat: "json";
117
+ status: import("hono/utils/http-status").ContentfulStatusCode;
118
+ };
119
+ };
120
+ } & {
121
+ "/person-relationships/:id": {
122
+ $patch: {
123
+ input: {
124
+ param: {
125
+ id: string;
126
+ };
127
+ };
128
+ output: {
129
+ error: string;
130
+ };
131
+ outputFormat: "json";
132
+ status: 404;
133
+ } | {
134
+ input: {
135
+ param: {
136
+ id: string;
137
+ };
138
+ };
139
+ output: {
140
+ data: {
141
+ id: string;
142
+ fromPersonId: string;
143
+ toPersonId: string;
144
+ kind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
145
+ inverseKind: "partner" | "other" | "spouse" | "parent" | "child" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
146
+ startDate: string | null;
147
+ endDate: string | null;
148
+ isPrimary: boolean;
149
+ notes: string | null;
150
+ metadata: {
151
+ [x: string]: import("hono/utils/types").JSONValue;
152
+ } | null;
153
+ createdAt: string;
154
+ updatedAt: string;
155
+ };
156
+ };
157
+ outputFormat: "json";
158
+ status: import("hono/utils/http-status").ContentfulStatusCode;
159
+ };
160
+ };
161
+ } & {
162
+ "/person-relationships/:id": {
163
+ $delete: {
164
+ input: {
165
+ param: {
166
+ id: string;
167
+ };
168
+ };
169
+ output: {
170
+ error: string;
171
+ };
172
+ outputFormat: "json";
173
+ status: 404;
174
+ } | {
175
+ input: {
176
+ param: {
177
+ id: string;
178
+ };
179
+ };
180
+ output: {
181
+ success: true;
182
+ };
183
+ outputFormat: "json";
184
+ status: import("hono/utils/http-status").ContentfulStatusCode;
185
+ };
186
+ };
187
+ }, "/", "/person-relationships/:id">;
188
+ export {};
189
+ //# sourceMappingURL=person-relationships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-relationships.d.ts","sourceRoot":"","sources":["../../src/routes/person-relationships.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAUjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAoCjC,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { parseJsonBody, parseQuery } from "@voyantjs/hono";
2
+ import { Hono } from "hono";
3
+ import { crmService } from "../service/index.js";
4
+ import { insertPersonRelationshipSchema, personRelationshipListQuerySchema, updatePersonRelationshipSchema, } from "../validation.js";
5
+ export const personRelationshipRoutes = new Hono()
6
+ .get("/people/:id/relationships", async (c) => {
7
+ const query = parseQuery(c, personRelationshipListQuerySchema);
8
+ return c.json({
9
+ data: await crmService.listPersonRelationships(c.get("db"), c.req.param("id"), query),
10
+ });
11
+ })
12
+ .post("/people/:id/relationships", async (c) => {
13
+ const row = await crmService.createPersonRelationship(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertPersonRelationshipSchema));
14
+ if (!row) {
15
+ return c.json({ error: "Person not found or self-relationship rejected" }, 400);
16
+ }
17
+ return c.json({ data: row }, 201);
18
+ })
19
+ .get("/person-relationships/:id", async (c) => {
20
+ const row = await crmService.getPersonRelationship(c.get("db"), c.req.param("id"));
21
+ if (!row)
22
+ return c.json({ error: "Relationship not found" }, 404);
23
+ return c.json({ data: row });
24
+ })
25
+ .patch("/person-relationships/:id", async (c) => {
26
+ const row = await crmService.updatePersonRelationship(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePersonRelationshipSchema));
27
+ if (!row)
28
+ return c.json({ error: "Relationship not found" }, 404);
29
+ return c.json({ data: row });
30
+ })
31
+ .delete("/person-relationships/:id", async (c) => {
32
+ const row = await crmService.deletePersonRelationship(c.get("db"), c.req.param("id"));
33
+ if (!row)
34
+ return c.json({ error: "Relationship not found" }, 404);
35
+ return c.json({ success: true });
36
+ });