-
Notifications
You must be signed in to change notification settings - Fork 3
feat: agenting.py type hints and OpenAPI specs #377 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/aiding_type_hints
Are you sure you want to change the base?
Changes from all commits
bf79ec4
3a184ad
d56e425
ccffd0c
65186c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,9 @@ import { Matter, MtrDex } from '../core/matter.ts'; | |
| import { components } from '../../types/keria-api-schema.ts'; | ||
|
|
||
| type OOBI = components['schemas']['OOBI']; | ||
| type KeyState = components['schemas']['KeyStateRecord']; | ||
| type KeyEventRecord = components['schemas']['KeyEventRecord']; | ||
| type AgentConfig = components['schemas']['AgentConfig']; | ||
|
|
||
| export function randomPasscode(): string { | ||
| const raw = libsodium.randombytes_buf(16); | ||
|
|
@@ -48,9 +51,9 @@ export class Oobis { | |
| * @async | ||
| * @param {string} oobi The OOBI to be resolver | ||
| * @param {string} [alias] Optional name or alias to link the OOBI resolution to a contact | ||
| * @returns {Promise<any>} A promise to the long-running operation | ||
| * @returns {Promise<Operation<any>>} A promise to the long-running operation | ||
| */ | ||
| async resolve(oobi: string, alias?: string): Promise<any> { | ||
| async resolve(oobi: string, alias?: string): Promise<Operation<any>> { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why any? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used any to avoid some syntax errors in current tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think lets do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for other places where we have |
||
| const path = `/oobis`; | ||
| const data: any = { | ||
| url: oobi, | ||
|
|
@@ -85,10 +88,6 @@ export interface OperationsDeps { | |
| ): Promise<Response>; | ||
| } | ||
|
|
||
| export interface AgentConfig { | ||
| iurls?: string[]; | ||
| } | ||
|
|
||
| /** | ||
| * Operations | ||
| * @remarks | ||
|
|
@@ -208,9 +207,9 @@ export class KeyEvents { | |
| * Retrieve key events for an identifier | ||
| * @async | ||
| * @param {string} pre Identifier prefix | ||
| * @returns {Promise<any>} A promise to the key events | ||
| * @returns {Promise<KeyEventRecord[]>} A promise to the key events | ||
| */ | ||
| async get(pre: string): Promise<any> { | ||
| async get(pre: string): Promise<KeyEventRecord[]> { | ||
| const path = `/events?pre=${pre}`; | ||
| const data = null; | ||
| const method = 'GET'; | ||
|
|
@@ -236,9 +235,9 @@ export class KeyStates { | |
| * Retriene the key state for an identifier | ||
| * @async | ||
| * @param {string} pre Identifier prefix | ||
| * @returns {Promise<any>} A promise to the key states | ||
| * @returns {Promise<KeyState[]>} A promise to the key states | ||
| */ | ||
| async get(pre: string): Promise<any> { | ||
| async get(pre: string): Promise<KeyState[]> { | ||
| const path = `/states?pre=${pre}`; | ||
| const data = null; | ||
| const method = 'GET'; | ||
|
|
@@ -252,7 +251,7 @@ export class KeyStates { | |
| * @param {Array<string>} pres List of identifier prefixes | ||
| * @returns {Promise<any>} A promise to the key states | ||
| */ | ||
| async list(pres: string[]): Promise<any> { | ||
| async list(pres: string[]): Promise<KeyState[]> { | ||
| const path = `/states?${pres.map((pre) => `pre=${pre}`).join('&')}`; | ||
| const data = null; | ||
| const method = 'GET'; | ||
|
|
@@ -266,9 +265,13 @@ export class KeyStates { | |
| * @param {string} pre Identifier prefix | ||
| * @param {number} [sn] Optional sequence number | ||
| * @param {any} [anchor] Optional anchor | ||
| * @returns {Promise<any>} A promise to the long-running operation | ||
| * @returns {Promise<Operation<any>>} A promise to the long-running operation | ||
| */ | ||
| async query(pre: string, sn?: string, anchor?: any): Promise<any> { | ||
| async query( | ||
| pre: string, | ||
| sn?: string, | ||
| anchor?: any | ||
| ): Promise<Operation<any>> { | ||
| const path = `/queries`; | ||
| const data: any = { | ||
| pre: pre, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, not sure if we needed to change this file - otherwise we are changing the API