Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
8,091 in github.com/PerpetualSoftware/pad
⨍
Functions
8,091
◇
Types & classes
983
↓ 8 callers
Function
assertBlocked
assertBlocked asserts the response is a 403 email_not_verified.
internal/server/middleware_verified_email_test.go:154
↓ 8 callers
Function
auditUser
auditUser creates a user that subsequent audit rows can FK-reference. The schema requires user_id REFERENCES users(id), so we can't insert audit rows
internal/store/mcp_audit_test.go:39
↓ 8 callers
Method
build
(workspace string)
internal/cmdhelp/dynamic_test.go:22
↓ 8 callers
Function
buildFositeRequest
buildFositeRequest produces a fully-populated *fosite.Request so adapter tests can drive Create*Session methods without depending on fosite's HTTP ent
internal/oauth/server_test.go:934
↓ 8 callers
Function
buildHTMLShell
buildHTMLShell wraps body HTML in the standard transactional-email chrome — header (Pad wordmark) + body + footer note + (Cloud only) marketing footer
internal/email/shell.go:29
↓ 8 callers
Function
canPromptForConfig
()
cmd/pad/configure.go:357
↓ 8 callers
Method
countRows
(t *testing.T, query string, args ...interface{})
internal/store/workspace_purge_test.go:47
↓ 8 callers
Method
createItemTx
createItemTx is the tx-taking form of item creation (PLAN-2357 / DR-9a) and the single implementation behind BOTH CreateItem and the cross-workspace c
internal/store/items.go:424
↓ 8 callers
Function
deleteAsUser
Delete-authorization tests for PLAN-2382 / TASK-2384. The item-detail attachment strip offers a delete affordance gated on the UI's grant-aware `canE
internal/server/handlers_storage_delete_authz_test.go:28
↓ 8 callers
Function
dialWSBracket
dialWSBracket joins as a bracket-capable participant (`?applier_bracket=1`) so the conn can be durably confirmed by a restore's finalization (BUG-2276
internal/collab/manager_test.go:362
↓ 8 callers
Method
dispatch
dispatch runs one MCP tool call through the in-process HTTP dispatcher against the real server, as the fixture's owner.
internal/mcp/dispatch_http_clear_assignment_test.go:105
↓ 8 callers
Function
doRequestWithCookieFrom
doRequestWithCookieFrom is like doRequestWithCookie but lets the caller set the request RemoteAddr so tests can simulate a session jumping to a differ
internal/server/middleware_session_ip_test.go:18
↓ 8 callers
Function
expandPath
expandPath substitutes {key} placeholders in template using input. Each placeholder must appear as a non-empty string in input; otherwise expandPath r
internal/mcp/dispatch_http_routes.go:91
↓ 8 callers
Function
fetchAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder, options?: MetadataFetchOption
web/src/lib/components/editor/attachment-metadata.ts:91
↓ 8 callers
Method
getOrCreate
getOrCreate returns the existing Room for itemID or, atomically under m.mu, mints a new one. Holding m.mu across the lookup + insertion keeps the grac
internal/collab/manager.go:824
↓ 8 callers
Method
getWorkspace
getWorkspace returns the full workspace object resolved by middleware. Falls back to direct resolution for routes without RequireWorkspaceAccess.
internal/server/server.go:2020
↓ 8 callers
Function
mapCollectionCreate
mapCollectionCreate dispatches `pad collection create <name> [--fields key:type[:opts]; ...] [--icon ...] [--description ...] [--layout ...] [--defaul
internal/mcp/dispatch_http_routes.go:469
↓ 8 callers
Method
maybeInjectWorkspace
maybeInjectWorkspace defaults the `workspace` input from the dispatcher's WorkspaceLister when the caller didn't pass one explicitly (TASK-1076). The
internal/mcp/dispatch_http_advanced.go:696
↓ 8 callers
Function
newAuditTestStore
Store-layer tests for the MCP audit log (PLAN-943 TASK-960). What's covered: - InsertMCPAuditEntry validates required fields and round-trips correct
internal/store/mcp_audit_test.go:25
↓ 8 callers
Function
newClaimTestEnv
(t *testing.T)
internal/server/handlers_oauth_claim_test.go:57
↓ 8 callers
Function
newDeleteAuthzFixture
(t *testing.T, srv *Server)
internal/server/handlers_storage_delete_authz_test.go:57
↓ 8 callers
Function
newEmptyStore
()
internal/cli/credentials.go:163
↓ 8 callers
Function
newRootCmd
newRootCmd constructs the pad CLI's root cobra command tree. Extracted from main() so tests can use the real tree (golden snapshots, schema validatio
cmd/pad/main.go:90
↓ 8 callers
Function
newTransformFixture
(t *testing.T, srv *Server)
internal/server/handlers_attachments_transform_authz_test.go:52
↓ 8 callers
Function
packageStructuredResponse
packageStructuredResponse encodes payload to JSON, then decodes it back to a generic any so the StructuredContent surface matches the shape MCP client
internal/mcp/dispatch_http_links.go:475
↓ 8 callers
Function
parseExamplesFromLong
parseExamplesFromLong extracts the indented invocation lines that follow an "Examples:" header in a cobra Long string. Returns nil when no such sectio
internal/cmdhelp/json.go:200
↓ 8 callers
Function
pickTemplateInteractive
pickTemplateInteractive presents a numbered list of visible templates grouped by category and returns the chosen template's Name. Returns the default
cmd/pad/templates_picker.go:72
↓ 8 callers
Function
postOAuthFormBearer
postOAuthFormBearer POSTs an x-www-form-urlencoded body with a Bearer Authorization header (used for /oauth/introspect, where fosite v0.49 requires ei
internal/server/handlers_oauth_test.go:2550
↓ 8 callers
Function
remoteHeadlessCfg
remoteHeadlessCfg builds a Config wired to point at the given httptest server URL in Remote mode. Remote mode makes EnsureServer a no-op.
cmd/pad/setup_headless_test.go:78
↓ 8 callers
Method
requireCollectionFullyVisible
requireCollectionFullyVisible checks that the collection is visible to the requesting user under FULL-collection-access semantics (BUG-1920 — codex R2
internal/server/server.go:2089
↓ 8 callers
Function
requirePostgresForConcurrency
requirePostgresForConcurrency skips a test unless a real PostgreSQL backend is configured. The parent-link TOCTOU races (BUG-2073) are Postgres-only:
internal/store/parent_link_concurrency_test.go:19
↓ 8 callers
Method
resolveAssignName
resolveAssignName rewrites a `--assign <name|email>` input into `assigned_user_id <uuid>` by hitting the workspace-members endpoint and finding a matc
internal/mcp/dispatch_http_advanced.go:33
↓ 8 callers
Method
rowCount
()
internal/collab/manager_test.go:251
↓ 8 callers
Function
seedBackfillAccess
(t *testing.T, s *Store, requestID, clientID, subject string, ts time.Time, sessionData string)
internal/store/oauth_connections_backfill_test.go:81
↓ 8 callers
Method
send
(data: Uint8Array)
web/src/lib/collab/wsProvider.svelte.ts:1158
↓ 8 callers
Method
size
size returns the current entry count. Used by tests and by startMCPSessionTracker's initial gauge prime.
internal/server/middleware_mcp_session.go:165
↓ 8 callers
Function
sourceIDs
(p *AttachmentCopyPlan)
internal/store/attachments_copy_plan_test.go:107
↓ 8 callers
Function
tokenWorkspaceID
tokenWorkspaceID returns the workspace ID set by the TokenAuth middleware, or an empty string if no token was used.
internal/server/middleware_auth.go:471
↓ 8 callers
Method
touch
touch inserts or refreshes an entry. No-op on empty id (defensive: callers pre-filter, but a missing header should never bump anything). Fires onChang
internal/server/middleware_mcp_session.go:112
↓ 8 callers
Function
transformAs
transformAs POSTs a rotate as a specific user + workspace role, bypassing the auth middleware the same way downloadAs does.
internal/server/handlers_attachments_transform_authz_test.go:95
↓ 8 callers
Function
uploadItemFixture
uploadItemFixture creates a workspace + collection + item for the item_id-invariant tests, returning the workspace slug and the item.
internal/server/handlers_attachments_test.go:367
↓ 8 callers
Method
validateCloudSecret
validateCloudSecret checks the cloud_secret field in a JSON request body against the server's configured cloud secret. Returns true if the secret matc
internal/server/handlers_cloud.go:45
↓ 7 callers
Method
BrowserURL
BrowserURL returns a URL suitable for displaying to humans in CLI prompts (e.g. "Or open the web UI at X"). It behaves like BaseURL except that when t
internal/config/config.go:403
↓ 7 callers
Function
BuildMetaPayload
BuildMetaPayload returns the meta payload for the given pad runtime version. An empty padVersion falls back to FallbackVersion for the same reason ser
internal/mcp/meta.go:54
↓ 7 callers
Method
CheckSession
CheckSession returns the current auth status.
internal/cli/client.go:1173
↓ 7 callers
Function
ConvertOpenAPI
ConvertOpenAPI converts an OpenAPI 3.x specification into a human-readable markdown document. The output is organized as: - H1 with the API title - I
internal/urlimport/openapi.go:30
↓ 7 callers
Method
CountBacklinks
CountBacklinks returns the total number of same-workspace backlinks the requester would see for a given target, applying the same visibility filter as
internal/store/wiki_links.go:1071
↓ 7 callers
Method
CreateAgentRole
(workspaceID string, input models.AgentRoleCreate)
internal/store/agent_roles.go:12
↓ 7 callers
Method
CreateEmailVerification
CreateEmailVerification generates an email-verification token for the given user. Returns the plaintext token (to embed in the verification URL). The
internal/store/email_verification.go:28
↓ 7 callers
Method
CreateWebhook
CreateWebhook registers a new webhook for a workspace.
internal/store/webhooks.go:11
↓ 7 callers
Method
CreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:111
↓ 7 callers
Function
CurrentUserFromContext
CurrentUserFromContext returns the user attached by WithCurrentUser (or by the standard auth middleware), and a boolean signalling whether one was pre
internal/server/context.go:63
↓ 7 callers
Method
FetchBytes
(ctx context.Context, args []string)
internal/mcp/resources.go:54
↓ 7 callers
Method
Get
Get returns the current session workspace, or empty string when none has been set.
internal/mcp/workspace.go:72
↓ 7 callers
Method
GetChildItems
GetChildItems returns all non-deleted child items linked to the given parent via item_links. Returns children from any collection.
internal/store/items.go:3939
↓ 7 callers
Method
GetDocument
(id string)
internal/store/documents.go:193
↓ 7 callers
Method
IsConnectionWorkspaceAllowed
IsConnectionWorkspaceAllowed reports whether workspace_id appears in the connection's allow-list. Used internally by GetOAuthConnectionAccess when cal
internal/store/oauth_connections.go:428
↓ 7 callers
Method
LastRestoreSeq
LastRestoreSeq returns the item.seq of the most recent restore for itemID, or (0, false) when none has been recorded. Join consults it to force_refres
internal/collab/manager.go:196
↓ 7 callers
Method
ListMCPAuditByUser
ListMCPAuditByUser returns the user's most recent audit rows in reverse-chronological order. limit caps the page; offset paginates. Caller must enforc
internal/store/mcp_audit.go:104
↓ 7 callers
Method
Provider
Provider returns the fosite.OAuth2Provider that sub-PR C's HTTP handlers will call (NewAuthorizeRequest, NewAccessRequest, WriteAuthorizeResponse, etc
internal/oauth/server.go:220
↓ 7 callers
Method
PruneSweep
PruneSweep finds every item whose ENTIRE op-log is older than `minAge` and prunes the whole op-log for those items under the per-item lock. Returns a
internal/collab/manager.go:636
↓ 7 callers
Method
RecordItemWorkspaceMoveTx
RecordItemWorkspaceMoveTx inserts one provenance row inside an existing transaction. It is tx-taking by design: the row must be written in the same tr
internal/store/item_workspace_moves.go:55
↓ 7 callers
Method
SearchItems
(workspaceID, query string)
internal/store/items.go:2772
↓ 7 callers
Method
Unsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/watchevents/watchevents.go:168
↓ 7 callers
Method
UpdateItemWithPreCheck
UpdateItemWithPreCheck is UpdateItem with an optional pre-mutation hook that runs inside the same transaction (and, on Postgres, holds the same worksp
internal/store/items.go:2057
↓ 7 callers
Method
WorkspaceStorageUsage
WorkspaceStorageUsage returns the total bytes consumed by non-deleted attachments in the workspace. Includes derived blobs (thumbnails) — those are re
internal/store/attachments.go:1075
↓ 7 callers
Function
WriteWorkspaceLink
WriteWorkspaceLink writes a .pad.toml in the given directory. serverURL is the base URL of the Pad server hosting this workspace. Pass the empty stri
internal/cli/workspace.go:94
↓ 7 callers
Function
_resetEscapeStackForTests
()
web/src/lib/stores/escapeStack.ts:97
↓ 7 callers
Function
adminBillingReq
adminBillingReq fires GET /api/v1/admin/billing-stats with the cookie from a logged-in user. Returns the recorder so callers can inspect status + body
internal/server/handlers_admin_billing_test.go:43
↓ 7 callers
Function
assertBlobDenied
assertBlobDenied pins the shared denial shape: 404, no-store, and the exact body every other denial writes.
internal/server/handlers_attachments_download_authz_test.go:203
↓ 7 callers
Function
assertBlobServed
assertBlobServed checks a 200 whose body is want (GET) or whose headers say so (HEAD — no body on the wire, so Content-Type + the positive cache direc
internal/server/handlers_attachments_download_authz_test.go:184
↓ 7 callers
Function
buildPlainShell
buildPlainShell builds the plain-text body for transactional emails. Self-hosted output is byte-equivalent to the prior templates. Cloud output adds a
internal/email/shell.go:93
↓ 7 callers
Function
buildQuery
buildQuery returns the URL-encoded query string for the mapping (without the leading '?'). Empty mapping → empty string. Numbers from JSON arrive as
internal/mcp/dispatch_http_routes.go:131
↓ 7 callers
Function
buildToolFromDef
buildToolFromDef compiles a ToolDef into the mcp.Tool shape mcp-go expects. The schema is flat: `action` is required, every other parameter is optiona
internal/mcp/catalog.go:313
↓ 7 callers
Method
callCount
()
internal/server/handlers_account_test.go:50
↓ 7 callers
Function
canOpenInViewer
(mime: string | null | undefined)
web/src/lib/attachments/display.ts:319
↓ 7 callers
Function
cancelInit
cancelInit is the canonical exit path for both Ctrl+C and explicit "Cancel" actions during pad init / pad workspace init. It prints a brief message to
cmd/pad/cancel.go:25
↓ 7 callers
Function
conventionsCollection
conventionsCollection returns a Conventions collection scoped to the caller's domain. The trigger and scope select options are supplied by the caller
internal/collections/templates.go:428
↓ 7 callers
Function
decodeEnvelope
decodeEnvelope helper extracts the ErrorEnvelope from an MCP error result. Uses textOf (the shared helper in catalog_test.go) to retrieve the JSON bod
internal/mcp/errors_test.go:306
↓ 7 callers
Method
deriveThumbnails
deriveThumbnails generates thumb-sm and thumb-md variants for the uploaded image identified by parentID. Idempotent and tolerant of every failure mode
internal/server/handlers_attachments_thumbnails.go:55
↓ 7 callers
Method
destroy
Cleanly close the WS, unbind doc/awareness handlers, and * prevent further reconnect attempts. Safe to call more than * once; idempotent.
web/src/lib/collab/wsProvider.svelte.ts:617
↓ 7 callers
Function
displayWidth
displayWidth returns the visible column width of s: escape and control sequences are stripped, then the remaining runes are counted. Every rune is app
internal/cli/format.go:169
↓ 7 callers
Method
doClaim
doClaim issues a POST /api/v1/oauth/claim with Bearer PAT auth. extraReqID, if non-empty, attaches a WithMCPTokenIdentity context override to simulate
internal/server/handlers_oauth_claim_test.go:103
↓ 7 callers
Function
doRequestFromRemoteAddr
(srv *Server, method, path string, body interface{}, remoteAddr string)
internal/server/server_test.go:48
↓ 7 callers
Method
encrypt
encrypt encrypts plaintext using AES-256-GCM and returns a base64-encoded ciphertext prefixed with "enc:" to distinguish from plaintext values.
internal/store/encryption.go:30
↓ 7 callers
Method
enrichItemsWithParent
enrichItemsWithParent batch-populates parent link info on a slice of items. Used by list endpoints where calling enrichItemForResponse per-item is too
internal/server/item_lineage.go:13
↓ 7 callers
Function
ensureWorkspace
── Shared helpers ──────────────────────────────────────────────────────────── ensureWorkspace checks if the current directory is linked to a workspac
cmd/pad/init.go:400
↓ 7 callers
Function
finiteOr
* Coerce a possibly-NaN/Infinite measurement to something usable. * * Infinity takes the fallback rather than saturating at a bound: an infinite *
web/src/lib/attachments/zoom.ts:160
↓ 7 callers
Function
fullPreflight
── fixtures ───────────────────────────────────────────────────────────── fullPreflight is a preview where EVERY bucket and EVERY warning is non-trivi
cmd/pad/item_copy_test.go:20
↓ 7 callers
Function
getConfig
--- helpers ---
cmd/pad/main.go:179
↓ 7 callers
Function
graphNode
(resp GraphResponse, ref string)
internal/server/handlers_graph_test.go:23
↓ 7 callers
Method
handleResponse
(resp *http.Response, result interface{})
internal/cli/client.go:1742
↓ 7 callers
Function
hasDocument
()
web/src/lib/a11y/viewerBackdrop.ts:60
↓ 7 callers
Function
headlessTestServer
headlessTestServer builds an httptest.Server that speaks the minimal subset of the Pad API that the headless bootstrap path touches: - GET /api/v1/a
cmd/pad/setup_headless_test.go:31
↓ 7 callers
Function
hopTransitions
hopTransitions returns only the "real" status hops — excluding the create-time "entered initial status" seed row (id prefix "create_") that every crea
internal/store/status_transitions_test.go:37
↓ 7 callers
Function
isCancellation
isCancellation reports whether err represents a user-initiated abort from any interactive init prompt. Init RunEs use this to convert the sentinel int
cmd/pad/cancel.go:84
↓ 7 callers
Function
isSupported
()
web/src/lib/stores/localIndexPersistence.ts:69
↓ 7 callers
Function
itemPrefetchHandler
itemPrefetchHandler routes /api/v1/workspaces/{ws}/items/{ref} GETs to a static map keyed by ref so each link-test can declare just the items it needs
internal/mcp/dispatch_http_links_test.go:18
↓ 7 callers
Method
parseError
(resp *http.Response)
internal/cli/client.go:1752
↓ 7 callers
Function
parsePadURI
parsePadURI extracts (workspace, kind, arg) from a pad:// URI. arg is empty for list-style resources (no trailing segment). Forms accepted: pad://w
internal/mcp/resources.go:590
← previous
next →
501–600 of 8,091, ranked by callers