@burdenoff/microfe-devportal 2026.601.2 → 2026.609.1

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 (87) hide show
  1. package/dist/devportal/hooks/useGraphQL.js +49 -36
  2. package/dist/devportal/hooks/useGraphQL.js.map +1 -1
  3. package/dist/devportal/pages/StoreSubmissionPage.js +98 -76
  4. package/dist/devportal/pages/StoreSubmissionPage.js.map +1 -1
  5. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +52 -0
  6. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
  7. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +41 -0
  8. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
  9. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +34 -0
  10. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
  11. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +6 -0
  12. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
  13. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +16 -0
  14. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
  15. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +19 -0
  16. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
  17. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +21 -0
  18. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
  19. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +17 -0
  20. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -0
  21. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +9 -0
  22. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -0
  23. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +9 -0
  24. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
  25. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +8 -0
  26. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
  27. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +9 -0
  28. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
  29. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +10 -0
  30. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
  31. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +8 -0
  32. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
  33. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +10 -0
  34. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
  35. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +23 -0
  36. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
  37. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +10 -0
  38. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
  39. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +57 -0
  40. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
  41. package/dist/node_modules/@apollo/client/version.js +6 -0
  42. package/dist/node_modules/@apollo/client/version.js.map +1 -0
  43. package/dist/node_modules/@wry/caches/lib/weak.js +67 -0
  44. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
  45. package/dist/node_modules/@wry/trie/lib/index.js +53 -0
  46. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
  47. package/dist/node_modules/graphql-ws/dist/client.js +272 -0
  48. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -0
  49. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +62 -0
  50. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -0
  51. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +21 -0
  52. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -0
  53. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +78 -0
  54. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
  55. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +117 -0
  56. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
  57. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +93 -0
  58. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
  59. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +12 -0
  60. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
  61. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +9 -0
  62. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
  63. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +16 -0
  64. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
  65. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +8 -0
  66. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
  67. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +13 -0
  68. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
  69. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
  70. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
  71. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +11 -0
  72. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
  73. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +22 -0
  74. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
  75. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
  76. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
  77. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
  78. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
  79. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
  80. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
  81. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +13 -0
  82. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
  83. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +14 -0
  84. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
  85. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js +52 -0
  86. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +1 -0
  87. package/package.json +2 -1
@@ -1,18 +1,21 @@
1
1
  import "../../generated/global-operations.js";
2
2
  import { CombinedGraphQLErrors as e } from "../../node_modules/@apollo/client/errors/CombinedGraphQLErrors.js";
3
3
  import { ServerError as t } from "../../node_modules/@apollo/client/errors/ServerError.js";
4
- import { ApolloClient as n, InMemoryCache as r, createHttpLink as i, from as a, split as o } from "@apollo/client/core";
5
- import { setContext as s } from "@apollo/client/link/context";
6
- import { onError as c } from "@apollo/client/link/error";
7
- import { isAuthNetworkError as l, redirectToLogin as u } from "@burdenoff/fe-libs/shared/utils";
4
+ import { getMainDefinition as n } from "../../node_modules/@apollo/client/utilities/internal/getMainDefinition.js";
5
+ import { GraphQLWsLink as r } from "../../node_modules/@apollo/client/link/subscriptions/index.js";
6
+ import { createClient as i } from "../../node_modules/graphql-ws/dist/client.js";
7
+ import { ApolloClient as a, InMemoryCache as o, createHttpLink as s, from as c, split as l } from "@apollo/client/core";
8
+ import { setContext as u } from "@apollo/client/link/context";
9
+ import { onError as d } from "@apollo/client/link/error";
10
+ import { isAuthNetworkError as f, redirectToLogin as p } from "@burdenoff/fe-libs/shared/utils";
8
11
  //#region src/devportal/hooks/useGraphQL.ts
