@solibo/solibo-query 1.16.13 → 1.16.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/api/commands/conversation/deleteConversation.d.ts +1 -0
  2. package/dist/api/commands/conversation/deleteConversation.js +1 -0
  3. package/dist/api/commands/conversation/deleteConversation.js.map +1 -1
  4. package/dist/api/commands/conversation/updateConversation.d.ts +1 -0
  5. package/dist/api/commands/conversation/updateConversation.js +1 -0
  6. package/dist/api/commands/conversation/updateConversation.js.map +1 -1
  7. package/dist/api/commands/invoicing/toggleInvoicingPlanTransactionOverdue.d.ts +1 -0
  8. package/dist/api/commands/invoicing/toggleInvoicingPlanTransactionOverdue.js +1 -0
  9. package/dist/api/commands/invoicing/toggleInvoicingPlanTransactionOverdue.js.map +1 -1
  10. package/dist/api/commands/resident/removePersonFromCompany.d.ts +2 -0
  11. package/dist/api/commands/resident/removePersonFromCompany.js +2 -0
  12. package/dist/api/commands/resident/removePersonFromCompany.js.map +1 -1
  13. package/dist/api/commands/routines/createRoutine.d.ts +3 -1
  14. package/dist/api/commands/routines/createRoutine.js +2 -0
  15. package/dist/api/commands/routines/createRoutine.js.map +1 -1
  16. package/dist/api/commands/section/massUpdateSection.d.ts +2 -1
  17. package/dist/api/commands/section/massUpdateSection.js +1 -0
  18. package/dist/api/commands/section/massUpdateSection.js.map +1 -1
  19. package/dist/api/queries/administration/insuranceAgreements.js +8 -3
  20. package/dist/api/queries/administration/insuranceAgreements.js.map +1 -1
  21. package/dist/api/queries/administration/loanAgreements.js +15 -4
  22. package/dist/api/queries/administration/loanAgreements.js.map +1 -1
  23. package/dist/api/queries/administration/tripletexDetails.js +3 -2
  24. package/dist/api/queries/administration/tripletexDetails.js.map +1 -1
  25. package/dist/api/queries/board/boardMembers.js +8 -3
  26. package/dist/api/queries/board/boardMembers.js.map +1 -1
  27. package/dist/api/queries/communication/newsletters.js +40 -19
  28. package/dist/api/queries/communication/newsletters.js.map +1 -1
  29. package/dist/api/queries/company/companies.js +39 -10
  30. package/dist/api/queries/company/companies.js.map +1 -1
  31. package/dist/api/queries/conversation/conversationCount.d.ts +30 -7
  32. package/dist/api/queries/conversation/conversationCount.js +17 -9
  33. package/dist/api/queries/conversation/conversationCount.js.map +1 -1
  34. package/dist/api/queries/conversation/conversations.js +58 -21
  35. package/dist/api/queries/conversation/conversations.js.map +1 -1
  36. package/dist/api/queries/conversation/unreadConversationsCount.d.ts +29 -5
  37. package/dist/api/queries/conversation/unreadConversationsCount.js +12 -6
  38. package/dist/api/queries/conversation/unreadConversationsCount.js.map +1 -1
  39. package/dist/api/queries/document/documents.js +15 -6
  40. package/dist/api/queries/document/documents.js.map +1 -1
  41. package/dist/api/queries/document/officeDocumentCandidates.js +5 -4
  42. package/dist/api/queries/document/officeDocumentCandidates.js.map +1 -1
  43. package/dist/api/queries/economy/invoices.js +48 -14
  44. package/dist/api/queries/economy/invoices.js.map +1 -1
  45. package/dist/api/queries/expense/expenseList.js +13 -4
  46. package/dist/api/queries/expense/expenseList.js.map +1 -1
  47. package/dist/api/queries/hms/hMSSettings.js +11 -2
  48. package/dist/api/queries/hms/hMSSettings.js.map +1 -1
  49. package/dist/api/queries/homepage/homepage.js +63 -18
  50. package/dist/api/queries/homepage/homepage.js.map +1 -1
  51. package/dist/api/queries/homepage/openHomepage.d.ts +2 -1
  52. package/dist/api/queries/homepage/openHomepage.js +2 -1
  53. package/dist/api/queries/homepage/openHomepage.js.map +1 -1
  54. package/dist/api/queries/invoicing/adHocGroups.d.ts +2 -1
  55. package/dist/api/queries/invoicing/adHocGroups.js +6 -1
  56. package/dist/api/queries/invoicing/adHocGroups.js.map +1 -1
  57. package/dist/api/queries/invoicing/invoicingKeys.js +68 -36
  58. package/dist/api/queries/invoicing/invoicingKeys.js.map +1 -1
  59. package/dist/api/queries/invoicing/preview.d.ts +4 -1
  60. package/dist/api/queries/invoicing/preview.js +6 -0
  61. package/dist/api/queries/invoicing/preview.js.map +1 -1
  62. package/dist/api/queries/issue/issues.js +11 -2
  63. package/dist/api/queries/issue/issues.js.map +1 -1
  64. package/dist/api/queries/meeting/meetings.js +2 -1
  65. package/dist/api/queries/meeting/meetings.js.map +1 -1
  66. package/dist/api/queries/organization/organizationsInCompany.js +16 -3
  67. package/dist/api/queries/organization/organizationsInCompany.js.map +1 -1
  68. package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js +9 -8
  69. package/dist/api/queries/parkingSpaces/parkingSpaceOperations.js.map +1 -1
  70. package/dist/api/queries/parkingSpaces/parkingSpaces.js +8 -3
  71. package/dist/api/queries/parkingSpaces/parkingSpaces.js.map +1 -1
  72. package/dist/api/queries/person/persons.js +12 -3
  73. package/dist/api/queries/person/persons.js.map +1 -1
  74. package/dist/api/queries/residentCommunication/residentCommunication.js +18 -13
  75. package/dist/api/queries/residentCommunication/residentCommunication.js.map +1 -1
  76. package/dist/api/queries/residentsAndSections/residents.d.ts +2 -1
  77. package/dist/api/queries/residentsAndSections/residents.js +35 -16
  78. package/dist/api/queries/residentsAndSections/residents.js.map +1 -1
  79. package/dist/api/queries/residentsAndSections/sectionStatus.d.ts +4 -1
  80. package/dist/api/queries/residentsAndSections/sectionStatus.js +10 -1
  81. package/dist/api/queries/residentsAndSections/sectionStatus.js.map +1 -1
  82. package/dist/api/queries/residentsAndSections/sections.d.ts +2 -1
  83. package/dist/api/queries/residentsAndSections/sections.js +39 -20
  84. package/dist/api/queries/residentsAndSections/sections.js.map +1 -1
  85. package/dist/api/queries/residentsAndSections/sectionsSearch.d.ts +3 -2
  86. package/dist/api/queries/residentsAndSections/sectionsSearch.js +3 -1
  87. package/dist/api/queries/residentsAndSections/sectionsSearch.js.map +1 -1
  88. package/dist/api/queries/routines/routines.js +20 -7
  89. package/dist/api/queries/routines/routines.js.map +1 -1
  90. package/dist/api/queries/scopedContact/scopedContacts.js +6 -1
  91. package/dist/api/queries/scopedContact/scopedContacts.js.map +1 -1
  92. package/dist/api/queries/settlement/settlements.js +31 -14
  93. package/dist/api/queries/settlement/settlements.js.map +1 -1
  94. package/dist/api/queries/storageRoom/storageRoomOperations.js +9 -8
  95. package/dist/api/queries/storageRoom/storageRoomOperations.js.map +1 -1
  96. package/dist/api/queries/storageRoom/storageRooms.js +8 -3
  97. package/dist/api/queries/storageRoom/storageRooms.js.map +1 -1
  98. package/dist/api/queries/supplier/suppliers.js +12 -4
  99. package/dist/api/queries/supplier/suppliers.js.map +1 -1
  100. package/dist/api/queries/task/tasks.js +6 -1
  101. package/dist/api/queries/task/tasks.js.map +1 -1
  102. package/dist/api/queries/thirdPartyInformation/thirdPartyInformation.js +21 -12
  103. package/dist/api/queries/thirdPartyInformation/thirdPartyInformation.js.map +1 -1
  104. package/dist/api/queries/thirdPartyInformation/thirdPartyInformationLetters.d.ts +2 -0
  105. package/dist/api/queries/thirdPartyInformation/thirdPartyInformationLetters.js +4 -0
  106. package/dist/api/queries/thirdPartyInformation/thirdPartyInformationLetters.js.map +1 -1
  107. package/dist/api/queries/user/authedUser.d.ts +4 -2
  108. package/dist/api/queries/user/authedUser.js +3 -3
  109. package/dist/api/queries/user/authedUser.js.map +1 -1
  110. package/dist/api/queries/user/user.d.ts +4 -2
  111. package/dist/api/queries/user/user.js +19 -6
  112. package/dist/api/queries/user/user.js.map +1 -1
  113. package/dist/api/queries/user/userConversations.d.ts +3 -1
  114. package/dist/api/queries/user/userConversations.js +4 -0
  115. package/dist/api/queries/user/userConversations.js.map +1 -1
  116. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"residentCommunication.js","sourceRoot":"","sources":["../../../../src/api/queries/residentCommunication/residentCommunication.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAyBtD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,EAAE,CAAC,uBAAuB,CAAU;IACvC,MAAM,EAAE,CAAC,SAAqB,EAAE,EAAE,CAChC,CAAC,GAAG,yBAAyB,CAAC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bridge.js\";\n\ninterface PageParams {\n fields?: string | null;\n pageToken?: string | null;\n autoPaginate?: boolean | null;\n count?: number | null;\n}\n\ninterface CompanyParams extends PageParams {\n companyId?: Id | null;\n}\n\ninterface PostParams extends CompanyParams {\n postId?: Id | null;\n}\n\ninterface GroupParams extends CompanyParams {\n groupId?: Id | null;\n}\n\ninterface CommentParams extends PostParams {\n commentId?: Id | null;\n}\n\nexport const residentCommunicationKeys = {\n all: [\"residentCommunication\"] as const,\n groups: (companyId?: Id | null) =>\n [...residentCommunicationKeys.all, \"groups\", toKeyId(companyId)] as const,\n groupPosts: (companyId?: Id | null, groupId?: Id | null) =>\n [\n ...residentCommunicationKeys.all,\n \"groupPosts\",\n toKeyId(companyId),\n toKeyId(groupId),\n ] as const,\n commonFeedPosts: (companyId?: Id | null) =>\n [\n ...residentCommunicationKeys.all,\n \"commonFeedPosts\",\n toKeyId(companyId),\n ] as const,\n post: (companyId?: Id | null, postId?: Id | null) =>\n [\n ...residentCommunicationKeys.all,\n \"post\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const,\n comments: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n ) =>\n [\n ...residentCommunicationKeys.all,\n kind,\n \"comments\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const,\n commentThread: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n commentId?: Id | null,\n ) =>\n [\n ...residentCommunicationKeys.all,\n kind,\n \"commentThread\",\n toKeyId(companyId),\n toKeyId(postId),\n toKeyId(commentId),\n ] as const,\n notificationPreference: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n ) =>\n [\n ...residentCommunicationKeys.all,\n kind,\n \"notificationPreference\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const,\n};\n\nconst nextPage = (lastPage: { paging?: { next?: string | null } | null }) =>\n lastPage.paging?.next === \"END_OF_LIST\"\n ? undefined\n : (lastPage.paging?.next ?? undefined);\n\nconst previousPage = (lastPage: {\n paging?: { previous?: string | null } | null;\n}) => lastPage.paging?.previous ?? undefined;\n\nexport function neighborhoodGroupsQueryOptions(\n sdk: SoliboClient,\n params: CompanyParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.groups(params.companyId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodGroups({\n ...params,\n companyId: params.companyId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodGroupPostsQueryOptions(\n sdk: SoliboClient,\n params: GroupParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.groupPosts(params.companyId, params.groupId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodGroupPosts({\n ...params,\n companyId: params.companyId!,\n groupId: params.groupId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null && params.groupId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodCommonFeedPostsQueryOptions(\n sdk: SoliboClient,\n params: CompanyParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.commonFeedPosts(params.companyId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodCommonFeedPosts({\n ...params,\n companyId: params.companyId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodPostQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.post(params.companyId, params.postId),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPost({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nexport function homepagePostNotificationPreferenceQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.notificationPreference(\n \"homepage\",\n params.companyId,\n params.postId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getHomepagePostNotificationPreference({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nexport function neighborhoodPostNotificationPreferenceQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.notificationPreference(\n \"neighborhood\",\n params.companyId,\n params.postId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPostNotificationPreference({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nfunction commentsQueryOptions(\n sdk: SoliboClient,\n kind: \"homepage\" | \"neighborhood\",\n params: PostParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.comments(kind, params.companyId, params.postId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) => {\n const input = {\n ...params,\n companyId: params.companyId!,\n postId: params.postId!,\n pageToken: pageParam,\n };\n return kind === \"homepage\"\n ? sdk.api.residentCommunication.listHomepagePostComments(input)\n : sdk.api.residentCommunication.listNeighborhoodPostComments(input);\n },\n enabled: params.companyId != null && params.postId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function homepagePostCommentsQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return commentsQueryOptions(sdk, \"homepage\", params);\n}\n\nexport function neighborhoodPostCommentsQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return commentsQueryOptions(sdk, \"neighborhood\", params);\n}\n\nexport function homepagePostCommentThreadQueryOptions(\n sdk: SoliboClient,\n params: CommentParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.commentThread(\n \"homepage\",\n params.companyId,\n params.postId,\n params.commentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getHomepagePostCommentThread({\n companyId: params.companyId!,\n postId: params.postId!,\n commentId: params.commentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.postId != null &&\n params.commentId != null,\n };\n}\n\nexport function neighborhoodPostCommentThreadQueryOptions(\n sdk: SoliboClient,\n params: CommentParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.commentThread(\n \"neighborhood\",\n params.companyId,\n params.postId,\n params.commentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPostCommentThread({\n companyId: params.companyId!,\n postId: params.postId!,\n commentId: params.commentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.postId != null &&\n params.commentId != null,\n };\n}\n"]}
