@econneq/gql-auth 1.0.10 → 1.0.11
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/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -6
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -6,7 +6,11 @@ export default function getApolloClient(options?: {
|
|
|
6
6
|
protocol: string;
|
|
7
7
|
RootApi: string;
|
|
8
8
|
NoDomainRootApi: string;
|
|
9
|
-
Subdomains:
|
|
9
|
+
Subdomains: {
|
|
10
|
+
subdomain: string;
|
|
11
|
+
processId?: string;
|
|
12
|
+
widgetID?: string;
|
|
13
|
+
}[];
|
|
10
14
|
apiKey: string;
|
|
11
15
|
}): Promise<ApolloClient | null>;
|
|
12
16
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA2B,MAAM,gBAAgB,CAAC;AAGvE,wBAA8B,eAAe,CAC3C,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,CAAC,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA2B,MAAM,gBAAgB,CAAC;AAGvE,wBAA8B,eAAe,CAC3C,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,CAAC,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3E,MAAM,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA6C9B"}
|
package/dist/client.js
CHANGED
|
@@ -12,9 +12,7 @@ export default async function getApolloClient(options, domain, config) {
|
|
|
12
12
|
: null;
|
|
13
13
|
// 2. Multi-tenant URL Logic
|
|
14
14
|
// Fallback to NoDomainRootApi if no valid tenant is found
|
|
15
|
-
const baseUrl =
|
|
16
|
-
? `${protocol}api${tenant.subdomain}${RootApi}`
|
|
17
|
-
: `${protocol}${NoDomainRootApi}`;
|
|
15
|
+
const baseUrl = `${protocol + RootApi}`;
|
|
18
16
|
const uri = `${baseUrl}/graphql/`;
|
|
19
17
|
// 3. Header Logic
|
|
20
18
|
const csrfToken = options?.csrfToken || (!isServer ? Cookies.get("csrftoken") : "");
|
|
@@ -24,9 +22,9 @@ export default async function getApolloClient(options, domain, config) {
|
|
|
24
22
|
...(options?.cookie && { 'Cookie': options.cookie }),
|
|
25
23
|
...(csrfToken && { 'X-CSRFToken': csrfToken }),
|
|
26
24
|
...(tenant && {
|
|
27
|
-
'X-Tenant-ID': tenant.
|
|
28
|
-
'X-Process-ID': tenant
|
|
29
|
-
'X-Widget-ID': tenant
|
|
25
|
+
'X-Tenant-ID': tenant.subdomain,
|
|
26
|
+
'X-Process-ID': tenant?.processId || "",
|
|
27
|
+
'X-Widget-ID': tenant?.widgetID || "",
|
|
30
28
|
}),
|
|
31
29
|
'Referer': baseUrl,
|
|
32
30
|
};
|