MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions8,091 in github.com/PerpetualSoftware/pad

↓ 19 callersFunctionLoadStore
LoadStore reads the credentials file and returns a usable CredentialStore. Returns an empty (but non-nil) store if the file doesn't exist — that's not
internal/cli/credentials.go:96
↓ 19 callersMethodResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:741
↓ 19 callersMethodUserCount
UserCount returns the total number of registered users.
internal/store/users.go:573
↓ 19 callersFunctionValidateFields
ValidateFields checks field values against the collection schema. It validates required fields are present, types are correct, and select values are w
internal/items/validate.go:78
↓ 19 callersFunctionbearerCall
(t *testing.T, srv *Server, method, path, token string, body []byte)
internal/server/handlers_watches_test.go:62
↓ 19 callersFunctionequalSlice
equalSlice is a small helper for stable []string comparison; kept here so test files across the package can share it. catalog_test.go has equalString
internal/mcp/registry_test.go:188
↓ 19 callersFunctiontick
()
web/src/lib/components/editor/block-drag-handle.ts:709
↓ 18 callersFunctionEncode
Encode serializes an Artifact to its portable on-disk form: --- <yaml frontmatter> --- <body> Output is deterministic: two Encode calls on the
internal/artifact/encode.go:23
↓ 18 callersMethodPublish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: full subscriber channels drop the event with a warnin
internal/collab/bus.go:108
↓ 18 callersMethodRemove
Remove deregisters a session. It must be idempotent and must not panic on an unknown id — the stream handler calls it from a defer that also runs on p
internal/server/session_presence.go:165
↓ 18 callersFunctionassertAllowed
(t *testing.T, got CrossWorkspaceAccess, label string)
internal/server/authz_cross_workspace_test.go:186
↓ 18 callersFunctionclientIP
clientIP extracts the client IP from RemoteAddr. This is safe because TrustedProxyRealIP runs earlier in the chain and — when a trusted proxy is confi
internal/server/middleware_ratelimit.go:532
↓ 18 callersFunctionconnectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 18 callersFunctioncreateViaTx
Tests for createItemTx — the tx-taking counterpart of CreateItem (PLAN-2357 / DR-9a). Each test below pins one line of the DR-9a parity checklist: slu
internal/store/items_create_tx_test.go:22
↓ 18 callersFunctiondispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1248
↓ 18 callersMethodlogAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:340
↓ 18 callersFunctionrequireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callersFunctionsessionCookieName
sessionCookieName returns the session cookie name. When running over TLS (secureCookies=true), the __Host- prefix is used to prevent subdomain cookie
internal/server/handlers_auth.go:45
↓ 18 callersFunctionsetupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 18 callersFunctionstrPtr
(s string)
internal/store/timeline_pagination_test.go:186
↓ 17 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:232
↓ 17 callersMethodApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on success; one of the sen
internal/collab/applier.go:242
↓ 17 callersMethodGetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 17 callersMethodGetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:197
↓ 17 callersMethodSetCloudSidecar
SetCloudSidecar installs the reverse pad → pad-cloud client. Called from cmd/pad/main.go when PAD_CLOUD_SIDECAR_URL + PAD_CLOUD_SECRET are set. When u
internal/server/server.go:543
↓ 17 callersFunction__resetViewerBackdropForTests
()
web/src/lib/a11y/viewerBackdrop.ts:496
↓ 17 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:240
↓ 17 callersFunctionerrCode
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_copy_preflight_test.go:216
↓ 17 callersFunctionmustItem
(t *testing.T, srv *Server, wsID, collID, title string)
internal/server/authz_cross_workspace_test.go:114
↓ 17 callersFunctiontestServerWithCollab
testServerWithCollab wires a RoomManager onto a fresh test server so the collab handler answers 200/101 on the happy path. Tests that only assert on a
internal/server/handlers_collab_test.go:21
↓ 17 callersFunctiontestStoreOAuth
Tests for the OAuth server constructor + audience strategy + storage adapter (PLAN-943 TASK-951 sub-PR B). Each layer is covered: - NewServer: requir
internal/oauth/server_test.go:40
↓ 17 callersFunctionwatchNotificationVisible
watchNotificationVisible decides whether a Notification should be delivered to a caller holding the given watch map. Extracted from the handler so the
internal/server/handlers_watch_events.go:430
↓ 16 callersMethodCreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 callersMethodGetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:865
↓ 16 callersMethodGetOAuthConnection
GetOAuthConnection fetches the connection row by request_id. Returns ErrOAuthConnectionNotFound if no row exists; any other error is a real I/O failur
internal/store/oauth_connections.go:106
↓ 16 callersFunctionNewProcessor
NewProcessor returns the Processor compiled into this binary. Pure-Go build → pureGoProcessor. libvips build → vipsProcessor (Phase 2). Constructed o
internal/attachments/processor_purego.go:43
↓ 16 callersMethodPublish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:139
↓ 16 callersMethodPut
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:40
↓ 16 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel. Safe to call with an already-removed channel — no-op in that case.
internal/collab/bus.go:102
↓ 16 callersFunctionWithTokenAllowedWorkspaces
WithTokenAllowedWorkspaces returns ctx decorated with the OAuth token's workspace allow-list set at consent time (TASK-952). The list is either a set
internal/server/context.go:140
↓ 16 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2626
↓ 16 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:556
↓ 16 callersFunctionclassifyExecError
classifyExecError turns an exec.Cmd failure (err + stderr) into a structured envelope. lookup is optional — when supplied, no_workspace errors get ava
internal/mcp/errors.go:435
↓ 16 callersFunctioncreateTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:257
↓ 16 callersFunctionnewMovedToFixture
(t *testing.T)
internal/server/item_moved_to_test.go:49
↓ 16 callersMethodnewRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1656
↓ 16 callersFunctionrender
()
web/src/lib/components/timeline/ItemTimeline.svelte.test.ts:218
↓ 15 callersFunctionDefaultConfig
()
internal/config/config.go:89
↓ 15 callersMethodDeleteWorkspace
(slug string)
internal/store/workspaces.go:255
↓ 15 callersMethodJSONExtractText
JSONExtractText returns SQL to extract a text value from a JSON column. SQLite: json_extract(col, '$.key') PostgreSQL: col->>'key'
internal/store/dialect.go:33
↓ 15 callersFunctionNewDispatcher
NewDispatcher creates a Dispatcher with the given store. The delivery client enforces the SSRF guard at connect time, not just at parse time: its dia
internal/webhooks/dispatcher.go:115
↓ 15 callersMethodSeedDefaultCollections
SeedDefaultCollections rescues a workspace that ended up with zero collections by seeding it with the standard Software-shape Defaults(). It is intent
internal/store/collections.go:699
↓ 15 callersMethodSetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:315
↓ 15 callersMethodarchiveSource
()
internal/server/item_moved_to_test.go:108
↓ 15 callersMethodbearerHeaders
()
internal/server/handlers_grant_visibility_test.go:104
↓ 15 callersFunctionpostOAuthForm
postOAuthForm POSTs an x-www-form-urlencoded body without any auth (used for /oauth/revoke + /oauth/token, where client_id rides in the form for publi
internal/server/handlers_oauth_test.go:2537
↓ 15 callersFunctionrunAuthCodeFlow
runAuthCodeFlow drives a full /oauth/authorize/decide → /oauth/token exchange and returns the parsed token JSON. Each invocation needs a unique verifi
internal/server/handlers_oauth_test.go:2473
↓ 15 callersFunctionseedParentAndChildren
seedParentAndChildren creates a plan + N child tasks with the given statuses (one per child), returning the parent and the slice of child refs in crea
internal/server/handlers_items_open_children_guard_test.go:24
↓ 15 callersFunctionwaitElectable
waitElectable polls until the room for itemID has at least n conns that pickApplier would actually elect — writable, anchored (replayDone), not frozen
internal/collab/manager_test.go:306
↓ 14 callersMethodApply
Apply walks doc and stamps EnumSource + resolved Enum values on matching args and flags. Resolution failures are silent: the document continues to adv
internal/cmdhelp/dynamic.go:113
↓ 14 callersMethodCreateShareLink
CreateShareLink creates a new share link and returns it with the raw token. The raw token is only available in this response — it is not stored.
internal/store/share_links.go:47
↓ 14 callersFunctionCrossWorkspaceWorkspaceOnlyScope
CrossWorkspaceWorkspaceOnlyScope requests a WORKSPACE-LEVEL CHECK ONLY, which is almost never sufficient on its own. It answers "does this caller hav
internal/server/authz_cross_workspace.go:374
↓ 14 callersMethodD
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:72
↓ 14 callersMethodDispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 14 callersMethodFetch
(ctx context.Context, args []string)
internal/mcp/resources.go:47
↓ 14 callersMethodGetItemLinks
GetItemLinks returns links where the given item is either source or target. Links pointing to or from soft-deleted items are filtered out so callers (
internal/store/items.go:3046
↓ 14 callersMethodGetMemberCollectionAccess
GetMemberCollectionAccess returns the collection IDs a member has been explicitly granted access to (only meaningful when collection_access = "specifi
internal/store/workspace_members.go:310
↓ 14 callersMethodIsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:277
↓ 14 callersFunctionLoad
()
internal/config/config.go:105
↓ 14 callersFunctionNewStorage
NewStorage wraps a *store.Store as a fosite-compatible adapter. The store must be a fully-initialized pad store (migrations applied); no validation he
internal/oauth/storage.go:129
↓ 14 callersMethodSeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:735
↓ 14 callersMethodSubscribe
Subscribe registers a subscriber for the given item and returns a buffered channel of OpEvents. Caller is responsible for calling Unsubscribe (typical
internal/collab/bus.go:98
↓ 14 callersFunctionassertSourceSet
(t *testing.T, p *AttachmentCopyPlan, want ...string)
internal/store/attachments_copy_plan_test.go:115
↓ 14 callersMethodcopy
(t *testing.T, req CrossWorkspaceCopyRequest)
internal/store/items_cross_workspace_copy_test.go:54
↓ 14 callersFunctiondialCollab
dialCollab opens a WebSocket against the test server's collab endpoint with the given itemID. Returns the connection and the HTTP response. The respon
internal/server/handlers_collab_test.go:40
↓ 14 callersFunctiondoRequestWithBearer
doRequestWithBearer dispatches a request with an Authorization: Bearer header set. The existing test helpers in server_test.go don't take a token para
internal/server/middleware_auth_public_paths_test.go:25
↓ 14 callersFunctiondoTransform
(srv *Server, slug, attachmentID string, body transformRequestBody)
internal/server/handlers_attachments_transform_test.go:29
↓ 14 callersMethodexecuteRequest
executeRequest builds + serves + packages a single HTTP request against the wrapped handler. Pulled out of Dispatch so the special-case methods (dispa
internal/mcp/dispatch_http.go:447
↓ 14 callersMethodgetSource
getSource performs GET on the source item exactly as the router would and requires a 200. Use rawGetSource when the status is what is under test.
internal/server/item_moved_to_test.go:124
↓ 14 callersFunctionmcpAndOAuthEnabledTestServer
===================================================================== mcp ↔ OAuth integration (sub-PR E, TASK-1027) ==================================
internal/server/handlers_mcp_test.go:512
↓ 14 callersFunctionmcpEnabledTestServer
mcpEnabledTestServer builds a Server with cloud mode + a stub streamable-HTTP transport so tests targeting auth / discovery / routing don't need to dr
internal/server/handlers_mcp_test.go:487
↓ 14 callersFunctionpostFormWithCookie
postFormWithCookie POSTs an x-www-form-urlencoded body with both a session cookie and the matching CSRF cookie set, plus the session-bound User-Agent.
internal/server/handlers_oauth_test.go:2403
↓ 14 callersMethodrelease
* Drop the lease. `released` is false on a repeat call (no-op). `stackEmpty` * reports whether any lease remains AFTER this release — the caller use
web/src/lib/a11y/viewerBackdrop.ts:37
↓ 14 callersFunctionrequireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:772
↓ 14 callersFunctiontestServerWithPresence
testServerWithPresence gives a server both the watch bus and the presence registry — the production pairing (cmd_server.go wires them on adjacent line
internal/server/handlers_sessions_test.go:19
↓ 14 callersFunctionworkspaceRole
workspaceRole returns the user's role in the current workspace, as set by RequireWorkspaceAccess. Returns empty string if not set.
internal/server/middleware_auth.go:716
↓ 14 callersMethodwriteItemResolveError
writeItemResolveError distinguishes a soft-deleted (archived) item from a genuinely-missing one for mutation handlers. An archived item still appears
internal/server/handlers_items.go:801
↓ 13 callersMethodBackfillOAuthConnections
BackfillOAuthConnections walks every distinct grant chain found in oauth_access_tokens and oauth_refresh_tokens, parses the newest chain row's session
internal/store/oauth_connections_backfill.go:93
↓ 13 callersMethodClose
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:147
↓ 13 callersMethodEventsSince
EventsSince returns events for a workspace with IDs greater than sinceID. Used to replay missed events on SSE reconnect (Last-Event-ID). Returns nil i
internal/events/bus.go:144
↓ 13 callersMethodGetCrossWorkspaceBacklinks
GetCrossWorkspaceBacklinks returns inbound `[[ws::REF]]` backlinks pointing at the queried target (`targetWorkspaceID`, `targetRef`) from EVERY OTHER
internal/store/wiki_links.go:1191
↓ 13 callersMethodInsertMCPAuditEntry
InsertMCPAuditEntry persists one audit row. Called from the audit middleware's async writer; the caller owns the buffered channel + the ordering, so t
internal/store/mcp_audit.go:53
↓ 13 callersMethodListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:407
↓ 13 callersMethodListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:297
↓ 13 callersFunctionNormalizeItemLinkType
NormalizeItemLinkType canonicalizes supported link types and returns an error for unknown values.
internal/models/item_links.go:33
↓ 13 callersFunctionSetWorkspaceTool
SetWorkspaceTool returns the (Tool, Handler) pair for the built-in pad_set_workspace tool. The handler updates state in place. Exposed as a construct
internal/mcp/workspace.go:121
↓ 13 callersMethodValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 13 callersMethodVisibleCollectionIDs
VisibleCollectionIDs returns the set of collection IDs a member can see. Returns nil if the member has "all" access (meaning no filtering needed). Sys
internal/store/workspace_members.go:139
↓ 13 callersFunctionWithTokenScopes
WithTokenScopes returns ctx decorated with the API token's JSON-encoded scopes string (e.g. `["read"]`, `["*"]`). Stashed by the MCP Bearer middleware
internal/server/context.go:89
↓ 13 callersMethodacquireWorkspaceSeqLock
acquireWorkspaceSeqLock takes a Postgres advisory transaction lock keyed on the workspace ID so concurrent seq-bumping mutations serialize. The lock a
internal/store/items.go:120
← previousnext →201–300 of 8,091, ranked by callers