1
+ {"version":3,"file":"residentCommunication.js","sourceRoot":"","sources":["../../../../src/api/queries/residentCommunication/residentCommunication.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAyBpE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,EAAE,CAAC,uBAAuB,CAAU;IACvC,MAAM,EAAE,CAAC,SAAqB,EAAE,EAAE,CAChC,qBAAqB,CAAC;QACpB,GAAG,yBAAyB,CAAC,GAAG;QAChC,QAAQ;QACR,OAAO,CAAC,SAAS,CAAC;KACV,CAAC;IACb,UAAU,EAAE,CAA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@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { trimTrailingUndefined } from \"../../../utils/queryKeys.js\";\n\ninterface PageParams {\n fields?: string | null;\n pageToken?: string | null;\n autoPaginate?: boolean | null;\n count?: number | null;\n}\n\ninterface CompanyParams extends PageParams {\n companyId?: Id | null;\n}\n\ninterface PostParams extends CompanyParams {\n postId?: Id | null;\n}\n\ninterface GroupParams extends CompanyParams {\n groupId?: Id | null;\n}\n\ninterface CommentParams extends PostParams {\n commentId?: Id | null;\n}\n\nexport const residentCommunicationKeys = {\n all: [\"residentCommunication\"] as const,\n groups: (companyId?: Id | null) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n \"groups\",\n toKeyId(companyId),\n ] as const),\n groupPosts: (companyId?: Id | null, groupId?: Id | null) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n \"groupPosts\",\n toKeyId(companyId),\n toKeyId(groupId),\n ] as const),\n commonFeedPosts: (companyId?: Id | null) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n \"commonFeedPosts\",\n toKeyId(companyId),\n ] as const),\n post: (companyId?: Id | null, postId?: Id | null) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n \"post\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const),\n comments: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n ) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n kind,\n \"comments\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const),\n commentThread: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n commentId?: Id | null,\n ) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n kind,\n \"commentThread\",\n toKeyId(companyId),\n toKeyId(postId),\n toKeyId(commentId),\n ] as const),\n notificationPreference: (\n kind: \"homepage\" | \"neighborhood\",\n companyId?: Id | null,\n postId?: Id | null,\n ) =>\n trimTrailingUndefined([\n ...residentCommunicationKeys.all,\n kind,\n \"notificationPreference\",\n toKeyId(companyId),\n toKeyId(postId),\n ] as const),\n};\n\nconst nextPage = (lastPage: { paging?: { next?: string | null } | null }) =>\n lastPage.paging?.next === \"END_OF_LIST\"\n ? undefined\n : (lastPage.paging?.next ?? undefined);\n\nconst previousPage = (lastPage: {\n paging?: { previous?: string | null } | null;\n}) => lastPage.paging?.previous ?? undefined;\n\nexport function neighborhoodGroupsQueryOptions(\n sdk: SoliboClient,\n params: CompanyParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.groups(params.companyId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodGroups({\n ...params,\n companyId: params.companyId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodGroupPostsQueryOptions(\n sdk: SoliboClient,\n params: GroupParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.groupPosts(params.companyId, params.groupId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodGroupPosts({\n ...params,\n companyId: params.companyId!,\n groupId: params.groupId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null && params.groupId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodCommonFeedPostsQueryOptions(\n sdk: SoliboClient,\n params: CompanyParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.commonFeedPosts(params.companyId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) =>\n sdk.api.residentCommunication.listNeighborhoodCommonFeedPosts({\n ...params,\n companyId: params.companyId!,\n pageToken: pageParam,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function neighborhoodPostQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.post(params.companyId, params.postId),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPost({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nexport function homepagePostNotificationPreferenceQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.notificationPreference(\n \"homepage\",\n params.companyId,\n params.postId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getHomepagePostNotificationPreference({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nexport function neighborhoodPostNotificationPreferenceQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.notificationPreference(\n \"neighborhood\",\n params.companyId,\n params.postId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPostNotificationPreference({\n companyId: params.companyId!,\n postId: params.postId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.postId != null,\n };\n}\n\nfunction commentsQueryOptions(\n sdk: SoliboClient,\n kind: \"homepage\" | \"neighborhood\",\n params: PostParams,\n) {\n return {\n initialPageParam: params.pageToken ?? undefined,\n queryKey: [\n residentCommunicationKeys.comments(kind, params.companyId, params.postId),\n params.fields,\n params.autoPaginate,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam?: string | null }) => {\n const input = {\n ...params,\n companyId: params.companyId!,\n postId: params.postId!,\n pageToken: pageParam,\n };\n return kind === \"homepage\"\n ? sdk.api.residentCommunication.listHomepagePostComments(input)\n : sdk.api.residentCommunication.listNeighborhoodPostComments(input);\n },\n enabled: params.companyId != null && params.postId != null,\n getNextPageParam: nextPage,\n getPreviousPageParam: previousPage,\n };\n}\n\nexport function homepagePostCommentsQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return commentsQueryOptions(sdk, \"homepage\", params);\n}\n\nexport function neighborhoodPostCommentsQueryOptions(\n sdk: SoliboClient,\n params: PostParams,\n) {\n return commentsQueryOptions(sdk, \"neighborhood\", params);\n}\n\nexport function homepagePostCommentThreadQueryOptions(\n sdk: SoliboClient,\n params: CommentParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.commentThread(\n \"homepage\",\n params.companyId,\n params.postId,\n params.commentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getHomepagePostCommentThread({\n companyId: params.companyId!,\n postId: params.postId!,\n commentId: params.commentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.postId != null &&\n params.commentId != null,\n };\n}\n\nexport function neighborhoodPostCommentThreadQueryOptions(\n sdk: SoliboClient,\n params: CommentParams,\n) {\n return {\n queryKey: [\n residentCommunicationKeys.commentThread(\n \"neighborhood\",\n params.companyId,\n params.postId,\n params.commentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residentCommunication.getNeighborhoodPostCommentThread({\n companyId: params.companyId!,\n postId: params.postId!,\n commentId: params.commentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.postId != null &&\n params.commentId != null,\n };\n}\n"]}
@@ -29,6 +29,7 @@ export type ResidentPeriodQueryParams<Fields extends string | undefined = undefi
29
29
  export type ResidentsQueryParams<Fields extends string | undefined = undefined> = {
30
30
  companyId?: Id | null | undefined;
31
31
  query?: string;
32
+ ids?: readonly Id[] | null | undefined;
32
33
  fields?: Fields;
33
34
  pageToken?: string;
34
35
  count?: number;
@@ -36,7 +37,7 @@ export type ResidentsQueryParams<Fields extends string | undefined = undefined>
36
37
  };
