@solibo/solibo-query 1.30.0 → 1.31.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.
@@ -4,6 +4,6 @@ export declare function updateAdministratorsForCompanyMutationOptions(sdk: Solib
4
4
  mutationFn: (params: {
5
5
  companyId: Id;
6
6
  cmd: SdkInput<UpdateManagementCommandProps>;
7
- }) => Promise<import("@solibo/solibo-sdk").Person[]>;
7
+ }) => Promise<import("@solibo/solibo-sdk").SoliboContacts>;
8
8
  onSuccess: (_: any, params: any) => Promise<[void, void, void]>;
9
9
  };
@@ -1,15 +1,16 @@
1
1
  import { CreateResidentCommand, Id, ResidentType, SoliboClient } from "@solibo/solibo-sdk";
2
2
  import type { QueryClient } from "@tanstack/query-core";
3
3
  /**
4
- * @deprecated The backend can return either person or organization data while
5
- * this legacy contract reports Person. Use createPersonResidentMutationOptions
6
- * or createOrganizationResidentMutationOptions for exact result types.
4
+ * @deprecated Use createPersonResidentMutationOptions or
5
+ * createOrganizationResidentMutationOptions for exact result types. This one
6
+ * returns the sealed Resident (PersonResident or OrganizationResident) since
7
+ * backend 1f85e4d declared it; it was typed Person before.
7
8
  */
8
9
  export declare function createResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
9
10
  mutationFn: (params: {
10
11
  companyId: Id;
11
12
  residentType: ResidentType;
12
13
  cmd: CreateResidentCommand;
13
- }) => Promise<import("@solibo/solibo-sdk").Person>;
14
+ }) => Promise<import("@solibo/solibo-sdk").Resident>;
14
15
  onSuccess: (_: any, params: any) => Promise<[void[], void, void, void, void, void, void, void]>;
15
16
  };
@@ -6,9 +6,10 @@ import { residentKeys } from "../../queries/residentsAndSections/residents.js";
6
6
  import { sectionKeys } from "../../queries/residentsAndSections/sections.js";
7
7
  import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
8
8
  /**
9
- * @deprecated The backend can return either person or organization data while
10
- * this legacy contract reports Person. Use createPersonResidentMutationOptions
11
- * or createOrganizationResidentMutationOptions for exact result types.
9
+ * @deprecated Use createPersonResidentMutationOptions or
10
+ * createOrganizationResidentMutationOptions for exact result types. This one
11
+ * returns the sealed Resident (PersonResident or OrganizationResident) since
12
+ * backend 1f85e4d declared it; it was typed Person before.
12
13
  */
