Public, non-pagination instance methods of a resource class, snake_cased.
(cls: { prototype: object })
| 27 | |
| 28 | /** Public, non-pagination instance methods of a resource class, snake_cased. */ |
| 29 | function methodsOf(cls: { prototype: object }): string[] { |
| 30 | return Object.getOwnPropertyNames(cls.prototype) |
| 31 | .filter((n) => n !== "constructor") |
| 32 | .filter((n) => !n.startsWith("_") && !n.startsWith("#")) |
| 33 | .filter((n) => !PAGINATION_HELPERS.has(n)) |
| 34 | // sub-resource accessors (`members`, `machines`) live on FleetsResource as |
| 35 | // getters, not methods — they are namespaces, surfaced separately below. |
| 36 | .filter((n) => { |
| 37 | const d = Object.getOwnPropertyDescriptor(cls.prototype, n); |
| 38 | return typeof d?.value === "function"; |
| 39 | }) |
| 40 | .map(toSnake) |
| 41 | .sort(); |
| 42 | } |
| 43 | |
| 44 | /** The actual Node SDK surface, keyed by namespace path. */ |
| 45 | export function actualSurface(): Record<string, string[]> { |