37
38
  export declare function residentsQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: ResidentsQueryParams<Fields>): {
38
39
  initialPageParam: string | undefined;
39
- queryKey: (string | number | boolean | readonly ["residents", "list", string | number | null | undefined] | undefined)[];
40
+ queryKey: (string | number | boolean | readonly string[] | readonly ["residents", "list", string | number | null | undefined] | null | undefined)[];
40
41
  queryFn: ({ pageParam }: {
41
42
  pageParam: string | undefined;
42
43
  }) => Promise<import("@solibo/solibo-sdk").ResidentListResult<Fields>>;
@@ -1,46 +1,63 @@
1
+ import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
1
2
  import { toKeyId } from "../../../utils/kt-bridge.js";
2
3
  import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
3
- import { canonicalQueryId, paginationIdentity } from "./queryIdentity.js";
4
+ import { canonicalQueryId, canonicalQueryIds, paginationIdentity, } from "./queryIdentity.js";
4
5
  export const residentKeys = {
5
6
  all: ["residents"],
6
- list: (companyId) => [...residentKeys.all, "list", toKeyId(companyId)],
7
- future: (companyId) => [...residentKeys.list(companyId), "future"],
8
- historic: (companyId) => [...residentKeys.list(companyId), "historic"],
9
- detail: (companyId, residentType, residentId) => [
7
+ list: (companyId) => trimTrailingUndefined([
8
+ ...residentKeys.all,
9
+ "list",
10
+ toKeyId(companyId),
11
+ ]),
12
+ future: (companyId) => trimTrailingUndefined([...residentKeys.list(companyId), "future"]),
13
+ historic: (companyId) => trimTrailingUndefined([
14
+ ...residentKeys.list(companyId),
15
+ "historic",
16
+ ]),
17
+ detail: (companyId, residentType, residentId) => trimTrailingUndefined([
10
18
  ...residentKeys.all,
11
19
  "detail",
12
20
  canonicalQueryId(companyId),
13
21
  residentType,
14
22
  canonicalQueryId(residentId),
15
- ],
16
- history: (companyId, sectionId) => [
23
+ ]),
24
+ history: (companyId, sectionId) => trimTrailingUndefined([
17
25
  ...residentKeys.all,
18
26
  "history",
19
27
  toKeyId(companyId),
20
28
  toKeyId(sectionId),
21
- ],
22
- byOrgnr: (companyId, orgNr) => [...residentKeys.all, "byOrgnr", toKeyId(companyId), orgNr],
23
- byPersonalIdentityNumber: (companyId, personalIdentityNumber) => [
29
+ ]),
30
+ byOrgnr: (companyId, orgNr) => trimTrailingUndefined([
31
+ ...residentKeys.all,
32
+ "byOrgnr",
33
+ toKeyId(companyId),
34
+ orgNr,
35
+ ]),
36
+ byPersonalIdentityNumber: (companyId, personalIdentityNumber) => trimTrailingUndefined([
24
37
  ...residentKeys.all,
25
38
  "byPersonalIdentityNumber",
26
39
  toKeyId(companyId),
27
40
  personalIdentityNumber,
28
- ],
29
- occupancy: (companyId, residentType, residentId, at) => [
41
+ ]),
42
+ occupancy: (companyId, residentType, residentId, at) => trimTrailingUndefined([
30
43
  ...residentKeys.all,
31
44
  "occupancy",
32
45
  toKeyId(companyId),
33
46
  residentType,
34
47
  toKeyId(residentId),
35
48
  toKeyId(at),
36
- ],
37
- types: (companyId) => [...residentKeys.all, "types", toKeyId(companyId)],
38
- personalId: (companyId, residentId) => [
49
+ ]),
50
+ types: (companyId) => trimTrailingUndefined([
51
+ ...residentKeys.all,
52
+ "types",
53
+ toKeyId(companyId),
54
+ ]),
55
+ personalId: (companyId, residentId) => trimTrailingUndefined([
39
56
  ...residentKeys.all,
40
57
  "personalId",
41
58
  toKeyId(companyId),
42
59
  toKeyId(residentId),
43
- ],
60
+ ]),
44
61
  };
45
62
  export function residentsQueryOptions(sdk, params) {
46
63
  const pagination = paginationIdentity(params);
@@ -49,6 +66,7 @@ export function residentsQueryOptions(sdk, params) {
49
66
  queryKey: [
50
67
  residentKeys.list(params.companyId),
51
68
  params.query,
69
+ canonicalQueryIds(params.ids),
52
70
  params.fields,
53
71
  params.count,
54
72
  pagination.pageToken,
@@ -57,6 +75,7 @@ export function residentsQueryOptions(sdk, params) {
57
75
  queryFn: ({ pageParam }) => sdk.api.residents.indexResident({
58
76
  companyId: params.companyId,
59
77
  query: params.query,
78
+ ids: params.ids,
60
79
  fields: params.fields,
61
80
  pageToken: pageParam,
62
81
  autoPaginate: pagination.autoPaginate,
@@ -1 +1 @@
1
- {"version":3,"file":"residents.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/residents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,WAAW,CAAU;IAC3B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAU;IAC5D,MAAM,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC5C,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAU;IACtD,QAAQ,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC9C,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,CAAU;IACxD,MAAM,EAAE,CACN,SAAiC,EACjC,YAAqB,EACrB,UAAkC,EAClC,EAAE,CACF;QACE,GAAG,YAAY,CAAC,GAAG;QACnB,QAAQ;QACR,gBAAgB,CAAC,SAAS,CAAC;QAC3B,YAAY;QACZ,gBAAgB,CAAC,UAAU,CAAC;KACpB;IACZ,OAAO,EAAE,CACP,SAAiC,EACjC,SAAiC,EACjC,EAAE,CACF;QACE,GAAG,YAAY,CAAC,GAAG;QACnB,SAAS;QACT,OAAO,CAAC,SAAS,CAAC;QAClB,OAAO,CAAC,SAAS,CAAC;KACV;IACZ,OAAO,EAAE,CAAC,SAAiC,EAAE,KAAc,EAAE,EAAE,CAC7D,CAAC,GAAG,YAAY,CAAC,GAAG,EA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{ Id, type ResidentType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { canonicalQueryId, paginationIdentity } from \"./queryIdentity.js\";\nexport const residentKeys = {\n all: [\"residents\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"list\", toKeyId(companyId)] as const,\n future: (companyId?: Id | null | undefined) =>\n [...residentKeys.list(companyId), \"future\"] as const,\n historic: (companyId?: Id | null | undefined) =>\n [...residentKeys.list(companyId), \"historic\"] as const,\n detail: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"detail\",\n canonicalQueryId(companyId),\n residentType,\n canonicalQueryId(residentId),\n ] as const,\n history: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"history\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n byOrgnr: (companyId?: Id | null | undefined, orgNr?: string) =>\n [...residentKeys.all, \"byOrgnr\", toKeyId(companyId), orgNr] as const,\n byPersonalIdentityNumber: (\n companyId?: Id | null | undefined,\n personalIdentityNumber?: string,\n ) =>\n [\n ...residentKeys.all,\n \"byPersonalIdentityNumber\",\n toKeyId(companyId),\n personalIdentityNumber,\n ] as const,\n occupancy: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n residentType,\n toKeyId(residentId),\n toKeyId(at),\n ] as const,\n types: (companyId?: Id | null | undefined) =>\n [...residentKeys.all, \"types\", toKeyId(companyId)] as const,\n personalId: (\n companyId?: Id | null | undefined,\n residentId?: Id | null | undefined,\n ) =>\n [\n ...residentKeys.all,\n \"personalId\",\n toKeyId(companyId),\n toKeyId(residentId),\n ] as const,\n};\n\nexport type ResidentDetailQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n residentType?: ResidentType[\"name\"];\n residentId?: Id | null | undefined;\n fields?: Fields;\n};\n\nexport type ResidentPeriodQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport type ResidentsQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n query?: string;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport function residentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentsQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n residentKeys.list(params.companyId),\n params.query,\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexResident({\n companyId: params.companyId!,\n query: params.query,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function residentQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentDetailQueryParams<Fields>) {\n return {\n queryKey: [\n residentKeys.detail(\n params.companyId,\n params.residentType,\n params.residentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residents.showResident({\n companyId: params.companyId!,\n residentType: params.residentType!,\n residentId: params.residentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.residentType != null &&\n params.residentId != null,\n };\n}\n\nexport function futureResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.future(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexFutureResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function historicResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.historic(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexHistoricResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
1
+ {"version":3,"file":"residents.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/residents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,WAAW,CAAU;IAC3B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,qBAAqB,CAAC;QACpB,GAAG,YAAY,CAAC,GAAG;QACnB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B,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;QACjC,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAE3C,GAAiB,EAAE,MAAyC;IAC5D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO;QACL,gBAAgB,EAAE,UAAU,CAAC,SAAS;QACtC,QAAQ,EAAE;YACR,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;YACZ,UAAU,CAAC,SAAS;YACpB,UAAU,CAAC,YAAY;SACxB;QACD,OAAO,EAAE,CAAC,EAAE,SAAS,EAAqC,EAAE,EAAE,CAC5D,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,sBAAsB,CAAC;YACvC,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;QACjC,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { trimTrailingUndefined } from \"../../../utils/queryKeys.js\";\nimport { Id, type ResidentType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport {\n canonicalQueryId,\n canonicalQueryIds,\n paginationIdentity,\n} from \"./queryIdentity.js\";\nexport const residentKeys = {\n all: [\"residents\"] as const,\n list: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"list\",\n toKeyId(companyId),\n ] as const),\n future: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([...residentKeys.list(companyId), \"future\"] as const),\n historic: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...residentKeys.list(companyId),\n \"historic\",\n ] as const),\n detail: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"detail\",\n canonicalQueryId(companyId),\n residentType,\n canonicalQueryId(residentId),\n ] as const),\n history: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"history\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n byOrgnr: (companyId?: Id | null | undefined, orgNr?: string) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"byOrgnr\",\n toKeyId(companyId),\n orgNr,\n ] as const),\n byPersonalIdentityNumber: (\n companyId?: Id | null | undefined,\n personalIdentityNumber?: string,\n ) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"byPersonalIdentityNumber\",\n toKeyId(companyId),\n personalIdentityNumber,\n ] as const),\n occupancy: (\n companyId?: Id | null | undefined,\n residentType?: string,\n residentId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n residentType,\n toKeyId(residentId),\n toKeyId(at),\n ] as const),\n types: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"types\",\n toKeyId(companyId),\n ] as const),\n personalId: (\n companyId?: Id | null | undefined,\n residentId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...residentKeys.all,\n \"personalId\",\n toKeyId(companyId),\n toKeyId(residentId),\n ] as const),\n};\n\nexport type ResidentDetailQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n residentType?: ResidentType[\"name\"];\n residentId?: Id | null | undefined;\n fields?: Fields;\n};\n\nexport type ResidentPeriodQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport type ResidentsQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n query?: string;\n ids?: readonly Id[] | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport function residentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentsQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n residentKeys.list(params.companyId),\n params.query,\n canonicalQueryIds(params.ids),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexResident({\n companyId: params.companyId!,\n query: params.query,\n ids: params.ids,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function residentQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentDetailQueryParams<Fields>) {\n return {\n queryKey: [\n residentKeys.detail(\n params.companyId,\n params.residentType,\n params.residentId,\n ),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.residents.showResident({\n companyId: params.companyId!,\n residentType: params.residentType!,\n residentId: params.residentId!,\n fields: params.fields,\n }),\n enabled:\n params.companyId != null &&\n params.residentType != null &&\n params.residentId != null,\n };\n}\n\nexport function futureResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.future(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexFutureResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function historicResidentsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: ResidentPeriodQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: pagination.pageToken,\n queryKey: [\n residentKeys.historic(params.companyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.residents.indexHistoricResidents({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: params.companyId != null,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
@@ -14,8 +14,11 @@ export declare function sectionStatusQueryOptions(sdk: SoliboClient, params: {
14
14
  export declare function sectionStatusesQueryOptions(sdk: SoliboClient, params: {
15
15
  companyId?: Id | null | undefined;
16
16
  fields?: string;
17
+ pageToken?: string;
18
+ autoPaginate?: boolean | null;
19
+ count?: number;
17
20
  }): {
18
- queryKey: (string | readonly ["sections", "statuses", string | number | null | undefined] | undefined)[];
21
+ queryKey: (string | number | boolean | readonly ["sections", "statuses", string | number | null | undefined] | undefined)[];
19
22
  queryFn: () => Promise<import("@solibo/solibo-sdk").CompanySectionStatusOverview[]>;
20
23
  enabled: boolean;
21
24
  };
@@ -21,11 +21,20 @@ export function sectionStatusQueryOptions(sdk, params) {
21
21
  }
22
22
  export function sectionStatusesQueryOptions(sdk, params) {
23
23
  return {
24
- queryKey: [sectionKeys.statuses(params.companyId), params.fields],
24
+ queryKey: [
25
+ sectionKeys.statuses(params.companyId),
26
+ params.fields,
27
+ params.pageToken,
28
+ params.autoPaginate ?? false,
29
+ params.count,
30
+ ],
25
31
  queryFn: async () => {
26
32
  const statuses = await sdk.api.sections.indexSectionStatus({
27
33
  companyId: params.companyId,
28
34
  fields: params.fields,
35
+ pageToken: params.pageToken,
36
+ autoPaginate: params.autoPaginate ?? false,
37
+ count: params.count,
29
38
  });
30
39
  return statuses.items;
31
40
  },
@@ -1 +1 @@
1
- {"version":3,"file":"sectionStatus.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/sectionStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,MAAM,UAAU,yBAAyB,CACvC,GAAiB,EACjB,MAKC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC;YACtD,MAAM,CAAC,UAAU;YACjB,MAAM,CAAC,MAAM;SACd;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC;gBACxD,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAChD,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAE,CAAU,CAC7B,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS;KAClD,CAAC;AACJ,CAAC;AACD,MAAM,UAAU,2BAA2B,CACzC,GAAiB,EACjB,MAGC;IAED,OAAO;QACL,QAAQ,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QACjE,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC;gBACzD,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SectionState, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { sectionKeys } from \"./sections.js\";\nexport function sectionStatusQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n sectionId?: Id | null | undefined;\n statusType?: SectionState | null;\n fields?: string;\n },\n) {\n return {\n queryKey: [\n sectionKeys.status(params.companyId, params.sectionId),\n params.statusType,\n params.fields,\n ],\n queryFn: async () => {\n const statuses = await sdk.api.sections.showSectionStatus({\n companyId: params.companyId!,\n sectionId: params.sectionId!,\n statusType: params.statusType,\n fields: params.fields,\n });\n const entries = Array.from(statuses.entries()).map(\n ([k, v]) => [k, v!] as const,\n );\n return Object.fromEntries(entries);\n },\n enabled: !!params.companyId && !!params.sectionId,\n };\n}\nexport function sectionStatusesQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n fields?: string;\n },\n) {\n return {\n queryKey: [sectionKeys.statuses(params.companyId), params.fields],\n queryFn: async () => {\n const statuses = await sdk.api.sections.indexSectionStatus({\n companyId: params.companyId!,\n fields: params.fields,\n });\n return statuses.items;\n },\n enabled: !!params.companyId,\n };\n}\n"]}
1
+ {"version":3,"file":"sectionStatus.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/sectionStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,MAAM,UAAU,yBAAyB,CACvC,GAAiB,EACjB,MAKC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC;YACtD,MAAM,CAAC,UAAU;YACjB,MAAM,CAAC,MAAM;SACd;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC;gBACxD,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAChD,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAE,CAAU,CAC7B,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS;KAClD,CAAC;AACJ,CAAC;AACD,MAAM,UAAU,2BAA2B,CACzC,GAAiB,EACjB,MAMC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;YACtC,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,SAAS;YAChB,MAAM,CAAC,YAAY,IAAI,KAAK;YAC5B,MAAM,CAAC,KAAK;SACb;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC;gBACzD,SAAS,EAAE,MAAM,CAAC,SAAU;gBAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,KAAK;gBAC1C,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SectionState, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { sectionKeys } from \"./sections.js\";\nexport function sectionStatusQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n sectionId?: Id | null | undefined;\n statusType?: SectionState | null;\n fields?: string;\n },\n) {\n return {\n queryKey: [\n sectionKeys.status(params.companyId, params.sectionId),\n params.statusType,\n params.fields,\n ],\n queryFn: async () => {\n const statuses = await sdk.api.sections.showSectionStatus({\n companyId: params.companyId!,\n sectionId: params.sectionId!,\n statusType: params.statusType,\n fields: params.fields,\n });\n const entries = Array.from(statuses.entries()).map(\n ([k, v]) => [k, v!] as const,\n );\n return Object.fromEntries(entries);\n },\n enabled: !!params.companyId && !!params.sectionId,\n };\n}\nexport function sectionStatusesQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n fields?: string;\n pageToken?: string;\n autoPaginate?: boolean | null;\n count?: number;\n },\n) {\n return {\n queryKey: [\n sectionKeys.statuses(params.companyId),\n params.fields,\n params.pageToken,\n params.autoPaginate ?? false,\n params.count,\n ],\n queryFn: async () => {\n const statuses = await sdk.api.sections.indexSectionStatus({\n companyId: params.companyId!,\n fields: params.fields,\n pageToken: params.pageToken,\n autoPaginate: params.autoPaginate ?? false,\n count: params.count,\n });\n return statuses.items;\n },\n enabled: !!params.companyId,\n };\n}\n"]}
@@ -10,6 +10,7 @@ export type SectionsQueryParams<Fields extends string | undefined = undefined> =
10
10
  companyId?: Id | null | undefined;
11
11
  state?: SectionState | null;
12
12
  query?: string;
13
+ ids?: readonly Id[] | null | undefined;
13
14
  fields?: Fields;
14
15
  pageToken?: string;
15
16
  count?: number;
@@ -34,7 +35,7 @@ export declare const sectionKeys: {
34
35
  };
35
36
  export declare function sectionsQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params: SectionsQueryParams<Fields>): {
36
37
  initialPageParam: string | undefined;
37
- queryKey: (string | number | boolean | SectionState | readonly ["sections", "list", string | number | null | undefined] | null | undefined)[];
38
+ queryKey: (string | number | boolean | readonly string[] | SectionState | readonly ["sections", "list", string | number | null | undefined] | null | undefined)[];
38
39
  queryFn: ({ pageParam }: {
39
40
  pageParam: string | undefined;
40
41
  }) => Promise<SectionListResult<Fields>>;
@@ -1,57 +1,74 @@
1
1
  import { minutes } from "../../../utils/dateTime.js";
2
2
  import { toKeyId } from "../../../utils/kt-bridge.js";
3
3
  import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
4
- import { paginationIdentity } from "./queryIdentity.js";
4
+ import { canonicalQueryIds, paginationIdentity } from "./queryIdentity.js";
5
+ import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
5
6
  export const sectionKeys = {
6
7
  all: ["sections"],
7
- list: (companyId) => [...sectionKeys.all, "list", toKeyId(companyId)],
8
- detail: (companyId, sectionId) => [
8
+ list: (companyId) => trimTrailingUndefined([
9
+ ...sectionKeys.all,
10
+ "list",
11
+ toKeyId(companyId),
12
+ ]),
13
+ detail: (companyId, sectionId) => trimTrailingUndefined([
9
14
  ...sectionKeys.all,
10
15
  "detail",
11
16
  toKeyId(companyId),
12
17
  toKeyId(sectionId),
13
- ],
14
- occupancy: (companyId, sectionId) => [
18
+ ]),
19
+ occupancy: (companyId, sectionId) => trimTrailingUndefined([
15
20
  ...sectionKeys.all,
16
21
  "occupancy",
17
22
  toKeyId(companyId),
18
23
  toKeyId(sectionId),
19
- ],
20
- status: (companyId, sectionId) => [
24
+ ]),
25
+ status: (companyId, sectionId) => trimTrailingUndefined([
21
26
  ...sectionKeys.all,
22
27
  "status",
23
28
  toKeyId(companyId),
24
29
  toKeyId(sectionId),
25
- ],
26
- statuses: (companyId) => [...sectionKeys.all, "statuses", toKeyId(companyId)],
27
- tags: (companyId, sectionId) => [
30
+ ]),
31
+ statuses: (companyId) => trimTrailingUndefined([
32
+ ...sectionKeys.all,
33
+ "statuses",
34
+ toKeyId(companyId),
35
+ ]),
36
+ tags: (companyId, sectionId) => trimTrailingUndefined([
28
37
  ...sectionKeys.all,
29
38
  "tags",
30
39
  toKeyId(companyId),
31
40
  toKeyId(sectionId),
32
- ],
33
- tagsBySection: (companyId) => [...sectionKeys.all, "tagsBySection", toKeyId(companyId)],
34
- tenants: (companyId, sectionId) => [
41
+ ]),
42
+ tagsBySection: (companyId) => trimTrailingUndefined([
43
+ ...sectionKeys.all,
44
+ "tagsBySection",
45
+ toKeyId(companyId),
46
+ ]),
47
+ tenants: (companyId, sectionId) => trimTrailingUndefined([
35
48
  ...sectionKeys.all,
36
49
  "tenants",
37
50
  toKeyId(companyId),
38
51
  toKeyId(sectionId),
39
- ],
40
- ownershipChanges: (companyId, sectionId) => [
52
+ ]),
53
+ ownershipChanges: (companyId, sectionId) => trimTrailingUndefined([
41
54
  ...sectionKeys.all,
42
55
  "ownershipChanges",
43
56
  toKeyId(companyId),
44
57
  toKeyId(sectionId),
45
- ],
46
- loansByFraction: (companyId, sectionId, at) => [
58
+ ]),
59
+ loansByFraction: (companyId, sectionId, at) => trimTrailingUndefined([
47
60
  ...sectionKeys.all,
48
61
  "loansByFraction",
49
62
  toKeyId(companyId),
50
63
  toKeyId(sectionId),
51
64
  toKeyId(at),
52
- ],
53
- existingTags: (companyId) => [...sectionKeys.all, "existingTags", toKeyId(companyId)],
54
- search: (query) => [...sectionKeys.all, "search", { query }],
65
+ ]),
66
+ existingTags: (companyId) => trimTrailingUndefined([
67
+ ...sectionKeys.all,
68
+ "existingTags",
69
+ toKeyId(companyId),
70
+ ]),
71
+ search: (query) => trimTrailingUndefined([...sectionKeys.all, "search", { query }]),
55
72
  };
56
73
  export function sectionsQueryOptions(sdk, params) {
57
74
  const pagination = paginationIdentity(params);
@@ -61,6 +78,7 @@ export function sectionsQueryOptions(sdk, params) {
61
78
  sectionKeys.list(params.companyId),
62
79
  params.state,
63
80
  params.query,
81
+ canonicalQueryIds(params.ids),
64
82
  params.fields,
65
83
  params.count,
66
84
  pagination.pageToken,
@@ -70,6 +88,7 @@ export function sectionsQueryOptions(sdk, params) {
70
88
  companyId: params.companyId,
71
89
  status: params.state,
72
90
  query: params.query,
91
+ ids: params.ids,
73
92
  fields: params.fields,
74
93
  pageToken: pageParam,
75
94
  autoPaginate: pagination.autoPaginate,
@@ -1 +1 @@
1
- {"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/sections.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAqBxD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,CAAC,UAAU,CAAU;IAC1B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,WAAW,CAA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EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS;QAC3B,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;QACtB,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAEjC,GAAiB,EAAE,MAAwC;IAC3D,OAAO;QACL,QAAQ,EAAE;YACR,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC;YACtD,MAAM,CAAC,MAAM;SACd;QACD,OAAO,EAAE,GAAG,EAAE,CACZ,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;QACJ,OAAO,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI;QAC7D,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;KACvB,CAAC;AACJ,CAAC","sourcesContent":["import {\n Id,\n type SectionListResult,\n SectionState,\n SoliboClient,\n} from \"@solibo/solibo-sdk\";\nimport { minutes } from \"../../../utils/dateTime.js\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { paginationIdentity } from \"./queryIdentity.js\";\n\nexport type SectionsPageForFields<Fields extends string | undefined> =\n SectionListResult<Fields>;\nexport type SectionDetailQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n sectionId?: Id | null | undefined;\n fields?: Fields;\n};\nexport type SectionsQueryParams<Fields extends string | undefined = undefined> =\n {\n companyId?: Id | null | undefined;\n state?: SectionState | null;\n query?: string;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean | null;\n };\nexport const sectionKeys = {\n all: [\"sections\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...sectionKeys.all, \"list\", toKeyId(companyId)] as const,\n detail: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"detail\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n occupancy: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n status: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"status\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n statuses: (companyId?: Id | null | undefined) =>\n [...sectionKeys.all, \"statuses\", toKeyId(companyId)] as const,\n tags: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"tags\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n tagsBySection: (companyId?: Id | null | undefined) =>\n [...sectionKeys.all, \"tagsBySection\", toKeyId(companyId)] as const,\n tenants: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"tenants\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n ownershipChanges: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"ownershipChanges\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const,\n loansByFraction: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n [\n ...sectionKeys.all,\n \"loansByFraction\",\n toKeyId(companyId),\n toKeyId(sectionId),\n toKeyId(at),\n ] as const,\n existingTags: (companyId?: Id | null | undefined) =>\n [...sectionKeys.all, \"existingTags\", toKeyId(companyId)] as const,\n search: (query?: string) =>\n [...sectionKeys.all, \"search\", { query }] as const,\n};\nexport function sectionsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionsQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n sectionKeys.list(params.companyId),\n params.state,\n params.query,\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.sections.indexSection({\n companyId: params.companyId!,\n status: params.state,\n query: params.query,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n staleTime: minutes(20),\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function sectionQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionDetailQueryParams<Fields>) {\n return {\n queryKey: [\n sectionKeys.detail(params.companyId, params.sectionId),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.sections.showSection({\n companyId: params.companyId!,\n sectionId: params.sectionId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.sectionId != null,\n staleTime: minutes(20),\n };\n}\n"]}
1
+ {"version":3,"file":"sections.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/sections.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAsBpE,MAAM,CAAC,M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esContent":["import {\n Id,\n type SectionListResult,\n SectionState,\n SoliboClient,\n} from \"@solibo/solibo-sdk\";\nimport { minutes } from \"../../../utils/dateTime.js\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { canonicalQueryIds, paginationIdentity } from \"./queryIdentity.js\";\nimport { trimTrailingUndefined } from \"../../../utils/queryKeys.js\";\n\nexport type SectionsPageForFields<Fields extends string | undefined> =\n SectionListResult<Fields>;\nexport type SectionDetailQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n companyId?: Id | null | undefined;\n sectionId?: Id | null | undefined;\n fields?: Fields;\n};\nexport type SectionsQueryParams<Fields extends string | undefined = undefined> =\n {\n companyId?: Id | null | undefined;\n state?: SectionState | null;\n query?: string;\n ids?: readonly Id[] | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean | null;\n };\nexport const sectionKeys = {\n all: [\"sections\"] as const,\n list: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"list\",\n toKeyId(companyId),\n ] as const),\n detail: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"detail\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n occupancy: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"occupancy\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n status: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"status\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n statuses: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"statuses\",\n toKeyId(companyId),\n ] as const),\n tags: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"tags\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n tagsBySection: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"tagsBySection\",\n toKeyId(companyId),\n ] as const),\n tenants: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"tenants\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n ownershipChanges: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"ownershipChanges\",\n toKeyId(companyId),\n toKeyId(sectionId),\n ] as const),\n loansByFraction: (\n companyId?: Id | null | undefined,\n sectionId?: Id | null | undefined,\n at?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"loansByFraction\",\n toKeyId(companyId),\n toKeyId(sectionId),\n toKeyId(at),\n ] as const),\n existingTags: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...sectionKeys.all,\n \"existingTags\",\n toKeyId(companyId),\n ] as const),\n search: (query?: string) =>\n trimTrailingUndefined([...sectionKeys.all, \"search\", { query }] as const),\n};\nexport function sectionsQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionsQueryParams<Fields>) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n sectionKeys.list(params.companyId),\n params.state,\n params.query,\n canonicalQueryIds(params.ids),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.sections.indexSection({\n companyId: params.companyId!,\n status: params.state,\n query: params.query,\n ids: params.ids,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId,\n staleTime: minutes(20),\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n\nexport function sectionQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionDetailQueryParams<Fields>) {\n return {\n queryKey: [\n sectionKeys.detail(params.companyId, params.sectionId),\n params.fields,\n ],\n queryFn: () =>\n sdk.api.sections.showSection({\n companyId: params.companyId!,\n sectionId: params.sectionId!,\n fields: params.fields,\n }),\n enabled: params.companyId != null && params.sectionId != null,\n staleTime: minutes(20),\n };\n}\n"]}
@@ -3,6 +3,7 @@ import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
3
3
  export type SectionsSearchQueryParams<Fields extends string | undefined = undefined> = {
4
4
  query?: string;
5
5
  companyIds?: Id[] | null | undefined;
6
+ ids?: readonly Id[] | null | undefined;
6
7
  fields?: Fields;
7
8
  pageToken?: string;
8
9
  count?: number;
@@ -10,9 +11,9 @@ export type SectionsSearchQueryParams<Fields extends string | undefined = undefi
10
11
  };
11
12
  export declare function sectionsSearchQueryOptions<Fields extends string | undefined = undefined>(sdk: SoliboClient, params?: SectionsSearchQueryParams<Fields>): {
12
13
  initialPageParam: string | undefined;
13
- queryKey: (string | number | boolean | readonly ["sections", "search", {
14
+ queryKey: (string | number | boolean | readonly string[] | readonly ["sections", "search", {
14
15
  readonly query: string | undefined;
15
- }] | (string | number | null | undefined)[] | undefined)[];
16
+ }] | (string | number | null | undefined)[] | null | undefined)[];
16
17
  queryFn: ({ pageParam }: {
17
18
  pageParam: string | undefined;
18
19
  }) => Promise<import("@solibo/solibo-sdk").SectionListResult<Fields>>;
@@ -1,7 +1,7 @@
1
1
  import { toKeyId } from "../../../utils/kt-bridge.js";
2
2
  import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
3
3
  import { sectionKeys } from "./sections.js";
4
- import { paginationIdentity } from "./queryIdentity.js";
4
+ import { canonicalQueryIds, paginationIdentity } from "./queryIdentity.js";
5
5
  export function sectionsSearchQueryOptions(sdk, params = {}) {
6
6
  const pagination = paginationIdentity(params);
7
7
  return {
@@ -9,6 +9,7 @@ export function sectionsSearchQueryOptions(sdk, params = {}) {
9
9
  queryKey: [
10
10
  sectionKeys.search(params.query),
11
11
  params.companyIds?.map(toKeyId),
12
+ canonicalQueryIds(params.ids),
12
13
  params.fields,
13
14
  params.count,
14
15
  pagination.pageToken,
@@ -19,6 +20,7 @@ export function sectionsSearchQueryOptions(sdk, params = {}) {
19
20
  companyIds: params.companyIds
20
21
  ? params.companyIds.map((id) => id)
21
22
  : undefined,
23
+ ids: params.ids,
22
24
  fields: params.fields,
23
25
  pageToken: pageParam,
24
26
  autoPaginate: pagination.autoPaginate,
@@ -1 +1 @@
1
- {"version":3,"file":"sectionsSearch.js","sourceRoot":"","sources":["../../../../src/api/queries/residentsAndSections/sectionsSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAaxD,MAAM,UAAU,0BAA0B,CAExC,GAAiB,EAAE,SAA4C,EAAE;IACjE,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO;QACL,gBAAgB,EAAE,MAAM,CAAC,SAAS;QAClC,QAAQ,EAAE;YACR,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC;YAC/B,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;YACZ,UAAU,CAAC,SAAS;YACpB,UAAU,CAAC,YAAY;SACxB;QACD,OAAO,EAAE,CAAC,EAAE,SAAS,EAAqC,EAAE,EAAE,CAC5D,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC7B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC3B,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;gBACnC,CAAC,CAAC,SAAS;YACb,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { sectionKeys } from \"./sections.js\";\nimport { paginationIdentity } from \"./queryIdentity.js\";\n\nexport type SectionsSearchQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n query?: string;\n companyIds?: Id[] | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport function sectionsSearchQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionsSearchQueryParams<Fields> = {}) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n sectionKeys.search(params.query),\n params.companyIds?.map(toKeyId),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.sections.indexSections({\n query: params.query,\n companyIds: params.companyIds\n ? params.companyIds.map((id) => id)\n : undefined,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n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,CAAC,KAAK;SACpB,CAAC;QACJ,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { sectionKeys } from \"./sections.js\";\nimport { canonicalQueryIds, paginationIdentity } from \"./queryIdentity.js\";\n\nexport type SectionsSearchQueryParams<\n Fields extends string | undefined = undefined,\n> = {\n query?: string;\n companyIds?: Id[] | null | undefined;\n ids?: readonly Id[] | null | undefined;\n fields?: Fields;\n pageToken?: string;\n count?: number;\n autoPaginate?: boolean;\n};\n\nexport function sectionsSearchQueryOptions<\n Fields extends string | undefined = undefined,\n>(sdk: SoliboClient, params: SectionsSearchQueryParams<Fields> = {}) {\n const pagination = paginationIdentity(params);\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n sectionKeys.search(params.query),\n params.companyIds?.map(toKeyId),\n canonicalQueryIds(params.ids),\n params.fields,\n params.count,\n pagination.pageToken,\n pagination.autoPaginate,\n ],\n queryFn: ({ pageParam }: { pageParam: string | undefined }) =>\n sdk.api.sections.indexSections({\n query: params.query,\n companyIds: params.companyIds\n ? params.companyIds.map((id) => id)\n : undefined,\n ids: params.ids,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: pagination.autoPaginate,\n count: params.count,\n }),\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
@@ -1,22 +1,35 @@
1
1
  import { toKeyId } from "../../../utils/kt-bridge.js";
2
2
  import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
3
+ import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
3
4
  export const routineKeys = {
4
5
  all: ["routines"],
5
- list: (companyId) => [...routineKeys.all, "list", toKeyId(companyId)],
6
- detail: (companyId, routineId) => [
6
+ list: (companyId) => trimTrailingUndefined([
7
+ ...routineKeys.all,
8
+ "list",
9
+ toKeyId(companyId),
10
+ ]),
11
+ detail: (companyId, routineId) => trimTrailingUndefined([
7
12
  ...routineKeys.all,
8
13
  "detail",
9
14
  toKeyId(companyId),
10
15
  toKeyId(routineId),
11
- ],
12
- availableTypes: (companyId) => [...routineKeys.all, "availableTypes", toKeyId(companyId)],
13
- companyFeatures: (companyId) => [...routineKeys.all, "companyFeatures", toKeyId(companyId)],
14
- groupDrafts: (companyId, groupId) => [
16
+ ]),
17
+ availableTypes: (companyId) => trimTrailingUndefined([
18
+ ...routineKeys.all,
19
+ "availableTypes",
20
+ toKeyId(companyId),
21
+ ]),
22
+ companyFeatures: (companyId) => trimTrailingUndefined([
23
+ ...routineKeys.all,
24
+ "companyFeatures",
25
+ toKeyId(companyId),
26
+ ]),
27
+ groupDrafts: (companyId, groupId) => trimTrailingUndefined([
15
28
  ...routineKeys.all,
16
29
  "groupDrafts",
17
30
  toKeyId(companyId),
18
31
  toKeyId(groupId),
19
- ],
32
+ ]),
20
33
  };
21
34
  export function routinesQueryOptions(sdk, params) {
22
35
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"routines.js","sourceRoot":"","sources":["../../../../src/api/queries/routines/routines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,CAAC,UAAU,CAAU;IAC1B,IAAI,EAAE,CAAC,SAAiC,EAAE,EAAE,CAC1C,CAAC,GAAG,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAU;IAC3D,MAAM,EAAE,CACN,SAAiC,EACjC,SAAiC,EACjC,EAAE,CACF;QACE,GAAG,WAAW,CAAC,GAAG;QAClB,QAAQ;QACR,OAAO,CAAC,SAAS,CAAC;QAClB,OAAO,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;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, RoutineType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nexport const routineKeys = {\n all: [\"routines\"] as const,\n list: (companyId?: Id | null | undefined) =>\n [...routineKeys.all, \"list\", toKeyId(companyId)] as const,\n detail: (\n companyId?: Id | null | undefined,\n routineId?: Id | null | undefined,\n ) =>\n [\n ...routineKeys.all,\n \"detail\",\n toKeyId(companyId),\n toKeyId(routineId),\n ] as const,\n availableTypes: (companyId?: Id | null | undefined) =>\n [...routineKeys.all, \"availableTypes\", toKeyId(companyId)] as const,\n companyFeatures: (companyId?: Id | null | undefined) =>\n [...routineKeys.all, \"companyFeatures\", toKeyId(companyId)] as const,\n groupDrafts: (\n companyId?: Id | null | undefined,\n groupId?: Id | null | undefined,\n ) =>\n [\n ...routineKeys.all,\n \"groupDrafts\",\n toKeyId(companyId),\n toKeyId(groupId),\n ] as const,\n};\nexport function routinesQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n managed?: boolean;\n year?: number | null;\n routineType?: RoutineType | null;\n fields?: string;\n pageToken?: string;\n autoPaginate?: boolean | null;\n count?: number;\n },\n) {\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n routineKeys.list(params.companyId),\n params.year,\n params.routineType,\n params.fields,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam: any }) =>\n sdk.api.routines.indexRoutines({\n companyId: params.companyId!,\n year: params.year,\n routineType: params.routineType,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: params.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId && params.managed !== false,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}
1
+ {"version":3,"file":"routines.js","sourceRoot":"","sources":["../../../../src/api/queries/routines/routines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,O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AC,IAAI;YACX,MAAM,CAAC,WAAW;YAClB,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,KAAK;SACb;QACD,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,EAAE,EAAE,CAC7C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC7B,SAAS,EAAE,MAAM,CAAC,SAAU;YAC5B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,SAAS;YACpB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK;QACvD,gBAAgB,EAAE,aAAa;QAC/B,oBAAoB,EAAE,aAAa;KACpC,CAAC;AACJ,CAAC","sourcesContent":["import { Id, RoutineType, SoliboClient } from \"@solibo/solibo-sdk\";\nimport { toKeyId } from \"../../../utils/kt-bridge.js\";\nimport { nextPageParam, prevPageParam } from \"../../../utils/pageUtils.js\";\nimport { trimTrailingUndefined } from \"../../../utils/queryKeys.js\";\nexport const routineKeys = {\n all: [\"routines\"] as const,\n list: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...routineKeys.all,\n \"list\",\n toKeyId(companyId),\n ] as const),\n detail: (\n companyId?: Id | null | undefined,\n routineId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...routineKeys.all,\n \"detail\",\n toKeyId(companyId),\n toKeyId(routineId),\n ] as const),\n availableTypes: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...routineKeys.all,\n \"availableTypes\",\n toKeyId(companyId),\n ] as const),\n companyFeatures: (companyId?: Id | null | undefined) =>\n trimTrailingUndefined([\n ...routineKeys.all,\n \"companyFeatures\",\n toKeyId(companyId),\n ] as const),\n groupDrafts: (\n companyId?: Id | null | undefined,\n groupId?: Id | null | undefined,\n ) =>\n trimTrailingUndefined([\n ...routineKeys.all,\n \"groupDrafts\",\n toKeyId(companyId),\n toKeyId(groupId),\n ] as const),\n};\nexport function routinesQueryOptions(\n sdk: SoliboClient,\n params: {\n companyId?: Id | null | undefined;\n managed?: boolean;\n year?: number | null;\n routineType?: RoutineType | null;\n fields?: string;\n pageToken?: string;\n autoPaginate?: boolean | null;\n count?: number;\n },\n) {\n return {\n initialPageParam: params.pageToken,\n queryKey: [\n routineKeys.list(params.companyId),\n params.year,\n params.routineType,\n params.fields,\n params.count,\n ],\n queryFn: ({ pageParam }: { pageParam: any }) =>\n sdk.api.routines.indexRoutines({\n companyId: params.companyId!,\n year: params.year,\n routineType: params.routineType,\n fields: params.fields,\n pageToken: pageParam,\n autoPaginate: params.autoPaginate,\n count: params.count,\n }),\n enabled: !!params.companyId && params.managed !== false,\n getNextPageParam: nextPageParam,\n getPreviousPageParam: prevPageParam,\n };\n}\n"]}