@wishknish/knishio-client-ts 0.7.1 → 0.7.4

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/index.d.cts CHANGED
@@ -233,6 +233,12 @@ interface RequestTokensParams {
233
233
  metaId?: MetaId | string | null;
234
234
  meta?: MetaData | null;
235
235
  }
236
+ interface MetaFilter {
237
+ key: string;
238
+ value: string;
239
+ comparison?: string;
240
+ criterion?: string;
241
+ }
236
242
  interface BalanceQueryParams {
237
243
  address?: WalletAddress | string | null;
238
244
  bundleHash?: BundleHash | string | null;
@@ -245,7 +251,7 @@ interface MetaQueryParams {
245
251
  key?: string | null;
246
252
  value?: string | null;
247
253
  latest?: boolean | null;
248
- filter?: string | null;
254
+ filter?: MetaFilter[] | null;
249
255
  queryArgs?: Record<string, unknown> | null;
250
256
  count?: number | null;
251
257
  countBy?: string | null;
@@ -658,10 +664,10 @@ declare class GraphQLClient implements GraphQLClient$1 {
658
664
  pubkey: string;
659
665
  wallet?: Wallet;
660
666
  }): void;
661
- query<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
662
- mutation<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
663
- mutate<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
664
- subscription<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): AsyncIterableIterator<GraphQLResponse<TResult>>;
667
+ query<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
668
+ mutation<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
669
+ mutate<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
670
+ subscription<TResult = unknown>(request: GraphQLRequest): AsyncIterableIterator<GraphQLResponse<TResult>>;
665
671
  subscribe(request: {
666
672
  query: string;
667
673
  variables?: Record<string, any>;
@@ -856,7 +862,7 @@ declare class Query {
856
862
  }): any;
857
863
  createQueryContext(): Record<string, any>;
858
864
  execute({ variables, context }?: {
859
- variables?: Record<string, any>;
865
+ variables?: Record<string, any> | null;
860
866
  context?: Record<string, any>;
861
867
  }): Promise<Response | null>;
862
868
  }
@@ -989,7 +995,7 @@ declare class KnishIOClient {
989
995
  value?: string | null;
990
996
  latest?: boolean | null;
991
997
  fields?: string[] | null;
992
- filter?: string | null;
998
+ filter?: MetaFilter[] | null;
993
999
  queryArgs?: Record<string, any> | null;
994
1000
  count?: number | null;
995
1001
  countBy?: string | null;
@@ -1029,7 +1035,7 @@ declare class KnishIOClient {
1029
1035
  metaId?: string | null;
1030
1036
  indexes?: number[] | null;
1031
1037
  index?: number | null;
1032
- filter?: string | null;
1038
+ filter?: MetaFilter[] | null;
1033
1039
  latest?: boolean | null;
1034
1040
  queryArgs?: Record<string, any> | null;
1035
1041
  }): Promise<Response>;
