@burdenoff/microfe-coolandlovely 2026.1109.2 → 2026.1109.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coolandlovely/api/creatorMarketplaceRequest.js +9 -9
- package/dist/coolandlovely/api/creatorMarketplaceRequest.js.map +1 -1
- package/dist/coolandlovely/hooks/useCreatorMarketplace.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/useCreatorMarketplace.js +2 -1
- package/dist/coolandlovely/hooks/useCreatorMarketplace.js.map +1 -1
- package/package.json +5 -1
|
@@ -5,8 +5,8 @@ async function a(a, o, s, c) {
|
|
|
5
5
|
if ((l.organizationId ?? null) !== (e() ?? null) || (l.projectId ?? null) !== (t() ?? null)) throw Error("The active context changed. Review the marketplace action again.");
|
|
6
6
|
};
|
|
7
7
|
u();
|
|
8
|
-
let d =
|
|
9
|
-
url:
|
|
8
|
+
let d = await r({
|
|
9
|
+
url: i("workspace", l.apiGatewayUrl),
|
|
10
10
|
authToken: l.authToken,
|
|
11
11
|
actorId: l.actorId,
|
|
12
12
|
workspaceId: l.workspaceId,
|
|
@@ -15,12 +15,12 @@ async function a(a, o, s, c) {
|
|
|
15
15
|
currentQuery: o,
|
|
16
16
|
signal: c
|
|
17
17
|
});
|
|
18
|
-
u(),
|
|
19
|
-
let
|
|
18
|
+
u(), d.assertCurrent();
|
|
19
|
+
let f = await n({
|
|
20
20
|
gateway: "workspace",
|
|
21
|
-
baseUrl:
|
|
21
|
+
baseUrl: l.apiGatewayUrl,
|
|
22
22
|
authToken: l.authToken,
|
|
23
|
-
workspaceToken:
|
|
23
|
+
workspaceToken: d.workspaceToken,
|
|
24
24
|
workspaceId: l.workspaceId,
|
|
25
25
|
organizationId: l.organizationId ?? !1,
|
|
26
26
|
tenantId: l.tenantId ?? !1,
|
|
@@ -31,9 +31,9 @@ async function a(a, o, s, c) {
|
|
|
31
31
|
}).catch((e) => {
|
|
32
32
|
throw e instanceof Error && "errors" in e && Array.isArray(e.errors) ? Object.assign(e, { graphQLErrors: e.errors }) : e;
|
|
33
33
|
});
|
|
34
|
-
if (u(),
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
34
|
+
if (u(), d.assertCurrent(), f.errors?.length) throw Object.assign(Error(f.errors[0]?.message ?? "The request could not be completed."), { graphQLErrors: f.errors });
|
|
35
|
+
if (f.data == null) throw Error("The request did not return data.");
|
|
36
|
+
return f.data;
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
39
|
export { a as creatorMarketplaceRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creatorMarketplaceRequest.js","names":[],"sources":["../../../src/coolandlovely/api/creatorMarketplaceRequest.ts"],"sourcesContent":["import {\n getStoredOrganizationId,\n getStoredProjectId,\n graphqlFetchPinned,\n prepareWorkspaceRequest,\n resolveGatewayUrl,\n} from '@burdenoff/fe-libs/shared/graphql';\n\n/** Captured from the mounted host context; never persisted or included in cache keys. */\nexport interface CreatorMarketplaceScope {\n apiGatewayUrl: string;\n authToken: string;\n actorId: string;\n workspaceId: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n workspaceToken?: string;\n}\n\nexport async function creatorMarketplaceRequest<T>(\n scope: CreatorMarketplaceScope,\n query: string,\n variables: Record<string, unknown>,\n signal?: AbortSignal\n): Promise<T> {\n const captured = { ...scope };\n const assertContext = () => {\n if (\n (captured.organizationId ?? null) !== (getStoredOrganizationId() ?? null) ||\n (captured.projectId ?? null) !== (getStoredProjectId() ?? null)\n )\n throw new Error('The active context changed. Review the marketplace action again.');\n };\n assertContext();\n const url = resolveGatewayUrl('workspace', captured.apiGatewayUrl);\n const prepared = await prepareWorkspaceRequest({\n url,\n authToken: captured.authToken,\n actorId: captured.actorId,\n workspaceId: captured.workspaceId,\n tenantId: captured.tenantId,\n workspaceToken: captured.workspaceToken,\n currentQuery: query,\n signal,\n });\n assertContext();\n prepared.assertCurrent();\n const result = await graphqlFetchPinned<T>({\n gateway: 'workspace',\n baseUrl:
|
|
1
|
+
{"version":3,"file":"creatorMarketplaceRequest.js","names":[],"sources":["../../../src/coolandlovely/api/creatorMarketplaceRequest.ts"],"sourcesContent":["import {\n getStoredOrganizationId,\n getStoredProjectId,\n graphqlFetchPinned,\n prepareWorkspaceRequest,\n resolveGatewayUrl,\n} from '@burdenoff/fe-libs/shared/graphql';\n\n/** Captured from the mounted host context; never persisted or included in cache keys. */\nexport interface CreatorMarketplaceScope {\n apiGatewayUrl: string;\n authToken: string;\n actorId: string;\n workspaceId: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n workspaceToken?: string;\n}\n\nexport async function creatorMarketplaceRequest<T>(\n scope: CreatorMarketplaceScope,\n query: string,\n variables: Record<string, unknown>,\n signal?: AbortSignal\n): Promise<T> {\n const captured = { ...scope };\n const assertContext = () => {\n if (\n (captured.organizationId ?? null) !== (getStoredOrganizationId() ?? null) ||\n (captured.projectId ?? null) !== (getStoredProjectId() ?? null)\n )\n throw new Error('The active context changed. Review the marketplace action again.');\n };\n assertContext();\n const url = resolveGatewayUrl('workspace', captured.apiGatewayUrl);\n const prepared = await prepareWorkspaceRequest({\n url,\n authToken: captured.authToken,\n actorId: captured.actorId,\n workspaceId: captured.workspaceId,\n tenantId: captured.tenantId,\n workspaceToken: captured.workspaceToken,\n currentQuery: query,\n signal,\n });\n assertContext();\n prepared.assertCurrent();\n const result = await graphqlFetchPinned<T>({\n gateway: 'workspace',\n baseUrl: captured.apiGatewayUrl,\n authToken: captured.authToken,\n workspaceToken: prepared.workspaceToken,\n workspaceId: captured.workspaceId,\n organizationId: captured.organizationId ?? false,\n tenantId: captured.tenantId ?? false,\n projectId: captured.projectId ?? false,\n query,\n variables,\n signal,\n }).catch((error: unknown) => {\n if (error instanceof Error && 'errors' in error && Array.isArray(error.errors))\n throw Object.assign(error, { graphQLErrors: error.errors });\n throw error;\n });\n assertContext();\n prepared.assertCurrent();\n if (result.errors?.length)\n throw Object.assign(\n new Error(result.errors[0]?.message ?? 'The request could not be completed.'),\n { graphQLErrors: result.errors }\n );\n if (result.data == null) throw new Error('The request did not return data.');\n return result.data;\n}\n"],"mappings":";;AAoBA,eAAsB,EACpB,GACA,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAAE,GAAG,EAAM,GACtB,UAAsB;EAC1B,KACG,EAAS,kBAAkB,WAAW,EAAwB,KAAK,UACnE,EAAS,aAAa,WAAW,EAAmB,KAAK,OAE1D,MAAU,MAAM,kEAAkE;CACtF;CACA,EAAc;CAEd,IAAM,IAAW,MAAM,EAAwB;EAC7C,KAFU,EAAkB,aAAa,EAAS,aAElD;EACA,WAAW,EAAS;EACpB,SAAS,EAAS;EAClB,aAAa,EAAS;EACtB,UAAU,EAAS;EACnB,gBAAgB,EAAS;EACzB,cAAc;EACd;CACF,CAAC;CAED,AADA,EAAc,GACd,EAAS,cAAc;CACvB,IAAM,IAAS,MAAM,EAAsB;EACzC,SAAS;EACT,SAAS,EAAS;EAClB,WAAW,EAAS;EACpB,gBAAgB,EAAS;EACzB,aAAa,EAAS;EACtB,gBAAgB,EAAS,kBAAkB;EAC3C,UAAU,EAAS,YAAY;EAC/B,WAAW,EAAS,aAAa;EACjC;EACA;EACA;CACF,CAAC,CAAC,CAAC,OAAO,MAAmB;EAG3B,MAFI,aAAiB,SAAS,YAAY,KAAS,MAAM,QAAQ,EAAM,MAAM,IACrE,OAAO,OAAO,GAAO,EAAE,eAAe,EAAM,OAAO,CAAC,IACtD;CACR,CAAC;CAGD,IAFA,EAAc,GACd,EAAS,cAAc,GACnB,EAAO,QAAQ,QACjB,MAAM,OAAO,OACP,MAAM,EAAO,OAAO,EAAE,EAAE,WAAW,qCAAqC,GAC5E,EAAE,eAAe,EAAO,OAAO,CACjC;CACF,IAAI,EAAO,QAAQ,MAAM,MAAU,MAAM,kCAAkC;CAC3E,OAAO,EAAO;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreatorMarketplace.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useCreatorMarketplace.ts"],"names":[],"mappings":"AAMA,OAAO,EAiBL,KAAK,iCAAiC,EAEtC,KAAK,iCAAiC,EAEtC,KAAK,kCAAkC,EAEvC,KAAK,kCAAkC,EAEvC,KAAK,kCAAkC,EAEvC,KAAK,6BAA6B,EAEnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,YAAY,EACV,8BAA8B,IAAI,YAAY,EAC9C,8BAA8B,IAAI,eAAe,GAClD,MAAM,mCAAmC,CAAC;AAE3C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAyCxC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,UAAO;;;kBAxBrF,CAAJ;;;;;eAGY,CAAC;;;;;;;;;;;;kBAMO,CAAC;;;UAwCpB;AACD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,UAAQ;;;;;;;;;;;;;;;;6BAatE;AACD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;kBAArB,CAAC;;;;;kBACH,CAAC;;;UAczC;AACD,wBAAgB,eAAe,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;kBAHrF,CAAC;;;;;;aAG0E,CAAC;;;;;;kBAKlF,CAAH;wBACe,CAAC;qBAET,CAAH;;0BACqB,CAAC;aACjB,CAAN;sBAAc,CAAC;;;;cAAuD,CAAC;sBAAe,CAAA;;;;kBAOnD,CAAC;;;;kBACpC,CAAC;;;UAHJ;
|
|
1
|
+
{"version":3,"file":"useCreatorMarketplace.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useCreatorMarketplace.ts"],"names":[],"mappings":"AAMA,OAAO,EAiBL,KAAK,iC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;AACJ,eAAO,MAAM,sBAAsB;;YAGhC,CAAC;AACJ,eAAO,MAAM,2BAA2B;QAImrC,oDAAoB;;YAD5uC,CAAC"}
|
|
@@ -98,8 +98,9 @@ function C(e, t, n) {
|
|
|
98
98
|
function w(e) {
|
|
99
99
|
let { request: t } = y(), n = h();
|
|
100
100
|
return p({
|
|
101
|
+
retry: !1,
|
|
101
102
|
mutationFn: (n) => t(e, n),
|
|
102
|
-
|
|
103
|
+
onSettled: async () => {
|
|
103
104
|
g(), await Promise.all([
|
|
104
105
|
n.invalidateQueries({ queryKey: v }),
|
|
105
106
|
n.invalidateQueries({ queryKey: ["coolandlovely", "collaborations"] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreatorMarketplace.js","names":[],"sources":["../../../src/coolandlovely/hooks/useCreatorMarketplace.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { print } from 'graphql';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql/fetch';\n\nimport { useCoolAndLovely } from '../context';\nimport { creatorMarketplaceRequest } from '../api/creatorMarketplaceRequest';\nimport {\n CooMarketplaceMyOffersDocument,\n CooMarketplacePublishedOffersDocument,\n CooMarketplaceOfferDocument,\n CooMarketplaceProposalBrandsDocument,\n CooMarketplaceInboxDocument,\n CooMarketplaceCreateOfferDocument,\n CooMarketplaceUpdateOfferDocument,\n CooMarketplacePublishOfferDocument,\n CooMarketplaceArchiveOfferDocument,\n CooMarketplaceProposeOfferDocument,\n CooMarketplaceRespondDocument,\n type CooMarketplaceMyOffersQuery,\n type CooMarketplacePublishedOffersQuery,\n type CooMarketplaceOfferQuery,\n type CooMarketplaceProposalBrandsQuery,\n type CooMarketplaceInboxQuery,\n type CooMarketplaceCreateOfferMutation,\n type CooMarketplaceCreateOfferMutationVariables,\n type CooMarketplaceUpdateOfferMutation,\n type CooMarketplaceUpdateOfferMutationVariables,\n type CooMarketplacePublishOfferMutation,\n type CooMarketplacePublishOfferMutationVariables,\n type CooMarketplaceArchiveOfferMutation,\n type CooMarketplaceArchiveOfferMutationVariables,\n type CooMarketplaceProposeOfferMutation,\n type CooMarketplaceProposeOfferMutationVariables,\n type CooMarketplaceRespondMutation,\n type CooMarketplaceRespondMutationVariables,\n} from '../../generated/wspace-operations';\nimport type { CooProposalDirection } from '../../generated/wspace-types';\n\nexport type {\n CooMarketplaceRateCardFragment as CreatorOffer,\n CooMarketplaceProposalFragment as CreatorProposal,\n} from '../../generated/wspace-operations';\nconst KEY = ['coolandlovely', 'creator-marketplace'] as const;\nexport const MARKETPLACE_PAGE_SIZE = 20;\n\nfunction useRequest() {\n const scope = useCoolAndLovely();\n const {\n apiGatewayUrl,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n currentUser,\n authToken,\n workspaceToken,\n } = scope;\n const ready = Boolean(apiGatewayUrl && workspaceId && currentUser?.id && authToken);\n const request = async <T>(\n query: string,\n variables: Record<string, unknown>,\n signal?: AbortSignal\n ): Promise<T> => {\n if (!apiGatewayUrl || !workspaceId || !currentUser?.id || !authToken)\n throw new Error('The marketplace account context is not ready.');\n return creatorMarketplaceRequest<T>(\n {\n apiGatewayUrl,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n actorId: currentUser.id,\n authToken,\n workspaceToken,\n },\n query,\n variables,\n signal\n );\n };\n return { request, ready };\n}\n\nexport function useCreatorOffers(mode: 'mine' | 'published', page: number, enabled = true) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, mode, page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) => {\n const variables = { limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE };\n return mode === 'mine'\n ? (\n await request<CooMarketplaceMyOffersQuery>(\n print(CooMarketplaceMyOffersDocument),\n variables,\n signal\n )\n ).cooMyCreatorRateCards\n : (\n await request<CooMarketplacePublishedOffersQuery>(\n print(CooMarketplacePublishedOffersDocument),\n variables,\n signal\n )\n ).cooPublishedCreatorRateCards;\n },\n });\n}\nexport function useCreatorOffer(id: string | undefined, enabled = false) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'offer', id],\n enabled: enabled && ready && Boolean(id),\n staleTime: 0,\n queryFn: async ({ signal }) => {\n if (!id) throw new Error('Choose an offer.');\n return (\n await request<CooMarketplaceOfferQuery>(print(CooMarketplaceOfferDocument), { id }, signal)\n ).cooCreatorRateCard;\n },\n });\n}\nexport function useProposalBrands(page: number, enabled: boolean) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'brands', page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) =>\n (\n await request<CooMarketplaceProposalBrandsQuery>(\n print(CooMarketplaceProposalBrandsDocument),\n { limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE },\n signal\n )\n ).cooMyProposalBrands,\n });\n}\nexport function useCreatorInbox(direction: CooProposalDirection, page: number, enabled: boolean) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'inbox', direction, page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) =>\n (\n await request<CooMarketplaceInboxQuery>(\n print(CooMarketplaceInboxDocument),\n { direction, limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE },\n signal\n )\n ).cooMyProposalInbox,\n });\n}\n\nfunction useAction<TData, TVariables extends Record<string, unknown>>(query: string) {\n const { request } = useRequest();\n const client = useQueryClient();\n return useMutation({\n mutationFn: (variables: TVariables) => request<TData>(query, variables),\n
|
|
1
|
+
{"version":3,"file":"useCreatorMarketplace.js","names":[],"sources":["../../../src/coolandlovely/hooks/useCreatorMarketplace.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { print } from 'graphql';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql/fetch';\n\nimport { useCoolAndLovely } from '../context';\nimport { creatorMarketplaceRequest } from '../api/creatorMarketplaceRequest';\nimport {\n CooMarketplaceMyOffersDocument,\n CooMarketplacePublishedOffersDocument,\n CooMarketplaceOfferDocument,\n CooMarketplaceProposalBrandsDocument,\n CooMarketplaceInboxDocument,\n CooMarketplaceCreateOfferDocument,\n CooMarketplaceUpdateOfferDocument,\n CooMarketplacePublishOfferDocument,\n CooMarketplaceArchiveOfferDocument,\n CooMarketplaceProposeOfferDocument,\n CooMarketplaceRespondDocument,\n type CooMarketplaceMyOffersQuery,\n type CooMarketplacePublishedOffersQuery,\n type CooMarketplaceOfferQuery,\n type CooMarketplaceProposalBrandsQuery,\n type CooMarketplaceInboxQuery,\n type CooMarketplaceCreateOfferMutation,\n type CooMarketplaceCreateOfferMutationVariables,\n type CooMarketplaceUpdateOfferMutation,\n type CooMarketplaceUpdateOfferMutationVariables,\n type CooMarketplacePublishOfferMutation,\n type CooMarketplacePublishOfferMutationVariables,\n type CooMarketplaceArchiveOfferMutation,\n type CooMarketplaceArchiveOfferMutationVariables,\n type CooMarketplaceProposeOfferMutation,\n type CooMarketplaceProposeOfferMutationVariables,\n type CooMarketplaceRespondMutation,\n type CooMarketplaceRespondMutationVariables,\n} from '../../generated/wspace-operations';\nimport type { CooProposalDirection } from '../../generated/wspace-types';\n\nexport type {\n CooMarketplaceRateCardFragment as CreatorOffer,\n CooMarketplaceProposalFragment as CreatorProposal,\n} from '../../generated/wspace-operations';\nconst KEY = ['coolandlovely', 'creator-marketplace'] as const;\nexport const MARKETPLACE_PAGE_SIZE = 20;\n\nfunction useRequest() {\n const scope = useCoolAndLovely();\n const {\n apiGatewayUrl,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n currentUser,\n authToken,\n workspaceToken,\n } = scope;\n const ready = Boolean(apiGatewayUrl && workspaceId && currentUser?.id && authToken);\n const request = async <T>(\n query: string,\n variables: Record<string, unknown>,\n signal?: AbortSignal\n ): Promise<T> => {\n if (!apiGatewayUrl || !workspaceId || !currentUser?.id || !authToken)\n throw new Error('The marketplace account context is not ready.');\n return creatorMarketplaceRequest<T>(\n {\n apiGatewayUrl,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n actorId: currentUser.id,\n authToken,\n workspaceToken,\n },\n query,\n variables,\n signal\n );\n };\n return { request, ready };\n}\n\nexport function useCreatorOffers(mode: 'mine' | 'published', page: number, enabled = true) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, mode, page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) => {\n const variables = { limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE };\n return mode === 'mine'\n ? (\n await request<CooMarketplaceMyOffersQuery>(\n print(CooMarketplaceMyOffersDocument),\n variables,\n signal\n )\n ).cooMyCreatorRateCards\n : (\n await request<CooMarketplacePublishedOffersQuery>(\n print(CooMarketplacePublishedOffersDocument),\n variables,\n signal\n )\n ).cooPublishedCreatorRateCards;\n },\n });\n}\nexport function useCreatorOffer(id: string | undefined, enabled = false) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'offer', id],\n enabled: enabled && ready && Boolean(id),\n staleTime: 0,\n queryFn: async ({ signal }) => {\n if (!id) throw new Error('Choose an offer.');\n return (\n await request<CooMarketplaceOfferQuery>(print(CooMarketplaceOfferDocument), { id }, signal)\n ).cooCreatorRateCard;\n },\n });\n}\nexport function useProposalBrands(page: number, enabled: boolean) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'brands', page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) =>\n (\n await request<CooMarketplaceProposalBrandsQuery>(\n print(CooMarketplaceProposalBrandsDocument),\n { limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE },\n signal\n )\n ).cooMyProposalBrands,\n });\n}\nexport function useCreatorInbox(direction: CooProposalDirection, page: number, enabled: boolean) {\n const { request, ready } = useRequest();\n return useQuery({\n queryKey: [...KEY, 'inbox', direction, page],\n enabled: enabled && ready,\n staleTime: 0,\n queryFn: async ({ signal }) =>\n (\n await request<CooMarketplaceInboxQuery>(\n print(CooMarketplaceInboxDocument),\n { direction, limit: MARKETPLACE_PAGE_SIZE, offset: page * MARKETPLACE_PAGE_SIZE },\n signal\n )\n ).cooMyProposalInbox,\n });\n}\n\nfunction useAction<TData, TVariables extends Record<string, unknown>>(query: string) {\n const { request } = useRequest();\n const client = useQueryClient();\n return useMutation({\n retry: false,\n mutationFn: (variables: TVariables) => request<TData>(query, variables),\n // Rejected confirmation can follow a committed write. Refresh reads without replaying it.\n onSettled: async () => {\n clearGraphqlFetchResponseCache();\n await Promise.all([\n client.invalidateQueries({ queryKey: KEY }),\n client.invalidateQueries({ queryKey: ['coolandlovely', 'collaborations'] }),\n client.invalidateQueries({ queryKey: ['coolandlovely', 'collaboration'] }),\n ]);\n },\n });\n}\nexport const useCreateCreatorOffer = () =>\n useAction<CooMarketplaceCreateOfferMutation, CooMarketplaceCreateOfferMutationVariables>(\n print(CooMarketplaceCreateOfferDocument)\n );\nexport const useUpdateCreatorOffer = () =>\n useAction<CooMarketplaceUpdateOfferMutation, CooMarketplaceUpdateOfferMutationVariables>(\n print(CooMarketplaceUpdateOfferDocument)\n );\nexport const usePublishCreatorOffer = () =>\n useAction<CooMarketplacePublishOfferMutation, CooMarketplacePublishOfferMutationVariables>(\n print(CooMarketplacePublishOfferDocument)\n );\nexport const useArchiveCreatorOffer = () =>\n useAction<CooMarketplaceArchiveOfferMutation, CooMarketplaceArchiveOfferMutationVariables>(\n print(CooMarketplaceArchiveOfferDocument)\n );\nexport const useProposeCreatorOffer = () =>\n useAction<CooMarketplaceProposeOfferMutation, CooMarketplaceProposeOfferMutationVariables>(\n print(CooMarketplaceProposeOfferDocument)\n );\nexport const useRespondToCreatorProposal = () =>\n useAction<CooMarketplaceRespondMutation, CooMarketplaceRespondMutationVariables>(\n print(CooMarketplaceRespondDocument)\n );\n"],"mappings":";;;;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|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-coolandlovely",
|
|
3
|
-
"version": "2026.1109.
|
|
3
|
+
"version": "2026.1109.3",
|
|
4
4
|
"description": "Burdenoff CoolAndLovely Microfrontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -129,5 +129,9 @@
|
|
|
129
129
|
"immutable": ">=3.8.3",
|
|
130
130
|
"zod": "4.6.7",
|
|
131
131
|
"@graphql-tools/utils": "^12.1.0"
|
|
132
|
+
},
|
|
133
|
+
"patchedDependencies": {
|
|
134
|
+
"minimatch@10.2.6": "patches/minimatch@10.2.6.patch",
|
|
135
|
+
"glob@13.0.7": "patches/glob@13.0.7.patch"
|
|
132
136
|
}
|
|
133
137
|
}
|