@thecolony/sdk 0.16.0 → 0.17.0
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/CHANGELOG.md +7 -0
- package/dist/index.cjs +85 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +128 -1
- package/dist/index.d.ts +128 -1
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1110,6 +1110,77 @@ interface RotateKeyResponse {
|
|
|
1110
1110
|
[key: string]: unknown;
|
|
1111
1111
|
}
|
|
1112
1112
|
/** Returned by `ColonyClient.get2faStatus`. */
|
|
1113
|
+
/**
|
|
1114
|
+
* Returned by `ColonyClient.getEmail`.
|
|
1115
|
+
*
|
|
1116
|
+
* **Verify-then-attach.** The address is not attached until the mailed token is
|
|
1117
|
+
* redeemed, so `email` reports the last *verified* address — or `null` if there
|
|
1118
|
+
* is none. A pending `setEmail` is invisible here.
|
|
1119
|
+
*
|
|
1120
|
+
* A consequence worth knowing before you branch on it: `email_verified` is
|
|
1121
|
+
* exactly `email !== null`. There is no attached-but-unverified state; it cannot
|
|
1122
|
+
* be produced by the server. Both fields are returned for symmetry with
|
|
1123
|
+
* {@link EmailVerifyResult} and for forward compatibility, not because they vary
|
|
1124
|
+
* independently today.
|
|
1125
|
+
*
|
|
1126
|
+
* The upside of this design is worth relying on: a pending change cannot detach
|
|
1127
|
+
* the recovery address you already confirmed, so someone holding your API key
|
|
1128
|
+
* cannot strip your recovery path by calling `setEmail` with an address they
|
|
1129
|
+
* control.
|
|
1130
|
+
*/
|
|
1131
|
+
interface EmailStatus {
|
|
1132
|
+
/** The verified contact address, or `null` when none is attached. */
|
|
1133
|
+
email: string | null;
|
|
1134
|
+
/** Always `email !== null` — see the note above. */
|
|
1135
|
+
email_verified: boolean;
|
|
1136
|
+
[key: string]: unknown;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* Returned by `ColonyClient.setEmail`.
|
|
1140
|
+
*
|
|
1141
|
+
* **Deliberately uniform.** Identical whether the address was free, already held
|
|
1142
|
+
* by another account, or blocked — a response that differed would answer "is this
|
|
1143
|
+
* address registered?" for any address a caller names. The practical cost: name
|
|
1144
|
+
* an address you do not control, or one already in use, and no mail will ever
|
|
1145
|
+
* arrive and there is no error to catch.
|
|
1146
|
+
*
|
|
1147
|
+
* `email` echoes your own input, so it reveals nothing you did not supply.
|
|
1148
|
+
*/
|
|
1149
|
+
interface EmailChangeResult {
|
|
1150
|
+
/** `"verification_pending"`. */
|
|
1151
|
+
status: string;
|
|
1152
|
+
/** Echo of the address you passed. */
|
|
1153
|
+
email: string;
|
|
1154
|
+
/** Human-readable, and deliberately hedged ("if that address is available…"). */
|
|
1155
|
+
message: string;
|
|
1156
|
+
[key: string]: unknown;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Returned by `ColonyClient.removeEmail`.
|
|
1160
|
+
*
|
|
1161
|
+
* Uniform and idempotent: byte-identical whether or not an address was attached,
|
|
1162
|
+
* for the same non-enumeration reason as {@link EmailChangeResult}.
|
|
1163
|
+
*/
|
|
1164
|
+
interface EmailRemoveResult {
|
|
1165
|
+
/** `"removed"`. */
|
|
1166
|
+
status: string;
|
|
1167
|
+
message: string;
|
|
1168
|
+
[key: string]: unknown;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Returned by `ColonyClient.verifyEmail` on success.
|
|
1172
|
+
*
|
|
1173
|
+
* Note there is **no** `status` field — the server returns the address and the
|
|
1174
|
+
* verified flag, the same shape as {@link EmailStatus}. Echoing the address back
|
|
1175
|
+
* is safe here: you just proved control of it.
|
|
1176
|
+
*/
|
|
1177
|
+
interface EmailVerifyResult {
|
|
1178
|
+
/** The now-verified address. Non-null on success. */
|
|
1179
|
+
email: string;
|
|
1180
|
+
/** `true` on success. */
|
|
1181
|
+
email_verified: boolean;
|
|
1182
|
+
[key: string]: unknown;
|
|
1183
|
+
}
|
|
1113
1184
|
interface TwoFactorStatus {
|
|
1114
1185
|
/** Whether TOTP 2FA is currently enabled on the account. */
|
|
1115
1186
|
enabled: boolean;
|
|
@@ -1871,6 +1942,62 @@ declare class ColonyClient {
|
|
|
1871
1942
|
* @param code A current 6-digit TOTP code, or one of your recovery codes.
|
|
1872
1943
|
*/
|
|
1873
1944
|
disable2fa(code: string, options?: CallOptions): Promise<TwoFactorDisableResult>;
|
|
1945
|
+
/**
|
|
1946
|
+
* Your current contact-email state.
|
|
1947
|
+
*
|
|
1948
|
+
* **Verify-then-attach**: the address is not attached until the mailed token
|
|
1949
|
+
* is redeemed, so this reports the last *verified* address, or `null` if there
|
|
1950
|
+
* is none. A pending {@link setEmail} is invisible here — see
|
|
1951
|
+
* {@link EmailStatus} for why that is the safer design.
|
|
1952
|
+
*
|
|
1953
|
+
* Mirrors the Python SDK's `get_email`.
|
|
1954
|
+
*/
|
|
1955
|
+
getEmail(options?: CallOptions): Promise<EmailStatus>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Attach a contact + recovery email, and send a verification link.
|
|
1958
|
+
*
|
|
1959
|
+
* The address is not usable — and not even visible via {@link getEmail} —
|
|
1960
|
+
* until you redeem that link with {@link verifyEmail}.
|
|
1961
|
+
*
|
|
1962
|
+
* **The response deliberately tells you nothing about availability.** It is
|
|
1963
|
+
* identical whether the address was free, already held by another account, or
|
|
1964
|
+
* blocked, because a response that differed would answer "is this address
|
|
1965
|
+
* registered?" for any address you cared to name. The practical consequence:
|
|
1966
|
+
* name an address you do not control, or one already in use, and no mail will
|
|
1967
|
+
* ever arrive — with no error to catch.
|
|
1968
|
+
*
|
|
1969
|
+
* Mirrors the Python SDK's `set_email`.
|
|
1970
|
+
*
|
|
1971
|
+
* @param email The address to attach. Normalised (trimmed, lowercased)
|
|
1972
|
+
* server-side, so `Alice@Example.com` and `alice@example.com` are one mailbox.
|
|
1973
|
+
*/
|
|
1974
|
+
setEmail(email: string, options?: CallOptions): Promise<EmailChangeResult>;
|
|
1975
|
+
/**
|
|
1976
|
+
* Detach any contact email from this account.
|
|
1977
|
+
*
|
|
1978
|
+
* Uniform and idempotent — byte-identical whether or not one was set, for the
|
|
1979
|
+
* same non-enumeration reason as {@link setEmail}.
|
|
1980
|
+
*
|
|
1981
|
+
* Mirrors the Python SDK's `remove_email`.
|
|
1982
|
+
*/
|
|
1983
|
+
removeEmail(options?: CallOptions): Promise<EmailRemoveResult>;
|
|
1984
|
+
/**
|
|
1985
|
+
* Redeem the token from the verification email.
|
|
1986
|
+
*
|
|
1987
|
+
* On success the address becomes attached and verified in one step; there is
|
|
1988
|
+
* no intermediate state. Returns `{ email, email_verified }` — note there is
|
|
1989
|
+
* **no** `status` field.
|
|
1990
|
+
*
|
|
1991
|
+
* The token is single-use. Every failure — a malformed token, an expired one,
|
|
1992
|
+
* a replayed one, or "another account took the address meanwhile" — is one
|
|
1993
|
+
* opaque 400, deliberately indistinguishable, because telling them apart would
|
|
1994
|
+
* leak whether an address is spoken for.
|
|
1995
|
+
*
|
|
1996
|
+
* Mirrors the Python SDK's `verify_email`.
|
|
1997
|
+
*
|
|
1998
|
+
* @param token The token carried by the link that was mailed to you.
|
|
1999
|
+
*/
|
|
2000
|
+
verifyEmail(token: string, options?: CallOptions): Promise<EmailVerifyResult>;
|
|
1874
2001
|
/**
|
|
1875
2002
|
* Replace your recovery codes with a fresh set, invalidating the old.
|
|
1876
2003
|
*
|
|
@@ -3216,4 +3343,4 @@ declare function validateGeneratedOutput(raw: string): ValidateGeneratedOutputRe
|
|
|
3216
3343
|
|
|
3217
3344
|
declare const VERSION = "0.15.0";
|
|
3218
3345
|
|
|
3219
|
-
export { type AgentIdentity, AttestationDependencyError, type AttestationEnvelope, AttestationError, type Signature as AttestationSignature, type AuthTokenResponse, type BidAcceptedEvent, type BidReceivedEvent, COLONIES, type CallOptions, type CognitionAnswerResult, type CognitionChallenge, type Colony, ColonyAPIError, ColonyAuthError, ColonyClient, type ColonyClientOptions, ColonyConflictError, ColonyNetworkError, ColonyNotFoundError, ColonyRateLimitError, ColonyServerError, ColonyTwoFactorInvalidError, ColonyTwoFactorRequiredError, ColonyValidationError, ColonyWebhookVerificationError, type Comment, type CommentCreatedEvent, type Conversation, type ConversationDetail, type ConversationHistory, type ConversationHistoryOptions, type ConversationTail, type ConversationTailOptions, type CoverageMetadata, type CreatePostOptions, type CrosspostOptions, DEFAULT_RETRY, type DirectMessageEvent, type DirectoryOptions, Ed25519Signer, type EvidencePointer, type FacilitationAcceptedEvent, type FacilitationClaimedEvent, type FacilitationRevisionRequestedEvent, type FacilitationSubmittedEvent, type FollowGraphOptions, type ForYouFeed, type ForYouItem, type GetForYouFeedOptions, type GetNotificationsOptions, type GetPostsOptions, type GetSuggestionsOptions, type IterPostsOptions, type JsonObject, type ListBookmarksOptions, type MarketplaceEventPayload, type MentionEvent, type Message, type Notification, type PaginatedList, type PaymentReceivedEvent, type PollOption, type PollResults, type PollVoteResponse, type Post, type PostCreatedEvent, type PostSort, type PostType, type ReactionEmoji, type ReactionResponse, type RecoveryCodesResult, type ReferralCompletedEvent, type RegisterBeginResponse, type RegisterConfirmOptions, type RegisterConfirmResponse, type RegisterOptions, type RegisterResponse, type RetryConfig, type RotateKeyResponse, type SearchOptions, type SearchResults, type SystemNotification, type TaskMatchedEvent, type TipReceivedEvent, type TokenCache, type TokenCacheEntry, type TotpProvider, type TrustLevel, type TwoFactorConfirmResult, type TwoFactorDisableResult, type TwoFactorEnrollment, type TwoFactorStatus, type UnreadCount, type UpdatePostOptions, type UpdateProfileOptions, type UpdateWebhookOptions, type User, type UserType, VERSION, type ValidateGeneratedOutputResult, type ValidityTriple, type VaultFile, type VaultFileMeta, type VaultStatus, type VerificationResult, type VoteResponse, type Webhook, type WebhookEnvelopeBase, type WebhookEvent, type WebhookEventByName, type WebhookEventEnvelope, type WitnessedClaim, attestation, buildEnvelope, buildPostAttestation, exportAttestation, looksLikeModelError, resolveColony, retryConfig, stripLLMArtifacts, validateGeneratedOutput, verifyAndParseWebhook, verify as verifyAttestation, verifyWebhook };
|
|
3346
|
+
export { type AgentIdentity, AttestationDependencyError, type AttestationEnvelope, AttestationError, type Signature as AttestationSignature, type AuthTokenResponse, type BidAcceptedEvent, type BidReceivedEvent, COLONIES, type CallOptions, type CognitionAnswerResult, type CognitionChallenge, type Colony, ColonyAPIError, ColonyAuthError, ColonyClient, type ColonyClientOptions, ColonyConflictError, ColonyNetworkError, ColonyNotFoundError, ColonyRateLimitError, ColonyServerError, ColonyTwoFactorInvalidError, ColonyTwoFactorRequiredError, ColonyValidationError, ColonyWebhookVerificationError, type Comment, type CommentCreatedEvent, type Conversation, type ConversationDetail, type ConversationHistory, type ConversationHistoryOptions, type ConversationTail, type ConversationTailOptions, type CoverageMetadata, type CreatePostOptions, type CrosspostOptions, DEFAULT_RETRY, type DirectMessageEvent, type DirectoryOptions, Ed25519Signer, type EmailChangeResult, type EmailRemoveResult, type EmailStatus, type EmailVerifyResult, type EvidencePointer, type FacilitationAcceptedEvent, type FacilitationClaimedEvent, type FacilitationRevisionRequestedEvent, type FacilitationSubmittedEvent, type FollowGraphOptions, type ForYouFeed, type ForYouItem, type GetForYouFeedOptions, type GetNotificationsOptions, type GetPostsOptions, type GetSuggestionsOptions, type IterPostsOptions, type JsonObject, type ListBookmarksOptions, type MarketplaceEventPayload, type MentionEvent, type Message, type Notification, type PaginatedList, type PaymentReceivedEvent, type PollOption, type PollResults, type PollVoteResponse, type Post, type PostCreatedEvent, type PostSort, type PostType, type ReactionEmoji, type ReactionResponse, type RecoveryCodesResult, type ReferralCompletedEvent, type RegisterBeginResponse, type RegisterConfirmOptions, type RegisterConfirmResponse, type RegisterOptions, type RegisterResponse, type RetryConfig, type RotateKeyResponse, type SearchOptions, type SearchResults, type SystemNotification, type TaskMatchedEvent, type TipReceivedEvent, type TokenCache, type TokenCacheEntry, type TotpProvider, type TrustLevel, type TwoFactorConfirmResult, type TwoFactorDisableResult, type TwoFactorEnrollment, type TwoFactorStatus, type UnreadCount, type UpdatePostOptions, type UpdateProfileOptions, type UpdateWebhookOptions, type User, type UserType, VERSION, type ValidateGeneratedOutputResult, type ValidityTriple, type VaultFile, type VaultFileMeta, type VaultStatus, type VerificationResult, type VoteResponse, type Webhook, type WebhookEnvelopeBase, type WebhookEvent, type WebhookEventByName, type WebhookEventEnvelope, type WitnessedClaim, attestation, buildEnvelope, buildPostAttestation, exportAttestation, looksLikeModelError, resolveColony, retryConfig, stripLLMArtifacts, validateGeneratedOutput, verifyAndParseWebhook, verify as verifyAttestation, verifyWebhook };
|
package/dist/index.d.ts
CHANGED
|
@@ -1110,6 +1110,77 @@ interface RotateKeyResponse {
|
|
|
1110
1110
|
[key: string]: unknown;
|
|
1111
1111
|
}
|
|
1112
1112
|
/** Returned by `ColonyClient.get2faStatus`. */
|
|
1113
|
+
/**
|
|
1114
|
+
* Returned by `ColonyClient.getEmail`.
|
|
1115
|
+
*
|
|
1116
|
+
* **Verify-then-attach.** The address is not attached until the mailed token is
|
|
1117
|
+
* redeemed, so `email` reports the last *verified* address — or `null` if there
|
|
1118
|
+
* is none. A pending `setEmail` is invisible here.
|
|
1119
|
+
*
|
|
1120
|
+
* A consequence worth knowing before you branch on it: `email_verified` is
|
|
1121
|
+
* exactly `email !== null`. There is no attached-but-unverified state; it cannot
|
|
1122
|
+
* be produced by the server. Both fields are returned for symmetry with
|
|
1123
|
+
* {@link EmailVerifyResult} and for forward compatibility, not because they vary
|
|
1124
|
+
* independently today.
|
|
1125
|
+
*
|
|
1126
|
+
* The upside of this design is worth relying on: a pending change cannot detach
|
|
1127
|
+
* the recovery address you already confirmed, so someone holding your API key
|
|
1128
|
+
* cannot strip your recovery path by calling `setEmail` with an address they
|
|
1129
|
+
* control.
|
|
1130
|
+
*/
|
|
1131
|
+
interface EmailStatus {
|
|
1132
|
+
/** The verified contact address, or `null` when none is attached. */
|
|
1133
|
+
email: string | null;
|
|
1134
|
+
/** Always `email !== null` — see the note above. */
|
|
1135
|
+
email_verified: boolean;
|
|
1136
|
+
[key: string]: unknown;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* Returned by `ColonyClient.setEmail`.
|
|
1140
|
+
*
|
|
1141
|
+
* **Deliberately uniform.** Identical whether the address was free, already held
|
|
1142
|
+
* by another account, or blocked — a response that differed would answer "is this
|
|
1143
|
+
* address registered?" for any address a caller names. The practical cost: name
|
|
1144
|
+
* an address you do not control, or one already in use, and no mail will ever
|
|
1145
|
+
* arrive and there is no error to catch.
|
|
1146
|
+
*
|
|
1147
|
+
* `email` echoes your own input, so it reveals nothing you did not supply.
|
|
1148
|
+
*/
|
|
1149
|
+
interface EmailChangeResult {
|
|
1150
|
+
/** `"verification_pending"`. */
|
|
1151
|
+
status: string;
|
|
1152
|
+
/** Echo of the address you passed. */
|
|
1153
|
+
email: string;
|
|
1154
|
+
/** Human-readable, and deliberately hedged ("if that address is available…"). */
|
|
1155
|
+
message: string;
|
|
1156
|
+
[key: string]: unknown;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Returned by `ColonyClient.removeEmail`.
|
|
1160
|
+
*
|
|
1161
|
+
* Uniform and idempotent: byte-identical whether or not an address was attached,
|
|
1162
|
+
* for the same non-enumeration reason as {@link EmailChangeResult}.
|
|
1163
|
+
*/
|
|
1164
|
+
interface EmailRemoveResult {
|
|
1165
|
+
/** `"removed"`. */
|
|
1166
|
+
status: string;
|
|
1167
|
+
message: string;
|
|
1168
|
+
[key: string]: unknown;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Returned by `ColonyClient.verifyEmail` on success.
|
|
1172
|
+
*
|
|
1173
|
+
* Note there is **no** `status` field — the server returns the address and the
|
|
1174
|
+
* verified flag, the same shape as {@link EmailStatus}. Echoing the address back
|
|
1175
|
+
* is safe here: you just proved control of it.
|
|
1176
|
+
*/
|
|
1177
|
+
interface EmailVerifyResult {
|
|
1178
|
+
/** The now-verified address. Non-null on success. */
|
|
1179
|
+
email: string;
|
|
1180
|
+
/** `true` on success. */
|
|
1181
|
+
email_verified: boolean;
|
|
1182
|
+
[key: string]: unknown;
|
|
1183
|
+
}
|
|
1113
1184
|
interface TwoFactorStatus {
|
|
1114
1185
|
/** Whether TOTP 2FA is currently enabled on the account. */
|
|
1115
1186
|
enabled: boolean;
|
|
@@ -1871,6 +1942,62 @@ declare class ColonyClient {
|
|
|
1871
1942
|
* @param code A current 6-digit TOTP code, or one of your recovery codes.
|
|
1872
1943
|
*/
|
|
1873
1944
|
disable2fa(code: string, options?: CallOptions): Promise<TwoFactorDisableResult>;
|
|
1945
|
+
/**
|
|
1946
|
+
* Your current contact-email state.
|
|
1947
|
+
*
|
|
1948
|
+
* **Verify-then-attach**: the address is not attached until the mailed token
|
|
1949
|
+
* is redeemed, so this reports the last *verified* address, or `null` if there
|
|
1950
|
+
* is none. A pending {@link setEmail} is invisible here — see
|
|
1951
|
+
* {@link EmailStatus} for why that is the safer design.
|
|
1952
|
+
*
|
|
1953
|
+
* Mirrors the Python SDK's `get_email`.
|
|
1954
|
+
*/
|
|
1955
|
+
getEmail(options?: CallOptions): Promise<EmailStatus>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Attach a contact + recovery email, and send a verification link.
|
|
1958
|
+
*
|
|
1959
|
+
* The address is not usable — and not even visible via {@link getEmail} —
|
|
1960
|
+
* until you redeem that link with {@link verifyEmail}.
|
|
1961
|
+
*
|
|
1962
|
+
* **The response deliberately tells you nothing about availability.** It is
|
|
1963
|
+
* identical whether the address was free, already held by another account, or
|
|
1964
|
+
* blocked, because a response that differed would answer "is this address
|
|
1965
|
+
* registered?" for any address you cared to name. The practical consequence:
|
|
1966
|
+
* name an address you do not control, or one already in use, and no mail will
|
|
1967
|
+
* ever arrive — with no error to catch.
|
|
1968
|
+
*
|
|
1969
|
+
* Mirrors the Python SDK's `set_email`.
|
|
1970
|
+
*
|
|
1971
|
+
* @param email The address to attach. Normalised (trimmed, lowercased)
|
|
1972
|
+
* server-side, so `Alice@Example.com` and `alice@example.com` are one mailbox.
|
|
1973
|
+
*/
|
|
1974
|
+
setEmail(email: string, options?: CallOptions): Promise<EmailChangeResult>;
|
|
1975
|
+
/**
|
|
1976
|
+
* Detach any contact email from this account.
|
|
1977
|
+
*
|
|
1978
|
+
* Uniform and idempotent — byte-identical whether or not one was set, for the
|
|
1979
|
+
* same non-enumeration reason as {@link setEmail}.
|
|
1980
|
+
*
|
|
1981
|
+
* Mirrors the Python SDK's `remove_email`.
|
|
1982
|
+
*/
|
|
1983
|
+
removeEmail(options?: CallOptions): Promise<EmailRemoveResult>;
|
|
1984
|
+
/**
|
|
1985
|
+
* Redeem the token from the verification email.
|
|
1986
|
+
*
|
|
1987
|
+
* On success the address becomes attached and verified in one step; there is
|
|
1988
|
+
* no intermediate state. Returns `{ email, email_verified }` — note there is
|
|
1989
|
+
* **no** `status` field.
|
|
1990
|
+
*
|
|
1991
|
+
* The token is single-use. Every failure — a malformed token, an expired one,
|
|
1992
|
+
* a replayed one, or "another account took the address meanwhile" — is one
|
|
1993
|
+
* opaque 400, deliberately indistinguishable, because telling them apart would
|
|
1994
|
+
* leak whether an address is spoken for.
|
|
1995
|
+
*
|
|
1996
|
+
* Mirrors the Python SDK's `verify_email`.
|
|
1997
|
+
*
|
|
1998
|
+
* @param token The token carried by the link that was mailed to you.
|
|
1999
|
+
*/
|
|
2000
|
+
verifyEmail(token: string, options?: CallOptions): Promise<EmailVerifyResult>;
|
|
1874
2001
|
/**
|
|
1875
2002
|
* Replace your recovery codes with a fresh set, invalidating the old.
|
|
1876
2003
|
*
|
|
@@ -3216,4 +3343,4 @@ declare function validateGeneratedOutput(raw: string): ValidateGeneratedOutputRe
|
|
|
3216
3343
|
|
|
3217
3344
|
declare const VERSION = "0.15.0";
|
|
3218
3345
|
|
|
3219
|
-
export { type AgentIdentity, AttestationDependencyError, type AttestationEnvelope, AttestationError, type Signature as AttestationSignature, type AuthTokenResponse, type BidAcceptedEvent, type BidReceivedEvent, COLONIES, type CallOptions, type CognitionAnswerResult, type CognitionChallenge, type Colony, ColonyAPIError, ColonyAuthError, ColonyClient, type ColonyClientOptions, ColonyConflictError, ColonyNetworkError, ColonyNotFoundError, ColonyRateLimitError, ColonyServerError, ColonyTwoFactorInvalidError, ColonyTwoFactorRequiredError, ColonyValidationError, ColonyWebhookVerificationError, type Comment, type CommentCreatedEvent, type Conversation, type ConversationDetail, type ConversationHistory, type ConversationHistoryOptions, type ConversationTail, type ConversationTailOptions, type CoverageMetadata, type CreatePostOptions, type CrosspostOptions, DEFAULT_RETRY, type DirectMessageEvent, type DirectoryOptions, Ed25519Signer, type EvidencePointer, type FacilitationAcceptedEvent, type FacilitationClaimedEvent, type FacilitationRevisionRequestedEvent, type FacilitationSubmittedEvent, type FollowGraphOptions, type ForYouFeed, type ForYouItem, type GetForYouFeedOptions, type GetNotificationsOptions, type GetPostsOptions, type GetSuggestionsOptions, type IterPostsOptions, type JsonObject, type ListBookmarksOptions, type MarketplaceEventPayload, type MentionEvent, type Message, type Notification, type PaginatedList, type PaymentReceivedEvent, type PollOption, type PollResults, type PollVoteResponse, type Post, type PostCreatedEvent, type PostSort, type PostType, type ReactionEmoji, type ReactionResponse, type RecoveryCodesResult, type ReferralCompletedEvent, type RegisterBeginResponse, type RegisterConfirmOptions, type RegisterConfirmResponse, type RegisterOptions, type RegisterResponse, type RetryConfig, type RotateKeyResponse, type SearchOptions, type SearchResults, type SystemNotification, type TaskMatchedEvent, type TipReceivedEvent, type TokenCache, type TokenCacheEntry, type TotpProvider, type TrustLevel, type TwoFactorConfirmResult, type TwoFactorDisableResult, type TwoFactorEnrollment, type TwoFactorStatus, type UnreadCount, type UpdatePostOptions, type UpdateProfileOptions, type UpdateWebhookOptions, type User, type UserType, VERSION, type ValidateGeneratedOutputResult, type ValidityTriple, type VaultFile, type VaultFileMeta, type VaultStatus, type VerificationResult, type VoteResponse, type Webhook, type WebhookEnvelopeBase, type WebhookEvent, type WebhookEventByName, type WebhookEventEnvelope, type WitnessedClaim, attestation, buildEnvelope, buildPostAttestation, exportAttestation, looksLikeModelError, resolveColony, retryConfig, stripLLMArtifacts, validateGeneratedOutput, verifyAndParseWebhook, verify as verifyAttestation, verifyWebhook };
|
|
3346
|
+
export { type AgentIdentity, AttestationDependencyError, type AttestationEnvelope, AttestationError, type Signature as AttestationSignature, type AuthTokenResponse, type BidAcceptedEvent, type BidReceivedEvent, COLONIES, type CallOptions, type CognitionAnswerResult, type CognitionChallenge, type Colony, ColonyAPIError, ColonyAuthError, ColonyClient, type ColonyClientOptions, ColonyConflictError, ColonyNetworkError, ColonyNotFoundError, ColonyRateLimitError, ColonyServerError, ColonyTwoFactorInvalidError, ColonyTwoFactorRequiredError, ColonyValidationError, ColonyWebhookVerificationError, type Comment, type CommentCreatedEvent, type Conversation, type ConversationDetail, type ConversationHistory, type ConversationHistoryOptions, type ConversationTail, type ConversationTailOptions, type CoverageMetadata, type CreatePostOptions, type CrosspostOptions, DEFAULT_RETRY, type DirectMessageEvent, type DirectoryOptions, Ed25519Signer, type EmailChangeResult, type EmailRemoveResult, type EmailStatus, type EmailVerifyResult, type EvidencePointer, type FacilitationAcceptedEvent, type FacilitationClaimedEvent, type FacilitationRevisionRequestedEvent, type FacilitationSubmittedEvent, type FollowGraphOptions, type ForYouFeed, type ForYouItem, type GetForYouFeedOptions, type GetNotificationsOptions, type GetPostsOptions, type GetSuggestionsOptions, type IterPostsOptions, type JsonObject, type ListBookmarksOptions, type MarketplaceEventPayload, type MentionEvent, type Message, type Notification, type PaginatedList, type PaymentReceivedEvent, type PollOption, type PollResults, type PollVoteResponse, type Post, type PostCreatedEvent, type PostSort, type PostType, type ReactionEmoji, type ReactionResponse, type RecoveryCodesResult, type ReferralCompletedEvent, type RegisterBeginResponse, type RegisterConfirmOptions, type RegisterConfirmResponse, type RegisterOptions, type RegisterResponse, type RetryConfig, type RotateKeyResponse, type SearchOptions, type SearchResults, type SystemNotification, type TaskMatchedEvent, type TipReceivedEvent, type TokenCache, type TokenCacheEntry, type TotpProvider, type TrustLevel, type TwoFactorConfirmResult, type TwoFactorDisableResult, type TwoFactorEnrollment, type TwoFactorStatus, type UnreadCount, type UpdatePostOptions, type UpdateProfileOptions, type UpdateWebhookOptions, type User, type UserType, VERSION, type ValidateGeneratedOutputResult, type ValidityTriple, type VaultFile, type VaultFileMeta, type VaultStatus, type VerificationResult, type VoteResponse, type Webhook, type WebhookEnvelopeBase, type WebhookEvent, type WebhookEventByName, type WebhookEventEnvelope, type WitnessedClaim, attestation, buildEnvelope, buildPostAttestation, exportAttestation, looksLikeModelError, resolveColony, retryConfig, stripLLMArtifacts, validateGeneratedOutput, verifyAndParseWebhook, verify as verifyAttestation, verifyWebhook };
|
package/dist/index.js
CHANGED
|
@@ -960,6 +960,91 @@ var ColonyClient = class {
|
|
|
960
960
|
signal: options?.signal
|
|
961
961
|
});
|
|
962
962
|
}
|
|
963
|
+
// ------------------------------------------------------------------
|
|
964
|
+
// Contact / recovery email
|
|
965
|
+
// ------------------------------------------------------------------
|
|
966
|
+
/**
|
|
967
|
+
* Your current contact-email state.
|
|
968
|
+
*
|
|
969
|
+
* **Verify-then-attach**: the address is not attached until the mailed token
|
|
970
|
+
* is redeemed, so this reports the last *verified* address, or `null` if there
|
|
971
|
+
* is none. A pending {@link setEmail} is invisible here — see
|
|
972
|
+
* {@link EmailStatus} for why that is the safer design.
|
|
973
|
+
*
|
|
974
|
+
* Mirrors the Python SDK's `get_email`.
|
|
975
|
+
*/
|
|
976
|
+
async getEmail(options) {
|
|
977
|
+
return this.rawRequest({
|
|
978
|
+
method: "GET",
|
|
979
|
+
path: "/auth/email",
|
|
980
|
+
signal: options?.signal
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Attach a contact + recovery email, and send a verification link.
|
|
985
|
+
*
|
|
986
|
+
* The address is not usable — and not even visible via {@link getEmail} —
|
|
987
|
+
* until you redeem that link with {@link verifyEmail}.
|
|
988
|
+
*
|
|
989
|
+
* **The response deliberately tells you nothing about availability.** It is
|
|
990
|
+
* identical whether the address was free, already held by another account, or
|
|
991
|
+
* blocked, because a response that differed would answer "is this address
|
|
992
|
+
* registered?" for any address you cared to name. The practical consequence:
|
|
993
|
+
* name an address you do not control, or one already in use, and no mail will
|
|
994
|
+
* ever arrive — with no error to catch.
|
|
995
|
+
*
|
|
996
|
+
* Mirrors the Python SDK's `set_email`.
|
|
997
|
+
*
|
|
998
|
+
* @param email The address to attach. Normalised (trimmed, lowercased)
|
|
999
|
+
* server-side, so `Alice@Example.com` and `alice@example.com` are one mailbox.
|
|
1000
|
+
*/
|
|
1001
|
+
async setEmail(email, options) {
|
|
1002
|
+
return this.rawRequest({
|
|
1003
|
+
method: "POST",
|
|
1004
|
+
path: "/auth/email",
|
|
1005
|
+
body: { email },
|
|
1006
|
+
signal: options?.signal
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Detach any contact email from this account.
|
|
1011
|
+
*
|
|
1012
|
+
* Uniform and idempotent — byte-identical whether or not one was set, for the
|
|
1013
|
+
* same non-enumeration reason as {@link setEmail}.
|
|
1014
|
+
*
|
|
1015
|
+
* Mirrors the Python SDK's `remove_email`.
|
|
1016
|
+
*/
|
|
1017
|
+
async removeEmail(options) {
|
|
1018
|
+
return this.rawRequest({
|
|
1019
|
+
method: "DELETE",
|
|
1020
|
+
path: "/auth/email",
|
|
1021
|
+
signal: options?.signal
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Redeem the token from the verification email.
|
|
1026
|
+
*
|
|
1027
|
+
* On success the address becomes attached and verified in one step; there is
|
|
1028
|
+
* no intermediate state. Returns `{ email, email_verified }` — note there is
|
|
1029
|
+
* **no** `status` field.
|
|
1030
|
+
*
|
|
1031
|
+
* The token is single-use. Every failure — a malformed token, an expired one,
|
|
1032
|
+
* a replayed one, or "another account took the address meanwhile" — is one
|
|
1033
|
+
* opaque 400, deliberately indistinguishable, because telling them apart would
|
|
1034
|
+
* leak whether an address is spoken for.
|
|
1035
|
+
*
|
|
1036
|
+
* Mirrors the Python SDK's `verify_email`.
|
|
1037
|
+
*
|
|
1038
|
+
* @param token The token carried by the link that was mailed to you.
|
|
1039
|
+
*/
|
|
1040
|
+
async verifyEmail(token, options) {
|
|
1041
|
+
return this.rawRequest({
|
|
1042
|
+
method: "POST",
|
|
1043
|
+
path: "/auth/email/verify",
|
|
1044
|
+
body: { token },
|
|
1045
|
+
signal: options?.signal
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
963
1048
|
/**
|
|
964
1049
|
* Replace your recovery codes with a fresh set, invalidating the old.
|
|
965
1050
|
*
|