@@ -1243,33 +1249,33 @@ declare class ResponseAtom extends Response {
1243
1249
  declare class QueryAtom extends Query {
1244
1250
  constructor(graphQLClient: GraphQLClient$1, knishIOClient: KnishIOClient);
1245
1251
  static createVariables({ molecularHashes, molecularHash, bundleHashes, bundleHash, positions, position, walletAddresses, walletAddress, isotopes, isotope, tokenSlugs, tokenSlug, cellSlugs, cellSlug, batchIds, batchId, values, value, metaTypes, metaType, metaIds, metaId, indexes, index, filter, latest, queryArgs }: {
1246
- molecularHashes?: string[];
1247
- molecularHash?: string;
1248
- bundleHashes?: string[];
1249
- bundleHash?: string;
1250
- positions?: string[];
1251
- position?: string;
1252
- walletAddresses?: string[];
1253
- walletAddress?: string;
1254
- isotopes?: string[];
1255
- isotope?: string;
1256
- tokenSlugs?: string[];
1257
- tokenSlug?: string;
1258
- cellSlugs?: string[];
1259
- cellSlug?: string;
1260
- batchIds?: string[];
1261
- batchId?: string;
1262
- values?: string[];
1263
- value?: string | number;
1264
- metaTypes?: string[];
1265
- metaType?: string;
1266
- metaIds?: string[];
1267
- metaId?: string;
1268
- indexes?: number[];
1269
- index?: number;
1270
- filter?: object[];
1271
- latest?: boolean;
1272
- queryArgs?: object;
1252
+ molecularHashes?: string[] | null;
1253
+ molecularHash?: string | null;
1254
+ bundleHashes?: string[] | null;
1255
+ bundleHash?: string | null;
1256
+ positions?: string[] | null;
1257
+ position?: string | null;
1258
+ walletAddresses?: string[] | null;
1259
+ walletAddress?: string | null;
1260
+ isotopes?: string[] | null;
1261
+ isotope?: string | null;
1262
+ tokenSlugs?: string[] | null;
1263
+ tokenSlug?: string | null;
1264
+ cellSlugs?: string[] | null;
1265
+ cellSlug?: string | null;
1266
+ batchIds?: string[] | null;
1267
+ batchId?: string | null;
1268
+ values?: string[] | null;
1269
+ value?: string | number | null;
1270
+ metaTypes?: string[] | null;
1271
+ metaType?: string | null;
1272
+ metaIds?: string[] | null;
1273
+ metaId?: string | null;
1274
+ indexes?: number[] | null;
1275
+ index?: number | null;
1276
+ filter?: object[] | null;
1277
+ latest?: boolean | null;
1278
+ queryArgs?: object | null;
1273
1279
  }): Record<string, any>;
1274
1280
  createResponse(json: any): ResponseAtom;
1275
1281
  }
@@ -1292,7 +1298,7 @@ declare class QueryMetaType extends Query {
1292
1298
  latest?: boolean | null;
1293
1299
  filter?: any | null;
1294
1300
  queryArgs?: any | null;
1295
- count?: string | null;
1301
+ count?: string | number | null;
1296
1302
  countBy?: string | null;
1297
1303
  cellSlug?: string | null;
1298
1304
  }): Record<string, any>;
@@ -1805,7 +1811,6 @@ declare const DevUtils: {
1805
1811
  runFullCompatibilityTests?: never;
1806
1812
  getBuildInfo?: never;
1807
1813
  };
1808
-
1809
1814
  declare const KnishIO: {
1810
1815
  shake256: typeof shake256;
1811
1816
  generateSecret: typeof generateSecret;
@@ -1830,4 +1835,4 @@ declare const KnishIO: {
1830
1835
  };
1831
1836
  };
1832
1837
 
1833
- export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, type SHAKE256Options, type SecretGenerationOptions, SignatureMismatchException, type SignatureOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, convertToBase17, createBundleHash, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, shake256 as default, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, randomString, runCompatibilityTests, runExtendedCompatibilityTests, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature };
1838
+ export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, type SHAKE256Options, type SecretGenerationOptions, SignatureMismatchException, type SignatureOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, convertToBase17, createBundleHash, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, randomString, runCompatibilityTests, runExtendedCompatibilityTests, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature };
package/dist/index.d.ts CHANGED
@@ -233,6 +233,12 @@ interface RequestTokensParams {
233
233
  metaId?: MetaId | string | null;
234
234
  meta?: MetaData | null;
235
235
  }