9
- function d(e = []) {
12
+ function m(e = []) {
10
13
  return e.some((e) => {
11
14
  let t = typeof e.extensions?.code == "string" ? e.extensions.code : "", n = typeof e.extensions?.errorCode == "string" ? e.extensions.errorCode : "", r = (e.message ?? "").toLowerCase();
12
15
  return t === "UNAUTHENTICATED" || n === "TOKEN_EXPIRED" || r.includes("token_expired") || r.includes("token expired") || r.includes("session expired") || r.includes("unauthorized") || r.includes("unauthenticated") || r.includes("authentication required") || r.includes("workspace context missing");
13
16
  });
14
17
  }
15
- var f = !1, p = f ? "/devportal-graphql" : "http://localhost:4015/graphql", m = f ? "/auth-graphql" : "http://localhost:4011/graphql", h = new Set([
18
+ var h = !1, g = h ? "/devportal-graphql" : "http://localhost:4015/graphql", _ = h ? "/auth-graphql" : "http://localhost:4011/graphql", v = new Set([
16
19
  "CurrentUserApps",
17
20
  "GetAuthApp",
18
21
  "AppsActingAsCurrentUser",
@@ -33,28 +36,38 @@ var f = !1, p = f ? "/devportal-graphql" : "http://localhost:4015/graphql", m =
33
36
  "RevokeAPIKeyAuth",
34
37
  "RotateAPIKeyAuth",
35
38
  "AuthenticateAPIKey"
36
- ]), g = "dev-user-001", _ = "user", v = i({ uri: p }), y = o(({ operationName: e }) => e ? h.has(e) : !1, i({ uri: m }), v), b = s((e, { headers: t }) => {
39
+ ]), y = "dev-user-001", b = "user";
40
+ function x(e) {
41
+ return e.replace(/^https/, "wss").replace(/^http/, "ws");
42
+ }
43
+ var S = s({ uri: g }), C = l(({ operationName: e }) => e ? v.has(e) : !1, s({ uri: _ }), S), w = u((e, { headers: t }) => {
37
44
  let n = typeof window < "u" ? localStorage.getItem("auth_token") : null, r = { ...t };
38
- if (n && (r.authorization = `Bearer ${n}`), f) {
39
- let e = typeof window < "u" && localStorage.getItem("dev_actor_id") || g, t = typeof window < "u" && localStorage.getItem("dev_actor_type") || _;
45
+ if (n && (r.authorization = `Bearer ${n}`), h) {
46
+ let e = typeof window < "u" && localStorage.getItem("dev_actor_id") || y, t = typeof window < "u" && localStorage.getItem("dev_actor_type") || b;
40
47
  r["x-actor-id"] = e, r["x-actor-type"] = t;
41
48
  }
42
49
  return { headers: r };
43
- }), x = new n({
44
- link: a([
45
- c(({ error: e }) => {
46
- if (e) {
47
- if (d("errors" in e && Array.isArray(e.errors) ? e.errors : [])) {
48
- u();
49
- return;
50
- }
51
- e instanceof Error && l(e) && u();
52
- }
53
- }),
54
- b,
55
- y
56
- ]),
57
- cache: new r({ typePolicies: {
50
+ }), T = d(({ error: e }) => {
51
+ if (e) {
52
+ if (m("errors" in e && Array.isArray(e.errors) ? e.errors : [])) {
53
+ p();
54
+ return;
55
+ }
56
+ e instanceof Error && f(e) && p();
57
+ }
58
+ }), E = new a({
59
+ link: l(({ query: e }) => {
60
+ let t = n(e);
61
+ return t.kind === "OperationDefinition" && t.operation === "subscription";
62
+ }, new r(i({
63
+ url: x(g),
64
+ connectionParams: () => ({ authorization: "" })
65
+ })), c([
66
+ T,
67
+ w,
68
+ C
69
+ ])),
70
+ cache: new o({ typePolicies: {
58
71
  Query: { fields: {
59
72
  developerOrganizations: {
60
73
  keyArgs: [
@@ -178,7 +191,7 @@ var f = !1, p = f ? "/devportal-graphql" : "http://localhost:4015/graphql", m =
178
191
  query: { fetchPolicy: "cache-first" }
179
192
  }
180
193
  });
181
- function S(n) {
194
+ function D(n) {
182
195
  return n instanceof e ? n.errors.map((e) => ({
183
196
  message: e.message,
184
197
  code: e.extensions?.code,
@@ -195,22 +208,22 @@ function S(n) {
195
208
  code: "UNKNOWN_ERROR"
196
209
  }];
197
210
  }
198
- function C(e) {
199
- return S(e).map((e) => e.message).join(", ");
211
+ function O(e) {
212
+ return D(e).map((e) => e.message).join(", ");
200
213
  }
201
- function w(e) {
202
- return S(e).some((e) => e.code === "UNAUTHENTICATED" || e.code === "FORBIDDEN");
214
+ function k(e) {
215
+ return D(e).some((e) => e.code === "UNAUTHENTICATED" || e.code === "FORBIDDEN");
203
216
  }
204
- function T(e) {
205
- return S(e).some((e) => e.code === "BAD_USER_INPUT" || e.code === "VALIDATION_ERROR");
217
+ function A(e) {
218
+ return D(e).some((e) => e.code === "BAD_USER_INPUT" || e.code === "VALIDATION_ERROR");
206
219
  }
207
- async function E() {
208
- await x.clearStore();
220
+ async function j() {
221
+ await E.clearStore();
209
222
  }
210
- async function D() {
211
- await x.resetStore();
223
+ async function M() {
224
+ await E.resetStore();
212
225
  }
213
226
  //#endregion
214
- export { x as apolloClient, E as clearApolloCache, C as getErrorMessage, w as isAuthError, T as isValidationError, S as parseGraphQLError, D as resetApolloStore };
227
+ export { E as apolloClient, j as clearApolloCache, O as getErrorMessage, k as isAuthError, A as isValidationError, D as parseGraphQLError, M as resetApolloStore };
215
228
 
216
229
  //# sourceMappingURL=useGraphQL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGraphQL.js","names":[],"sources":["../../../src/devportal/hooks/useGraphQL.ts"],"sourcesContent":["/**\n * Apollo Client hooks and utilities for DevPortal\n *\n * This file provides the GraphQL client setup and custom hooks for the Developer Portal.\n * It wraps the generated Apollo hooks with additional functionality like error handling,\n * loading states, and authentication context.\n */\n\nimport {\n ApolloClient,\n InMemoryCache,\n createHttpLink,\n from,\n split,\n} from \"@apollo/client/core\";\nimport { CombinedGraphQLErrors, ServerError } from \"@apollo/client/errors\";\nimport { setContext } from \"@apollo/client/link/context\";\nimport { onError } from \"@apollo/client/link/error\";\nimport {\n isAuthNetworkError,\n redirectToLogin,\n} from \"@burdenoff/fe-libs/shared/utils\";\n\nfunction hasSessionAuthErrors(\n errors: ReadonlyArray<{\n message?: string;\n extensions?: Record<string, unknown>;\n }> = [],\n): boolean {\n return errors.some((error) => {\n const code =\n typeof error.extensions?.code === \"string\" ? error.extensions.code : \"\";\n const errorCode =\n typeof error.extensions?.errorCode === \"string\"\n ? error.extensions.errorCode\n : \"\";\n const message = (error.message ?? \"\").toLowerCase();\n\n return (\n code === \"UNAUTHENTICATED\" ||\n errorCode === \"TOKEN_EXPIRED\" ||\n message.includes(\"token_expired\") ||\n message.includes(\"token expired\") ||\n message.includes(\"session expired\") ||\n message.includes(\"unauthorized\") ||\n message.includes(\"unauthenticated\") ||\n message.includes(\"authentication required\") ||\n message.includes(\"workspace context missing\")\n );\n });\n}\n\n// Re-export all generated hooks for direct use\nexport * from \"../../generated/global-operations\";\n\n// Vite environment variable declaration\ndeclare global {\n interface ImportMeta {\n readonly env: {\n readonly VITE_GRAPHQL_ENDPOINT?: string;\n readonly VITE_AUTH_GRAPHQL_ENDPOINT?: string;\n readonly VITE_DEV_ACTOR_ID?: string;\n readonly VITE_DEV_ACTOR_TYPE?: string;\n readonly DEV?: boolean;\n [key: string]: string | boolean | undefined;\n };\n }\n}\n\n// Development mode check\nconst isDevelopment =\n typeof import.meta !== \"undefined\" && import.meta.env?.DEV === true;\n\n// Default GraphQL endpoints - can be overridden via environment.\n// In standalone dev mode we route through same-origin Vite proxies to avoid CORS.\nconst DEFAULT_GRAPHQL_ENDPOINT =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_GRAPHQL_ENDPOINT) ||\n (isDevelopment ? \"/devportal-graphql\" : \"http://localhost:4015/graphql\");\n\nconst DEFAULT_AUTH_GRAPHQL_ENDPOINT =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_AUTH_GRAPHQL_ENDPOINT) ||\n (isDevelopment ? \"/auth-graphql\" : \"http://localhost:4011/graphql\");\n\nconst AUTH_OPERATION_NAMES = new Set([\n \"CurrentUserApps\",\n \"GetAuthApp\",\n \"AppsActingAsCurrentUser\",\n \"CreateAuthApp\",\n \"UpdateAuthApp\",\n \"DeactivateApp\",\n \"RotateAppSecret\",\n \"AuthenticateApp\",\n \"GenerateAppToken\",\n \"GenerateAppAsUserToken\",\n \"ExchangeToken\",\n \"CurrentUserDelegations\",\n \"CurrentUserGrantedDelegations\",\n \"GrantDelegation\",\n \"RevokeDelegation\",\n \"MyApiKeys\",\n \"GenerateAPIKey\",\n \"RevokeAPIKeyAuth\",\n \"RotateAPIKeyAuth\",\n \"AuthenticateAPIKey\",\n]);\n\n// Development actor ID - simulates gateway-injected headers\n// In production, the gateway adds these after JWT verification\nconst DEV_ACTOR_ID =\n (typeof import.meta !== \"undefined\" && import.meta.env?.VITE_DEV_ACTOR_ID) ||\n \"dev-user-001\";\n\nconst DEV_ACTOR_TYPE =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_DEV_ACTOR_TYPE) ||\n \"user\";\n\n// Create the HTTP links\nconst devportalHttpLink = createHttpLink({\n uri: DEFAULT_GRAPHQL_ENDPOINT,\n});\n\nconst authHttpLink = createHttpLink({\n uri: DEFAULT_AUTH_GRAPHQL_ENDPOINT,\n});\n\nconst httpLink = split(\n ({ operationName }) => {\n if (!operationName) {\n return false;\n }\n\n return AUTH_OPERATION_NAMES.has(operationName);\n },\n authHttpLink,\n devportalHttpLink,\n);\n\n// Auth link to add authentication headers\nconst authLink = setContext((_, { headers }) => {\n // Get auth token from storage or context\n const token =\n typeof window !== \"undefined\" ? localStorage.getItem(\"auth_token\") : null;\n\n // Build headers\n const authHeaders: Record<string, string> = {\n ...headers,\n };\n\n if (token) {\n authHeaders[\"authorization\"] = `Bearer ${token}`;\n }\n\n // In development mode, add actor headers to simulate gateway behavior\n // In production, the API Gateway adds these headers after JWT verification\n if (isDevelopment) {\n // Use actor ID from localStorage (set by dev tools) or fall back to env/default\n const actorId =\n (typeof window !== \"undefined\" && localStorage.getItem(\"dev_actor_id\")) ||\n DEV_ACTOR_ID;\n const actorType =\n (typeof window !== \"undefined\" &&\n localStorage.getItem(\"dev_actor_type\")) ||\n DEV_ACTOR_TYPE;\n\n authHeaders[\"x-actor-id\"] = actorId;\n authHeaders[\"x-actor-type\"] = actorType;\n }\n\n return { headers: authHeaders };\n});\n\nconst errorLink = onError(({ error }) => {\n if (!error) return;\n\n const graphQLErrors =\n \"errors\" in error && Array.isArray(error.errors) ? error.errors : [];\n\n if (hasSessionAuthErrors(graphQLErrors)) {\n redirectToLogin();\n return;\n }\n\n if (error instanceof Error && isAuthNetworkError(error)) {\n redirectToLogin();\n }\n});\n\n// Create the Apollo Client instance\n// NOTE: defaultOptions.errorPolicy is intentionally omitted. Apollo Client v4\n// guards it behind a DeclareDefaultOptions module augmentation that does not\n// resolve reliably in CI's frozen install, so it is left at the v4 default\n// (\"none\"). Per-operation errorPolicy: \"all\" can be set on individual hooks\n// where partial-data-on-error handling is required.\nexport const apolloClient = new ApolloClient({\n link: from([errorLink, authLink, httpLink]),\n cache: new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n // Pagination policies for connection types\n developerOrganizations: {\n keyArgs: [\"tier\", \"isVerified\", \"isCertified\", \"partnerTier\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n applications: {\n keyArgs: [\"status\", \"visibility\", \"developerId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgSales: {\n keyArgs: [\n \"organizationId\",\n \"applicationId\",\n \"status\",\n \"pricingModel\",\n \"isPaidOut\",\n ],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgPayouts: {\n keyArgs: [\"organizationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgMembers: {\n keyArgs: [\"organizationId\", \"role\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgInvitations: {\n keyArgs: [\"organizationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n webhooks: {\n keyArgs: [\"applicationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n webhookDeliveries: {\n keyArgs: [\"webhookId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n auditLogs: {\n keyArgs: [\"resource\", \"resourceId\", \"actorId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n applicationVersions: {\n // TODO(phase1-backend): Switch to ApplicationVersionConnection cursor pagination\n // once backend ships connection type. See stability tracker.\n keyArgs: [\"applicationId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n if (Array.isArray(incoming) && Array.isArray(existing)) {\n return [...existing, ...incoming];\n }\n return incoming;\n },\n },\n },\n },\n WebhookDelivery: {\n keyFields: [\"id\"],\n },\n ApplicationVersion: {\n keyFields: [\"id\"],\n },\n DeveloperOrganization: {\n keyFields: [\"id\"],\n },\n Application: {\n keyFields: [\"id\"],\n },\n DeveloperOrgMember: {\n keyFields: [\"id\"],\n },\n DeveloperOrgInvitation: {\n keyFields: [\"id\"],\n },\n Webhook: {\n keyFields: [\"id\"],\n },\n ApiKey: {\n keyFields: [\"id\"],\n },\n OAuthClient: {\n keyFields: [\"id\"],\n },\n },\n }),\n defaultOptions: {\n watchQuery: {\n fetchPolicy: \"cache-and-network\",\n },\n query: {\n fetchPolicy: \"cache-first\",\n },\n },\n});\n\n/**\n * Error handling utilities\n */\nexport interface GraphQLErrorInfo {\n message: string;\n code?: string;\n path?: readonly (string | number)[];\n}\n\n// Type for Apollo errors (can be CombinedGraphQLErrors, ServerError, or Error)\nexport type ApolloErrorLike = Error & {\n graphQLErrors?: readonly {\n message: string;\n extensions?: { code?: string };\n path?: readonly (string | number)[];\n }[];\n networkError?: Error | null;\n};\n\nexport function parseGraphQLError(error: ApolloErrorLike): GraphQLErrorInfo[] {\n if (error instanceof CombinedGraphQLErrors) {\n return error.errors.map((err) => ({\n message: err.message,\n code: err.extensions?.code as string | undefined,\n path: err.path,\n }));\n }\n\n if (error.graphQLErrors && error.graphQLErrors.length > 0) {\n return error.graphQLErrors.map((err) => ({\n message: err.message,\n code: err.extensions?.code as string | undefined,\n path: err.path,\n }));\n }\n\n if (error instanceof ServerError || error.networkError) {\n return [\n {\n message: \"Network error. Please check your connection and try again.\",\n code: \"NETWORK_ERROR\",\n },\n ];\n }\n\n return [\n {\n message: error.message || \"An unexpected error occurred\",\n code: \"UNKNOWN_ERROR\",\n },\n ];\n}\n\n/**\n * Get a user-friendly error message from an Apollo error\n */\nexport function getErrorMessage(error: ApolloErrorLike): string {\n const errors = parseGraphQLError(error);\n return errors.map((e) => e.message).join(\", \");\n}\n\n/**\n * Check if an error is an authentication error\n */\nexport function isAuthError(error: ApolloErrorLike): boolean {\n const errors = parseGraphQLError(error);\n return errors.some(\n (e) => e.code === \"UNAUTHENTICATED\" || e.code === \"FORBIDDEN\",\n );\n}\n\n/**\n * Check if an error is a validation error\n */\nexport function isValidationError(error: ApolloErrorLike): boolean {\n const errors = parseGraphQLError(error);\n return errors.some(\n (e) => e.code === \"BAD_USER_INPUT\" || e.code === \"VALIDATION_ERROR\",\n );\n}\n\n/**\n * Clear Apollo cache (useful for logout)\n */\nexport async function clearApolloCache(): Promise<void> {\n await apolloClient.clearStore();\n}\n\n/**\n * Reset Apollo store and refetch queries\n */\nexport async function resetApolloStore(): Promise<void> {\n await apolloClient.resetStore();\n}\n"],"mappings":";;;;;;;;AAuBA,SAAS,EACP,IAGK,EAAE,EACE;AACT,QAAO,EAAO,MAAM,MAAU;EAC5B,IAAM,IACJ,OAAO,EAAM,YAAY,QAAS,WAAW,EAAM,WAAW,OAAO,IACjE,IACJ,OAAO,EAAM,YAAY,aAAc,WACnC,EAAM,WAAW,YACjB,IACA,KAAW,EAAM,WAAW,IAAI,aAAa;AAEnD,SACE,MAAS,qBACT,MAAc,mBACd,EAAQ,SAAS,gBAAgB,IACjC,EAAQ,SAAS,gBAAgB,IACjC,EAAQ,SAAS,kBAAkB,IACnC,EAAQ,SAAS,eAAe,IAChC,EAAQ,SAAS,kBAAkB,IACnC,EAAQ,SAAS,0BAA0B,IAC3C,EAAQ,SAAS,4BAA4B;GAE/C;;AAqBJ,IAAM,IACkC,IAIlC,IAGH,IAAgB,uBAAuB,iCAEpC,IAGH,IAAgB,kBAAkB,iCAE/B,IAAuB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAII,IAEJ,gBAEI,IAGJ,QAGI,IAAoB,EAAe,EACvC,KAAK,GACN,CAAC,EAMI,IAAW,GACd,EAAE,uBACI,IAIE,EAAqB,IAAI,EAAc,GAHrC,IAPQ,EAAe,EAClC,KAAK,GACN,CAAC,EAWA,EACD,EAGK,IAAW,GAAY,GAAG,EAAE,iBAAc;CAE9C,IAAM,IACJ,OAAO,SAAW,MAAc,aAAa,QAAQ,aAAa,GAAG,MAGjE,IAAsC,EAC1C,GAAG,GACJ;AAQD,KANI,MACF,EAAY,gBAAmB,UAAU,MAKvC,GAAe;EAEjB,IAAM,IACH,OAAO,SAAW,OAAe,aAAa,QAAQ,eAAe,IACtE,GACI,IACH,OAAO,SAAW,OACjB,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AAM,CACzB,KAAK,MAAM,EAAE,QAAQ,CAAC,KAAK,KAAK;;AAMhD,SAAgB,EAAY,GAAiC;AAE3D,QADe,EAAkB,EAAM,CACzB,MACX,MAAM,EAAE,SAAS,qBAAqB,EAAE,SAAS,YACnD;;AAMH,SAAgB,EAAkB,GAAiC;AAEjE,QADe,EAAkB,EAAM,CACzB,MACX,MAAM,EAAE,SAAS,oBAAoB,EAAE,SAAS,mBAClD;;AAMH,eAAsB,IAAkC;AACtD,OAAM,EAAa,YAAY;;AAMjC,eAAsB,IAAkC;AACtD,OAAM,EAAa,YAAY"}
1
+ {"version":3,"file":"useGraphQL.js","names":[],"sources":["../../../src/devportal/hooks/useGraphQL.ts"],"sourcesContent":["/**\n * Apollo Client hooks and utilities for DevPortal\n *\n * This file provides the GraphQL client setup and custom hooks for the Developer Portal.\n * It wraps the generated Apollo hooks with additional functionality like error handling,\n * loading states, and authentication context.\n */\n\nimport {\n ApolloClient,\n InMemoryCache,\n createHttpLink,\n from,\n split,\n} from \"@apollo/client/core\";\nimport { CombinedGraphQLErrors, ServerError } from \"@apollo/client/errors\";\nimport { setContext } from \"@apollo/client/link/context\";\nimport { onError } from \"@apollo/client/link/error\";\nimport { GraphQLWsLink } from \"@apollo/client/link/subscriptions\";\nimport { getMainDefinition } from \"@apollo/client/utilities\";\nimport { createClient as createWsClient } from \"graphql-ws\";\nimport {\n isAuthNetworkError,\n redirectToLogin,\n} from \"@burdenoff/fe-libs/shared/utils\";\n\nfunction hasSessionAuthErrors(\n errors: ReadonlyArray<{\n message?: string;\n extensions?: Record<string, unknown>;\n }> = [],\n): boolean {\n return errors.some((error) => {\n const code =\n typeof error.extensions?.code === \"string\" ? error.extensions.code : \"\";\n const errorCode =\n typeof error.extensions?.errorCode === \"string\"\n ? error.extensions.errorCode\n : \"\";\n const message = (error.message ?? \"\").toLowerCase();\n\n return (\n code === \"UNAUTHENTICATED\" ||\n errorCode === \"TOKEN_EXPIRED\" ||\n message.includes(\"token_expired\") ||\n message.includes(\"token expired\") ||\n message.includes(\"session expired\") ||\n message.includes(\"unauthorized\") ||\n message.includes(\"unauthenticated\") ||\n message.includes(\"authentication required\") ||\n message.includes(\"workspace context missing\")\n );\n });\n}\n\n// Re-export all generated hooks for direct use\nexport * from \"../../generated/global-operations\";\n\n// Vite environment variable declaration\ndeclare global {\n interface ImportMeta {\n readonly env: {\n readonly VITE_GRAPHQL_ENDPOINT?: string;\n readonly VITE_AUTH_GRAPHQL_ENDPOINT?: string;\n readonly VITE_DEV_ACTOR_ID?: string;\n readonly VITE_DEV_ACTOR_TYPE?: string;\n readonly DEV?: boolean;\n [key: string]: string | boolean | undefined;\n };\n }\n}\n\n// Development mode check\nconst isDevelopment =\n typeof import.meta !== \"undefined\" && import.meta.env?.DEV === true;\n\n// Default GraphQL endpoints - can be overridden via environment.\n// In standalone dev mode we route through same-origin Vite proxies to avoid CORS.\nconst DEFAULT_GRAPHQL_ENDPOINT =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_GRAPHQL_ENDPOINT) ||\n (isDevelopment ? \"/devportal-graphql\" : \"http://localhost:4015/graphql\");\n\nconst DEFAULT_AUTH_GRAPHQL_ENDPOINT =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_AUTH_GRAPHQL_ENDPOINT) ||\n (isDevelopment ? \"/auth-graphql\" : \"http://localhost:4011/graphql\");\n\nconst AUTH_OPERATION_NAMES = new Set([\n \"CurrentUserApps\",\n \"GetAuthApp\",\n \"AppsActingAsCurrentUser\",\n \"CreateAuthApp\",\n \"UpdateAuthApp\",\n \"DeactivateApp\",\n \"RotateAppSecret\",\n \"AuthenticateApp\",\n \"GenerateAppToken\",\n \"GenerateAppAsUserToken\",\n \"ExchangeToken\",\n \"CurrentUserDelegations\",\n \"CurrentUserGrantedDelegations\",\n \"GrantDelegation\",\n \"RevokeDelegation\",\n \"MyApiKeys\",\n \"GenerateAPIKey\",\n \"RevokeAPIKeyAuth\",\n \"RotateAPIKeyAuth\",\n \"AuthenticateAPIKey\",\n]);\n\n// Development actor ID - simulates gateway-injected headers\n// In production, the gateway adds these after JWT verification\nconst DEV_ACTOR_ID =\n (typeof import.meta !== \"undefined\" && import.meta.env?.VITE_DEV_ACTOR_ID) ||\n \"dev-user-001\";\n\nconst DEV_ACTOR_TYPE =\n (typeof import.meta !== \"undefined\" &&\n import.meta.env?.VITE_DEV_ACTOR_TYPE) ||\n \"user\";\n\nfunction toWsUrl(httpUrl: string): string {\n return httpUrl.replace(/^https/, \"wss\").replace(/^http/, \"ws\");\n}\n\n// Create the HTTP links\nconst devportalHttpLink = createHttpLink({\n uri: DEFAULT_GRAPHQL_ENDPOINT,\n});\n\nconst authHttpLink = createHttpLink({\n uri: DEFAULT_AUTH_GRAPHQL_ENDPOINT,\n});\n\nconst httpLink = split(\n ({ operationName }) => {\n if (!operationName) {\n return false;\n }\n\n return AUTH_OPERATION_NAMES.has(operationName);\n },\n authHttpLink,\n devportalHttpLink,\n);\n\n// Auth link to add authentication headers\nconst authLink = setContext((_, { headers }) => {\n // Get auth token from storage or context\n const token =\n typeof window !== \"undefined\" ? localStorage.getItem(\"auth_token\") : null;\n\n // Build headers\n const authHeaders: Record<string, string> = {\n ...headers,\n };\n\n if (token) {\n authHeaders[\"authorization\"] = `Bearer ${token}`;\n }\n\n // In development mode, add actor headers to simulate gateway behavior\n // In production, the API Gateway adds these headers after JWT verification\n if (isDevelopment) {\n // Use actor ID from localStorage (set by dev tools) or fall back to env/default\n const actorId =\n (typeof window !== \"undefined\" && localStorage.getItem(\"dev_actor_id\")) ||\n DEV_ACTOR_ID;\n const actorType =\n (typeof window !== \"undefined\" &&\n localStorage.getItem(\"dev_actor_type\")) ||\n DEV_ACTOR_TYPE;\n\n authHeaders[\"x-actor-id\"] = actorId;\n authHeaders[\"x-actor-type\"] = actorType;\n }\n\n return { headers: authHeaders };\n});\n\nconst errorLink = onError(({ error }) => {\n if (!error) return;\n\n const graphQLErrors =\n \"errors\" in error && Array.isArray(error.errors) ? error.errors : [];\n\n if (hasSessionAuthErrors(graphQLErrors)) {\n redirectToLogin();\n return;\n }\n\n if (error instanceof Error && isAuthNetworkError(error)) {\n redirectToLogin();\n }\n});\n\nconst wsLink = new GraphQLWsLink(\n createWsClient({\n url: toWsUrl(DEFAULT_GRAPHQL_ENDPOINT),\n connectionParams: () => {\n // Grab the auth token from the auth link's context builder for WS handshake\n return { authorization: \"\" }; // token injected server-side from cookie/session\n },\n }),\n);\n\nconst splitLink = split(\n ({ query }) => {\n const definition = getMainDefinition(query);\n return (\n definition.kind === \"OperationDefinition\" &&\n definition.operation === \"subscription\"\n );\n },\n wsLink,\n from([errorLink, authLink, httpLink]),\n);\n\n// Create the Apollo Client instance\n// NOTE: defaultOptions.errorPolicy is intentionally omitted. Apollo Client v4\n// guards it behind a DeclareDefaultOptions module augmentation that does not\n// resolve reliably in CI's frozen install, so it is left at the v4 default\n// (\"none\"). Per-operation errorPolicy: \"all\" can be set on individual hooks\n// where partial-data-on-error handling is required.\nexport const apolloClient = new ApolloClient({\n link: splitLink,\n cache: new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n // Pagination policies for connection types\n developerOrganizations: {\n keyArgs: [\"tier\", \"isVerified\", \"isCertified\", \"partnerTier\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n applications: {\n keyArgs: [\"status\", \"visibility\", \"developerId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgSales: {\n keyArgs: [\n \"organizationId\",\n \"applicationId\",\n \"status\",\n \"pricingModel\",\n \"isPaidOut\",\n ],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgPayouts: {\n keyArgs: [\"organizationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) {\n return incoming;\n }\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgMembers: {\n keyArgs: [\"organizationId\", \"role\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n developerOrgInvitations: {\n keyArgs: [\"organizationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n webhooks: {\n keyArgs: [\"applicationId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n webhookDeliveries: {\n keyArgs: [\"webhookId\", \"status\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n auditLogs: {\n keyArgs: [\"resource\", \"resourceId\", \"actorId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n return {\n ...incoming,\n edges: [...(existing?.edges || []), ...incoming.edges],\n };\n },\n },\n applicationVersions: {\n // TODO(phase1-backend): Switch to ApplicationVersionConnection cursor pagination\n // once backend ships connection type. See stability tracker.\n keyArgs: [\"applicationId\"],\n merge(existing, incoming, { args }) {\n if (!args?.offset || args.offset === 0) return incoming;\n if (Array.isArray(incoming) && Array.isArray(existing)) {\n return [...existing, ...incoming];\n }\n return incoming;\n },\n },\n },\n },\n WebhookDelivery: {\n keyFields: [\"id\"],\n },\n ApplicationVersion: {\n keyFields: [\"id\"],\n },\n DeveloperOrganization: {\n keyFields: [\"id\"],\n },\n Application: {\n keyFields: [\"id\"],\n },\n DeveloperOrgMember: {\n keyFields: [\"id\"],\n },\n DeveloperOrgInvitation: {\n keyFields: [\"id\"],\n },\n Webhook: {\n keyFields: [\"id\"],\n },\n ApiKey: {\n keyFields: [\"id\"],\n },\n OAuthClient: {\n keyFields: [\"id\"],\n },\n },\n }),\n defaultOptions: {\n watchQuery: {\n fetchPolicy: \"cache-and-network\",\n },\n query: {\n fetchPolicy: \"cache-first\",\n },\n },\n});\n\n/**\n * Error handling utilities\n */\nexport interface GraphQLErrorInfo {\n message: string;\n code?: string;\n path?: readonly (string | number)[];\n}\n\n// Type for Apollo errors (can be CombinedGraphQLErrors, ServerError, or Error)\nexport type ApolloErrorLike = Error & {\n graphQLErrors?: readonly {\n message: string;\n extensions?: { code?: string };\n path?: readonly (string | number)[];\n }[];\n networkError?: Error | null;\n};\n\nexport function parseGraphQLError(error: ApolloErrorLike): GraphQLErrorInfo[] {\n if (error instanceof CombinedGraphQLErrors) {\n return error.errors.map((err) => ({\n message: err.message,\n code: err.extensions?.code as string | undefined,\n path: err.path,\n }));\n }\n\n if (error.graphQLErrors && error.graphQLErrors.length > 0) {\n return error.graphQLErrors.map((err) => ({\n message: err.message,\n code: err.extensions?.code as string | undefined,\n path: err.path,\n }));\n }\n\n if (error instanceof ServerError || error.networkError) {\n return [\n {\n message: \"Network error. Please check your connection and try again.\",\n code: \"NETWORK_ERROR\",\n },\n ];\n }\n\n return [\n {\n message: error.message || \"An unexpected error occurred\",\n code: \"UNKNOWN_ERROR\",\n },\n ];\n}\n\n/**\n * Get a user-friendly error message from an Apollo error\n */\nexport function getErrorMessage(error: ApolloErrorLike): string {\n const errors = parseGraphQLError(error);\n return errors.map((e) => e.message).join(\", \");\n}\n\n/**\n * Check if an error is an authentication error\n */\nexport function isAuthError(error: ApolloErrorLike): boolean {\n const errors = parseGraphQLError(error);\n return errors.some(\n (e) => e.code === \"UNAUTHENTICATED\" || e.code === \"FORBIDDEN\",\n );\n}\n\n/**\n * Check if an error is a validation error\n */\nexport function isValidationError(error: ApolloErrorLike): boolean {\n const errors = parseGraphQLError(error);\n return errors.some(\n (e) => e.code === \"BAD_USER_INPUT\" || e.code === \"VALIDATION_ERROR\",\n );\n}\n\n/**\n * Clear Apollo cache (useful for logout)\n */\nexport async function clearApolloCache(): Promise<void> {\n await apolloClient.clearStore();\n}\n\n/**\n * Reset Apollo store and refetch queries\n */\nexport async function resetApolloStore(): Promise<void> {\n await apolloClient.resetStore();\n}\n"],"mappings":";;;;;;;;;;;AA0BA,SAAS,EACP,IAGK,EAAE,EACE;AACT,QAAO,EAAO,MAAM,MAAU;EAC5B,IAAM,IACJ,OAAO,EAAM,YAAY,QAAS,WAAW,EAAM,WAAW,OAAO,IACjE,IACJ,OAAO,EAAM,YAAY,aAAc,WACnC,EAAM,WAAW,YACjB,IACA,KAAW,EAAM,WAAW,IAAI,aAAa;AAEnD,SACE,MAAS,qBACT,MAAc,mBACd,EAAQ,SAAS,gBAAgB,IACjC,EAAQ,SAAS,gBAAgB,IACjC,EAAQ,SAAS,kBAAkB,IACnC,EAAQ,SAAS,eAAe,IAChC,EAAQ,SAAS,kBAAkB,IACnC,EAAQ,SAAS,0BAA0B,IAC3C,EAAQ,SAAS,4BAA4B;GAE/C;;AAqBJ,IAAM,IACkC,IAIlC,IAGH,IAAgB,uBAAuB,iCAEpC,IAGH,IAAgB,kBAAkB,iCAE/B,IAAuB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,EAII,IAEJ,gBAEI,IAGJ;AAEF,SAAS,EAAQ,GAAyB;AACxC,QAAO,EAAQ,QAAQ,UAAU,MAAM,CAAC,QAAQ,SAAS,KAAK;;AAIhE,IAAM,IAAoB,EAAe,EACvC,KAAK,GACN,CAAC,EAMI,IAAW,GACd,EAAE,uBACI,IAIE,EAAqB,IAAI,EAAc,GAHrC,I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,YAAY,EACV,aAAa,qBACd;EACD,OAAO,EACL,aAAa,eACd;EACF;CACF,CAAC;AAqBF,SAAgB,EAAkB,GAA4C;AA0B5E,QAzBI,aAAiB,IACZ,EAAM,OAAO,KAAK,OAAS;EAChC,SAAS,EAAI;EACb,MAAM,EAAI,YAAY;EACtB,MAAM,EAAI;EACX,EAAE,GAGD,EAAM,iBAAiB,EAAM,cAAc,SAAS,IAC/C,EAAM,cAAc,KAAK,OAAS;EACvC,SAAS,EAAI;EACb,MAAM,EAAI,YAAY;EACtB,MAAM,EAAI;EACX,EAAE,GAGD,aAAiB,KAAe,EAAM,eACjC,CACL;EACE,SAAS;EACT,MAAM;EACP,CACF,GAGI,CACL;EACE,SAAS,EAAM,WAAW;EAC1B,MAAM;EACP,CACF;;AAMH,SAAgB,EAAgB,GAAgC;AAE9D,QADe,EAAkB,EAAM,CACzB,KAAK,MAAM,EAAE,QAAQ,CAAC,KAAK,KAAK;;AAMhD,SAAgB,EAAY,GAAiC;AAE3D,QADe,EAAkB,EAAM,CACzB,MACX,MAAM,EAAE,SAAS,qBAAqB,EAAE,SAAS,YACnD;;AAMH,SAAgB,EAAkB,GAAiC;AAEjE,QADe,EAAkB,EAAM,CACzB,MACX,MAAM,EAAE,SAAS,oBAAoB,EAAE,SAAS,mBAClD;;AAMH,eAAsB,IAAkC;AACtD,OAAM,EAAa,YAAY;;AAMjC,eAAsB,IAAkC;AACtD,OAAM,EAAa,YAAY"}
@@ -8,9 +8,11 @@ import { AlertTriangle as o, ArrowLeft as s, CheckCircle2 as c, Clock as l, Refr
8
8
  import { useNavigate as p, useParams as m } from "react-router-dom";
9
9
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
10
  import { graphqlFetch as _ } from "@burdenoff/fe-libs/shared/graphql";
11
+ import { useApolloClient as v } from "@apollo/client/react";
12
+ import { gql as y } from "@apollo/client/core";
11
13
  //#region src/devportal/pages/StoreSubmissionPage.tsx
12
- var v = "\n query DevportalAppForSubmission($id: ID!) {\n application(id: $id) {\n id\n name\n slug\n status\n reviewStatus\n iconUrl\n metadata\n }\n }\n", y = "\n mutation DevportalSubmitForReview($id: ID!, $notes: String) {\n submitApplicationForReview(id: $id, notes: $notes) {\n id\n status\n submittedAt\n metadata\n }\n }\n";
13
- function b(e) {
14
+ var b = "\n query DevportalAppForSubmission($id: ID!) {\n application(id: $id) {\n id\n name\n slug\n status\n reviewStatus\n iconUrl\n metadata\n }\n }\n", x = "\n mutation DevportalSubmitForReview($id: ID!, $notes: String) {\n submitApplicationForReview(id: $id, notes: $notes) {\n id\n status\n submittedAt\n metadata\n }\n }\n";
15
+ function S(e) {
14
16
  if (!e) return null;
15
17
  let t = e.metadata ?? {}, n = typeof t.storeProductId == "string" ? t.storeProductId : "", r = typeof t.storeSubmissionStatus == "string" ? t.storeSubmissionStatus : null;
16
18
  return {
@@ -23,7 +25,7 @@ function b(e) {
23
25
  rejectedReason: null
24
26
  };
25
27
  }
26
- var x = {
28
+ var C = {
27
29
  DRAFT: {
28
30
  i18nKey: "devportal.storeSubmission.status.draft",
29
31
  fallback: "Draft",
@@ -54,53 +56,73 @@ var x = {
54
56
  icon: o,
55
57
  tone: "text-text-tertiary"
56
58
  }
57
- }, S = () => {
58
- let { appId: o } = m(), f = p(), S = e(), C = r(), w = n(t.APP_SUBMIT), [T, E] = a(null), [D, O] = a(!0), [k, A] = a(null), [j, M] = a(!1), [N, P] = a(""), F = async () => {
59
+ }, w = () => {
60
+ let { appId: o } = m(), f = p(), w = e(), T = r(), E = n(t.APP_SUBMIT), [D, O] = a(null), [k, A] = a(!0), [j, M] = a(null), [N, P] = a(!1), [F, I] = a(""), L = v(), R = async () => {
59
61
  if (o) {
60
- O(!0), A(null);
62
+ A(!0), M(null);
61
63
  try {
62
64
  let e = await _({
63
65
  gateway: "global",
64
- query: v,
66
+ query: b,
65
67
  variables: { id: o }
66
68
  });
67
- if (e.errors?.length) throw Error(e.errors[0]?.message ?? C("devportal.storeSubmission.errors.loadFailed", "Failed to load application"));
68
- E(e.data?.application ?? null);
69
+ if (e.errors?.length) throw Error(e.errors[0]?.message ?? T("devportal.storeSubmission.errors.loadFailed", "Failed to load application"));
70
+ O(e.data?.application ?? null);
69
71
  } catch (e) {
70
- A(e instanceof Error ? e.message : C("devportal.storeSubmission.errors.loadFailed", "Failed to load application"));
72
+ M(e instanceof Error ? e.message : T("devportal.storeSubmission.errors.loadFailed", "Failed to load application"));
71
73
  } finally {
72
- O(!1);
74
+ A(!1);
73
75
  }
74
76
  }
75
77
  };
76
78
  i(() => {
77
- F();
78
- let e = () => {
79
- F();
80
- };
81
- return window.addEventListener("focus", e), () => window.removeEventListener("focus", e);
82
- }, [o]);
83
- let I = async () => {
79
+ R();
80
+ }, [o]), i(() => {
81
+ if (!o) return;
82
+ let e = L.subscribe({
83
+ query: y`
84
+ subscription ApplicationStoreStatusChanged($applicationId: ID!) {
85
+ applicationStoreStatusChanged(applicationId: $applicationId) {
86
+ applicationId
87
+ status
88
+ reviewNotes
89
+ rejectedReason
90
+ updatedAt
91
+ }
92
+ }
93
+ `,
94
+ variables: { applicationId: o }
95
+ }).subscribe({
96
+ next: () => {
97
+ R();
98
+ },
99
+ error: (e) => {
100
+ console.warn("[StoreSubmissionPage] subscription error:", e);
101
+ }
102
+ });
103
+ return () => e.unsubscribe();
104
+ }, [o, L]);
105
+ let z = async () => {
84
106
  if (o) {
85
- M(!0), A(null);
107
+ P(!0), M(null);
86
108
  try {
87
109
  let e = await _({
88
110
  gateway: "global",
89
- query: y,
111
+ query: x,
90
112
  variables: {
91
113
  id: o,
92
- notes: N || null
114
+ notes: F || null
93
115
  }
94
116
  });
95
- if (e.errors?.length) throw Error(e.errors[0]?.message ?? C("devportal.storeSubmission.errors.submitFailed", "Submission failed"));
96
- S.emit("devportal.app.submitted", { appId: o }), await F();
117
+ if (e.errors?.length) throw Error(e.errors[0]?.message ?? T("devportal.storeSubmission.errors.submitFailed", "Submission failed"));
118
+ w.emit("devportal.app.submitted", { appId: o }), await R();
97
119
  } catch (e) {
98
- A(e instanceof Error ? e.message : C("devportal.storeSubmission.errors.submitFailed", "Submission failed"));
120
+ M(e instanceof Error ? e.message : T("devportal.storeSubmission.errors.submitFailed", "Submission failed"));
99
121
  } finally {
100
- M(!1);
122
+ P(!1);
101
123
  }
102
124
  }
103
- }, L = b(T), R = L ? x[L.status] : x.UNKNOWN, z = R.icon;
125
+ }, B = S(D), V = B ? C[B.status] : C.UNKNOWN, H = V.icon;
104
126
  return /* @__PURE__ */ g("main", {
105
127
  className: "min-h-screen bg-surface-default",
106
128
  "aria-labelledby": "store-submission-heading",
@@ -117,7 +139,7 @@ var x = {
117
139
  children: [/* @__PURE__ */ h(s, {
118
140
  className: "h-4 w-4",
119
141
  "aria-hidden": "true"
120
- }), C("devportal.common.back", "Back")]
142
+ }), T("devportal.common.back", "Back")]
121
143
  }), /* @__PURE__ */ g("div", {
122
144
  className: "flex items-center gap-2",
123
145
  children: [/* @__PURE__ */ h(d, {
@@ -126,23 +148,23 @@ var x = {
126
148
  }), /* @__PURE__ */ h("h1", {
127
149
  id: "store-submission-heading",
128
150
  className: "text-xl font-semibold text-text-primary",
129
- children: C("devportal.storeSubmission.title", "Store submission")
151
+ children: T("devportal.storeSubmission.title", "Store submission")
130
152
  })]
131
153
  })]
132
154
  })
133
155
  })
134
156
  }), /* @__PURE__ */ g("div", {
135
157
  className: "mx-auto max-w-3xl px-6 py-6",
136
- children: [k && /* @__PURE__ */ h("div", {
158
+ children: [j && /* @__PURE__ */ h("div", {
137
159
  role: "alert",
138
160
  className: "mb-4 rounded-md border border-border-danger bg-surface-danger-muted px-4 py-3 text-sm text-text-danger",
139
- children: k
140
- }), D && !T ? /* @__PURE__ */ h("div", {
161
+ children: j
162
+ }), k && !D ? /* @__PURE__ */ h("div", {
141
163
  className: "py-16 text-center text-text-secondary",
142
164
  role: "status",
143
165
  "aria-live": "polite",
144
- children: C("devportal.storeSubmission.loading", "Loading application…")
145
- }) : T ? /* @__PURE__ */ g("div", {
166
+ children: T("devportal.storeSubmission.loading", "Loading application…")
167
+ }) : D ? /* @__PURE__ */ g("div", {
146
168
  className: "space-y-4",
147
169
  children: [
148
170
  /* @__PURE__ */ h("div", {
@@ -150,49 +172,49 @@ var x = {
150
172
  children: /* @__PURE__ */ g("div", {
151
173
  className: "flex items-center gap-3",
152
174
  children: [
153
- T.iconUrl ? /* @__PURE__ */ h("img", {
154
- src: T.iconUrl,
175
+ D.iconUrl ? /* @__PURE__ */ h("img", {
176
+ src: D.iconUrl,
155
177
  alt: "",
156
178
  className: "h-14 w-14 flex-shrink-0 rounded-md object-cover"
157
179
  }) : /* @__PURE__ */ h("div", {
158
180
  className: "flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-md bg-surface-muted text-text-secondary",
159
- children: T.name.slice(0, 2).toUpperCase()
181
+ children: D.name.slice(0, 2).toUpperCase()
160
182
  }),
161
183
  /* @__PURE__ */ g("div", {
162
184
  className: "min-w-0 flex-1",
163
185
  children: [/* @__PURE__ */ h("h2", {
164
186
  className: "text-lg font-semibold text-text-primary",
165
- children: T.name
187
+ children: D.name
166
188
  }), /* @__PURE__ */ h("p", {
167
189
  className: "font-mono text-xs text-text-tertiary",
168
- children: T.slug
190
+ children: D.slug
169
191
  })]
170
192
  }),
171
193
  /* @__PURE__ */ g("div", {
172
- className: `flex items-center gap-1.5 ${R.tone}`,
194
+ className: `flex items-center gap-1.5 ${V.tone}`,
173
195
  role: "status",
174
- children: [/* @__PURE__ */ h(z, {
196
+ children: [/* @__PURE__ */ h(H, {
175
197
  className: "h-5 w-5",
176
198
  "aria-hidden": "true"
177
199
  }), /* @__PURE__ */ h("span", {
178
200
  className: "text-sm font-medium",
179
- children: C(R.i18nKey, R.fallback)
201
+ children: T(V.i18nKey, V.fallback)
180
202
  })]
181
203
  })
182
204
  ]
183
205
  })
184
206
  }),
185
- L && L.status !== "UNKNOWN" && /* @__PURE__ */ g("div", {
207
+ B && B.status !== "UNKNOWN" && /* @__PURE__ */ g("div", {
186
208
  className: "rounded-lg border border-border-default bg-surface-raised p-4",
187
209
  children: [
188
210
  /* @__PURE__ */ h("h3", {
189
211
  className: "mb-3 text-sm font-semibold text-text-primary",
190
- children: C("devportal.storeSubmission.timeline", "Submission timeline")
212
+ children: T("devportal.storeSubmission.timeline", "Submission timeline")
191
213
  }),
192
214
  /* @__PURE__ */ g("ul", {
193
215
  className: "space-y-2 text-sm",
194
216
  children: [
195
- L.submittedAt && /* @__PURE__ */ g("li", {
217
+ B.submittedAt && /* @__PURE__ */ g("li", {
196
218
  className: "flex items-center gap-2",
197
219
  children: [
198
220
  /* @__PURE__ */ h(l, {
@@ -201,15 +223,15 @@ var x = {
201
223
  }),
202
224
  /* @__PURE__ */ h("span", {
203
225
  className: "text-text-secondary",
204
- children: C("devportal.storeSubmission.submitted", "Submitted:")
226
+ children: T("devportal.storeSubmission.submitted", "Submitted:")
205
227
  }),
206
228
  /* @__PURE__ */ h("span", {
207
229
  className: "text-text-primary",
208
- children: new Date(L.submittedAt).toLocaleString()
230
+ children: new Date(B.submittedAt).toLocaleString()
209
231
  })
210
232
  ]
211
233
  }),
212
- L.reviewedAt && /* @__PURE__ */ g("li", {
234
+ B.reviewedAt && /* @__PURE__ */ g("li", {
213
235
  className: "flex items-center gap-2",
214
236
  children: [
215
237
  /* @__PURE__ */ h(c, {
@@ -218,15 +240,15 @@ var x = {
218
240
  }),
219
241
  /* @__PURE__ */ h("span", {
220
242
  className: "text-text-secondary",
221
- children: C("devportal.storeSubmission.reviewed", "Reviewed:")
243
+ children: T("devportal.storeSubmission.reviewed", "Reviewed:")
222
244
  }),
223
245
  /* @__PURE__ */ h("span", {
224
246
  className: "text-text-primary",
225
- children: new Date(L.reviewedAt).toLocaleString()
247
+ children: new Date(B.reviewedAt).toLocaleString()
226
248
  })
227
249
  ]
228
250
  }),
229
- L.publishedAt && /* @__PURE__ */ g("li", {
251
+ B.publishedAt && /* @__PURE__ */ g("li", {
230
252
  className: "flex items-center gap-2",
231
253
  children: [
232
254
  /* @__PURE__ */ h(c, {
@@ -235,99 +257,99 @@ var x = {
235
257
  }),
236
258
  /* @__PURE__ */ h("span", {
237
259
  className: "text-text-secondary",
238
- children: C("devportal.storeSubmission.published", "Published:")
260
+ children: T("devportal.storeSubmission.published", "Published:")
239
261
  }),
240
262
  /* @__PURE__ */ h("span", {
241
263
  className: "text-text-primary",
242
- children: new Date(L.publishedAt).toLocaleString()
264
+ children: new Date(B.publishedAt).toLocaleString()
243
265
  })
244
266
  ]
245
267
  })
246
268
  ]
247
269
  }),
248
- L.reviewNotes && /* @__PURE__ */ g("div", {
270
+ B.reviewNotes && /* @__PURE__ */ g("div", {
249
271
  className: "mt-3 rounded-md bg-surface-muted p-3",
250
272
  children: [/* @__PURE__ */ h("p", {
251
273
  className: "text-xs font-medium text-text-secondary",
252
- children: C("devportal.storeSubmission.reviewerNotes", "Reviewer notes")
274
+ children: T("devportal.storeSubmission.reviewerNotes", "Reviewer notes")
253
275
  }), /* @__PURE__ */ h("p", {
254
276
  className: "mt-1 text-sm text-text-primary",
255
- children: L.reviewNotes
277
+ children: B.reviewNotes
256
278
  })]
257
279
  }),
258
- L.rejectedReason && /* @__PURE__ */ g("div", {
280
+ B.rejectedReason && /* @__PURE__ */ g("div", {
259
281
  className: "mt-3 rounded-md border border-border-danger bg-surface-danger-muted p-3",
260
282
  role: "alert",
261
283
  children: [/* @__PURE__ */ h("p", {
262
284
  className: "text-xs font-medium text-text-danger",
263
- children: C("devportal.storeSubmission.rejectionReason", "Rejection reason")
285
+ children: T("devportal.storeSubmission.rejectionReason", "Rejection reason")
264
286
  }), /* @__PURE__ */ h("p", {
265
287
  className: "mt-1 text-sm text-text-primary",
266
- children: L.rejectedReason
288
+ children: B.rejectedReason
267
289
  })]
268
290
  })
269
291
  ]
270
292
  }),
271
- (!L || L.status === "UNKNOWN" || L.status === "DRAFT" || L.status === "REJECTED") && /* @__PURE__ */ g("div", {
293
+ (!B || B.status === "UNKNOWN" || B.status === "DRAFT" || B.status === "REJECTED") && /* @__PURE__ */ g("div", {
272
294
  className: "rounded-lg border border-border-default bg-surface-raised p-4",
273
295
  children: [
274
296
  /* @__PURE__ */ h("h3", {
275
297
  className: "mb-2 text-sm font-semibold text-text-primary",
276
- children: L?.status === "REJECTED" ? C("devportal.storeSubmission.resubmitForReview", "Resubmit for review") : C("devportal.storeSubmission.submitForReview", "Submit for review")
298
+ children: B?.status === "REJECTED" ? T("devportal.storeSubmission.resubmitForReview", "Resubmit for review") : T("devportal.storeSubmission.submitForReview", "Submit for review")
277
299
  }),
278
300
  /* @__PURE__ */ h("p", {
279
301
  className: "mb-3 text-sm text-text-secondary",
280
- children: C("devportal.storeSubmission.help", "Your application will be sent to the store's review queue. Whether it's auto-published or requires admin approval depends on the target store's configuration.")
302
+ children: T("devportal.storeSubmission.help", "Your application will be sent to the store's review queue. Whether it's auto-published or requires admin approval depends on the target store's configuration.")
281
303
  }),
282
304
  /* @__PURE__ */ h("label", {
283
305
  className: "block",
284
306
  htmlFor: "store-submission-notes",
285
307
  children: /* @__PURE__ */ h("span", {
286
308
  className: "sr-only",
287
- children: C("devportal.storeSubmission.notesLabel", "Notes for the reviewer (optional)")
309
+ children: T("devportal.storeSubmission.notesLabel", "Notes for the reviewer (optional)")
288
310
  })
289
311
  }),
290
312
  /* @__PURE__ */ h("textarea", {
291
313
  id: "store-submission-notes",
292
- value: N,
293
- onChange: (e) => P(e.target.value),
314
+ value: F,
315
+ onChange: (e) => I(e.target.value),
294
316
  rows: 3,
295
- placeholder: C("devportal.storeSubmission.notesLabel", "Notes for the reviewer (optional)"),
317
+ placeholder: T("devportal.storeSubmission.notesLabel", "Notes for the reviewer (optional)"),
296
318
  className: "mb-3 w-full rounded-md border border-border-default bg-surface-default px-3 py-2 text-sm text-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
297
319
  }),
298
320
  /* @__PURE__ */ g("button", {
299
321
  type: "button",
300
- onClick: () => void I(),
301
- disabled: j || !w.allowed,
302
- "aria-disabled": j || !w.allowed,
303
- title: w.allowed ? void 0 : C("devportal.common.noPermission", "You do not have permission to perform this action"),
322
+ onClick: () => void z(),
323
+ disabled: N || !E.allowed,
324
+ "aria-disabled": N || !E.allowed,
325
+ title: E.allowed ? void 0 : T("devportal.common.noPermission", "You do not have permission to perform this action"),
304
326
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text hover:opacity-90 disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
305
- children: [j && /* @__PURE__ */ h(u, {
327
+ children: [N && /* @__PURE__ */ h(u, {
306
328
  className: "h-4 w-4 animate-spin",
307
329
  "aria-hidden": "true"
308
- }), L?.status === "REJECTED" ? C("devportal.storeSubmission.resubmit", "Resubmit") : C("devportal.storeSubmission.submitForReview", "Submit for review")]
330
+ }), B?.status === "REJECTED" ? T("devportal.storeSubmission.resubmit", "Resubmit") : T("devportal.storeSubmission.submitForReview", "Submit for review")]
309
331
  })
310
332
  ]
311
333
  }),
312
- L?.productId && /* @__PURE__ */ g("div", {
334
+ B?.productId && /* @__PURE__ */ g("div", {
313
335
  className: "rounded-lg border border-border-default bg-surface-raised p-4",
314
336
  children: [/* @__PURE__ */ h("p", {
315
337
  className: "text-xs font-medium text-text-secondary",
316
- children: C("devportal.storeSubmission.storeProductId", "Store product ID")
338
+ children: T("devportal.storeSubmission.storeProductId", "Store product ID")
317
339
  }), /* @__PURE__ */ h("code", {
318
340
  className: "mt-1 block break-all font-mono text-xs text-text-primary",
319
- children: L.productId
341
+ children: B.productId
320
342
  })]
321
343
  })
322
344
  ]
323
345
  }) : /* @__PURE__ */ h("div", {
324
346
  className: "py-16 text-center text-text-secondary",
325
- children: C("devportal.storeSubmission.notFound", "Application not found.")
347
+ children: T("devportal.storeSubmission.notFound", "Application not found.")
326
348
  })]
327
349
  })]
328
350
  });
329
351
  };
330
352
  //#endregion
331
- export { S as StoreSubmissionPage };
353
+ export { w as StoreSubmissionPage };
332
354
 
333
355
  //# sourceMappingURL=StoreSubmissionPage.js.map