@codex-data/sdk 0.6.2 → 1.0.0-rc2
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/resources/generated_mutations/CreateApiTokens.graphql +9 -0
- package/dist/resources/generated_mutations/CreateWebhooks.graphql +80 -0
- package/dist/resources/generated_mutations/DeleteApiToken.graphql +3 -0
- package/{src/sdk/graphql → dist/resources/generated_mutations}/DeleteWebhooks.graphql +1 -1
- package/dist/resources/generated_queries/ApiToken.graphql +9 -0
- package/dist/resources/generated_queries/ApiTokens.graphql +9 -0
- package/dist/resources/generated_queries/Balances.graphql +12 -0
- package/dist/resources/generated_queries/ChartUrls.graphql +7 -0
- package/dist/resources/generated_queries/FilterExchanges.graphql +43 -0
- package/dist/resources/generated_queries/FilterNftCollections.graphql +569 -0
- package/dist/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
- package/dist/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
- package/dist/resources/generated_queries/FilterNftPools.graphql +124 -0
- package/dist/resources/generated_queries/FilterPairs.graphql +343 -0
- package/dist/resources/generated_queries/FilterTokens.graphql +282 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetBars.graphql +21 -9
- package/dist/resources/generated_queries/GetCommunityNotes.graphql +20 -0
- package/dist/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetDetailedPairStats.graphql +372 -373
- package/dist/resources/generated_queries/GetDetailedPairsStats.graphql +924 -0
- package/dist/resources/generated_queries/GetEventLabels.graphql +24 -0
- package/dist/resources/generated_queries/GetExchanges.graphql +12 -0
- package/dist/resources/generated_queries/GetLatestPairs.graphql +57 -0
- package/dist/resources/generated_queries/GetLatestTokens.graphql +39 -0
- package/dist/resources/generated_queries/GetNetworkStats.graphql +13 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworkStatus.graphql +2 -1
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetNetworks.graphql +1 -0
- package/dist/resources/generated_queries/GetNftAssets.graphql +59 -0
- package/dist/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
- package/dist/resources/generated_queries/GetNftContracts.graphql +39 -0
- package/dist/resources/generated_queries/GetNftEvents.graphql +54 -0
- package/dist/resources/generated_queries/GetNftPool.graphql +74 -0
- package/dist/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
- package/dist/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
- package/dist/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
- package/dist/resources/generated_queries/GetNftPoolStats.graphql +40 -0
- package/dist/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
- package/dist/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
- package/dist/resources/generated_queries/GetParallelAssets.graphql +50 -0
- package/dist/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
- package/dist/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
- package/dist/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
- package/dist/resources/generated_queries/GetPrimePools.graphql +62 -0
- package/dist/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/GetSymbol.graphql +7 -7
- package/dist/resources/generated_queries/GetTokenCount.graphql +3 -0
- package/dist/resources/generated_queries/GetTokenEvents.graphql +49 -0
- package/dist/resources/generated_queries/GetTokenEventsForMaker.graphql +49 -0
- package/dist/resources/generated_queries/GetTokenInfo.graphql +18 -0
- package/dist/resources/generated_queries/GetTokenPrices.graphql +9 -0
- package/dist/resources/generated_queries/GetTokensInfo.graphql +18 -0
- package/dist/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
- package/dist/resources/generated_queries/GetWebhooks.graphql +36 -0
- package/dist/resources/generated_queries/Holders.graphql +14 -0
- package/dist/resources/generated_queries/LiquidityLocks.graphql +26 -0
- package/dist/resources/generated_queries/LiquidityMetadata.graphql +17 -0
- package/dist/resources/generated_queries/ListFavoriteTokens.graphql +59 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/ListPairsForToken.graphql +79 -41
- package/dist/resources/generated_queries/ListPairsWithMetadataForToken.graphql +286 -0
- package/{src/sdk/graphql → dist/resources/generated_queries}/ListTopTokens.graphql +23 -16
- package/dist/resources/generated_queries/NftHolders.graphql +12 -0
- package/{src/sdk/graphql/OnPairMetadataUpdated.graphql → dist/resources/generated_queries/PairMetadata.graphql} +21 -3
- package/dist/resources/generated_queries/PrimeBalance.graphql +12 -0
- package/dist/resources/generated_queries/PrimeHolders.graphql +13 -0
- package/dist/resources/generated_queries/SearchNfts.graphql +35 -0
- package/dist/resources/generated_queries/Token.graphql +63 -0
- package/dist/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
- package/{src/sdk/graphql/GetSparklines.graphql → dist/resources/generated_queries/TokenSparklines.graphql} +2 -2
- package/dist/resources/generated_queries/Tokens.graphql +63 -0
- package/dist/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
- package/dist/resources/generated_queries/WalletNftCollections.graphql +10 -0
- package/dist/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnDetailedStatsUpdated.graphql +119 -111
- package/dist/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
- package/dist/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
- package/dist/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
- package/dist/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnNftAssetsCreated.graphql +30 -17
- package/dist/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
- package/dist/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
- package/dist/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
- package/{src/sdk/graphql → dist/resources/generated_subscriptions}/OnPriceUpdated.graphql +1 -1
- package/dist/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
- package/dist/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
- package/dist/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
- package/dist/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
- package/dist/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
- package/dist/resources/graphql.d.ts +175 -1
- package/dist/resources/graphql.d.ts.map +1 -1
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/graphql.schema.json +1901 -2
- package/dist/resources/graphql.ts +199 -1
- package/dist/resources/schema.graphql +230 -1
- package/dist/scripts/buildSdk.d.ts +2 -0
- package/dist/scripts/buildSdk.d.ts.map +1 -0
- package/dist/scripts/buildSdk.js +135 -0
- package/dist/scripts/buildSdk.js.map +1 -0
- package/dist/scripts/generateGraphql.d.ts +30 -0
- package/dist/scripts/generateGraphql.d.ts.map +1 -0
- package/dist/scripts/generateGraphql.js +179 -0
- package/dist/scripts/generateGraphql.js.map +1 -0
- package/dist/sdk/Mutation.d.ts +5 -8
- package/dist/sdk/Mutation.d.ts.map +1 -1
- package/dist/sdk/Mutation.js +3 -0
- package/dist/sdk/Mutation.js.map +1 -1
- package/dist/sdk/Query.d.ts +65 -13
- package/dist/sdk/Query.d.ts.map +1 -1
- package/dist/sdk/Query.js +65 -12
- package/dist/sdk/Query.js.map +1 -1
- package/dist/sdk/Subscribe.d.ts +18 -11
- package/dist/sdk/Subscribe.d.ts.map +1 -1
- package/dist/sdk/Subscribe.js +112 -9
- package/dist/sdk/Subscribe.js.map +1 -1
- package/dist/sdk/generated/gql.d.ts +646 -66
- package/dist/sdk/generated/gql.d.ts.map +1 -1
- package/dist/sdk/generated/gql.js +85 -22
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8422 -2087
- package/dist/sdk/generated/graphql.d.ts.map +1 -1
- package/dist/sdk/generated/graphql.js +88 -25
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/package.json +12 -4
- package/src/resources/generated_mutations/CreateApiTokens.graphql +9 -0
- package/src/resources/generated_mutations/CreateWebhooks.graphql +80 -0
- package/src/resources/generated_mutations/DeleteApiToken.graphql +3 -0
- package/src/resources/generated_mutations/DeleteWebhooks.graphql +5 -0
- package/src/resources/generated_queries/ApiToken.graphql +9 -0
- package/src/resources/generated_queries/ApiTokens.graphql +9 -0
- package/src/resources/generated_queries/Balances.graphql +12 -0
- package/src/resources/generated_queries/ChartUrls.graphql +7 -0
- package/src/resources/generated_queries/FilterExchanges.graphql +43 -0
- package/src/resources/generated_queries/FilterNftCollections.graphql +569 -0
- package/src/resources/generated_queries/FilterNftParallelAssets.graphql +60 -0
- package/src/resources/generated_queries/FilterNftPoolCollections.graphql +71 -0
- package/src/resources/generated_queries/FilterNftPools.graphql +124 -0
- package/src/resources/generated_queries/FilterPairs.graphql +343 -0
- package/src/resources/generated_queries/FilterTokens.graphql +282 -0
- package/src/resources/generated_queries/GetBars.graphql +44 -0
- package/src/resources/generated_queries/GetCommunityNotes.graphql +20 -0
- package/src/resources/generated_queries/GetDetailedNftStats.graphql +831 -0
- package/src/resources/generated_queries/GetDetailedPairStats.graphql +940 -0
- package/src/resources/generated_queries/GetDetailedPairsStats.graphql +924 -0
- package/src/resources/generated_queries/GetEventLabels.graphql +24 -0
- package/src/resources/generated_queries/GetExchanges.graphql +12 -0
- package/src/resources/generated_queries/GetLatestPairs.graphql +57 -0
- package/src/resources/generated_queries/GetLatestTokens.graphql +39 -0
- package/src/resources/generated_queries/GetNetworkStats.graphql +13 -0
- package/src/resources/generated_queries/GetNetworkStatus.graphql +8 -0
- package/src/resources/generated_queries/GetNetworks.graphql +7 -0
- package/src/resources/generated_queries/GetNftAssets.graphql +59 -0
- package/src/resources/generated_queries/GetNftCollectionMetadata.graphql +75 -0
- package/src/resources/generated_queries/GetNftContracts.graphql +39 -0
- package/src/resources/generated_queries/GetNftEvents.graphql +54 -0
- package/src/resources/generated_queries/GetNftPool.graphql +74 -0
- package/src/resources/generated_queries/GetNftPoolCollection.graphql +33 -0
- package/src/resources/generated_queries/GetNftPoolCollectionsByExchange.graphql +38 -0
- package/src/resources/generated_queries/GetNftPoolEvents.graphql +41 -0
- package/src/resources/generated_queries/GetNftPoolStats.graphql +40 -0
- package/src/resources/generated_queries/GetNftPoolsByCollectionAndExchange.graphql +89 -0
- package/src/resources/generated_queries/GetNftPoolsByOwner.graphql +89 -0
- package/src/resources/generated_queries/GetParallelAssets.graphql +50 -0
- package/src/resources/generated_queries/GetParallelCardChanges.graphql +57 -0
- package/src/resources/generated_queries/GetPrimePoolAssets.graphql +32 -0
- package/src/resources/generated_queries/GetPrimePoolEvents.graphql +38 -0
- package/src/resources/generated_queries/GetPrimePools.graphql +62 -0
- package/src/resources/generated_queries/GetSimulateTokenContractResults.graphql +128 -0
- package/src/resources/generated_queries/GetSymbol.graphql +11 -0
- package/src/resources/generated_queries/GetTokenCount.graphql +3 -0
- package/src/resources/generated_queries/GetTokenEvents.graphql +49 -0
- package/src/resources/generated_queries/GetTokenEventsForMaker.graphql +49 -0
- package/src/resources/generated_queries/GetTokenInfo.graphql +18 -0
- package/src/resources/generated_queries/GetTokenPrices.graphql +9 -0
- package/src/resources/generated_queries/GetTokensInfo.graphql +18 -0
- package/src/resources/generated_queries/GetUniV3Ticks.graphql +22 -0
- package/src/resources/generated_queries/GetWebhooks.graphql +36 -0
- package/src/resources/generated_queries/Holders.graphql +14 -0
- package/src/resources/generated_queries/LiquidityLocks.graphql +26 -0
- package/src/resources/generated_queries/LiquidityMetadata.graphql +17 -0
- package/src/resources/generated_queries/ListFavoriteTokens.graphql +59 -0
- package/src/resources/generated_queries/ListPairsForToken.graphql +143 -0
- package/src/resources/generated_queries/ListPairsWithMetadataForToken.graphql +286 -0
- package/src/resources/generated_queries/ListTopTokens.graphql +55 -0
- package/src/resources/generated_queries/NftHolders.graphql +12 -0
- package/src/resources/generated_queries/PairMetadata.graphql +73 -0
- package/src/resources/generated_queries/PrimeBalance.graphql +12 -0
- package/src/resources/generated_queries/PrimeHolders.graphql +13 -0
- package/src/resources/generated_queries/SearchNfts.graphql +35 -0
- package/src/resources/generated_queries/Token.graphql +63 -0
- package/src/resources/generated_queries/TokenLifecycleEvents.graphql +22 -0
- package/src/resources/generated_queries/TokenSparklines.graphql +10 -0
- package/src/resources/generated_queries/Tokens.graphql +63 -0
- package/src/resources/generated_queries/WalletNftCollectionAssets.graphql +11 -0
- package/src/resources/generated_queries/WalletNftCollections.graphql +10 -0
- package/src/resources/generated_subscriptions/OnBarsUpdated.graphql +513 -0
- package/src/resources/generated_subscriptions/OnDetailedStatsUpdated.graphql +332 -0
- package/src/resources/generated_subscriptions/OnEventLabelCreated.graphql +11 -0
- package/src/resources/generated_subscriptions/OnEventsCreated.graphql +46 -0
- package/src/resources/generated_subscriptions/OnLatestPairUpdated.graphql +42 -0
- package/src/resources/generated_subscriptions/OnLatestTokens.graphql +37 -0
- package/src/resources/generated_subscriptions/OnNftAssetsCreated.graphql +42 -0
- package/src/resources/generated_subscriptions/OnNftEventsCreated.graphql +36 -0
- package/src/resources/generated_subscriptions/OnNftPoolEventsCreated.graphql +37 -0
- package/src/resources/generated_subscriptions/OnPairMetadataUpdated.graphql +73 -0
- package/src/resources/generated_subscriptions/OnPriceUpdated.graphql +9 -0
- package/src/resources/generated_subscriptions/OnPricesUpdated.graphql +9 -0
- package/src/resources/generated_subscriptions/OnSimulateTokenContract.graphql +121 -0
- package/src/resources/generated_subscriptions/OnTokenEventsCreated.graphql +39 -0
- package/src/resources/generated_subscriptions/OnTokenLifecycleEventsCreated.graphql +18 -0
- package/src/resources/generated_subscriptions/OnUnconfirmedEventsCreated.graphql +32 -0
- package/src/resources/graphql.schema.json +1901 -2
- package/src/resources/graphql.ts +199 -1
- package/src/resources/schema.graphql +230 -1
- package/src/scripts/buildSdk.ts +173 -0
- package/src/scripts/generateGraphql.ts +236 -0
- package/src/sdk/Mutation.ts +13 -4
- package/src/sdk/Query.ts +254 -35
- package/src/sdk/Subscribe.ts +231 -42
- package/src/sdk/generated/gql.ts +359 -44
- package/src/sdk/generated/graphql.ts +928 -129
- package/dist/sdk/Query.test.d.ts +0 -2
- package/dist/sdk/Query.test.d.ts.map +0 -1
- package/dist/sdk/Query.test.js +0 -50
- package/dist/sdk/Query.test.js.map +0 -1
- package/src/sdk/Query.test.ts +0 -40
- package/src/sdk/graphql/CreateWebhooks.graphql +0 -464
- package/src/sdk/graphql/FilterExchanges.graphql +0 -23
- package/src/sdk/graphql/FilterPairs.graphql +0 -126
- package/src/sdk/graphql/FilterTokens.graphql +0 -131
- package/src/sdk/graphql/GetPrice.graphql +0 -9
- package/src/sdk/graphql/GetTokens.graphql +0 -14
- package/src/sdk/graphql/GetWebhooks.graphql +0 -120
- package/src/sdk/graphql/OnBarsUpdated.graphql +0 -68
- package/src/sdk/graphql/OnEventsCreated.graphql +0 -62
- package/src/sdk/graphql/OnNftEventsCreated.graphql +0 -83
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const fs_1 = __importDefault(require("fs"));
|
|
16
|
+
const camelCase_1 = __importDefault(require("lodash/camelCase"));
|
|
17
|
+
const path_1 = __importDefault(require("path"));
|
|
18
|
+
const GENERATED_SUBSCRIPTIONS_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_subscriptions");
|
|
19
|
+
const GENERATED_MUTATIONS_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_mutations");
|
|
20
|
+
const GENERATED_QUERIES_DIRECTORY = path_1.default.join(__dirname, "..", "resources", "generated_queries");
|
|
21
|
+
class Subscription {
|
|
22
|
+
constructor(subscriptionName) {
|
|
23
|
+
this.subscriptionName = subscriptionName;
|
|
24
|
+
}
|
|
25
|
+
pre() {
|
|
26
|
+
return `${this.subscriptionName}SubscriptionVariables, ${this.subscriptionName}Subscription`;
|
|
27
|
+
}
|
|
28
|
+
main() {
|
|
29
|
+
const graphqlString = fs_1.default.readFileSync(path_1.default.join(GENERATED_SUBSCRIPTIONS_DIRECTORY, this.subscriptionName + ".graphql"), "utf8");
|
|
30
|
+
return `${(0, camelCase_1.default)(this.subscriptionName)} = async (vars: ${this.subscriptionName}SubscriptionVariables, sink: Sink<ExecutionResult<${this.subscriptionName}Subscription>>) => this.sdk.subscribe(\`${graphqlString}\`, vars, sink);`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
class Mutation {
|
|
34
|
+
constructor(mutationName) {
|
|
35
|
+
this.mutationName = mutationName;
|
|
36
|
+
}
|
|
37
|
+
pre() {
|
|
38
|
+
return `${this.mutationName}Document,
|
|
39
|
+
${this.mutationName}MutationVariables`;
|
|
40
|
+
}
|
|
41
|
+
main() {
|
|
42
|
+
return `${(0, camelCase_1.default)(this.mutationName)} = async (vars: ${this.mutationName}MutationVariables) => this.sdk.mutation(${this.mutationName}Document, vars);`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class Query {
|
|
46
|
+
constructor(queryName) {
|
|
47
|
+
this.queryName = queryName;
|
|
48
|
+
}
|
|
49
|
+
pre() {
|
|
50
|
+
return `${this.queryName}Document,
|
|
51
|
+
${this.queryName}QueryVariables`;
|
|
52
|
+
}
|
|
53
|
+
main() {
|
|
54
|
+
return `${(0, camelCase_1.default)(this.queryName)} = async (vars: ${this.queryName}QueryVariables) => this.sdk.query(${this.queryName}Document, vars);`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class SDK {
|
|
58
|
+
constructor() {
|
|
59
|
+
this.queries = [];
|
|
60
|
+
this.mutations = [];
|
|
61
|
+
this.subscriptions = [];
|
|
62
|
+
this.initialize();
|
|
63
|
+
}
|
|
64
|
+
initialize() {
|
|
65
|
+
// crawl the generatedQueries and then create the typescript code for that query.
|
|
66
|
+
const queries = fs_1.default.readdirSync(GENERATED_QUERIES_DIRECTORY);
|
|
67
|
+
const mutations = fs_1.default.readdirSync(GENERATED_MUTATIONS_DIRECTORY);
|
|
68
|
+
const subscriptions = fs_1.default.readdirSync(GENERATED_SUBSCRIPTIONS_DIRECTORY);
|
|
69
|
+
for (const file of queries) {
|
|
70
|
+
this.queries.push(new Query(path_1.default.basename(file, ".graphql")));
|
|
71
|
+
}
|
|
72
|
+
for (const file of mutations) {
|
|
73
|
+
this.mutations.push(new Mutation(path_1.default.basename(file, ".graphql")));
|
|
74
|
+
}
|
|
75
|
+
for (const file of subscriptions) {
|
|
76
|
+
this.subscriptions.push(new Subscription(path_1.default.basename(file, ".graphql")));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
printSubscriptions() {
|
|
80
|
+
return `
|
|
81
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
82
|
+
import {
|
|
83
|
+
${this.subscriptions.map((q) => " " + q.pre()).join(",\n")}
|
|
84
|
+
} from "./generated/graphql";
|
|
85
|
+
import { Codex } from "./index";
|
|
86
|
+
import { ExecutionResult, Sink } from "graphql-ws";
|
|
87
|
+
|
|
88
|
+
export class Subscribe {
|
|
89
|
+
constructor(private sdk: Codex) {}
|
|
90
|
+
${this.subscriptions.map((q) => q.main()).join("\n")}
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
printMutations() {
|
|
95
|
+
return `
|
|
96
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
97
|
+
import {
|
|
98
|
+
${this.mutations.map((q) => " " + q.pre()).join(",\n")}
|
|
99
|
+
} from "./generated/graphql";
|
|
100
|
+
import { Codex } from "./index";
|
|
101
|
+
|
|
102
|
+
export class Mutation {
|
|
103
|
+
constructor(private sdk: Codex) {}
|
|
104
|
+
${this.mutations.map((q) => q.main()).join("\n")}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
printQueries() {
|
|
109
|
+
return `
|
|
110
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
111
|
+
import {
|
|
112
|
+
${this.queries.map((q) => " " + q.pre()).join(",\n")}
|
|
113
|
+
} from "./generated/graphql";
|
|
114
|
+
import { Codex } from "./index";
|
|
115
|
+
|
|
116
|
+
export class Query {
|
|
117
|
+
constructor(private sdk: Codex) {}
|
|
118
|
+
${this.queries.map((q) => q.main()).join("\n")}
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
output() {
|
|
123
|
+
fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Subscribe.ts"), this.printSubscriptions(), "utf8");
|
|
124
|
+
fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Mutation.ts"), this.printMutations(), "utf8");
|
|
125
|
+
fs_1.default.writeFileSync(path_1.default.join(__dirname, "..", "sdk", "Query.ts"), this.printQueries(), "utf8");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function run() {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const sdk = new SDK();
|
|
131
|
+
sdk.output();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
run().then(() => process.exit());
|
|
135
|
+
//# sourceMappingURL=buildSdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSdk.js","sourceRoot":"","sources":["../../src/scripts/buildSdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,iEAAyC;AACzC,gDAAwB;AAExB,MAAM,iCAAiC,GAAG,cAAI,CAAC,IAAI,CACjD,SAAS,EACT,IAAI,EACJ,WAAW,EACX,yBAAyB,CAC1B,CAAC;AACF,MAAM,6BAA6B,GAAG,cAAI,CAAC,IAAI,CAC7C,SAAS,EACT,IAAI,EACJ,WAAW,EACX,qBAAqB,CACtB,CAAC;AACF,MAAM,2BAA2B,GAAG,cAAI,CAAC,IAAI,CAC3C,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,CACpB,CAAC;AAEF,MAAM,YAAY;IAChB,YAAoB,gBAAwB;QAAxB,qBAAgB,GAAhB,gBAAgB,CAAQ;IAAG,CAAC;IAChD,GAAG;QACD,OAAO,GAAG,IAAI,CAAC,gBAAgB,0BAA0B,IAAI,CAAC,gBAAgB,cAAc,CAAC;IAC/F,CAAC;IACD,IAAI;QACF,MAAM,aAAa,GAAG,YAAE,CAAC,YAAY,CACnC,cAAI,CAAC,IAAI,CACP,iCAAiC,EACjC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CACnC,EACD,MAAM,CACP,CAAC;QACF,OAAO,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,gBAAgB,CAAC,mBACxC,IAAI,CAAC,gBACP,qDACE,IAAI,CAAC,gBACP,2CAA2C,aAAa,kBAAkB,CAAC;IAC7E,CAAC;CACF;AAED,MAAM,QAAQ;IACZ,YAAoB,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;IAAG,CAAC;IAC5C,GAAG;QACD,OAAO,GAAG,IAAI,CAAC,YAAY;IAC3B,IAAI,CAAC,YAAY,mBAAmB,CAAC;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AAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,EACjD,IAAI,CAAC,kBAAkB,EAAE,EACzB,MAAM,CACP,CAAC;QACF,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,EAChD,IAAI,CAAC,cAAc,EAAE,EACrB,MAAM,CACP,CAAC;QACF,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,EAC7C,IAAI,CAAC,YAAY,EAAE,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAED,SAAe,GAAG;;QAChB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,GAAG,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;CAAA;AAED,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import VariableOptions from "gql-query-builder/build/VariableOptions";
|
|
2
|
+
type SchemaTypeDefinition = {
|
|
3
|
+
kind: "NON_NULL" | "SCALAR" | "LIST" | "OBJECT" | "INPUT_OBJECT" | "ENUM" | "UNION" | undefined | null;
|
|
4
|
+
name?: string | null;
|
|
5
|
+
ofType?: SchemaTypeDefinition | null;
|
|
6
|
+
isDeprecated?: boolean | null;
|
|
7
|
+
};
|
|
8
|
+
type SchemaType = {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
type: SchemaTypeDefinition;
|
|
12
|
+
isDeprecated?: boolean | null;
|
|
13
|
+
fields?: SchemaType[];
|
|
14
|
+
};
|
|
15
|
+
type Fields = Array<string | {
|
|
16
|
+
[key: string]: Fields;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const getLeafType: (type: SchemaTypeDefinition, allTypes: SchemaType[], result: Fields, currentName: string, level?: number) => Fields;
|
|
19
|
+
export declare const getLeafArgs: (type: SchemaTypeDefinition, result: VariableOptions) => VariableOptions;
|
|
20
|
+
export declare function parseVariables(args: SchemaType[]): {
|
|
21
|
+
type?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
value: any;
|
|
24
|
+
list?: boolean | [boolean] | undefined;
|
|
25
|
+
required?: boolean | undefined;
|
|
26
|
+
} | {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=generateGraphql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateGraphql.d.ts","sourceRoot":"","sources":["../../src/scripts/generateGraphql.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAItE,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EACA,UAAU,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,cAAc,GACd,MAAM,GACN,OAAO,GACP,SAAS,GACT,IAAI,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC;AAMxD,eAAO,MAAM,WAAW,SAChB,oBAAoB,YAChB,UAAU,EAAE,+BAET,MAAM,2BAmCpB,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,oBAAoB,UAClB,eAAe,KACtB,eA2BF,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE;;;;;;;;EAWhD"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.parseVariables = exports.getLeafArgs = exports.getLeafType = void 0;
|
|
39
|
+
const fs_1 = __importDefault(require("fs"));
|
|
40
|
+
const gql = __importStar(require("gql-query-builder"));
|
|
41
|
+
const mkdirp_1 = require("mkdirp");
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
function capitalize(str) {
|
|
44
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
45
|
+
}
|
|
46
|
+
const getLeafType = (type, allTypes, result, currentName, level = 0) => {
|
|
47
|
+
var _a;
|
|
48
|
+
if (level > 8 || !(type === null || type === void 0 ? void 0 : type.kind) || type.kind === "UNION" || type.isDeprecated)
|
|
49
|
+
return result;
|
|
50
|
+
// If it's a scalar, return the name
|
|
51
|
+
if (type.kind === "SCALAR" || type.kind === "ENUM")
|
|
52
|
+
return [...result, currentName];
|
|
53
|
+
// If it's an object resolve it.
|
|
54
|
+
if (type.kind === "OBJECT") {
|
|
55
|
+
// For each of the fields of the subtype, resolve them
|
|
56
|
+
const subType = allTypes.find((t) => t.name === type.name);
|
|
57
|
+
const subTypeLeaves = ((_a = subType === null || subType === void 0 ? void 0 : subType.fields) !== null && _a !== void 0 ? _a : [])
|
|
58
|
+
.filter((t) => !t.isDeprecated)
|
|
59
|
+
.map((f) => (0, exports.getLeafType)(f.type, allTypes, [], f.name, level + 1))
|
|
60
|
+
.flat();
|
|
61
|
+
return [
|
|
62
|
+
...result,
|
|
63
|
+
...(level === 0 ? subTypeLeaves : [{ [currentName]: subTypeLeaves }]),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
// If it's a list, resolve the first object type
|
|
67
|
+
if (type.kind === "LIST")
|
|
68
|
+
return (0, exports.getLeafType)(type.ofType, allTypes, [...result], currentName, level);
|
|
69
|
+
// If it's required, resolve the first object type
|
|
70
|
+
if (type.kind === "NON_NULL")
|
|
71
|
+
return (0, exports.getLeafType)(type.ofType, allTypes, [...result], currentName, level);
|
|
72
|
+
throw new Error(`Unknown type ${type.name} ${type.kind}`);
|
|
73
|
+
};
|
|
74
|
+
exports.getLeafType = getLeafType;
|
|
75
|
+
const getLeafArgs = (type, result) => {
|
|
76
|
+
var _a;
|
|
77
|
+
if (type.kind === "NON_NULL" &&
|
|
78
|
+
["INPUT_OBJECT", "SCALAR", "OBJECT", "ENUM"].includes((_a = type.ofType) === null || _a === void 0 ? void 0 : _a.kind))
|
|
79
|
+
return Object.assign(Object.assign({}, result), { type: `${type.ofType.name}!` });
|
|
80
|
+
// If it's a scalar, return the name
|
|
81
|
+
if (type.kind === "SCALAR" ||
|
|
82
|
+
type.kind === "OBJECT" ||
|
|
83
|
+
type.kind === "ENUM" ||
|
|
84
|
+
type.kind === "INPUT_OBJECT")
|
|
85
|
+
return Object.assign(Object.assign({}, result), { type: type.name, value: null });
|
|
86
|
+
// If it's a list, resolve the first object type
|
|
87
|
+
if (type.kind === "LIST")
|
|
88
|
+
return (0, exports.getLeafArgs)(type.ofType, Object.assign(Object.assign({}, result), { list: true }));
|
|
89
|
+
// If it's required, resolve the first object type
|
|
90
|
+
if (type.kind === "NON_NULL")
|
|
91
|
+
return (0, exports.getLeafArgs)(type.ofType, Object.assign(Object.assign({}, result), { required: true }));
|
|
92
|
+
throw new Error(`Unknown type ${type.name} ${type.kind}`);
|
|
93
|
+
};
|
|
94
|
+
exports.getLeafArgs = getLeafArgs;
|
|
95
|
+
function parseVariables(args) {
|
|
96
|
+
const parsedVariables = args.reduce((acc, arg) => {
|
|
97
|
+
return Object.assign(Object.assign({}, acc), { [arg.name]: (0, exports.getLeafArgs)(arg.type, {}) });
|
|
98
|
+
}, {});
|
|
99
|
+
return parsedVariables;
|
|
100
|
+
}
|
|
101
|
+
exports.parseVariables = parseVariables;
|
|
102
|
+
/**
|
|
103
|
+
* Runs a query against the currently published graphql schema,
|
|
104
|
+
* and generates a query ts file for query.
|
|
105
|
+
*/
|
|
106
|
+
function run() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
console.log("Generating...");
|
|
109
|
+
// Fetch schema from remote
|
|
110
|
+
const res = yield fetch(`https://graph.codex.io/schema/latest.json`, {
|
|
111
|
+
method: "GET",
|
|
112
|
+
});
|
|
113
|
+
const schemaJson = yield res.json();
|
|
114
|
+
const types = schemaJson.__schema.types;
|
|
115
|
+
const mutationType = types.find((type) => type.name === "Mutation");
|
|
116
|
+
const queryType = types.find((type) => type.name === "Query");
|
|
117
|
+
const subscriptionType = types.find((type) => type.name === "Subscription");
|
|
118
|
+
for (const field of mutationType.fields) {
|
|
119
|
+
const args = field.args;
|
|
120
|
+
const parsedVariables = parseVariables(args);
|
|
121
|
+
const parsedFields = (0, exports.getLeafType)(field.type, types, [], "").filter(Boolean);
|
|
122
|
+
const mutationBuilderObject = gql.mutation({
|
|
123
|
+
operation: field.name,
|
|
124
|
+
variables: Object.keys(parsedVariables).length
|
|
125
|
+
? parsedVariables
|
|
126
|
+
: undefined,
|
|
127
|
+
fields: parsedFields.length ? parsedFields : undefined,
|
|
128
|
+
});
|
|
129
|
+
console.log(`Writing mutation: ${field.name}.graphql`);
|
|
130
|
+
const mutationsFolderPath = path_1.default.join(__dirname, "..", "resources", "generated_mutations");
|
|
131
|
+
yield (0, mkdirp_1.mkdirp)(mutationsFolderPath);
|
|
132
|
+
fs_1.default.writeFileSync(path_1.default.join(mutationsFolderPath, `${capitalize(field.name)}.graphql`), `mutation ${capitalize(field.name)}${mutationBuilderObject.query
|
|
133
|
+
.toString()
|
|
134
|
+
.slice("mutation ".length)}`);
|
|
135
|
+
}
|
|
136
|
+
for (const field of subscriptionType.fields) {
|
|
137
|
+
const args = field.args;
|
|
138
|
+
const parsedVariables = parseVariables(args);
|
|
139
|
+
const parsedFields = (0, exports.getLeafType)(field.type, types, [], "").filter(Boolean);
|
|
140
|
+
const subscriptionBuilderObject = gql.subscription({
|
|
141
|
+
operation: field.name,
|
|
142
|
+
variables: Object.keys(parsedVariables).length
|
|
143
|
+
? parsedVariables
|
|
144
|
+
: undefined,
|
|
145
|
+
fields: parsedFields.length ? parsedFields : undefined,
|
|
146
|
+
});
|
|
147
|
+
console.log(`Writing subscription: ${field.name}.graphql`);
|
|
148
|
+
const subscriptionsFolderPath = path_1.default.join(__dirname, "..", "resources", "generated_subscriptions");
|
|
149
|
+
yield (0, mkdirp_1.mkdirp)(subscriptionsFolderPath);
|
|
150
|
+
fs_1.default.writeFileSync(path_1.default.join(subscriptionsFolderPath, `${capitalize(field.name)}.graphql`), `subscription ${capitalize(field.name)}${subscriptionBuilderObject.query
|
|
151
|
+
.toString()
|
|
152
|
+
.slice("subscription ".length)}`);
|
|
153
|
+
}
|
|
154
|
+
for (const field of queryType.fields) {
|
|
155
|
+
if (field.isDeprecated) {
|
|
156
|
+
console.log("Skipping deprecated field", field.name);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const args = field.args;
|
|
160
|
+
const parsedVariables = parseVariables(args);
|
|
161
|
+
const parsedFields = (0, exports.getLeafType)(field.type, types, [], "").filter(Boolean);
|
|
162
|
+
const queryBuilderObject = gql.query({
|
|
163
|
+
operation: field.name,
|
|
164
|
+
variables: Object.keys(parsedVariables).length
|
|
165
|
+
? parsedVariables
|
|
166
|
+
: undefined,
|
|
167
|
+
fields: parsedFields.length ? parsedFields : undefined,
|
|
168
|
+
});
|
|
169
|
+
console.log(`Writing query: ${field.name}.graphql`);
|
|
170
|
+
const queriesFolderPath = path_1.default.join(__dirname, "..", "resources", "generated_queries");
|
|
171
|
+
yield (0, mkdirp_1.mkdirp)(queriesFolderPath);
|
|
172
|
+
fs_1.default.writeFileSync(path_1.default.join(queriesFolderPath, `${capitalize(field.name)}.graphql`), `query ${capitalize(field.name)}${queryBuilderObject.query
|
|
173
|
+
.toString()
|
|
174
|
+
.slice("query ".length)}`);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
run().then(() => process.exit());
|
|
179
|
+
//# sourceMappingURL=generateGraphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateGraphql.js","sourceRoot":"","sources":["../../src/scripts/generateGraphql.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,uDAAyC;AAEzC,mCAAgC;AAChC,gDAAwB;AA4BxB,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAEM,MAAM,WAAW,GAAG,CACzB,IAA0B,EAC1B,QAAsB,EACtB,MAAc,EACd,WAAmB,EACnB,KAAK,GAAG,CAAC,EACD,EAAE;;IACV,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAA,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,YAAY;QACxE,OAAO,MAAM,CAAC;IAEhB,oCAAoC;IACpC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAChD,OAAO,CAAC,GAAG,MAAM,EAAE,WAAY,CAAC,CAAC;IAEnC,gCAAgC;IAChC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC1B,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AAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;aACvD,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC;YAEpD,MAAM,iBAAiB,GAAG,cAAI,CAAC,IAAI,CACjC,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,CACpB,CAAC;YACF,MAAM,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAC;YAChC,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EACjE,SAAS,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,KAAK;iBACvD,QAAQ,EAAE;iBACV,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAC5B,CAAC;SACH;IACH,CAAC;CAAA;AAED,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
package/dist/sdk/Mutation.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CreateWebhooksInput } from "./generated/graphql";
|
|
1
|
+
import { CreateApiTokensMutationVariables, CreateWebhooksMutationVariables, DeleteApiTokenMutationVariables, DeleteWebhooksMutationVariables } from "./generated/graphql";
|
|
3
2
|
import { Codex } from "./index";
|
|
4
3
|
export declare class Mutation {
|
|
5
4
|
private sdk;
|
|
6
5
|
constructor(sdk: Codex);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
deleteWebhooks: (vars:
|
|
11
|
-
input: DeleteWebhooksInput;
|
|
12
|
-
}) => Promise<import("./generated/graphql").DeleteWebhooksMutation>;
|
|
6
|
+
deleteApiToken: (vars: DeleteApiTokenMutationVariables) => Promise<import("./generated/graphql").DeleteApiTokenMutation>;
|
|
7
|
+
createWebhooks: (vars: CreateWebhooksMutationVariables) => Promise<import("./generated/graphql").CreateWebhooksMutation>;
|
|
8
|
+
createApiTokens: (vars: CreateApiTokensMutationVariables) => Promise<import("./generated/graphql").CreateApiTokensMutation>;
|
|
9
|
+
deleteWebhooks: (vars: DeleteWebhooksMutationVariables) => Promise<import("./generated/graphql").DeleteWebhooksMutation>;
|
|
13
10
|
}
|
|
14
11
|
//# sourceMappingURL=Mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.d.ts","sourceRoot":"","sources":["../../src/sdk/Mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Mutation.d.ts","sourceRoot":"","sources":["../../src/sdk/Mutation.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gCAAgC,EAEhC,+BAA+B,EAE/B,+BAA+B,EAE/B,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAQ;IACP,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,KAAK;IAC9B,cAAc,SAAgB,+BAA+B,mEACX;IAClD,cAAc,SAAgB,+BAA+B,mEACX;IAClD,eAAe,SAAgB,gCAAgC,oEACZ;IACnD,cAAc,SAAgB,+BAA+B,mEACX;CACnD"}
|
package/dist/sdk/Mutation.js
CHANGED
|
@@ -10,11 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Mutation = void 0;
|
|
13
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT IT DIRECTLY
|
|
13
14
|
const graphql_1 = require("./generated/graphql");
|
|
14
15
|
class Mutation {
|
|
15
16
|
constructor(sdk) {
|
|
16
17
|
this.sdk = sdk;
|
|
18
|
+
this.deleteApiToken = (vars) => __awaiter(this, void 0, void 0, function* () { return this.sdk.mutation(graphql_1.DeleteApiTokenDocument, vars); });
|
|
17
19
|
this.createWebhooks = (vars) => __awaiter(this, void 0, void 0, function* () { return this.sdk.mutation(graphql_1.CreateWebhooksDocument, vars); });
|
|
20
|
+
this.createApiTokens = (vars) => __awaiter(this, void 0, void 0, function* () { return this.sdk.mutation(graphql_1.CreateApiTokensDocument, vars); });
|
|
18
21
|
this.deleteWebhooks = (vars) => __awaiter(this, void 0, void 0, function* () { return this.sdk.mutation(graphql_1.DeleteWebhooksDocument, vars); });
|
|
19
22
|
}
|
|
20
23
|
}
|
package/dist/sdk/Mutation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../src/sdk/Mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../src/sdk/Mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAAgE;AAChE,iDAS6B;AAG7B,MAAa,QAAQ;IACnB,YAAoB,GAAU;QAAV,QAAG,GAAH,GAAG,CAAO;QAC9B,mBAAc,GAAG,CAAO,IAAqC,EAAE,EAAE,gDAC/D,OAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gCAAsB,EAAE,IAAI,CAAC,CAAA,GAAA,CAAC;QAClD,mBAAc,GAAG,CAAO,IAAqC,EAAE,EAAE,gDAC/D,OAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gCAAsB,EAAE,IAAI,CAAC,CAAA,GAAA,CAAC;QAClD,oBAAe,GAAG,CAAO,IAAsC,EAAE,EAAE,gDACjE,OAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,iCAAuB,EAAE,IAAI,CAAC,CAAA,GAAA,CAAC;QACnD,mBAAc,GAAG,CAAO,IAAqC,EAAE,EAAE,gDAC/D,OAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gCAAsB,EAAE,IAAI,CAAC,CAAA,GAAA,CAAC;IARjB,CAAC;CASnC;AAVD,4BAUC"}
|
package/dist/sdk/Query.d.ts
CHANGED
|
@@ -1,22 +1,74 @@
|
|
|
1
|
-
import { FilterExchangesQueryVariables, FilterPairsQueryVariables, FilterTokensQueryVariables,
|
|
1
|
+
import { ApiTokenQueryVariables, ApiTokensQueryVariables, BalancesQueryVariables, ChartUrlsQueryVariables, FilterExchangesQueryVariables, FilterNftCollectionsQueryVariables, FilterNftParallelAssetsQueryVariables, FilterNftPoolCollectionsQueryVariables, FilterNftPoolsQueryVariables, FilterPairsQueryVariables, FilterTokensQueryVariables, GetBarsQueryVariables, GetCommunityNotesQueryVariables, GetDetailedNftStatsQueryVariables, GetDetailedPairsStatsQueryVariables, GetDetailedPairStatsQueryVariables, GetEventLabelsQueryVariables, GetExchangesQueryVariables, GetLatestPairsQueryVariables, GetLatestTokensQueryVariables, GetNetworksQueryVariables, GetNetworkStatsQueryVariables, GetNetworkStatusQueryVariables, GetNftAssetsQueryVariables, GetNftCollectionMetadataQueryVariables, GetNftContractsQueryVariables, GetNftEventsQueryVariables, GetNftPoolCollectionQueryVariables, GetNftPoolCollectionsByExchangeQueryVariables, GetNftPoolEventsQueryVariables, GetNftPoolQueryVariables, GetNftPoolsByCollectionAndExchangeQueryVariables, GetNftPoolsByOwnerQueryVariables, GetNftPoolStatsQueryVariables, GetParallelAssetsQueryVariables, GetParallelCardChangesQueryVariables, GetPrimePoolAssetsQueryVariables, GetPrimePoolEventsQueryVariables, GetPrimePoolsQueryVariables, GetSimulateTokenContractResultsQueryVariables, GetSymbolQueryVariables, GetTokenCountQueryVariables, GetTokenEventsForMakerQueryVariables, GetTokenEventsQueryVariables, GetTokenInfoQueryVariables, GetTokenPricesQueryVariables, GetTokensInfoQueryVariables, GetUniV3TicksQueryVariables, GetWebhooksQueryVariables, HoldersQueryVariables, LiquidityLocksQueryVariables, LiquidityMetadataQueryVariables, ListFavoriteTokensQueryVariables, ListPairsForTokenQueryVariables, ListPairsWithMetadataForTokenQueryVariables, ListTopTokensQueryVariables, NftHoldersQueryVariables, PairMetadataQueryVariables, PrimeBalanceQueryVariables, PrimeHoldersQueryVariables, SearchNftsQueryVariables, TokenLifecycleEventsQueryVariables, TokenQueryVariables, TokenSparklinesQueryVariables, TokensQueryVariables, WalletNftCollectionAssetsQueryVariables, WalletNftCollectionsQueryVariables } from "./generated/graphql";
|
|
2
2
|
import { Codex } from "./index";
|
|
3
3
|
export declare class Query {
|
|
4
4
|
private sdk;
|
|
5
5
|
constructor(sdk: Codex);
|
|
6
|
-
pairEvents: (vars: PairEventsQueryVariables) => Promise<import("./generated/graphql").PairEventsQuery>;
|
|
7
|
-
sparklines: (vars: GetSparklinesQueryVariables) => Promise<import("./generated/graphql").GetSparklinesQuery>;
|
|
8
|
-
token: (vars: QueryTokenArgs) => Promise<import("./generated/graphql").GetTokensQuery>;
|
|
9
|
-
price: (vars: QueryGetTokenPricesArgs) => Promise<import("./generated/graphql").GetTokenPriceQuery>;
|
|
10
|
-
detailedPairStats: (vars: QueryGetDetailedPairStatsArgs) => Promise<import("./generated/graphql").GetDetailedPairStatsQuery>;
|
|
11
|
-
bars: (vars: QueryGetBarsArgs) => Promise<import("./generated/graphql").GetBarsQuery>;
|
|
12
|
-
topTokens: (vars: QueryListTopTokensArgs) => Promise<import("./generated/graphql").ListTopTokensQuery>;
|
|
13
6
|
filterTokens: (vars: FilterTokensQueryVariables) => Promise<import("./generated/graphql").FilterTokensQuery>;
|
|
14
|
-
|
|
7
|
+
filterNftPools: (vars: FilterNftPoolsQueryVariables) => Promise<import("./generated/graphql").FilterNftPoolsQuery>;
|
|
8
|
+
filterNftPoolCollections: (vars: FilterNftPoolCollectionsQueryVariables) => Promise<import("./generated/graphql").FilterNftPoolCollectionsQuery>;
|
|
9
|
+
listPairsWithMetadataForToken: (vars: ListPairsWithMetadataForTokenQueryVariables) => Promise<import("./generated/graphql").ListPairsWithMetadataForTokenQuery>;
|
|
10
|
+
getTokenCount: (vars: GetTokenCountQueryVariables) => Promise<import("./generated/graphql").GetTokenCountQuery>;
|
|
11
|
+
tokens: (vars: TokensQueryVariables) => Promise<import("./generated/graphql").TokensQuery>;
|
|
12
|
+
getNftPoolStats: (vars: GetNftPoolStatsQueryVariables) => Promise<import("./generated/graphql").GetNftPoolStatsQuery>;
|
|
13
|
+
listTopTokens: (vars: ListTopTokensQueryVariables) => Promise<import("./generated/graphql").ListTopTokensQuery>;
|
|
14
|
+
getNftPoolEvents: (vars: GetNftPoolEventsQueryVariables) => Promise<import("./generated/graphql").GetNftPoolEventsQuery>;
|
|
15
|
+
getLatestPairs: (vars: GetLatestPairsQueryVariables) => Promise<import("./generated/graphql").GetLatestPairsQuery>;
|
|
16
|
+
balances: (vars: BalancesQueryVariables) => Promise<import("./generated/graphql").BalancesQuery>;
|
|
17
|
+
getDetailedPairStats: (vars: GetDetailedPairStatsQueryVariables) => Promise<import("./generated/graphql").GetDetailedPairStatsQuery>;
|
|
18
|
+
getNftPoolsByOwner: (vars: GetNftPoolsByOwnerQueryVariables) => Promise<import("./generated/graphql").GetNftPoolsByOwnerQuery>;
|
|
19
|
+
token: (vars: TokenQueryVariables) => Promise<import("./generated/graphql").TokenQuery>;
|
|
20
|
+
primeBalance: (vars: PrimeBalanceQueryVariables) => Promise<import("./generated/graphql").PrimeBalanceQuery>;
|
|
21
|
+
getUniV3Ticks: (vars: GetUniV3TicksQueryVariables) => Promise<import("./generated/graphql").GetUniV3TicksQuery>;
|
|
22
|
+
getExchanges: (vars: GetExchangesQueryVariables) => Promise<import("./generated/graphql").GetExchangesQuery>;
|
|
23
|
+
getSymbol: (vars: GetSymbolQueryVariables) => Promise<import("./generated/graphql").GetSymbolQuery>;
|
|
24
|
+
getNftPoolsByCollectionAndExchange: (vars: GetNftPoolsByCollectionAndExchangeQueryVariables) => Promise<import("./generated/graphql").GetNftPoolsByCollectionAndExchangeQuery>;
|
|
25
|
+
liquidityMetadata: (vars: LiquidityMetadataQueryVariables) => Promise<import("./generated/graphql").LiquidityMetadataQuery>;
|
|
26
|
+
getNftContracts: (vars: GetNftContractsQueryVariables) => Promise<import("./generated/graphql").GetNftContractsQuery>;
|
|
15
27
|
listPairsForToken: (vars: ListPairsForTokenQueryVariables) => Promise<import("./generated/graphql").ListPairsForTokenQuery>;
|
|
28
|
+
getNetworks: (vars: GetNetworksQueryVariables) => Promise<import("./generated/graphql").GetNetworksQuery>;
|
|
29
|
+
getTokensInfo: (vars: GetTokensInfoQueryVariables) => Promise<import("./generated/graphql").GetTokensInfoQuery>;
|
|
30
|
+
getNftPoolCollectionsByExchange: (vars: GetNftPoolCollectionsByExchangeQueryVariables) => Promise<import("./generated/graphql").GetNftPoolCollectionsByExchangeQuery>;
|
|
31
|
+
getTokenPrices: (vars: GetTokenPricesQueryVariables) => Promise<import("./generated/graphql").GetTokenPricesQuery>;
|
|
32
|
+
getWebhooks: (vars: GetWebhooksQueryVariables) => Promise<import("./generated/graphql").GetWebhooksQuery>;
|
|
33
|
+
getBars: (vars: GetBarsQueryVariables) => Promise<import("./generated/graphql").GetBarsQuery>;
|
|
34
|
+
searchNfts: (vars: SearchNftsQueryVariables) => Promise<import("./generated/graphql").SearchNftsQuery>;
|
|
35
|
+
chartUrls: (vars: ChartUrlsQueryVariables) => Promise<import("./generated/graphql").ChartUrlsQuery>;
|
|
36
|
+
apiToken: (vars: ApiTokenQueryVariables) => Promise<import("./generated/graphql").ApiTokenQuery>;
|
|
37
|
+
filterNftParallelAssets: (vars: FilterNftParallelAssetsQueryVariables) => Promise<import("./generated/graphql").FilterNftParallelAssetsQuery>;
|
|
38
|
+
getTokenEventsForMaker: (vars: GetTokenEventsForMakerQueryVariables) => Promise<import("./generated/graphql").GetTokenEventsForMakerQuery>;
|
|
39
|
+
filterNftCollections: (vars: FilterNftCollectionsQueryVariables) => Promise<import("./generated/graphql").FilterNftCollectionsQuery>;
|
|
40
|
+
getPrimePools: (vars: GetPrimePoolsQueryVariables) => Promise<import("./generated/graphql").GetPrimePoolsQuery>;
|
|
41
|
+
tokenLifecycleEvents: (vars: TokenLifecycleEventsQueryVariables) => Promise<import("./generated/graphql").TokenLifecycleEventsQuery>;
|
|
42
|
+
getPrimePoolAssets: (vars: GetPrimePoolAssetsQueryVariables) => Promise<import("./generated/graphql").GetPrimePoolAssetsQuery>;
|
|
43
|
+
getPrimePoolEvents: (vars: GetPrimePoolEventsQueryVariables) => Promise<import("./generated/graphql").GetPrimePoolEventsQuery>;
|
|
44
|
+
walletNftCollectionAssets: (vars: WalletNftCollectionAssetsQueryVariables) => Promise<import("./generated/graphql").WalletNftCollectionAssetsQuery>;
|
|
45
|
+
getEventLabels: (vars: GetEventLabelsQueryVariables) => Promise<import("./generated/graphql").GetEventLabelsQuery>;
|
|
46
|
+
getCommunityNotes: (vars: GetCommunityNotesQueryVariables) => Promise<import("./generated/graphql").GetCommunityNotesQuery>;
|
|
47
|
+
walletNftCollections: (vars: WalletNftCollectionsQueryVariables) => Promise<import("./generated/graphql").WalletNftCollectionsQuery>;
|
|
48
|
+
getNftAssets: (vars: GetNftAssetsQueryVariables) => Promise<import("./generated/graphql").GetNftAssetsQuery>;
|
|
49
|
+
pairMetadata: (vars: PairMetadataQueryVariables) => Promise<import("./generated/graphql").PairMetadataQuery>;
|
|
16
50
|
filterExchanges: (vars: FilterExchangesQueryVariables) => Promise<import("./generated/graphql").FilterExchangesQuery>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
getNftCollectionMetadata: (vars: GetNftCollectionMetadataQueryVariables) => Promise<import("./generated/graphql").GetNftCollectionMetadataQuery>;
|
|
52
|
+
nftHolders: (vars: NftHoldersQueryVariables) => Promise<import("./generated/graphql").NftHoldersQuery>;
|
|
53
|
+
getNftPoolCollection: (vars: GetNftPoolCollectionQueryVariables) => Promise<import("./generated/graphql").GetNftPoolCollectionQuery>;
|
|
54
|
+
getParallelAssets: (vars: GetParallelAssetsQueryVariables) => Promise<import("./generated/graphql").GetParallelAssetsQuery>;
|
|
55
|
+
getNftEvents: (vars: GetNftEventsQueryVariables) => Promise<import("./generated/graphql").GetNftEventsQuery>;
|
|
56
|
+
listFavoriteTokens: (vars: ListFavoriteTokensQueryVariables) => Promise<import("./generated/graphql").ListFavoriteTokensQuery>;
|
|
57
|
+
getTokenEvents: (vars: GetTokenEventsQueryVariables) => Promise<import("./generated/graphql").GetTokenEventsQuery>;
|
|
58
|
+
liquidityLocks: (vars: LiquidityLocksQueryVariables) => Promise<import("./generated/graphql").LiquidityLocksQuery>;
|
|
59
|
+
getDetailedPairsStats: (vars: GetDetailedPairsStatsQueryVariables) => Promise<import("./generated/graphql").GetDetailedPairsStatsQuery>;
|
|
60
|
+
getParallelCardChanges: (vars: GetParallelCardChangesQueryVariables) => Promise<import("./generated/graphql").GetParallelCardChangesQuery>;
|
|
61
|
+
apiTokens: (vars: ApiTokensQueryVariables) => Promise<import("./generated/graphql").ApiTokensQuery>;
|
|
62
|
+
primeHolders: (vars: PrimeHoldersQueryVariables) => Promise<import("./generated/graphql").PrimeHoldersQuery>;
|
|
63
|
+
getDetailedNftStats: (vars: GetDetailedNftStatsQueryVariables) => Promise<import("./generated/graphql").GetDetailedNftStatsQuery>;
|
|
64
|
+
filterPairs: (vars: FilterPairsQueryVariables) => Promise<import("./generated/graphql").FilterPairsQuery>;
|
|
65
|
+
getSimulateTokenContractResults: (vars: GetSimulateTokenContractResultsQueryVariables) => Promise<import("./generated/graphql").GetSimulateTokenContractResultsQuery>;
|
|
66
|
+
getLatestTokens: (vars: GetLatestTokensQueryVariables) => Promise<import("./generated/graphql").GetLatestTokensQuery>;
|
|
67
|
+
getNetworkStats: (vars: GetNetworkStatsQueryVariables) => Promise<import("./generated/graphql").GetNetworkStatsQuery>;
|
|
68
|
+
tokenSparklines: (vars: TokenSparklinesQueryVariables) => Promise<import("./generated/graphql").TokenSparklinesQuery>;
|
|
69
|
+
getNftPool: (vars: GetNftPoolQueryVariables) => Promise<import("./generated/graphql").GetNftPoolQuery>;
|
|
70
|
+
holders: (vars: HoldersQueryVariables) => Promise<import("./generated/graphql").HoldersQuery>;
|
|
71
|
+
getNetworkStatus: (vars: GetNetworkStatusQueryVariables) => Promise<import("./generated/graphql").GetNetworkStatusQuery>;
|
|
72
|
+
getTokenInfo: (vars: GetTokenInfoQueryVariables) => Promise<import("./generated/graphql").GetTokenInfoQuery>;
|
|
21
73
|
}
|
|
22
74
|
//# sourceMappingURL=Query.d.ts.map
|
package/dist/sdk/Query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/sdk/Query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/sdk/Query.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EAEtB,uBAAuB,EAEvB,sBAAsB,EAEtB,uBAAuB,EAEvB,6BAA6B,EAE7B,kCAAkC,EAElC,qCAAqC,EAErC,sCAAsC,EAEtC,4BAA4B,EAE5B,yBAAyB,EAEzB,0BAA0B,EAE1B,qBAAqB,EAErB,+BAA+B,EAE/B,iCAAiC,EAEjC,mCAAmC,EAEnC,kCAAkC,EAElC,4BAA4B,EAE5B,0BAA0B,EAE1B,4BAA4B,EAE5B,6BAA6B,EAE7B,yBAAyB,EAEzB,6BAA6B,EAE7B,8BAA8B,EAE9B,0BAA0B,EAE1B,sCAAsC,EAEtC,6BAA6B,EAE7B,0BAA0B,EAE1B,kCAAkC,EAElC,6CAA6C,EAG7C,8BAA8B,EAC9B,wBAAwB,EAExB,gDAAgD,EAEhD,gCAAgC,EAEhC,6BAA6B,EAE7B,+BAA+B,EAE/B,oCAAoC,EAEpC,gCAAgC,EAEhC,gCAAgC,EAEhC,2BAA2B,EAE3B,6CAA6C,EAE7C,uBAAuB,EAEvB,2BAA2B,EAG3B,oCAAoC,EACpC,4BAA4B,EAE5B,0BAA0B,EAE1B,4BAA4B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