@wishknish/knishio-client-ts 0.7.6 → 0.7.8
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/README.md +68 -0
- package/dist/index.cjs +305 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -27
- package/dist/index.d.ts +75 -27
- package/dist/index.iife.js +307 -12
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +304 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/KnishIOClient.ts +194 -5
- package/src/core/Molecule.ts +36 -13
- package/src/index.ts +7 -0
- package/src/libraries/GraphQLClient.ts +15 -0
- package/src/query/QueryEmbeddingStatus.ts +130 -0
- package/src/response/ResponseEmbeddingStatus.ts +107 -0
- package/src/response/ResponseProposeMolecule.ts +47 -0
package/dist/index.d.cts
CHANGED
|
@@ -652,15 +652,17 @@ declare class Molecule {
|
|
|
652
652
|
remainderWallet: Wallet | null;
|
|
653
653
|
atoms: Atom[];
|
|
654
654
|
version: string | null | undefined;
|
|
655
|
+
continuIdPosition: string | null;
|
|
655
656
|
parentHashes: string[];
|
|
656
657
|
local?: number;
|
|
657
|
-
constructor({ secret, bundle, sourceWallet, remainderWallet, cellSlug, version }?: {
|
|
658
|
+
constructor({ secret, bundle, sourceWallet, remainderWallet, cellSlug, version, continuIdPosition }?: {
|
|
658
659
|
secret?: string | null;
|
|
659
660
|
bundle?: string | null;
|
|
660
661
|
sourceWallet?: Wallet | null;
|
|
661
662
|
remainderWallet?: Wallet | null;
|
|
662
663
|
cellSlug?: string | null;
|
|
663
664
|
version?: string | number | null;
|
|
665
|
+
continuIdPosition?: string | null;
|
|
664
666
|
});
|
|
665
667
|
get cellSlugDelimiter(): string;
|
|
666
668
|
getIsotopes(isotopes: AtomIsotope | AtomIsotope[]): Atom[];
|
|
@@ -864,6 +866,7 @@ declare class GraphQLClient implements GraphQLClient$1 {
|
|
|
864
866
|
getSocketUri(): string | null;
|
|
865
867
|
getUri(): string;
|
|
866
868
|
setUri(uri: string): void;
|
|
869
|
+
setSocketUri(socketUri: string): void;
|
|
867
870
|
socketDisconnect(): void;
|
|
868
871
|
}
|
|
869
872
|
|
|
@@ -1056,6 +1059,31 @@ declare class Mutation extends Query {
|
|
|
1056
1059
|
}): Promise<Response | null>;
|
|
1057
1060
|
}
|
|
1058
1061
|
|
|
1062
|
+
interface BaseExceptionOptions {
|
|
1063
|
+
message?: string;
|
|
1064
|
+
cause?: Error | unknown;
|
|
1065
|
+
context?: ErrorContext;
|
|
1066
|
+
code?: string;
|
|
1067
|
+
details?: Record<string, unknown>;
|
|
1068
|
+
}
|
|
1069
|
+
declare class BaseException extends Error {
|
|
1070
|
+
readonly type: KnishIOErrorType;
|
|
1071
|
+
readonly context: ErrorContext | null;
|
|
1072
|
+
readonly code: string | null;
|
|
1073
|
+
readonly details: Record<string, unknown> | null;
|
|
1074
|
+
readonly timestamp: number;
|
|
1075
|
+
constructor(type: KnishIOErrorType, message: string, options?: BaseExceptionOptions);
|
|
1076
|
+
getFullMessage(): string;
|
|
1077
|
+
toJSON(): Record<string, unknown>;
|
|
1078
|
+
isType(type: KnishIOErrorType): boolean;
|
|
1079
|
+
getContextValue(key: keyof ErrorContext): unknown;
|
|
1080
|
+
withContext(additionalContext: Partial<ErrorContext>): this;
|
|
1081
|
+
static create<T extends BaseException>(this: new (type: KnishIOErrorType, message: string, options?: BaseExceptionOptions) => T, type: KnishIOErrorType, message: string, options?: BaseExceptionOptions): T;
|
|
1082
|
+
static isKnishIOException(error: unknown): error is BaseException;
|
|
1083
|
+
static getErrorType(error: unknown): KnishIOErrorType | null;
|
|
1084
|
+
static fromError(error: Error | unknown, type?: KnishIOErrorType, additionalContext?: Partial<ErrorContext>): BaseException;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1059
1087
|
declare class ResponseProposeMolecule extends Response {
|
|
1060
1088
|
private $__clientMolecule;
|
|
1061
1089
|
constructor({ query, json }: {
|
|
@@ -1068,6 +1096,7 @@ declare class ResponseProposeMolecule extends Response {
|
|
|
1068
1096
|
success(): boolean;
|
|
1069
1097
|
status(): string;
|
|
1070
1098
|
reason(): string;
|
|
1099
|
+
toException(): BaseException | null;
|
|
1071
1100
|
payload(): any;
|
|
1072
1101
|
}
|
|
1073
1102
|
|
|
@@ -1095,6 +1124,8 @@ declare class KnishIOClient {
|
|
|
1095
1124
|
private $__remainderWallet;
|
|
1096
1125
|
private lastMoleculeQuery;
|
|
1097
1126
|
private abortControllers;
|
|
1127
|
+
private $__capabilityCache;
|
|
1128
|
+
private $__moleculeChain;
|
|
1098
1129
|
constructor(config: {
|
|
1099
1130
|
uri: string | string[];
|
|
1100
1131
|
cellSlug?: string | null;
|
|
@@ -1125,6 +1156,7 @@ declare class KnishIOClient {
|
|
|
1125
1156
|
reset(): void;
|
|
1126
1157
|
client(): GraphQLClient;
|
|
1127
1158
|
setUri(uri: string | string[]): void;
|
|
1159
|
+
setSocketUri(socketUri: string): void;
|
|
1128
1160
|
getUri(): string[];
|
|
1129
1161
|
setCellSlug(cellSlug: string | null): void;
|
|
1130
1162
|
getCellSlug(): string | null;
|
|
@@ -1144,7 +1176,9 @@ declare class KnishIOClient {
|
|
|
1144
1176
|
mutationClass: new (client: GraphQLClient, knishIOClient: KnishIOClient, molecule: Molecule) => T;
|
|
1145
1177
|
molecule?: Molecule | null;
|
|
1146
1178
|
}): Promise<T>;
|
|
1179
|
+
private withMoleculeLock;
|
|
1147
1180
|
executeQuery(query: Query | Mutation, variables?: Record<string, any> | null): Promise<Response | null>;
|
|
1181
|
+
private handlePositionDrift;
|
|
1148
1182
|
setSecret(secret: string): void;
|
|
1149
1183
|
setAuthToken(authToken: AuthToken): void;
|
|
1150
1184
|
getSourceWallet(): Promise<Wallet>;
|
|
@@ -1224,6 +1258,15 @@ declare class KnishIOClient {
|
|
|
1224
1258
|
keys?: string[] | null;
|
|
1225
1259
|
atomValues?: any[] | null;
|
|
1226
1260
|
}): Promise<Response>;
|
|
1261
|
+
hasQueryField(fieldName: string): Promise<boolean>;
|
|
1262
|
+
queryEmbeddingStatus({ metaType, metaId, instances }: {
|
|
1263
|
+
metaType?: string | null;
|
|
1264
|
+
metaId?: string | null;
|
|
1265
|
+
instances?: Array<{
|
|
1266
|
+
metaType: string;
|
|
1267
|
+
metaId: string;
|
|
1268
|
+
}> | null;
|
|
1269
|
+
}): Promise<Response | null>;
|
|
1227
1270
|
queryBatch({ batchId }: {
|
|
1228
1271
|
batchId: BatchId | string;
|
|
1229
1272
|
}): Promise<Response>;
|
|
@@ -1562,6 +1605,36 @@ declare class QueryMetaTypeViaAtom extends Query {
|
|
|
1562
1605
|
createResponse(json: any): ResponseMetaTypeViaAtom;
|
|
1563
1606
|
}
|
|
1564
1607
|
|
|
1608
|
+
interface EmbeddingStatusItem {
|
|
1609
|
+
metaType: string;
|
|
1610
|
+
metaId: string;
|
|
1611
|
+
state: 'PENDING' | 'STALE' | 'COMPLETE';
|
|
1612
|
+
totalMetas: number;
|
|
1613
|
+
embeddedCount: number;
|
|
1614
|
+
embeddedAt: number | null;
|
|
1615
|
+
model: string | null;
|
|
1616
|
+
}
|
|
1617
|
+
declare class ResponseEmbeddingStatus extends Response {
|
|
1618
|
+
constructor({ query, json }: {
|
|
1619
|
+
query: Query;
|
|
1620
|
+
json: any;
|
|
1621
|
+
});
|
|
1622
|
+
payload(): EmbeddingStatusItem[] | null;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
declare class QueryEmbeddingStatus extends Query {
|
|
1626
|
+
constructor(graphQLClient: GraphQLClient$1, knishIOClient: KnishIOClient);
|
|
1627
|
+
static createVariables({ metaType, metaId, instances }?: {
|
|
1628
|
+
metaType?: string | null;
|
|
1629
|
+
metaId?: string | null;
|
|
1630
|
+
instances?: Array<{
|
|
1631
|
+
metaType: string;
|
|
1632
|
+
metaId: string;
|
|
1633
|
+
}> | null;
|
|
1634
|
+
}): Record<string, any>;
|
|
1635
|
+
createResponse(json: any): ResponseEmbeddingStatus;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1565
1638
|
declare class ResponseContinuId extends Response {
|
|
1566
1639
|
constructor({ query, json }: {
|
|
1567
1640
|
query: Query;
|
|
@@ -1812,31 +1885,6 @@ declare function runExtendedCompatibilityTests(): {
|
|
|
1812
1885
|
}>;
|
|
1813
1886
|
};
|
|
1814
1887
|
|
|
1815
|
-
interface BaseExceptionOptions {
|
|
1816
|
-
message?: string;
|
|
1817
|
-
cause?: Error | unknown;
|
|
1818
|
-
context?: ErrorContext;
|
|
1819
|
-
code?: string;
|
|
1820
|
-
details?: Record<string, unknown>;
|
|
1821
|
-
}
|
|
1822
|
-
declare class BaseException extends Error {
|
|
1823
|
-
readonly type: KnishIOErrorType;
|
|
1824
|
-
readonly context: ErrorContext | null;
|
|
1825
|
-
readonly code: string | null;
|
|
1826
|
-
readonly details: Record<string, unknown> | null;
|
|
1827
|
-
readonly timestamp: number;
|
|
1828
|
-
constructor(type: KnishIOErrorType, message: string, options?: BaseExceptionOptions);
|
|
1829
|
-
getFullMessage(): string;
|
|
1830
|
-
toJSON(): Record<string, unknown>;
|
|
1831
|
-
isType(type: KnishIOErrorType): boolean;
|
|
1832
|
-
getContextValue(key: keyof ErrorContext): unknown;
|
|
1833
|
-
withContext(additionalContext: Partial<ErrorContext>): this;
|
|
1834
|
-
static create<T extends BaseException>(this: new (type: KnishIOErrorType, message: string, options?: BaseExceptionOptions) => T, type: KnishIOErrorType, message: string, options?: BaseExceptionOptions): T;
|
|
1835
|
-
static isKnishIOException(error: unknown): error is BaseException;
|
|
1836
|
-
static getErrorType(error: unknown): KnishIOErrorType | null;
|
|
1837
|
-
static fromError(error: Error | unknown, type?: KnishIOErrorType, additionalContext?: Partial<ErrorContext>): BaseException;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
1888
|
declare class AtomIndexException extends BaseException {
|
|
1841
1889
|
constructor(message?: string, options?: BaseExceptionOptions);
|
|
1842
1890
|
static indexConflict(index: number, existingIndex: number): AtomIndexException;
|
|
@@ -2066,4 +2114,4 @@ declare const KnishIO: {
|
|
|
2066
2114
|
};
|
|
2067
2115
|
};
|
|
2068
2116
|
|
|
2069
|
-
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$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, 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 };
|
|
2117
|
+
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, type EmbeddingStatusItem, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryEmbeddingStatus, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseEmbeddingStatus, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, 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
|
@@ -652,15 +652,17 @@ declare class Molecule {
|
|
|
652
652
|
remainderWallet: Wallet | null;
|
|
653
653
|
atoms: Atom[];
|
|
654
654
|
version: string | null | undefined;
|
|
655
|
+
continuIdPosition: string | null;
|
|
655
656
|
parentHashes: string[];
|
|
656
657
|
local?: number;
|
|
657
|
-
constructor({ secret, bundle, sourceWallet, remainderWallet, cellSlug, version }?: {
|
|
658
|
+
constructor({ secret, bundle, sourceWallet, remainderWallet, cellSlug, version, continuIdPosition }?: {
|
|
658
659
|
secret?: string | null;
|
|
659
660
|
bundle?: string | null;
|
|
660
661
|
sourceWallet?: Wallet | null;
|
|
661
662
|
remainderWallet?: Wallet | null;
|
|
662
663
|
cellSlug?: string | null;
|
|
663
664
|
version?: string | number | null;
|
|
665
|
+
continuIdPosition?: string | null;
|
|
664
666
|
});
|
|
665
667
|
get cellSlugDelimiter(): string;
|
|
666
668
|
getIsotopes(isotopes: AtomIsotope | AtomIsotope[]): Atom[];
|
|
@@ -864,6 +866,7 @@ declare class GraphQLClient implements GraphQLClient$1 {
|
|
|
864
866
|
getSocketUri(): string | null;
|
|
865
867
|
getUri(): string;
|
|
866
868
|
setUri(uri: string): void;
|
|
869
|
+
setSocketUri(socketUri: string): void;
|
|
867
870
|
socketDisconnect(): void;
|
|
868
871
|
}
|
|
869
872
|
|
|
@@ -1056,6 +1059,31 @@ declare class Mutation extends Query {
|
|
|
1056
1059
|
}): Promise<Response | null>;
|
|
1057
1060
|
}
|
|
1058
1061
|
|
|
1062
|
+
interface BaseExceptionOptions {
|
|
1063
|
+
message?: string;
|
|
1064
|
+
cause?: Error | unknown;
|
|
1065
|
+
context?: ErrorContext;
|
|
1066
|
+
code?: string;
|
|
1067
|
+
details?: Record<string, unknown>;
|
|
1068
|
+
}
|
|
1069
|
+
declare class BaseException extends Error {
|
|
1070
|
+
readonly type: KnishIOErrorType;
|
|
1071
|
+
readonly context: ErrorContext | null;
|
|
1072
|
+
readonly code: string | null;
|
|
1073
|
+
readonly details: Record<string, unknown> | null;
|
|
1074
|
+
readonly timestamp: number;
|
|
1075
|
+
constructor(type: KnishIOErrorType, message: string, options?: BaseExceptionOptions);
|
|
1076
|
+
getFullMessage(): string;
|
|
1077
|
+
toJSON(): Record<string, unknown>;
|
|
1078
|
+
isType(type: KnishIOErrorType): boolean;
|
|
1079
|
+
getContextValue(key: keyof ErrorContext): unknown;
|
|
1080
|
+
withContext(additionalContext: Partial<ErrorContext>): this;
|
|
1081
|
+
static create<T extends BaseException>(this: new (type: KnishIOErrorType, message: string, options?: BaseExceptionOptions) => T, type: KnishIOErrorType, message: string, options?: BaseExceptionOptions): T;
|
|
1082
|
+
static isKnishIOException(error: unknown): error is BaseException;
|
|
1083
|
+
static getErrorType(error: unknown): KnishIOErrorType | null;
|
|
1084
|
+
static fromError(error: Error | unknown, type?: KnishIOErrorType, additionalContext?: Partial<ErrorContext>): BaseException;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1059
1087
|
declare class ResponseProposeMolecule extends Response {
|
|
1060
1088
|
private $__clientMolecule;
|
|
1061
1089
|
constructor({ query, json }: {
|
|
@@ -1068,6 +1096,7 @@ declare class ResponseProposeMolecule extends Response {
|
|
|
1068
1096
|
success(): boolean;
|
|
1069
1097
|
status(): string;
|
|
1070
1098
|
reason(): string;
|
|
1099
|
+
toException(): BaseException | null;
|
|
1071
1100
|
payload(): any;
|
|
1072
1101
|
}
|
|
1073
1102
|
|
|
@@ -1095,6 +1124,8 @@ declare class KnishIOClient {
|
|
|
1095
1124
|
private $__remainderWallet;
|
|
1096
1125
|
private lastMoleculeQuery;
|
|
1097
1126
|
private abortControllers;
|
|
1127
|
+
private $__capabilityCache;
|
|
1128
|
+
private $__moleculeChain;
|
|
1098
1129
|
constructor(config: {
|
|
1099
1130
|
uri: string | string[];
|
|
1100
1131
|
cellSlug?: string | null;
|
|
@@ -1125,6 +1156,7 @@ declare class KnishIOClient {
|
|
|
1125
1156
|
reset(): void;
|
|
1126
1157
|
client(): GraphQLClient;
|
|
1127
1158
|
setUri(uri: string | string[]): void;
|
|
1159
|
+
setSocketUri(socketUri: string): void;
|
|
1128
1160
|
getUri(): string[];
|
|
1129
1161
|
setCellSlug(cellSlug: string | null): void;
|
|
1130
1162
|
getCellSlug(): string | null;
|
|
@@ -1144,7 +1176,9 @@ declare class KnishIOClient {
|
|
|
1144
1176
|
mutationClass: new (client: GraphQLClient, knishIOClient: KnishIOClient, molecule: Molecule) => T;
|
|
1145
1177
|
molecule?: Molecule | null;
|
|
1146
1178
|
}): Promise<T>;
|
|
1179
|
+
private withMoleculeLock;
|
|
1147
1180
|
executeQuery(query: Query | Mutation, variables?: Record<string, any> | null): Promise<Response | null>;
|
|
1181
|
+
private handlePositionDrift;
|
|
1148
1182
|
setSecret(secret: string): void;
|
|
1149
1183
|
setAuthToken(authToken: AuthToken): void;
|
|
1150
1184
|
getSourceWallet(): Promise<Wallet>;
|
|
@@ -1224,6 +1258,15 @@ declare class KnishIOClient {
|
|
|
1224
1258
|
keys?: string[] | null;
|
|
1225
1259
|
atomValues?: any[] | null;
|
|
1226
1260
|
}): Promise<Response>;
|
|
1261
|
+
hasQueryField(fieldName: string): Promise<boolean>;
|
|
1262
|
+
queryEmbeddingStatus({ metaType, metaId, instances }: {
|
|
1263
|
+
metaType?: string | null;
|
|
1264
|
+
metaId?: string | null;
|
|
1265
|
+
instances?: Array<{
|
|
1266
|
+
metaType: string;
|
|
1267
|
+
metaId: string;
|
|
1268
|
+
}> | null;
|
|
1269
|
+
}): Promise<Response | null>;
|
|
1227
1270
|
queryBatch({ batchId }: {
|
|
1228
1271
|
batchId: BatchId | string;
|
|
1229
1272
|
}): Promise<Response>;
|
|
@@ -1562,6 +1605,36 @@ declare class QueryMetaTypeViaAtom extends Query {
|
|
|
1562
1605
|
createResponse(json: any): ResponseMetaTypeViaAtom;
|
|
1563
1606
|
}
|
|
1564
1607
|
|
|
1608
|
+
interface EmbeddingStatusItem {
|
|
1609
|
+
metaType: string;
|
|
1610
|
+
metaId: string;
|
|
1611
|
+
state: 'PENDING' | 'STALE' | 'COMPLETE';
|
|
1612
|
+
totalMetas: number;
|
|
1613
|
+
embeddedCount: number;
|
|
1614
|
+
embeddedAt: number | null;
|
|
1615
|
+
model: string | null;
|
|
1616
|
+
}
|
|
1617
|
+
declare class ResponseEmbeddingStatus extends Response {
|
|
1618
|
+
constructor({ query, json }: {
|
|
1619
|
+
query: Query;
|
|
1620
|
+
json: any;
|
|
1621
|
+
});
|
|
1622
|
+
payload(): EmbeddingStatusItem[] | null;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
declare class QueryEmbeddingStatus extends Query {
|
|
1626
|
+
constructor(graphQLClient: GraphQLClient$1, knishIOClient: KnishIOClient);
|
|
1627
|
+
static createVariables({ metaType, metaId, instances }?: {
|
|
1628
|
+
metaType?: string | null;
|
|
1629
|
+
metaId?: string | null;
|
|
1630
|
+
instances?: Array<{
|
|
1631
|
+
metaType: string;
|
|
1632
|
+
metaId: string;
|
|
1633
|
+
}> | null;
|
|
1634
|
+
}): Record<string, any>;
|
|
1635
|
+
createResponse(json: any): ResponseEmbeddingStatus;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1565
1638
|
declare class ResponseContinuId extends Response {
|
|
1566
1639
|
constructor({ query, json }: {
|
|
1567
1640
|
query: Query;
|
|
@@ -1812,31 +1885,6 @@ declare function runExtendedCompatibilityTests(): {
|
|
|
1812
1885
|
}>;
|
|
1813
1886
|
};
|
|
1814
1887
|
|
|
1815
|
-
interface BaseExceptionOptions {
|
|
1816
|
-
message?: string;
|
|
1817
|
-
cause?: Error | unknown;
|
|
1818
|
-
context?: ErrorContext;
|
|
1819
|
-
code?: string;
|
|
1820
|
-
details?: Record<string, unknown>;
|
|
1821
|
-
}
|
|
1822
|
-
declare class BaseException extends Error {
|
|
1823
|
-
readonly type: KnishIOErrorType;
|
|
1824
|
-
readonly context: ErrorContext | null;
|
|
1825
|
-
readonly code: string | null;
|
|
1826
|
-
readonly details: Record<string, unknown> | null;
|
|
1827
|
-
readonly timestamp: number;
|
|
1828
|
-
constructor(type: KnishIOErrorType, message: string, options?: BaseExceptionOptions);
|
|
1829
|
-
getFullMessage(): string;
|
|
1830
|
-
toJSON(): Record<string, unknown>;
|
|
1831
|
-
isType(type: KnishIOErrorType): boolean;
|
|
1832
|
-
getContextValue(key: keyof ErrorContext): unknown;
|
|
1833
|
-
withContext(additionalContext: Partial<ErrorContext>): this;
|
|
1834
|
-
static create<T extends BaseException>(this: new (type: KnishIOErrorType, message: string, options?: BaseExceptionOptions) => T, type: KnishIOErrorType, message: string, options?: BaseExceptionOptions): T;
|
|
1835
|
-
static isKnishIOException(error: unknown): error is BaseException;
|
|
1836
|
-
static getErrorType(error: unknown): KnishIOErrorType | null;
|
|
1837
|
-
static fromError(error: Error | unknown, type?: KnishIOErrorType, additionalContext?: Partial<ErrorContext>): BaseException;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
1888
|
declare class AtomIndexException extends BaseException {
|
|
1841
1889
|
constructor(message?: string, options?: BaseExceptionOptions);
|
|
1842
1890
|
static indexConflict(index: number, existingIndex: number): AtomIndexException;
|
|
@@ -2066,4 +2114,4 @@ declare const KnishIO: {
|
|
|
2066
2114
|
};
|
|
2067
2115
|
};
|
|
2068
2116
|
|
|
2069
|
-
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$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, 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 };
|
|
2117
|
+
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, type EmbeddingStatusItem, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, Meta$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryEmbeddingStatus, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseEmbeddingStatus, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, 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 };
|