@show-karma/karma-gap-sdk 0.3.8 → 0.3.9

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.
@@ -1,132 +0,0 @@
1
- import { Hex, IAttestation, TSchemaName } from "core/types";
2
- import { Attestation } from "../Attestation";
3
- import { Community, Grant, MemberOf, Milestone, Project } from "../entities";
4
- import { Grantee } from "../types/attestations";
5
- import { AxiosGQL } from "./AxiosGQL";
6
- export declare abstract class Fetcher extends AxiosGQL {
7
- /**
8
- * Fetch a single attestation by its UID.
9
- * @param uid
10
- */
11
- abstract attestation<T = unknown>(uid: Hex): Promise<Attestation<T>>;
12
- /**
13
- * Fetch attestations of a schema.
14
- * @param schemaName
15
- * @param search if set, will search decodedDataJson by the value.
16
- * @returns
17
- */
18
- abstract attestations(schemaName: TSchemaName, search?: string): Promise<IAttestation[]>;
19
- /**
20
- * Fetch attestations of a schema.
21
- * @param schemaName
22
- * @param recipient
23
- * @returns
24
- */
25
- abstract attestationsOf(schemaName: TSchemaName, recipient: Hex): Promise<IAttestation[]>;
26
- /**
27
- * Fetch attestations of a schema for a specific recipient.
28
- * @param schemaName
29
- * @param recipient
30
- * @returns
31
- */
32
- abstract attestationsTo(schemaName: TSchemaName, recipient: Hex): Promise<IAttestation[]>;
33
- /**
34
- * Fetch all available communities with details and grantees uids.
35
- *
36
- * If search is defined, will try to find communities by the search string.
37
- * @param search
38
- * @returns
39
- */
40
- abstract communities(search?: string): Promise<Community[]>;
41
- /**
42
- * Fetch a set of communities by their ids.
43
- * @param uids
44
- * @returns
45
- */
46
- abstract communitiesByIds(uids: Hex[]): Promise<Community[]>;
47
- /**
48
- * Fetch a community by its name with details, grants and milestones.
49
- *
50
- * It is possible that the resulted community is not the one you are looking for.
51
- * @param name
52
- * @returns
53
- */
54
- abstract communityBySlug(slug: string): Promise<Community>;
55
- /**
56
- * Fetch a community by its id. This method will also return the
57
- * community details and projects.
58
- */
59
- abstract communityById(uid: Hex): Promise<Community>;
60
- /**
61
- * Fetch a project by its id.
62
- * @param uid
63
- * @returns
64
- */
65
- abstract projectById(uid: Hex): Promise<Project>;
66
- /**
67
- * Fetch a project by its slug.
68
- * @param slug
69
- * @returns
70
- */
71
- abstract projectBySlug(slug: string): Promise<Project>;
72
- /**
73
- * Fetch projects with details and members.
74
- * @param name if set, will search by the name.
75
- * @returns
76
- */
77
- abstract projects(name?: string): Promise<Project[]>;
78
- /**
79
- * Fetch projects with details and members.
80
- * @param grantee the public address of the grantee
81
- * @returns
82
- */
83
- abstract projectsOf(grantee: Hex): Promise<Project[]>;
84
- /**
85
- * Fetch Grantee with details and projects.
86
- * @param address
87
- * @param withProjects if true, will get grantee project details.
88
- * @returns
89
- */
90
- abstract grantee(address: Hex): Promise<Grantee>;
91
- /**
92
- * Fetch all Grantees with details.
93
- * @returns
94
- */
95
- abstract grantees(): Promise<Grantee[]>;
96
- /**
97
- * Fetches the grantes related to a grantee address (recipient).
98
- * @param grantee grantee address
99
- * @returns
100
- */
101
- abstract grantsOf(grantee: Hex, withCommunity?: boolean): Promise<Grant[]>;
102
- /**
103
- * Fetch grants for an array of projects with milestones.
104
- * @param projects
105
- * @returns
106
- */
107
- abstract grantsFor(projects: Project[], withCommunity?: boolean): Promise<Grant[]>;
108
- /**
109
- * Fetch a grants that belongs to a community.
110
- * @param uid community uid
111
- * @returns
112
- */
113
- abstract grantsByCommunity(uid: Hex): any;
114
- /**
115
- * Fetch all milestones related to an array of Grants.
116
- * @param grants
117
- * @returns
118
- */
119
- abstract milestonesOf(grants: Grant[]): Promise<Milestone[]>;
120
- /**
121
- * Bulk fetch members with details of an array of Projects.
122
- * @param projects
123
- * @returns
124
- */
125
- abstract membersOf(projects: Project[]): Promise<MemberOf[]>;
126
- /**
127
- * Check if a name is already in use.
128
- * @param slug
129
- * @returns
130
- */
131
- abstract slugExists(slug: string): Promise<boolean>;
132
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fetcher = void 0;
4
- const AxiosGQL_1 = require("./AxiosGQL");
5
- class Fetcher extends AxiosGQL_1.AxiosGQL {
6
- }
7
- exports.Fetcher = Fetcher;
@@ -1,160 +0,0 @@
1
- import { Attestation } from "../Attestation";
2
- import { Hex, IAttestation, TSchemaName } from "../../types";
3
- import { Grantee } from "../types/attestations";
4
- import { GapSchema } from "../GapSchema";
5
- import { EASClient } from "./EASClient";
6
- import { Grant, Milestone, Project, MemberOf } from "../entities";
7
- import { Community } from "../entities/Community";
8
- export declare class GAPFetcher extends EASClient {
9
- /**
10
- * Fetches all the schemas deployed by an owner
11
- * @param owner
12
- */
13
- schemas(owner: Hex): Promise<GapSchema[]>;
14
- /**
15
- * Fetch a single attestation by its UID.
16
- * @param uid
17
- */
18
- attestation<T = unknown>(uid: Hex): Promise<Attestation<T, GapSchema>>;
19
- /**
20
- * Fetch attestations of a schema.
21
- * @param schemaName
22
- * @param search if set, will search decodedDataJson by the value.
23
- * @returns
24
- */
25
- attestations(schemaName: TSchemaName, search?: string): Promise<IAttestation[]>;
26
- /**
27
- * Fetch attestations of a schema.
28
- * @param schemaName
29
- * @param recipient
30
- * @returns
31
- */
32
- attestationsOf(schemaName: TSchemaName, recipient: Hex): Promise<IAttestation[]>;
33
- /**
34
- * Fetch attestations of a schema for a specific recipient.
35
- * @param schemaName
36
- * @param recipient
37
- * @returns
38
- */
39
- attestationsTo(schemaName: TSchemaName, recipient: Hex): Promise<IAttestation[]>;
40
- /**
41
- * Fetch all dependent attestations of a parent schema.
42
- * @param parentSchema the schema name to get dependents of.
43
- * @param parentUid the parent uid to get dependents of.
44
- */
45
- dependentsOf(parentSchema: TSchemaName, parentUid: Hex): Promise<Attestation[]>;
46
- /**
47
- * Fetch all available communities with details and grantees uids.
48
- *
49
- * If search is defined, will try to find communities by the search string.
50
- * @param search
51
- * @returns
52
- */
53
- communities(search?: string): Promise<Community[]>;
54
- /**
55
- * Fetch a set of communities by their ids.
56
- * @param uids
57
- * @returns
58
- */
59
- communitiesByIds(uids: Hex[]): Promise<Community[]>;
60
- /**
61
- * Get details for a set of communities and returns the updated array.
62
- * @param communities
63
- * @returns
64
- */
65
- communitiesDetails(communities: Community[]): Promise<Community[]>;
66
- /**
67
- * Fetch a community by its name with details, grants and milestones.
68
- *
69
- * It is possible that the resulted community is not the one you are looking for.
70
- * @param name
71
- * @returns
72
- */
73
- communityBySlug(slug: string): Promise<Community>;
74
- /**
75
- * Fetch a community by its id. This method will also return the
76
- * community details and projects.
77
- */
78
- communityById(uid: Hex): Promise<Community>;
79
- /**
80
- * Fetch the details for a set of
81
- * projects with project grants,
82
- * members, milestones, and tags.
83
- * @param projects
84
- */
85
- projectsDetails(projects: Project[]): Promise<Project[]>;
86
- /**
87
- * Fetch a project by its id.
88
- * @param uid
89
- * @returns
90
- */
91
- projectById(uid: Hex): Promise<Project>;
92
- /**
93
- * Fetch a project by its id.
94
- * @param uid
95
- * @returns
96
- */
97
- projectBySlug(slug: string): Promise<Project>;
98
- /**
99
- * Check if a name is already in use.
100
- * @param slug
101
- * @returns
102
- */
103
- slugExists(slug: string): Promise<boolean>;
104
- /**
105
- * Fetch projects with details and members.
106
- * @param name if set, will search by the name.
107
- * @returns
108
- */
109
- projects(name?: string): Promise<Project[]>;
110
- /**
111
- * Fetch projects with details and members.
112
- * @param grantee the public address of the grantee
113
- * @returns
114
- */
115
- projectsOf(grantee: Hex): Promise<Project[]>;
116
- /**
117
- * Fetch Grantee with details and projects.
118
- * @param address
119
- * @param withProjects if true, will get grantee project details.
120
- * @returns
121
- */
122
- grantee(address: Hex): Promise<Grantee>;
123
- /**
124
- * Fetch all Grantees with details.
125
- * @returns
126
- */
127
- grantees(): Promise<Grantee[]>;
128
- /**
129
- * Fetches the grantes related to a grantee address (recipient).
130
- * @param grantee
131
- * @returns
132
- */
133
- grantsOf(grantee: Hex, withCommunity?: boolean): Promise<Grant[]>;
134
- grantsUpdates(grants: Grant[]): Promise<Grant[]>;
135
- grantsByCommunity(uid: Hex): Promise<Grant[]>;
136
- /**
137
- * Fetch grants for an array of projects with milestones.
138
- * @param projects
139
- * @returns
140
- */
141
- grantsFor(projects: Project[], withCommunity?: boolean): Promise<Grant[]>;
142
- /**
143
- * Fetch all milestones related to an array of Grants.
144
- * @param grants
145
- * @returns
146
- */
147
- milestonesOf(grants: Grant[]): Promise<Milestone[]>;
148
- /**
149
- * Bulk fetch members with details of an array of Projects.
150
- * @param projects
151
- * @returns
152
- */
153
- membersOf(projects: Project[]): Promise<MemberOf[]>;
154
- /**
155
- * Returns a string to be used to search by a value in `decodedDataJson`.
156
- * @param field
157
- * @param value
158
- */
159
- private getSearchFieldString;
160
- }