=============== LIBRARY RULES =============== From library maintainers: - The published site is https://docs.khanh.id. - Each library is its own product. Pages start at //overview. - Use only the APIs and fields written on the pages for that library. ### Quick Example: With what-the-fetch Source: https://github.com/hckhanh/docs/blob/main/what-the-fetch/overview.mdx Shows how to define an API schema with Zod and create a type-safe fetch client using createFetch. The schema declares GET /users/:id and POST /users endpoints with inferred methods. Use this as the starting point for building a typed API client. ```typescript import { createFetch } from 'what-the-fetch'; import { z } from 'zod'; // Define API schema once (methods inferred automatically) const api = { '/users/:id': { // GET (no body) params: z.object({ id: z.number() }), query: z.object({ fields: z.string().optional() }), response: z.object({ id: z.number(), name: z.string(), email: z.string() }) }, '/users': { // POST (has body) body: z.object({ name: z.string(), email: z.string() }), response: z.object({ id: z.number(), name: z.string() }) } }; const apiFetch = createFetch(api, 'https://api.example.com'); ``` ", credentialType: "", }, defaultTtl: "", environmentSlug: "", path: "", projectSlug: "", }, ) ``` ### Arguments | Property | Type | Required | Description | | --- | --- | --- | --- | | `configuration` | `DynamicSecretKubernetesConfiguration (input)` | yes | The configuration of the dynamic secret | | `defaultTtl` | `string` | yes | The default TTL that will be applied for all the leases. | | `environmentSlug` | `string` | yes | The slug of the environment to create the dynamic secret in. | | `maxTtl` | `string` | no | The maximum limit a TTL can be leased or renewed for. | | `metadatas` | `DynamicSecretKubernetesMetadata (input)[]` | no | The metadata associated with this dynamic secret | | `name` | `string` | no | The name of the dynamic secret. | | `path` | `string` | yes | The path to create the dynamic secret in. | | `projectSlug` | `string` | yes | The slug of the project to create dynamic secret in. | | `usernameTemplate` | `string` | no | The username template of the dynamic secret | ``` -------------------------------- ### Create ComputeContainerApp Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/bunnynet/resources/compute-container-app.mdx Example of creating a ComputeContainerApp resource with required arguments. ```APIDOC ## Create ComputeContainerApp ### Description Creates a new ComputeContainerApp resource in the pulumi-bunnynet provider. This resource manages a container application with configurable regions, autoscaling, containers, and volumes. ### Method Create ### Endpoint `new bunnynet.ComputeContainerApp(name, args, opts)` ### Parameters #### Arguments - `autoscalingMax` (number) - Optional - The maximum number of instances that will be provisioned per active region. - `autoscalingMin` (number) - Optional - The minimum number of instances that will be provisioned per active region. - `containers` (ComputeContainerAppContainer (input)[]) - Optional - Defines a container for the application. - `name` (string) - Optional - The name of the application. - `regionsAlloweds` (string[]) - Required - The regions that will be dynamically provisionable based on the user latency. - `regionsMaxAllowed` (number) - Optional - The maximum amount of regions to be deployed at any given time. - `regionsRequireds` (string[]) - Required - The regions that will be statically provisioned and will always be running and available to users. - `version` (number) - Optional - (no description provided) - `volumes` (ComputeContainerAppVolume (input)[]) - Optional - Defines a persistent volume to be used by the application. ### Request Example ```ts import * as bunnynet from "pulumi-bunnynet" const resource = new bunnynet.ComputeContainerApp("computeContainerApp", { regionsAlloweds: [""], regionsRequireds: [""], }) ``` ### Response Returns a new ComputeContainerApp resource instance. ``` -------------------------------- ### Install ArkType schema validation library Source: https://github.com/hckhanh/docs/blob/main/what-the-fetch/getting-started.mdx Install ArkType, a schema validation library that implements Standard Schema, required for what-the-fetch. ```bash npm install arktype ``` -------------------------------- ### Combined Path and Query Parameters Example Source: https://github.com/hckhanh/docs/blob/main/fast-url/getting-started.mdx Mix path substitution with query parameters using createUrl. The output is logged to the console. ```javascript import { createUrl } from "fast-url" const url = createUrl("https://api.example.com", "/users/:id/posts", { id: 123, limit: 10, published: true, }) console.log(url) // → 'https://api.example.com/users/123/posts?limit=10&published=true' ``` -------------------------------- ### createFetch() Source: https://github.com/hckhanh/docs/blob/main/what-the-fetch/api-reference.mdx Documentation for the createFetch function, including its signature, parameters, return type, and a usage example. ```APIDOC ## `createFetch()` ### Description Creates a type-safe fetch function for your API. ### Signature ```typescript function createFetch( apis: Schema, baseUrl: string, sharedInit?: RequestInit, ): >( path: Path, options?: FetchOptions, init?: RequestInit, ) => Promise> ``` ### Parameters - `apis` (Schema) - Required - An object mapping API paths to their schema definitions. - `baseUrl` (string) - Required - The base URL for all API requests. - `sharedInit` (RequestInit) - Optional - Shared [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) options that will be merged with per-request options. ### Returns A typed fetch function that accepts: - `path` (Path) - The API path (must be a key from your schema). - `options` (FetchOptions) - Optional - Request options (params, query, body) based on the path's schema. - `init` (RequestInit) - Optional - Per-request [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) to customize the fetch request (merged with sharedInit). ### Example ```typescript import { createFetch } from "what-the-fetch" import { z } from "zod" const api = { "/users/:id": { params: z.object({ id: z.number() }), query: z.object({ fields: z.string().optional() }), response: z.object({ id: z.number(), name: z.string(), email: z.string(), }), }, } const apiFetch = createFetch(api, "https://api.example.com") const user = await apiFetch("/users/:id", { params: { id: 123 }, query: { fields: "name,email" }, }) // user is typed as { id: number; name: string; email: string } ``` ``` -------------------------------- ### Install Zod schema validation library Source: https://github.com/hckhanh/docs/blob/main/what-the-fetch/getting-started.mdx Install Zod, a schema validation library that implements Standard Schema, required for what-the-fetch. ```bash npm install zod ``` -------------------------------- ### Install vn-number with yarn Source: https://github.com/hckhanh/docs/blob/main/vn-number/overview.mdx Installs the vn-number package using the yarn package manager. Use this command in a project that uses yarn. ```bash yarn add vn-number ``` -------------------------------- ### getKubernetesApplication Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/portainer/functions/get-kubernetes-application.mdx Documentation for the getKubernetesApplication function in the pulumi-portainer SDK, including arguments, result fields, and an example invocation. ```APIDOC ## portainer:index/getKubernetesApplication:getKubernetesApplication ### Description Invokes the `getKubernetesApplication` function from the pulumi-portainer SDK to retrieve details about a Kubernetes application. This function is called directly by users to fetch application information based on the provided arguments. ### Invoke Token `portainer:index/getKubernetesApplication:getKubernetesApplication` ### Arguments | Property | Type | Required | Description | | -------------- | -------- | -------- | ----------- | | `endpointId` | `number` | yes | | | `id` | `string` | no | | | `name` | `string` | yes | | | `namespace` | `string` | yes | | | `resourceType` | `string` | no | | ### Result | Property | Type | Always present | Description | | ------------------ | --------------------------- | -------------- | ----------- | | `applicationOwner` | `string` | yes | | | `applicationType` | `string` | yes | | | `creationDate` | `string` | yes | | | `deploymentType` | `string` | yes | | | `details` | `string` | yes | | | `endpointId` | `number` | yes | | | `id` | `string` | yes | | | `image` | `string` | yes | | | `kind` | `string` | yes | | | `labels` | `{ [key: string]: string }` | yes | | | `loadBalancerIp` | `string` | yes | | | `name` | `string` | yes | | | `namespace` | `string` | yes | | | `resourceType` | `string` | no | | | `runningPods` | `number` | yes | | | `serviceName` | `string` | yes | | | `serviceType` | `string` | yes | | | `stackId` | `string` | yes | | | `stackName` | `string` | yes | | | `status` | `string` | yes | | | `totalPods` | `number` | yes | | | `uid` | `string` | yes | | ### Example ```ts import * as portainer from "pulumi-portainer" const result = await portainer.getKubernetesApplication({ endpointId: 0, name: "", namespace: "", }) ``` `getKubernetesApplicationOutput` accepts Input values and returns `Output` of the same result. ``` -------------------------------- ### new betteruptime.IncomingWebhook() Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/better-uptime/resources/incoming-webhook.mdx Creates a new IncomingWebhook resource with the specified configuration. ```APIDOC ## new betteruptime.IncomingWebhook() ### Description Creates a new IncomingWebhook resource with the specified configuration. ### Method Constructor ### Endpoint `new betteruptime.IncomingWebhook(name, args, opts)` ### Parameters #### Arguments - **acknowledgedAlertIdField** (IncomingWebhookAcknowledgedAlertIdField (input)) - Optional - When acknowledging an incident, how to extract an alert id, a unique alert identifier which will be used to acknowledge and resolve incidents. - **acknowledgedRuleType** (string) - Required - Should an incident be acknowledged for all webhooks, those satisfying all acknowledged_rules, or those satisfying any of them. Valid values are unused, all, or any - **acknowledgedRules** (IncomingWebhookAcknowledgedRule (input)[]) - Optional - An array of rules to match to acknowledge an incident. - **call** (boolean) - Optional - Whether to call when a new incident is created. - **causeField** (IncomingWebhookCauseField (input)) - Optional - A field describing how to extract an incident cause, used as a short description shared with the team member on-call. - **criticalAlert** (boolean) - Optional - Whether to send a critical push notification that ignores the mute switch and Do not Disturb mode when a new incident is created. - **email** (boolean) - Optional - Whether to send an email when a new incident is created. - **name** (string) - Optional - The name of this incoming webhook. - **otherAcknowledgedFields** (IncomingWebhookOtherAcknowledgedField (input)[]) - Optional - An array of additional fields, which will be extracted when acknowledging an incident. - **otherResolvedFields** (IncomingWebhookOtherResolvedField (input)[]) - Optional - An array of additional fields, which will be extracted when resolving an incident. - **otherStartedFields** (IncomingWebhookOtherStartedField (input)[]) - Optional - An array of additional fields, which will be extracted when starting an incident. - **paused** (boolean) - Optional - Set to true to pause monitoring - we won't notify you about downtime. Set to false to resume monitoring. - **policyId** (string) - Optional - ID of the escalation policy associated with the incoming webhook. - **resolvedAlertIdField** (IncomingWebhookResolvedAlertIdField (input)) - Optional - When resolving an incident, how to extract an alert id, a unique alert identifier which will be used to acknowledge and resolve incidents. - **resolvedRuleType** (string) - Required - Should an incident be resolved for all webhooks, those satisfying all resolved_rules, or those satisfying any of them. Valid values are unused, all, or any. - **resolvedRules** (IncomingWebhookResolvedRule (input)[]) - Optional - An array of rules to match to resolve an incident. - **sms** (boolean) - Optional - Whether to send an SMS when a new incident is created. - **startedAlertIdField** (IncomingWebhookStartedAlertIdField (input)) - Optional - When starting an incident, how to extract an alert id, a unique alert identifier which will be used to acknowledge and resolve incidents. - **startedRuleType** (string) - Required - Should an incident be started for all webhooks, those satisfying all started_rules, or those satisfying any of them. Valid values are unused, all, or any. - **startedRules** (IncomingWebhookStartedRule (input)[]) - Optional - An array of rules to match to start an incident. - **teamName** (string) - Optional - The name of the team associated with the incoming webhook. - **webhookType** (string) - Optional - The type of the webhook. ### Request Example ```typescript import * as betteruptime from "pulumi-better-uptime" const resource = new betteruptime.IncomingWebhook("incomingWebhook", { acknowledgedRuleType: "", resolvedRuleType: "", startedRuleType: "", }) ``` ### Response #### Success Response (200) - **id** (string) - The ID of the created IncomingWebhook resource. #### Response Example ```json { "id": "string" } ``` ``` -------------------------------- ### getDockerVolume example Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/portainer/functions/get-docker-volume.mdx Calls the getDockerVolume function with the required arguments endpointId and name. The example uses TypeScript and imports the pulumi-portainer package. ```ts import * as portainer from "pulumi-portainer" const result = await portainer.getDockerVolume({ endpointId: 0, name: "", }) ``` -------------------------------- ### Create AppConnectionBitbucket with TypeScript Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/infisical/resources/app-connection-bitbucket.mdx Creates a new infisical.AppConnectionBitbucket resource. Only required arguments are set; strings in angle brackets stand in for argument values. The example sets the credentials (apiToken and email) and method arguments. ```ts import * as infisical from "pulumi-infisical" const resource = new infisical.AppConnectionBitbucket( "appConnectionBitbucket", { credentials: { apiToken: "", email: "", }, method: "", }, ) ``` -------------------------------- ### getSshKey TypeScript example Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/teamcity/functions/get-ssh-key.mdx Invokes the teamcity.getSshKey function with required arguments name and projectId. The example uses TypeScript and imports the pulumi-teamcity module. ```ts import * as teamcity from "pulumi-teamcity" const result = await teamcity.getSshKey({ name: "", projectId: "", }) ``` -------------------------------- ### getDockerSecret TypeScript example Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/portainer/functions/get-docker-secret.mdx Invokes the portainer.getDockerSecret function with the required arguments endpointId and name. The example uses TypeScript and imports the pulumi-portainer package. ```ts import * as portainer from "pulumi-portainer" const result = await portainer.getDockerSecret({ endpointId: 0, name: "", }) ``` -------------------------------- ### Create IncomingWebhook with betteruptime.IncomingWebhook Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/better-uptime/resources/incoming-webhook.mdx Creates a new IncomingWebhook resource using the pulumi-better-uptime SDK. Only required arguments are set; strings in angle brackets are placeholders for actual values. The example shows the required acknowledgedRuleType, resolvedRuleType, and startedRuleType arguments. ```ts import * as betteruptime from "pulumi-better-uptime" const resource = new betteruptime.IncomingWebhook("incomingWebhook", { acknowledgedRuleType: "", resolvedRuleType: "", startedRuleType: "", }) ``` -------------------------------- ### Install vn-number with pnpm Source: https://github.com/hckhanh/docs/blob/main/vn-number/overview.mdx Installs the vn-number package using the pnpm package manager. Use this command in a project that uses pnpm as its package manager. ```bash pnpm add vn-number ``` -------------------------------- ### Method Prefix with Path Parameters Source: https://github.com/hckhanh/docs/blob/main/what-the-fetch/api-reference.mdx Shows how method prefixes combine with path parameters in a typed API definition. The example defines an api object with a @put/users/:userId/posts/:postId endpoint, creates a fetch client, and calls it with params and body. The resulting request is PUT https://api.example.com/users/123/posts/456. ```typescript const api = { "@put/users/:userId/posts/:postId": { params: z.object({ userId: z.number(), postId: z.number(), }), body: z.object({ title: z.string(), content: z.string() }), response: z.object({ success: z.boolean() }), }, } const apiFetch = createFetch(api, "https://api.example.com") await apiFetch("@put/users/:userId/posts/:postId", { params: { userId: 123, postId: 456 }, body: { title: "Updated", content: "New content" }, }) // PUT https://api.example.com/users/123/posts/456 ``` ```typescript const api = { "@GET/users": {/* ... */}, "@get/posts": {/* ... */}, "@GeT/comments": {/* ... */}, } // All are treated as GET ``` -------------------------------- ### Install vn-number with bun Source: https://github.com/hckhanh/docs/blob/main/vn-number/overview.mdx Installs the vn-number package using the bun package manager. Use this command in a project that uses bun as its package manager. ```bash bun add vn-number ``` -------------------------------- ### createUrl() usage example Source: https://github.com/hckhanh/docs/blob/main/fast-url/api-reference.mdx Imports createUrl from fast-url and builds a URL by substituting the :id path parameter. Any unused params are appended as a query string. ```javascript import { createUrl } from "fast-url" const url = createUrl("http://api.example.com/users/:id", { id: 42, active: true, page: 2 }) ``` -------------------------------- ### posthog.Experiment Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/posthog/resources/experiment.mdx Creates a new Experiment resource in pulumi-posthog. The example shows the minimal required arguments. ```APIDOC ## posthog.Experiment ### Description Creates a new Experiment resource in pulumi-posthog. ### Pulumi Type `posthog:index/experiment:Experiment` ### Example ```ts import * as posthog from "pulumi-posthog" const resource = new posthog.Experiment("experiment", { featureFlagKey: "featureFlagKey", }) ``` ### Arguments | Property | Type | Required | Description | | --- | --- | --- | --- | | `allowUnknownEvents` | `boolean` | no | Opt-in bypass of the API validation that rejects metrics referencing not-yet-ingested events. Sent on every write (so a draft with such a metric can still be launched/edited); config-only, not read back from the API. | | `description` | `string` | no | Experiment description. | ``` -------------------------------- ### Create a PipelineSchedule with required arguments Source: https://github.com/hckhanh/docs/blob/main/pulumi-any-terraform/providers/buildkite/resources/pipeline-schedule.mdx This example creates a PipelineSchedule resource using the pulumi-buildkite provider. Only required arguments are set; strings in angle brackets are placeholders for actual values. ```ts import * as buildkite from "pulumi-buildkite" const resource = new buildkite.PipelineSchedule("pipelineSchedule", { branch: "", cronline: "", label: "