diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 296e9469e6d771..16049d26b74758 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -99,7 +99,7 @@ /types/ajv-async/ @dmitriismitnov /types/ajv-bsontype/ @adjerbetian /types/ajv-pack/ @qm3ster @ChristianMurphy -/types/akamai-edgeworkers/ @evan-hughes @wabain @swathimr @ananner @bmatthew +/types/akamai-edgeworkers/ @cdaley-akamai @wabain @yanakad @miliworking @lperra /types/akumina-core/ @akumina @jasonarden @MarshHawk /types/akumina-core/v4/ @akumina @jasonarden @MarshHawk /types/alcides/ @asaidimu @@ -5493,7 +5493,7 @@ /types/palx/ @mikefowler /types/pangu/ @plantain-00 @AH-dark /types/pannellum/ @zhirzh -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @jliuhtonen @rbarbazz @peterblazejewicz @emmanuelgautier @OpportunityLiu @matsuby +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @jliuhtonen @peterblazejewicz @emmanuelgautier @OpportunityLiu @matsuby /types/parallel-transform/ @djcsdy /types/paralleljs/ @jbaldwin /types/parameter/ @zhyupe @Runtu4378 @@ -7209,6 +7209,8 @@ /types/share-api-polyfill/ @jnv /types/sharedb/ @soney @ericyhwang @pxpeterxu @alecgibson @pypmannetjies @craigbeck /types/sharepoint/ @gandjustas @andrei-markeev @teroarvola @dennispg @SPWizard01 @betlgtu +/types/sharetribe-flex-integration-sdk/ @jayenashar @venmartin +/types/sharetribe-flex-sdk/ @jayenashar @venmartin /types/sharpie/ @peterblazejewicz /types/shasum/ @TeamworkGuy2 /types/shebang-command/ @BendingBender @@ -7968,7 +7970,7 @@ /types/typeof/ @OpenByteDev /types/typescript-deferred/ @DirtyHairy /types/typo-js/ @whawker -/types/typography/ @krzysztofzuraw @dominicfallows +/types/typography/ @dominicfallows /types/typography-breakpoint-constants/ @goblindegook /types/typopo/ @peterblazejewicz /types/typpy/ @BendingBender diff --git a/types/google-one-tap/index.d.ts b/types/google-one-tap/index.d.ts index fc84750a40886b..8372f86c84b5b2 100644 --- a/types/google-one-tap/index.d.ts +++ b/types/google-one-tap/index.d.ts @@ -23,6 +23,8 @@ export interface GsiButtonConfiguration { logo_alignment?: "left" | "center"; width?: number; locale?: string; + click_listener?: () => void; + state?: string; } export interface CredentialResponse { diff --git a/types/google-one-tap/test/google-one-tap-global.test.ts b/types/google-one-tap/test/google-one-tap-global.test.ts index 04ae19aa3e6064..bfdc406d55127a 100644 --- a/types/google-one-tap/test/google-one-tap-global.test.ts +++ b/types/google-one-tap/test/google-one-tap-global.test.ts @@ -59,6 +59,8 @@ const buttonOptions: google.GsiButtonConfiguration = { theme: "outline", size: "large", text: "continue_with", + click_listener: () => {}, + state: "test_state", }; const button: HTMLElement = new HTMLDivElement(); diff --git a/types/mokapi/http.d.ts b/types/mokapi/http.d.ts index 18410b02215956..43cf6d463f0ff1 100644 --- a/types/mokapi/http.d.ts +++ b/types/mokapi/http.d.ts @@ -115,28 +115,6 @@ export function options(url: string, body?: JSONValue, args?: Args): Response; */ export function fetch(url: string, opts?: FetchOptions): Promise; -/** - * Request arguments. - * Used to add headers to a request. - */ -export interface Args { - /** Request headers. */ - headers?: { [name: string]: string }; - /** - * The number of redirects to follow for this request. - * @default 5 - */ - maxRedirects?: number; - /** - * Maximum time to wait for the request to complete. Default - * timeout is 60 seconds ("60s"). The type can also be a number, in which - * case Mokapi interprets it as milliseconds - * @example - * const res = get(url, { timeout: '5m' }) - */ - timeout?: number | string; -} - /** * Options for the {@link fetch} function. */ @@ -187,6 +165,28 @@ export interface FetchOptions { timeout?: number | string; } +/** + * Request arguments. + * Used to add headers to a request. + */ +export interface Args { + /** Request headers. */ + headers?: { [name: string]: string }; + /** + * The number of redirects to follow for this request. + * @default 5 + */ + maxRedirects?: number; + /** + * Maximum time to wait for the request to complete. Default + * timeout is 60 seconds ("60s"). The type can also be a number, in which + * case Mokapi interprets it as milliseconds + * @example + * const res = get(url, { timeout: '5m' }) + */ + timeout?: number | string; +} + /** * Response of an HTTP request * https://mokapi.io/docs/javascript-api/mokapi-http/httpresponse diff --git a/types/mokapi/index.d.ts b/types/mokapi/index.d.ts index 481866a3b7c3da..e768bd318d9659 100644 --- a/types/mokapi/index.d.ts +++ b/types/mokapi/index.d.ts @@ -162,6 +162,9 @@ export interface HttpRequest { /** OperationId defined in OpenAPI */ readonly operationId: string; + + /** Returns a string representing this HttpRequest object. */ + toString(): string; } /** @@ -170,7 +173,7 @@ export interface HttpRequest { */ export interface HttpResponse { /** Object contains header parameters specified by OpenAPI header parameters. */ - headers: { [key: string]: string }; + headers: { [key: string]: any }; /** Specifies the http status used to select the OpenAPI response definition. */ statusCode: number; @@ -192,11 +195,17 @@ export interface Url { /** URL host. */ readonly host: string; + /** URL port */ + readonly port: number; + /** URL path. */ readonly path: string; /** URL query string. */ readonly query: string; + + /** Returns a string representing this Url object. */ + toString(): string; } /** @@ -429,20 +438,20 @@ export type DateLayout = */ export interface EventArgs { /** - * Optional key-value pairs used to label the event in the dashboard. + * Adds or overrides existing tags used to label the event in dashboard */ tags?: { [key: string]: string }; /** * Set to `true` to enable tracking of this event handler in the dashboard. - * If omitted, Mokapi automatically checks whether the response object has - * been modified and tracks the handler only if a change is detected. + * Set to `false` to disable tracking. If omitted, Mokapi checks the response + * object to determine if the handler changed it, and tracks it accordingly. */ track?: boolean; } /** - * cheduledEventArgs is an object used by every and cron function. + * ScheduledEventHandler is an object used by every and cron function. * https://mokapi.io/docs/javascript-api/mokapi/eventhandler/scheduledeventargs * @example * export default function() { diff --git a/types/mokapi/test/mokapi-tests.ts b/types/mokapi/test/mokapi-tests.ts index f658ef792fda0d..aa5d31822101f3 100644 --- a/types/mokapi/test/mokapi-tests.ts +++ b/types/mokapi/test/mokapi-tests.ts @@ -50,6 +50,16 @@ on("http", async () => {}); on("http", (request) => { request.querystring; }); +on("http", (request, response) => { + const s = request.toString(); + const url = request.url.toString(); + + response.headers = { + "Content-Type": "application/json", + }; + response.headers["Access-Control-Allow-Origin"] = "*"; + response.headers["foo"] = { bar: 123 }; +}); // @ts-expect-error every(12, () => {}); @@ -134,7 +144,6 @@ h = (req: HttpRequest, res: HttpResponse) => { res.data = 12; res.data = "foo"; res.data = {}; - // @ts-expect-error res.headers.foo = 12; res.headers.foo = "bar"; res.headers["Content-Type"] = "application/json";