236
+ interface MetaFilter {
237
+ key: string;
238
+ value: string;
239
+ comparison?: string;
240
+ criterion?: string;
241
+ }
236
242
  interface BalanceQueryParams {
237
243
  address?: WalletAddress | string | null;
238
244
  bundleHash?: BundleHash | string | null;
@@ -245,7 +251,7 @@ interface MetaQueryParams {
245
251
  key?: string | null;
246
252
  value?: string | null;
247
253
  latest?: boolean | null;
248
- filter?: string | null;
254
+ filter?: MetaFilter[] | null;
249
255
  queryArgs?: Record<string, unknown> | null;
250
256
  count?: number | null;
251
257
  countBy?: string | null;
@@ -658,10 +664,10 @@ declare class GraphQLClient implements GraphQLClient$1 {
658
664
  pubkey: string;
659
665
  wallet?: Wallet;
660
666
  }): void;
661
- query<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
662
- mutation<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
663
- mutate<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): Promise<GraphQLResponse<TResult>>;
664
- subscription<TResult = unknown, TVariables = GraphQLVariables>(request: GraphQLRequest, variables?: TVariables): AsyncIterableIterator<GraphQLResponse<TResult>>;
667
+ query<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
668
+ mutation<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
669
+ mutate<TResult = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<TResult>>;
670
+ subscription<TResult = unknown>(request: GraphQLRequest): AsyncIterableIterator<GraphQLResponse<TResult>>;
665
671
  subscribe(request: {
666
672
  query: string;
667
673
  variables?: Record<string, any>;
@@ -856,7 +862,7 @@ declare class Query {
856
862
  }): any;
857
863
  createQueryContext(): Record<string, any>;
858
864
  execute({ variables, context }?: {
859
- variables?: Record<string, any>;
865
+ variables?: Record<string, any> | null;
860
866
  context?: Record<string, any>;
861
867
  }): Promise<Response | null>;
862
868
  }
@@ -989,7 +995,7 @@ declare class KnishIOClient {
989
995
  value?: string | null;
990
996
  latest?: boolean | null;
991
997
  fields?: string[] | null;
992
- filter?: string | null;
998
+ filter?: MetaFilter[] | null;
993
999
  queryArgs?: Record<string, any> | null;
994
1000
  count?: number | null;
995
1001
  countBy?: string | null;
@@ -1029,7 +1035,7 @@ declare class KnishIOClient {
1029
1035
  metaId?: string | null;
1030
1036
  indexes?: number[] | null;
1031
1037
  index?: number | null;
1032
- filter?: string | null;
1038
+ filter?: MetaFilter[] | null;
1033
1039
  latest?: boolean | null;
1034
1040
  queryArgs?: Record<string, any> | null;
1035
1041
  }): Promise<Response>;
@@ -1243,33 +1249,33 @@ declare class ResponseAtom extends Response {
1243
1249
  declare class QueryAtom extends Query {
1244
1250
  constructor(graphQLClient: GraphQLClient$1, knishIOClient: KnishIOClient);
1245
1251
  static createVariables({ molecularHashes, molecularHash, bundleHashes, bundleHash, positions, position, walletAddresses, walletAddress, isotopes, isotope, tokenSlugs, tokenSlug, cellSlugs, cellSlug, batchIds, batchId, values, value, metaTypes, metaType, metaIds, metaId, indexes, index, filter, latest, queryArgs }: {
1246
- molecularHashes?: string[];
1247
- molecularHash?: string;
1248
- bundleHashes?: string[];
1249
- bundleHash?: string;
1250
- positions?: string[];
1251
- position?: string;
1252
- walletAddresses?: string[];
1253
- walletAddress?: string;
1254
- isotopes?: string[];
1255
- isotope?: string;
1256
- tokenSlugs?: string[];
1257
- tokenSlug?: string;
1258
- cellSlugs?: string[];
1259
- cellSlug?: string;
1260
- batchIds?: string[];
1261
- batchId?: string;
1262
- values?: string[];
1263
- value?: string | number;
1264
- metaTypes?: string[];
1265
- metaType?: string;
1266
- metaIds?: string[];
1267
- metaId?: string;
1268
- indexes?: number[];
1269
- index?: number;
1270
- filter?: object[];
1271
- latest?: boolean;
1272
- queryArgs?: object;
1252
+ molecularHashes?: string[] | null;
1253
+ molecularHash?: string | null;
1254
+ bundleHashes?: string[] | null;
1255
+ bundleHash?: string | null;
1256
+ positions?: string[] | null;
1257
+ position?: string | null;
1258
+ walletAddresses?: string[] | null;
1259
+ walletAddress?: string | null;
1260
+ isotopes?: string[] | null;
1261
+ isotope?: string | null;
1262
+ tokenSlugs?: string[] | null;
1263
+ tokenSlug?: string | null;
1264
+ cellSlugs?: string[] | null;
1265
+ cellSlug?: string | null;
1266
+ batchIds?: string[] | null;
1267
+ batchId?: string | null;
1268
+ values?: string[] | null;
1269
+ value?: string | number | null;
1270
+ metaTypes?: string[] | null;
1271
+ metaType?: string | null;
1272
+ metaIds?: string[] | null;
1273
+ metaId?: string | null;
1274
+ indexes?: number[] | null;
1275
+ index?: number | null;
1276
+ filter?: object[] | null;
1277
+ latest?: boolean | null;
1278
+ queryArgs?: object | null;
1273
1279
  }): Record<string, any>;
1274
1280
  createResponse(json: any): ResponseAtom;
1275
1281
  }
@@ -1292,7 +1298,7 @@ declare class QueryMetaType extends Query {
1292
1298
  latest?: boolean | null;
1293
1299
  filter?: any | null;
1294
1300
  queryArgs?: any | null;
1295
- count?: string | null;
1301
+ count?: string | number | null;
1296
1302
  countBy?: string | null;
1297
1303
  cellSlug?: string | null;
1298
1304
  }): Record<string, any>;
