MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions9,998 in github.com/PerpetualSoftware/pad

↓ 53 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/watchevents/watchevents.go:272
↓ 53 callersMethodrequest
* Open the confirmation and resolve when the user answers — the descriptor's * `ctx.confirmDelete`. A no-op that resolves false when the caller may
web/src/lib/attachments/surfaceDeleteConfirm.svelte.ts:54
↓ 52 callersMethodpost
( url: string, options: { headers?: Record<string, string>; data?: unknown; multipart?: unknown } )
web/e2e/workspace-bundle-roundtrip.spec.ts:63
↓ 52 callersFunctionrequireMinRole
requireMinRole checks role and writes a 403 if insufficient. Returns true if the request should continue, false if it was rejected.
internal/server/middleware_auth.go:782
↓ 51 callersMethodDB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:150
↓ 51 callersFunctioncreateTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:257
↓ 49 callersFunctionNew
New creates a new Metrics instance with a custom registry and registers all application metrics plus Go runtime and process collectors.
internal/metrics/metrics.go:409
↓ 48 callersFunctionoauthEnabledTestServer
oauthEnabledTestServer builds a Server with cloud mode + a real internal/oauth.Server backed by the test store. Returns the Server so each test can dr
internal/server/handlers_oauth_test.go:54
↓ 48 callersFunctionregisterTestClient
===================================================================== Helpers ===================================================================== re
internal/server/handlers_oauth_test.go:2426
↓ 47 callersMethodDeleteItem
DeleteItem soft-deletes the item by stamping deleted_at and bumping the workspace-scoped seq so delta-sync clients see the tombstone. The seq bump use
internal/store/items.go:2733
↓ 46 callersMethodSetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:286
↓ 46 callersFunctiondoRequestWithHeaders
doRequestWithHeaders is a thin variant of doRequest that lets a test set arbitrary request headers (e.g. Authorization) without spinning up a real aut
internal/server/handlers_items_test.go:19
↓ 46 callersFunctiontestServerWithWatchEvents
(t *testing.T)
internal/server/handlers_watch_events_test.go:18
↓ 45 callersMethodGetBacklinks
GetBacklinks returns the items in `workspaceID` that contain a resolved `[[...]]` reference to `targetItemID`. Phase 1 only returns ref-kind backlinks
internal/store/wiki_links.go:950
↓ 45 callersFunctioncreateTestWorkspaceViaAPI
(t *testing.T, srv *Server)
internal/server/handlers_items_attribution_test.go:134
↓ 44 callersFunctiondoMultipartUpload
(srv *Server, slug, filename string, body []byte)
internal/server/handlers_attachments_test.go:52
↓ 44 callersMethodset
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
↓ 44 callersMethodvisibleCollectionIDs
visibleCollectionIDs returns the set of collection IDs the current user can see in the given workspace. Returns nil if the user has "all" access (no f
internal/server/server.go:2321
↓ 43 callersMethodCreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 43 callersFunctioncurrentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:540
↓ 42 callersMethodGetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:138
↓ 42 callersFunctionbearerJSON
bearerJSON marshals body and issues a Bearer-authenticated request. Needed for any mutation issued AFTER a real user has been created in the test's st
internal/server/handlers_watches_test.go:53
↓ 42 callersFunctionnewCollabTestServer
newCollabTestServer wires up an httptest server whose only handler upgrades the inbound WS, registers it with the manager, and waits for the session t
internal/collab/manager_test.go:260
↓ 41 callersMethodCreateAttachment
CreateAttachment inserts an attachment row. id and created_at are generated by the store. The caller is expected to have already written the blob via
internal/store/attachments.go:78
↓ 41 callersFunctionclearOutbox
(t *testing.T, s *Store)
internal/store/event_outbox_test.go:76
↓ 39 callersMethodreq
req builds a request from A to B with the standard actor.
internal/store/attachments_copy_plan_test.go:85
↓ 38 callersMethodClose
Close stops every active room AND blocks until every in-flight Join goroutine has returned. After Close, Join is undefined — callers must coordinate s
internal/collab/manager.go:1338
↓ 38 callersMethodbaseBody
()
internal/server/handlers_items_copy_preflight_test.go:209
↓ 37 callersMethodRead
(p []byte)
internal/cli/client_items_copy.go:473
↓ 37 callersMethodRebind
Rebind converts a query with "?" placeholders to the dialect's format. For SQLite this is a no-op. For PostgreSQL, "?" becomes "$1", "$2", etc.
internal/store/dialect.go:28
↓ 37 callersMethodSetObserver
SetObserver attaches an Observer. Passing nil detaches. Safe to call after the bus is running; cmd/pad/cmd_server.go calls it at wiring time.
internal/events/observer.go:284
↓ 37 callersMethodrequireItemVisible
requireItemVisible checks that the item's collection is visible to the requesting user. For guests with item-level grants, also verifies that the spec
internal/server/server.go:2375
↓ 36 callersMethodIsZero
IsZero reports whether the collection declares no kernel traits at all.
internal/models/collection_traits.go:128
↓ 36 callersFunctionauditMeta
auditMeta safely marshals a map to a JSON string for audit log metadata. Falls back to "{}" on marshal error so audit calls never break.
internal/server/handlers_documents.go:463
↓ 36 callersFunctionnewPlanFixture
(t *testing.T)
internal/store/attachments_copy_plan_test.go:24
↓ 35 callersMethodDecode
Decode reads bytes from r and returns the decoded image plus the detected format ("png", "jpeg", "gif", "bmp", "tiff", …). The returned format is the
internal/attachments/processor.go:35
↓ 35 callersMethodget
(path string, result interface{})
internal/cli/client.go:1916
↓ 35 callersFunctionnewTransitionTestWorkspace
(t *testing.T, s *Store)
internal/store/status_transitions_test.go:48
↓ 35 callersFunctionwaitForWatchEvent
(t *testing.T, ch <-chan watchSSEEvent, timeout time.Duration)
internal/server/handlers_watch_events_test.go:113
↓ 34 callersMethodWrite
(p []byte)
internal/server/token_reaper_test.go:21
↓ 34 callersFunctionisCollectionVisible
isCollectionVisible checks if a collection ID is in the visible set. If visibleIDs is nil, all collections are visible.
internal/server/server.go:2654
↓ 33 callersMethodEventsSince
EventsSince returns buffered notifications with ID > sinceID, for Last-Event-ID resume. Returns nil if sinceID has been evicted from the buffer (gap t
internal/watchevents/watchevents.go:280
↓ 33 callersMethodSet
Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the c
internal/cli/credentials.go:185
↓ 33 callersMethodplan
(t *testing.T, req AttachmentCopyRequest)
internal/store/attachments_copy_plan_test.go:96
↓ 33 callersFunctions256Challenge
s256Challenge computes the base64url(no-padding, SHA256(verifier)) per RFC 7636 §4.2. PKCE clients use this to derive code_challenge from code_verifie
internal/server/handlers_oauth_test.go:2548
↓ 33 callersFunctiontestServerWithEvents
(t *testing.T)
internal/server/handlers_events_test.go:20
↓ 32 callersFunctionBuild
Build returns a cmdhelp Document without serializing it. Callers that need to inspect or further mutate the document (tests, dynamic enum resolvers in
internal/cmdhelp/json.go:83
↓ 32 callersMethodGetAttachment
GetAttachment returns the attachment with the given id, or (nil, nil) if no such row exists. Soft-deleted rows ARE returned (so download handlers can
internal/store/attachments.go:239
↓ 32 callersMethodGetCollectionBySlug
(workspaceID, slug string)
internal/store/collections.go:244
↓ 32 callersMethodListCollections
(workspaceID string)
internal/store/collections.go:323
↓ 32 callersMethodguestResourceFilter
guestResourceFilter returns the full-collection IDs and granted item IDs for the current user if they need item-level grant filtering. Returns nil/nil
internal/server/server.go:2587
↓ 32 callersFunctionliveCmdhelpDoc
liveCmdhelpDoc returns a minimal cmdhelp.Document with every command path the read-only catalog references. Lighter than re-running pad's full cobra e
internal/mcp/catalog_readonly_test.go:430
↓ 32 callersFunctionrunItemCopy
runItemCopy is the whole command, minus flag binding. Order of operations is load-bearing: 1. Build the request (the SAME body both endpoints take).
cmd/pad/cmd_item.go:1756
↓ 32 callersFunctionworkspaceIDForSlug
workspaceIDForSlug looks up the internal UUID for a slug — used by tests that synthesize attachment rows directly via the store (bypassing the upload
internal/server/handlers_storage_test.go:425
↓ 31 callersMethodUpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:271
↓ 31 callersFunctionbaseOpts
()
cmd/pad/item_copy_test.go:139
↓ 31 callersMethoddeps
()
cmd/pad/item_copy_test.go:110
↓ 31 callersFunctiongetDashboard
helper: fetch the dashboard and return the parsed response
internal/server/handlers_dashboard_test.go:25
↓ 31 callersFunctionnewRestrictedOwnerVisibilityFixture
(t *testing.T)
internal/server/handlers_grant_visibility_test.go:33
↓ 31 callersFunctionreadCSRFFromCookie
readCSRFFromCookie hits any consent-rendering endpoint that sets the CSRF cookie on first visit, returns the token. We use oauth/authorize because it'
internal/server/handlers_oauth_test.go:2515
↓ 31 callersMethodsnapshot
()
internal/watchevents/observer_test.go:96
↓ 31 callersFunctiontimelineItemWithStructured
BUG-2301: `pad item note` / `pad item decide` wrote structured entries that no web surface rendered — the renderer shipped in c61f4cda and was deleted
internal/server/handlers_timeline_structured_test.go:24
↓ 30 callersFunctionItemRef
ItemRef returns the reference string (e.g. "TASK-5") for an item, or empty string.
internal/cli/format.go:95
↓ 30 callersFunctionimageRef
(id string)
internal/store/attachments_copy_plan_test.go:105
↓ 30 callersFunctionmount
()
web/src/lib/components/graph/ItemGraph.svelte.test.ts:151
↓ 30 callersMethodresolvableBody
resolvableBody is a request the copy can actually satisfy: the two needs_value entries the base fixture leaves open are supplied, so the preflight com
internal/server/handlers_items_copy_test.go:111
↓ 29 callersFunctionLoad
()
internal/config/config.go:313
↓ 29 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:306
↓ 29 callersMethodSetParentLink
--- Phase Links --- SetParentLink sets the parent for an item. Since an item can belong to at most one parent, this deletes any existing parent link f
internal/store/items.go:3358
↓ 29 callersFunctionmustUser
(t *testing.T, srv *Server, email, username, role string)
internal/server/authz_cross_workspace_test.go:76
↓ 29 callersFunctionrefOf
refOf builds a PREFIX-NUMBER string from a fresh item — used by the integration tests since the canonical ref isn't on the model directly. ItemNumber
internal/store/wiki_links_test.go:543
↓ 29 callersFunctionroot
()
web/src/lib/components/common/Lightbox.svelte.test.ts:187
↓ 28 callersMethodResolve
Resolve returns the store responsible for key, or an error if no matching backend is registered. The key format is "<prefix>:<rest>".
internal/attachments/registry.go:63
↓ 28 callersMethodSubscribeIfAllowed
SubscribeIfAllowed atomically checks the per-workspace subscriber limit and, only if it is satisfied, subscribes in the same critical section. Return
internal/events/bus.go:235
↓ 28 callersFunctionbrowserLogin
(page: Page)
web/e2e/lib/collab-helpers.ts:18
↓ 28 callersFunctionerrorHandler
errorHandler fails the test if invoked. Used to assert that a code path doesn't hit the handler at all.
internal/mcp/dispatch_http_advanced_test.go:891
↓ 28 callersFunctionmkUser
(t *testing.T, srv *Server, email string)
internal/server/handlers_storage_delete_authz_test.go:107
↓ 28 callersFunctionparseTimePtr
(s *string)
internal/store/store.go:980
↓ 28 callersFunctiontick
()
web/src/lib/components/editor/block-drag-handle.ts:709
↓ 27 callersMethodCreateItemLink
--- Item Links ---
internal/store/items.go:3023
↓ 27 callersMethodGetWorkspaceMember
GetWorkspaceMember retrieves a single membership record.
internal/store/workspace_members.go:104
↓ 27 callersFunctionNew
New creates a MemoryBus with the default replay buffer size.
internal/watchevents/watchevents.go:423
↓ 27 callersMethodattach
attach creates an original attachment in ws and returns it.
internal/store/attachments_copy_plan_test.go:37
↓ 27 callersMethodcall
call issues the preflight exactly as the router would, with the caller's auth surface described by o. The workspace-A role and resolved ID are stashed
internal/server/handlers_items_copy_preflight_test.go:126
↓ 27 callersFunctionnewCrossWSFixture
(t *testing.T)
internal/server/authz_cross_workspace_test.go:50
↓ 27 callersFunctionnewMiniredisBus
(t *testing.T, size int)
internal/watchevents/redis_bus_integration_test.go:28
↓ 26 callersMethodQuery
(query string, args ...any)
internal/store/items.go:4427
↓ 26 callersFunctionWithCurrentUser
Exported context-key helpers for callers that need to synthesize an authenticated request without going through the auth middleware chain (e.g. the in
internal/server/context.go:25
↓ 26 callersFunctionactorFromRequest
actorFromRequest derives actor and source from the request's auth context. Actor is "user" or "agent" (determined by X-Pad-Agent header). Source is "w
internal/server/handlers_documents.go:355
↓ 26 callersFunctioncloudAdminReq
cloudAdminReq is a small helper that builds a request with optional JSON body and the caller-chosen headers.
internal/server/cloud_admin_gate_test.go:19
↓ 26 callersFunctiondialWS
(t *testing.T, server *httptest.Server, itemID string)
internal/collab/manager_test.go:296
↓ 26 callersFunctionnewHeartbeatBus
newHeartbeatBus builds a phase-1 bus (recognises heartbeats, publishes none) on a hand-driven clock, with an observer attached.
internal/events/redis_heartbeat_test.go:43
↓ 25 callersMethodAuthorizeCrossWorkspaceEdit
AuthorizeCrossWorkspaceEdit decides whether the caller may WRITE the scoped resource in a workspace OTHER than the request's own. It runs every step
internal/server/authz_cross_workspace.go:509
↓ 25 callersMethodDispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 25 callersFunctionNewRedisBus
NewRedisBus creates a new Redis-backed EventBus. The provided redis.Client should already be configured and connected.
internal/events/redis_bus.go:803
↓ 25 callersMethodcurrentGen
NOTE: callerIsGone already exists in this package, added by BUG-2751 for the resume settle path, and is reused here rather than duplicated. Its reason
internal/watchevents/heartbeat.go:515
↓ 25 callersFunctionfetchTimeline
(t *testing.T, srv *Server, wsSlug, itemSlug, query string)
internal/server/handlers_timeline_structured_test.go:49
↓ 25 callersFunctionnewTestRedisBus
(t *testing.T)
internal/events/redis_resume_coverage_test.go:11
↓ 25 callersMethodrecord
* Claim what is now on screen. Recording a token whose key is null (an * un-addressable view) correctly claims nothing.
web/src/lib/attachments/viewFence.ts:183
↓ 24 callersMethodBoolToInt
BoolToInt converts a Go bool to a query parameter value. SQLite: 0/1 (integers) PostgreSQL: true/false (native booleans)
internal/store/dialect.go:69
← previousnext →101–200 of 9,998, ranked by callers