13
14
  export function createResidentMutationOptions(sdk, queryClient) {
14
15
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"createResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/createResident.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAIZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,KAAK,EAAE,MAAM,CAAC,GAAG;SAClB,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC;YACV,+BAA+B,CAAC,WAAW,EAAE;gBAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI;gBACtC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,SAAS;aAC7C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAChD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC/C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,YAAY,CAAC,OAAO,CAClB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,SAAS,CAClC;iBACF;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,aAAa,CAAC,SAAS,CACrB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,SAAS,CAClC;iBACF;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC9C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n CreateResidentCommand,\n Id,\n ResidentType,\n SoliboClient,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { sectionKeys } from \"../../queries/residentsAndSections/sections.js\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n/**\n * @deprecated The backend can return either person or organization data while\n * this legacy contract reports Person. Use createPersonResidentMutationOptions\n * or createOrganizationResidentMutationOptions for exact result types.\n */\nexport function createResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n cmd: CreateResidentCommand;\n }) =>\n sdk.api.residents.createResident({\n companyId: params.companyId,\n residentType: params.residentType,\n input: params.cmd,\n }),\n onSuccess: (_, params) =>\n Promise.all([\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType.name,\n sectionId: params.cmd.sectionId ?? undefined,\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [sectionKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n residentKeys.history(\n params.companyId,\n params.cmd.sectionId ?? undefined,\n ),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.recipient(\n params.companyId,\n params.cmd.sectionId ?? undefined,\n ),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"createResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/createResident.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0CA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C,SAAS,IAAI,SAAS,CAClC;iBACF;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,aAAa,CAAC,SAAS,CACrB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,SAAS,CAClC;iBACF;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC9C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n CreateResidentCommand,\n Id,\n ResidentType,\n SoliboClient,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { sectionKeys } from \"../../queries/residentsAndSections/sections.js\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n/**\n * @deprecated Use createPersonResidentMutationOptions or\n * createOrganizationResidentMutationOptions for exact result types. This one\n * returns the sealed Resident (PersonResident or OrganizationResident) since\n * backend 1f85e4d declared it; it was typed Person before.\n */\nexport function createResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n cmd: CreateResidentCommand;\n }) =>\n sdk.api.residents.createResident({\n companyId: params.companyId,\n residentType: params.residentType,\n input: params.cmd,\n }),\n onSuccess: (_, params) =>\n Promise.all([\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType.name,\n sectionId: params.cmd.sectionId ?? undefined,\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [sectionKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n residentKeys.history(\n params.companyId,\n params.cmd.sectionId ?? undefined,\n ),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.recipient(\n params.companyId,\n params.cmd.sectionId ?? undefined,\n ),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
@@ -1,9 +1,10 @@
1
- import { Id, Person, ResidentType, SoliboClient, UpdateResidentCommand } from "@solibo/solibo-sdk";
1
+ import { Id, ResidentType, SoliboClient, UpdateResidentCommand } from "@solibo/solibo-sdk";
2
2
  import type { QueryClient } from "@tanstack/query-core";
3
3
  /**
4
- * @deprecated The backend can return either person or organization data while
5
- * this legacy contract reports Person. Use updatePersonResidentMutationOptions
6
- * or updateOrganizationResidentMutationOptions for exact result types.
4
+ * @deprecated Use updatePersonResidentMutationOptions or
5
+ * updateOrganizationResidentMutationOptions for exact result types. This one
6
+ * returns the sealed Resident (PersonResident or OrganizationResident) since
7
+ * backend 1f85e4d declared it; it was typed Person before.
7
8
  */
8
9
  export declare function updateResidentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
9
10
  mutationFn: (params: {
@@ -11,6 +12,8 @@ export declare function updateResidentMutationOptions(sdk: SoliboClient, queryCl
11
12
  residentType: ResidentType;
12
13
  residentId: Id;
13
14
  cmd: UpdateResidentCommand;
14
- }) => Promise<Person>;
15
- onSuccess: (res: Person, params: any) => Promise<[void[], void, void, void, void, void, void, void, void, void, void, void, void, void]>;
15
+ }) => Promise<import("@solibo/solibo-sdk").Resident>;
16
+ onSuccess: (res: {
17
+ id: bigint;
18
+ }, params: any) => Promise<[void[], void, void, void, void, void, void, void, void, void, void, void, void, void]>;
16
19
  };
@@ -7,9 +7,10 @@ import { personKeys } from "../../queries/person/persons.js";
7
7
  import { residentKeys } from "../../queries/residentsAndSections/residents.js";
8
8
  import { invalidateResidentSectionCaches } from "../residentsAndSections/cacheInvalidation.js";
9
9
  /**
10
- * @deprecated The backend can return either person or organization data while
11
- * this legacy contract reports Person. Use updatePersonResidentMutationOptions
12
- * or updateOrganizationResidentMutationOptions for exact result types.
10
+ * @deprecated Use updatePersonResidentMutationOptions or
11
+ * updateOrganizationResidentMutationOptions for exact result types. This one
12
+ * returns the sealed Resident (PersonResident or OrganizationResident) since
13
+ * backend 1f85e4d declared it; it was typed Person before.
13
14
  */