@@ -1805,7 +1811,6 @@ declare const DevUtils: {
1805
1811
  runFullCompatibilityTests?: never;
1806
1812
  getBuildInfo?: never;
1807
1813
  };
1808
-
1809
1814
  declare const KnishIO: {
1810
1815
  shake256: typeof shake256;
1811
1816
  generateSecret: typeof generateSecret;
@@ -1830,4 +1835,4 @@ declare const KnishIO: {
1830
1835
  };
1831
1836
  };
1832
1837
 
1833
- export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, type SHAKE256Options, type SecretGenerationOptions, SignatureMismatchException, type SignatureOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, convertToBase17, createBundleHash, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, shake256 as default, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, randomString, runCompatibilityTests, runExtendedCompatibilityTests, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature };
1838
+ export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, type SHAKE256Options, type SecretGenerationOptions, SignatureMismatchException, type SignatureOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, convertToBase17, createBundleHash, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, randomString, runCompatibilityTests, runExtendedCompatibilityTests, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature };
@@ -19997,6 +19997,13 @@ ${operationTypes.join("\n")}
19997
19997
  }
19998
19998
  throw new exports.InvalidResponseException();
19999
19999
  }
20000
+ if (this.$__response.errors && Array.isArray(this.$__response.errors) && this.$__response.errors.length > 0) {
20001
+ const errorMessage = this.$__response.errors[0].message || "Unknown GraphQL error";
20002
+ if (errorMessage.includes("Unauthenticated")) {
20003
+ throw new UnauthenticatedException("Unauthenticated request");
20004
+ }
20005
+ throw new exports.InvalidResponseException(`GraphQL Error: ${errorMessage}`);
20006
+ }
20000
20007
  this.init();
20001
20008
  }
20002
20009
  /**
@@ -20011,8 +20018,11 @@ ${operationTypes.join("\n")}
20011
20018
  if (!this.dataKey) {
20012
20019
  return this.response();
20013
20020
  }
20021
+ if (!this.response().data) {
20022
+ throw new exports.InvalidResponseException("Response has no data field");
20023
+ }
20014
20024
  if (!exports.Dot.has(this.response(), this.dataKey)) {
20015
- throw new exports.InvalidResponseException();
20025
+ throw new exports.InvalidResponseException(`Missing expected field: ${this.dataKey}`);
20016
20026
  }
20017
20027
  return exports.Dot.get(this.response(), this.dataKey);
20018
20028
  }
@@ -26965,24 +26975,24 @@ ${operationTypes.join("\n")}
26965
26975
  encrypt: this.cipherLink
26966
26976
  });
26967
26977
  }
26968
- async query(request, variables) {
26969
- const finalVariables = variables || request.variables || {};
26970
- const result = await this.$__client.query(request.query, finalVariables).toPromise();
26978
+ async query(request) {
26979
+ const { query, variables } = request;
26980
+ const result = await this.$__client.query(query, variables || {}).toPromise();
26971
26981
  return this.formatResponse(result);
26972
26982
  }
26973
- async mutation(request, variables) {
26974
- const finalVariables = variables || request.variables || {};
26975
- const mutationString = request.mutation || request.query;
26976
- const result = await this.$__client.mutation(mutationString, finalVariables).toPromise();
26983
+ async mutation(request) {
26984
+ const { query, variables } = request;
26985
+ const mutationString = request.mutation || query;
26986
+ const result = await this.$__client.mutation(mutationString, variables || {}).toPromise();
26977
26987
  return this.formatResponse(result);
26978
26988
  }
26979
26989
  // Alias for mutation() to match JS SDK interface
26980
- async mutate(request, variables) {
26981
- return this.mutation(request, variables);
26990
+ async mutate(request) {
26991
+ return this.mutation(request);
26982
26992
  }
26983
- async *subscription(request, variables) {
26984
- const finalVariables = variables || request.variables || {};
26985
- const subscription = this.$__client.subscription(request.query, finalVariables);
26993
+ async *subscription(request) {
26994
+ const { query, variables } = request;
26995
+ const subscription = this.$__client.subscription(query, variables || {});
26986
26996
  const results = [];
26987
26997
  const { unsubscribe } = pipe(
26988
26998
  subscription,
@@ -27160,7 +27170,7 @@ ${operationTypes.join("\n")}
27160
27170
  * Executes the Query and returns a Response
27161
27171
  */
