@seedprotocol/eas 0.7.1 → 0.7.2-next.593.gd5bd4ea
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/api.d.ts +42 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/graphql/fragments/Attestation.d.ts.map +1 -1
- package/dist/graphql/gql/gql.d.ts +12 -2
- package/dist/graphql/gql/gql.d.ts.map +1 -1
- package/dist/graphql/gql/graphql.d.ts +35 -7
- package/dist/graphql/gql/graphql.d.ts.map +1 -1
- package/dist/index.js +511 -302
- package/dist/index.js.map +1 -1
- package/dist/node/QueryClient.d.ts +10 -0
- package/dist/node/QueryClient.d.ts.map +1 -1
- package/dist/node.js +38 -14
- package/dist/node.js.map +1 -1
- package/dist/queries.d.ts +12 -0
- package/dist/queries.d.ts.map +1 -1
- package/package.json +7 -1
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { IQueryClient } from '../QueryClient/IQueryClient.js';
|
|
2
2
|
import type { IQueryClientFactory } from '../QueryClient/IQueryClientFactory.js';
|
|
3
|
+
/**
|
|
4
|
+
* TanStack Query client for Node. Concurrent requests with the same key share one fetch.
|
|
5
|
+
*
|
|
6
|
+
* Results are not kept once a request settles (gcTime 0) unless the caller passes a `staleTime`,
|
|
7
|
+
* in which case they are kept and reused for that long: a server process sees many distinct keys
|
|
8
|
+
* (e.g. change checks keyed by time), and EAS data is otherwise always read fresh. No retries
|
|
9
|
+
* (TanStack's default for imperative queries), no structural sharing (nothing to share with), and
|
|
10
|
+
* no online detection (`networkMode: 'always'`).
|
|
11
|
+
*/
|
|
3
12
|
export declare class NodeQueryClient implements IQueryClientFactory {
|
|
13
|
+
private queryClient;
|
|
4
14
|
getQueryClient(): IQueryClient;
|
|
5
15
|
}
|
|
6
16
|
/** @deprecated Prefer NodeQueryClient */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClient.d.ts","sourceRoot":"","sources":["../../src/node/QueryClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueryClient.d.ts","sourceRoot":"","sources":["../../src/node/QueryClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAqB,YAAY,EAAE,MAAM,gCAAgC,CAAA;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAgBhF;;;;;;;;GAQG;AACH,qBAAa,eAAgB,YAAW,mBAAmB;IACzD,OAAO,CAAC,WAAW,CAA0B;IAE7C,cAAc,IAAI,YAAY;CA6B/B;AAED,yCAAyC;AACzC,eAAO,MAAM,WAAW,wBAAkB,CAAA"}
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { _ as e, g as t, r as n } from "./easEndpoint-BYyoBW_s.js";
|
|
2
2
|
import { GraphQLClient as r } from "graphql-request";
|
|
3
|
+
import { QueryClient as i } from "@tanstack/query-core";
|
|
3
4
|
//#region src/node/EasClient.ts
|
|
4
|
-
var
|
|
5
|
+
var a = class {
|
|
5
6
|
easClient;
|
|
6
7
|
getEasClient() {
|
|
7
8
|
let e = n();
|
|
@@ -10,26 +11,49 @@ var i = class {
|
|
|
10
11
|
client: new r(e)
|
|
11
12
|
}), this.easClient.client;
|
|
12
13
|
}
|
|
13
|
-
},
|
|
14
|
-
e.configure(new
|
|
14
|
+
}, o = a;
|
|
15
|
+
e.configure(new a()), new a();
|
|
15
16
|
//#endregion
|
|
16
17
|
//#region src/node/QueryClient.ts
|
|
17
|
-
var
|
|
18
|
+
var s = (e) => {
|
|
19
|
+
let t = "";
|
|
20
|
+
try {
|
|
21
|
+
t = n();
|
|
22
|
+
} catch {}
|
|
23
|
+
return [t, ...e];
|
|
24
|
+
}, c = class {
|
|
25
|
+
queryClient;
|
|
18
26
|
getQueryClient() {
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
if (this.queryClient) return this.queryClient;
|
|
28
|
+
let e = new i({ defaultOptions: { queries: {
|
|
29
|
+
gcTime: 0,
|
|
30
|
+
networkMode: "always",
|
|
31
|
+
structuralSharing: !1
|
|
32
|
+
} } });
|
|
33
|
+
return this.queryClient = {
|
|
34
|
+
fetchQuery: ({ queryKey: t, queryFn: n, networkMode: r, staleTime: i }) => e.query({
|
|
35
|
+
queryKey: s(t),
|
|
36
|
+
queryFn: n,
|
|
37
|
+
...r ? { networkMode: r === "onlineOnly" ? "online" : r } : {},
|
|
38
|
+
...i ? {
|
|
39
|
+
staleTime: i,
|
|
40
|
+
gcTime: i
|
|
41
|
+
} : {}
|
|
42
|
+
}),
|
|
43
|
+
getQueryData: (t) => e.getQueryData(s(t)),
|
|
44
|
+
removeQueries: async ({ queryKey: t }) => {
|
|
45
|
+
e.removeQueries({ queryKey: s(t) });
|
|
46
|
+
}
|
|
47
|
+
}, this.queryClient;
|
|
24
48
|
}
|
|
25
|
-
},
|
|
26
|
-
t.configure(new
|
|
49
|
+
}, l = c;
|
|
50
|
+
t.configure(new c()), new c();
|
|
27
51
|
//#endregion
|
|
28
52
|
//#region src/node/index.ts
|
|
29
|
-
function
|
|
30
|
-
e.configure(new
|
|
53
|
+
function u() {
|
|
54
|
+
e.configure(new a()), t.configure(new c());
|
|
31
55
|
}
|
|
32
56
|
//#endregion
|
|
33
|
-
export {
|
|
57
|
+
export { o as EasClient, a as NodeEasClient, c as NodeQueryClient, l as QueryClient, u as registerNodeEasPlatform };
|
|
34
58
|
|
|
35
59
|
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","names":["BaseEasClient","BaseQueryClient","getEasEndpoint","NodeEasClient","url","GraphQLClient","EasClient","NodeQueryClient","
|
|
1
|
+
{"version":3,"file":"node.js","names":["TanStackQueryClient","BaseEasClient","BaseQueryClient","getEasEndpoint","QueryClient$1","NodeEasClient","url","GraphQLClient","EasClient","scopeKey","endpoint","queryKey","NodeQueryClient","client","networkMode","staleTime","QueryClient","registerNodeEasPlatform"],"sources":["../src/node/EasClient.ts","../src/node/QueryClient.ts","../src/node/index.ts"],"sourcesContent":["import { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport type { IEasClient } from '../EasClient/IEasClient.js'\nimport { getEasEndpoint } from '../easEndpoint.js'\nimport { GraphQLClient } from 'graphql-request'\n\nexport class NodeEasClient implements IEasClient {\n private easClient: { url: string; client: GraphQLClient } | undefined\n\n /** Reads the endpoint per call so SDK / publish chain config applied after import takes effect. */\n getEasClient(): GraphQLClient {\n const url = getEasEndpoint()\n if (this.easClient?.url !== url) {\n this.easClient = { url, client: new GraphQLClient(url) }\n }\n return this.easClient.client\n }\n}\n\n/** @deprecated Prefer NodeEasClient */\nexport const EasClient = NodeEasClient\n\nBaseEasClient.configure(new NodeEasClient())\n\nconst _check: IEasClient = new NodeEasClient()\nvoid _check\n","import { QueryClient as TanStackQueryClient } from '@tanstack/query-core'\nimport { getEasEndpoint } from '../easEndpoint.js'\nimport { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\nimport type { FetchQueryOptions, IQueryClient } from '../QueryClient/IQueryClient.js'\nimport type { IQueryClientFactory } from '../QueryClient/IQueryClientFactory.js'\n\n/**\n * Keys are scoped to the EAS endpoint (the chain), so a process that switches chains never shares\n * a request or a result between them.\n */\nconst scopeKey = (queryKey: readonly unknown[]): unknown[] => {\n let endpoint = ''\n try {\n endpoint = getEasEndpoint()\n } catch {\n // Misconfigured chain: the request itself will fail.\n }\n return [endpoint, ...queryKey]\n}\n\n/**\n * TanStack Query client for Node. Concurrent requests with the same key share one fetch.\n *\n * Results are not kept once a request settles (gcTime 0) unless the caller passes a `staleTime`,\n * in which case they are kept and reused for that long: a server process sees many distinct keys\n * (e.g. change checks keyed by time), and EAS data is otherwise always read fresh. No retries\n * (TanStack's default for imperative queries), no structural sharing (nothing to share with), and\n * no online detection (`networkMode: 'always'`).\n */\nexport class NodeQueryClient implements IQueryClientFactory {\n private queryClient: IQueryClient | undefined\n\n getQueryClient(): IQueryClient {\n if (this.queryClient) return this.queryClient\n\n const client = new TanStackQueryClient({\n defaultOptions: {\n queries: {\n gcTime: 0,\n networkMode: 'always',\n structuralSharing: false,\n },\n },\n })\n\n this.queryClient = {\n fetchQuery: <T>({ queryKey, queryFn, networkMode, staleTime }: FetchQueryOptions<T>) =>\n client.query({\n queryKey: scopeKey(queryKey),\n queryFn,\n // IQueryClient's 'onlineOnly' is TanStack v5's 'online'.\n ...(networkMode ? { networkMode: networkMode === 'onlineOnly' ? 'online' : networkMode } : {}),\n ...(staleTime ? { staleTime, gcTime: staleTime } : {}),\n }) as Promise<T>,\n getQueryData: (queryKey) => client.getQueryData(scopeKey(queryKey)),\n removeQueries: async ({ queryKey }) => {\n client.removeQueries({ queryKey: scopeKey(queryKey) })\n },\n }\n return this.queryClient\n }\n}\n\n/** @deprecated Prefer NodeQueryClient */\nexport const QueryClient = NodeQueryClient\n\nBaseQueryClient.configure(new NodeQueryClient())\n\nconst _check: IQueryClientFactory = new NodeQueryClient()\nvoid _check\n","import { NodeEasClient } from './EasClient.js'\nimport { NodeQueryClient } from './QueryClient.js'\nimport { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\n\nexport { EasClient, NodeEasClient } from './EasClient.js'\nexport { QueryClient, NodeQueryClient } from './QueryClient.js'\n\n/** Register Node.js EAS + query client implementations. */\nexport function registerNodeEasPlatform(): void {\n BaseEasClient.configure(new NodeEasClient())\n BaseQueryClient.configure(new NodeQueryClient())\n}\n"],"mappings":";;;;AAKA,IAAaK,IAAb,MAAiD;CAC/C;CAGA,eAA8B;EAC5B,IAAMC,IAAMH,EAAe;EAI3B,OAHI,KAAK,WAAW,QAAQG,MAC1B,KAAK,YAAY;GAAE;GAAK,QAAQ,IAAIC,EAAcD,CAAG;EAAE,IAElD,KAAK,UAAU;CACxB;AACF,GAGaE,IAAYH;AAEzBJ,EAAc,UAAU,IAAII,EAAc,CAAC,GAEhB,IAAIA,EAAc;;;ACb7C,IAAMI,KAAY,MAA4C;CAC5D,IAAIC,IAAW;CACf,IAAI;EACF,IAAWP,EAAe;CAC5B,QAAQ,CAER;CACA,OAAO,CAACO,GAAU,GAAGC,CAAQ;AAC/B,GAWaC,IAAb,MAA4D;CAC1D;CAEA,iBAA+B;EAC7B,IAAI,KAAK,aAAa,OAAO,KAAK;EAElC,IAAMC,IAAS,IAAIb,EAAoB,EACrC,gBAAgB,EACd,SAAS;GACP,QAAQ;GACR,aAAa;GACb,mBAAmB;EACrB,EACF,EACF,CAAC;EAgBD,OAdA,KAAK,cAAc;GACjB,aAAgB,EAAE,aAAU,YAAS,gBAAa,mBAChDa,EAAO,MAAM;IACX,UAAUJ,EAASE,CAAQ;IAC3B;IAEA,GAAIG,IAAc,EAAE,aAAaA,MAAgB,eAAe,WAAWA,EAAY,IAAI,CAAC;IAC5F,GAAIC,IAAY;KAAE;KAAW,QAAQA;IAAU,IAAI,CAAC;GACtD,CAAC;GACH,eAAe,MAAaF,EAAO,aAAaJ,EAASE,CAAQ,CAAC;GAClE,eAAe,OAAO,EAAE,kBAAe;IACrC,EAAO,cAAc,EAAE,UAAUF,EAASE,CAAQ,EAAE,CAAC;GACvD;EACF,GACO,KAAK;CACd;AACF,GAGaK,IAAcJ;AAE3BV,EAAgB,UAAU,IAAIU,EAAgB,CAAC,GAEX,IAAIA,EAAgB;;;AC3DxD,SAAgBK,IAAgC;CAE9C,AADAhB,EAAc,UAAU,IAAII,EAAc,CAAC,GAC3CH,EAAgB,UAAU,IAAIU,EAAgB,CAAC;AACjD"}
|
package/dist/queries.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ export declare const GET_SCHEMA_BY_NAME: TypedDocumentNode<{
|
|
|
9
9
|
export declare const GET_SEEDS: TypedDocumentNode<{
|
|
10
10
|
itemSeeds: Attestation[];
|
|
11
11
|
}>;
|
|
12
|
+
/**
|
|
13
|
+
* GET_SEEDS without `schema { schemaNames }`, which makes the request several times slower on
|
|
14
|
+
* easscan. Callers that need seed schema names attach them from `schemaId`
|
|
15
|
+
* (see getSchemaNamesBySchemaUids).
|
|
16
|
+
*/
|
|
17
|
+
export declare const GET_SEEDS_LEAN: TypedDocumentNode<{
|
|
18
|
+
itemSeeds: Attestation[];
|
|
19
|
+
}>;
|
|
12
20
|
export declare const GET_SEED_IDS: TypedDocumentNode<{
|
|
13
21
|
itemSeedIds: Attestation[];
|
|
14
22
|
}>;
|
|
@@ -33,4 +41,8 @@ export declare const GET_IMAGE_SEEDS: TypedDocumentNode<{
|
|
|
33
41
|
export declare const GET_IMAGE_VERSIONS: TypedDocumentNode<{
|
|
34
42
|
imageVersions: Attestation[];
|
|
35
43
|
}>;
|
|
44
|
+
/** Just enough of each attestation to tell what changed: see getAttestationChangesSince. */
|
|
45
|
+
export declare const GET_ATTESTATION_CHANGES: TypedDocumentNode<{
|
|
46
|
+
changes: Array<Pick<Attestation, "id" | "refUID" | "timeCreated" | "revocationTime">>;
|
|
47
|
+
}>;
|
|
36
48
|
//# sourceMappingURL=queries.d.ts.map
|
package/dist/queries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEhF,eAAO,MAAM,WAAW;;GAUtB,CAAA;AAEF,eAAO,MAAM,kBAAkB,EAUzB,iBAAiB,CAAC;IAAE,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAAC,CAAA;AAEjD,eAAO,MAAM,SAAS,EAmBhB,iBAAiB,CAAC;IAAE,SAAS,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAAA;AAErD,eAAO,MAAM,YAAY,EAMnB,iBAAiB,CAAC;IAAE,WA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
|
3
|
+
"version": "0.7.2-next.593.gd5bd4ea",
|
|
4
4
|
"description": "EAS GraphQL read client and helpers for Seed Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
40
40
|
"@noble/hashes": "^1.8.0",
|
|
41
|
+
"@tanstack/query-core": "^5.104.1",
|
|
41
42
|
"debug": "^4.4.1",
|
|
42
43
|
"graphql": "^16.10.0",
|
|
43
44
|
"graphql-request": "^7.3.5"
|
|
@@ -51,6 +52,11 @@
|
|
|
51
52
|
},
|
|
52
53
|
"author": "Keith Axline <keith@journodao.xyz>",
|
|
53
54
|
"license": "MIT",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/JournoLabs/seed-protocol-sdk.git",
|
|
58
|
+
"directory": "packages/eas"
|
|
59
|
+
},
|
|
54
60
|
"publishConfig": {
|
|
55
61
|
"access": "public"
|
|
56
62
|
}
|