14
15
  export function updateResidentMutationOptions(sdk, queryClient) {
15
16
  return {
@@ -19,6 +20,7 @@ export function updateResidentMutationOptions(sdk, queryClient) {
19
20
  residentId: params.residentId,
20
21
  input: params.cmd,
21
22
  }),
23
+ // Typed by what it reads, so it fits the old Person and the new Resident contract.
22
24
  onSuccess: (res, params) => Promise.all([
23
25
  invalidateResidentSectionCaches(queryClient, {
24
26
  companyId: params.companyId,
@@ -1 +1 @@
1
- {"version":3,"file":"updateResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateResident.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,aAAa,E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gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n Person,\n ResidentType,\n SoliboClient,\n UpdateResidentCommand,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { boardKeys } from \"../../queries/board/boardMembers.js\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n/**\n * @deprecated The backend can return either person or organization data while\n * this legacy contract reports Person. Use updatePersonResidentMutationOptions\n * or updateOrganizationResidentMutationOptions for exact result types.\n */\nexport function updateResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n residentId: Id;\n cmd: UpdateResidentCommand;\n }) =>\n sdk.api.residents.updateResident({\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n input: params.cmd,\n }),\n onSuccess: (res: Person, params) =>\n Promise.all([\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.personalId(params.companyId, res.id)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.customers(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.customerDetail(params.companyId, params.residentId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.plans(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [boardKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.preview(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.previewPdf(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
1
+ {"version":3,"file":"updateResident.js","sourceRoot":"","sources":["../../../../src/api/commands/resident/updateResident.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,GAAiB,EACjB,WAAwB;IAExB,OAAO;QACL,UAAU,EAAE,CAAC,MAKZ,EAAE,EAAE,CACH,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,YAAY,EAAE,MAAM,CA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,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACtD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE;oBACR,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC;iBAClE;aACF,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAClD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC7C,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACvD,CAAC;YACF,WAAW,CAAC,iBAAiB,CAAC;gBAC5B,QAAQ,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACpD,CAAC;SACH,CAAC;KACL,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n ResidentType,\n SoliboClient,\n UpdateResidentCommand,\n} from \"@solibo/solibo-sdk\";\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport { boardKeys } from \"../../queries/board/boardMembers.js\";\nimport { communicationKeys } from \"../../queries/communication/newsletters.js\";\nimport { conversationKeys } from \"../../queries/conversation/conversations.js\";\nimport { invoicingKeys } from \"../../queries/invoicing/invoicingKeys.js\";\nimport { organizationKeys } from \"../../queries/organization/organizationsInCompany.js\";\nimport { personKeys } from \"../../queries/person/persons.js\";\nimport { residentKeys } from \"../../queries/residentsAndSections/residents.js\";\nimport { invalidateResidentSectionCaches } from \"../residentsAndSections/cacheInvalidation.js\";\n/**\n * @deprecated Use updatePersonResidentMutationOptions or\n * updateOrganizationResidentMutationOptions for exact result types. This one\n * returns the sealed Resident (PersonResident or OrganizationResident) since\n * backend 1f85e4d declared it; it was typed Person before.\n */\nexport function updateResidentMutationOptions(\n sdk: SoliboClient,\n queryClient: QueryClient,\n) {\n return {\n mutationFn: (params: {\n companyId: Id;\n residentType: ResidentType;\n residentId: Id;\n cmd: UpdateResidentCommand;\n }) =>\n sdk.api.residents.updateResident({\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n input: params.cmd,\n }),\n // Typed by what it reads, so it fits the old Person and the new Resident contract.\n onSuccess: (res: { id: bigint }, params) =>\n Promise.all([\n invalidateResidentSectionCaches(queryClient, {\n companyId: params.companyId,\n residentType: params.residentType.name,\n residentId: params.residentId,\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [residentKeys.personalId(params.companyId, res.id)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n communicationKeys.notificationGroupsEmail(params.companyId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [communicationKeys.notificationGroupsSms(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [organizationKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [personKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.customers(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [\n invoicingKeys.customerDetail(params.companyId, params.residentId),\n ],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.plans(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [boardKeys.list(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.preview(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [invoicingKeys.previewPdf(params.companyId)],\n }),\n queryClient.invalidateQueries({\n queryKey: [conversationKeys.list(params.companyId)],\n }),\n ]),\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-query",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "description": "Framework-agnostic TanStack Query options for the Solibo Home SDK. Solibo Home is the platform for owning and managing homes in Norway.",
5
5
  "homepage": "https://sdk.solibo.no",
6
6
  "repository": {
@@ -40,7 +40,7 @@
40
40
  "buffer": "^6.0.3",
41
41
  "hash-wasm": "^4.12.0",
42
42
  "mime-types": "^3.0.2",
43
- "@solibo/solibo-sdk": "1.30.0"
43
+ "@solibo/solibo-sdk": "1.31.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@eslint/js": "^10.0.1",