27162
27172
  async execute({
27163
- variables = {},
27173
+ variables = null,
27164
27174
  context = {}
27165
27175
  } = {}) {
27166
27176
  this.$__request = this.createQuery({ variables });
@@ -31153,51 +31163,44 @@ ${operationTypes.join("\n")}
31153
31163
  queryArgs = null,
31154
31164
  count = null,
31155
31165
  countBy = null,
31156
- throughAtom = null,
31166
+ throughAtom = true,
31157
31167
  values = null,
31158
31168
  keys = null,
31159
31169
  atomValues = null
31160
31170
  }) {
31161
31171
  this.log("info", `KnishIOClient::queryMeta() - Querying metaType: ${metaType}, metaId: ${metaId}...`);
31162
31172
  let query;
31163
- if (throughAtom === true) {
31173
+ let variables;
31174
+ if (throughAtom) {
31164
31175
  query = this.createQuery(QueryMetaTypeViaAtom);
31176
+ variables = QueryMetaTypeViaAtom.createVariables({
31177
+ metaType,
31178
+ metaId,
31179
+ key,
31180
+ value: value2,
31181
+ latest,
31182
+ filter: filter2,
31183
+ queryArgs,
31184
+ countBy,
31185
+ values,
31186
+ keys,
31187
+ atomValues,
31188
+ cellSlug: this.getCellSlug()
31189
+ });
31165
31190
  } else {
31166
31191
  query = this.createQuery(QueryMetaType);
31167
- }
31168
- const variables = {
31169
- metaType: metaType.toUpperCase(),
31170
- metaId
31171
- };
31172
- if (filter2 !== null) {
31173
- variables.filter = filter2;
31174
- }
31175
- if (latest !== null) {
31176
- variables.latest = latest;
31177
- }
31178
- if (key !== null) {
31179
- variables.key = key;
31180
- }
31181
- if (value2 !== null) {
31182
- variables.value = value2;
31183
- }
31184
- if (queryArgs !== null) {
31185
- variables.queryArgs = queryArgs;
31186
- }
31187
- if (count !== null) {
31188
- variables.count = count;
31189
- }
31190
- if (countBy !== null) {
31191
- variables.countBy = countBy;
31192
- }
31193
- if (values !== null) {
31194
- variables.values = values;
31195
- }
31196
- if (keys !== null) {
31197
- variables.keys = keys;
31198
- }
31199
- if (atomValues !== null) {
31200
- variables.atomValues = atomValues;
31192
+ variables = QueryMetaType.createVariables({
31193
+ metaType,
31194
+ metaId,
31195
+ key,
31196
+ value: value2,
31197
+ latest,
31198
+ filter: filter2,
31199
+ queryArgs,
31200
+ count,
31201
+ countBy,
31202
+ cellSlug: this.getCellSlug()
31203
+ });
31201
31204
  }
31202
31205
  return this.executeQuery(query, variables);
31203
31206
  }
@@ -31257,35 +31260,37 @@ ${operationTypes.join("\n")}
31257
31260
  latest = null,
31258
31261
  queryArgs = null
31259
31262
  } = {}) {
31263
+ this.log("info", "KnishIOClient::queryAtom() - Querying atom instances");
31260
31264
  const query = this.createQuery(QueryAtom);
31261
- const variables = {};
31262
- if (molecularHashes !== null) variables.molecularHashes = molecularHashes;
31263
- if (molecularHash !== null) variables.molecularHash = molecularHash;
31264
- if (bundleHashes !== null) variables.bundleHashes = bundleHashes;
31265
- if (bundleHash !== null) variables.bundleHash = bundleHash;
31266
- if (positions !== null) variables.positions = positions;
31267
- if (position !== null) variables.position = position;
31268
- if (walletAddresses !== null) variables.walletAddresses = walletAddresses;
31269
- if (walletAddress !== null) variables.walletAddress = walletAddress;
31270
- if (isotopes !== null) variables.isotopes = isotopes;
31271
- if (isotope !== null) variables.isotope = isotope;
31272
- if (tokenSlugs !== null) variables.tokenSlugs = tokenSlugs;
31273
- if (tokenSlug !== null) variables.tokenSlug = tokenSlug;
31274
- if (cellSlugs !== null) variables.cellSlugs = cellSlugs;
31275
- if (cellSlug !== null) variables.cellSlug = cellSlug;
31276
- if (batchIds !== null) variables.batchIds = batchIds;
31277
- if (batchId !== null) variables.batchId = batchId;
31278
- if (values !== null) variables.values = values;
31279
- if (value2 !== null) variables.value = value2;
31280
- if (metaTypes !== null) variables.metaTypes = metaTypes;
31281
- if (metaType !== null) variables.metaType = metaType;
31282
- if (metaIds !== null) variables.metaIds = metaIds;
31283
- if (metaId !== null) variables.metaId = metaId;
31284
- if (indexes !== null) variables.indexes = indexes;
31285
- if (index !== null) variables.index = index;
31286
- if (filter2 !== null) variables.filter = filter2;
31287
- if (latest !== null) variables.latest = latest;
31288
- if (queryArgs !== null) variables.queryArgs = queryArgs;
31265
+ const variables = QueryAtom.createVariables({
31266
+ molecularHashes,
31267
+ molecularHash,
31268
+ bundleHashes,
31269
+ bundleHash,
31270
+ positions,
31271
+ position,
31272
+ walletAddresses,
31273
+ walletAddress,
31274
+ isotopes,
31275
+ isotope,
31276
+ tokenSlugs,
31277
+ tokenSlug,
31278
+ cellSlugs,
31279
+ cellSlug,
31280
+ batchIds,
31281
+ batchId,
31282
+ values,
31283
+ value: value2,
31284
+ metaTypes,
31285
+ metaType,
31286
+ metaIds,
31287
+ metaId,
31288
+ indexes,
31289
+ index,
31290
+ filter: filter2,
31291
+ latest,
31292
+ queryArgs
31293
+ });
31289
31294
  return this.executeQuery(query, variables);
31290
31295
  }
31291
31296
  /**
@@ -32251,7 +32256,6 @@ ${operationTypes.join("\n")}
32251
32256
  exports.createTokenSlug = createTokenSlug;
32252
32257
  exports.createWalletAddress = createWalletAddress;
32253
32258
  exports.deepCloning = deepCloning;
32254
- exports.default = shake256;
32255
32259
  exports.diff = diff;
32256
32260
  exports.enumerateMolecularHash = enumerateMolecularHash;
32257
32261
  exports.generateBatchId = generateBatchId;
@@ -32289,8 +32293,6 @@ ${operationTypes.join("\n")}
32289
32293
  exports.validateWalletAddress = validateWalletAddress;
32290
32294
  exports.verifyOTSSignature = verifyOTSSignature;
32291
32295
 
32292
- Object.defineProperty(exports, '__esModule', { value: true });
32293
-
32294
32296
  return exports;
32295
32297
 
32296
32298
  })({});