@singi-labs/sifa-sdk 0.19.33 → 0.19.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{index-CH8NiQwH.d.cts → index-BMUJEOoA.d.cts} +6 -2
  2. package/dist/{index-ayiu2kGy.d.ts → index-D7IufF6R.d.ts} +6 -2
  3. package/dist/index.cjs +172 -4
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +79 -7
  6. package/dist/index.d.ts +79 -7
  7. package/dist/index.js +168 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/jsonld/index.d.cts +1 -1
  10. package/dist/jsonld/index.d.ts +1 -1
  11. package/dist/{network-map-CemKAXaz.d.ts → network-map--qYzsEP_.d.ts} +3 -4
  12. package/dist/{network-map-5ZQalf1g.d.cts → network-map-DHkUgCYs.d.cts} +3 -4
  13. package/dist/{org-Baoxl7ha.d.ts → org-BSHNseXX.d.ts} +5 -256
  14. package/dist/{org-D-zPVoep.d.cts → org-BYL2yrSq.d.cts} +5 -256
  15. package/dist/{profile-investment-BIOYJf-x.d.cts → profile-investment-CJwwK8DY.d.cts} +1 -4
  16. package/dist/{profile-investment-BIOYJf-x.d.ts → profile-investment-CJwwK8DY.d.ts} +1 -4
  17. package/dist/{profile-summary-DOkOlwml.d.cts → profile-summary-BmUSSgAr.d.cts} +1 -1
  18. package/dist/{profile-summary-Bw6SLwnM.d.ts → profile-summary-wEt4IKo1.d.ts} +1 -1
  19. package/dist/query/fetchers/index.cjs +3 -1
  20. package/dist/query/fetchers/index.cjs.map +1 -1
  21. package/dist/query/fetchers/index.d.cts +6 -6
  22. package/dist/query/fetchers/index.d.ts +6 -6
  23. package/dist/query/fetchers/index.js +3 -1
  24. package/dist/query/fetchers/index.js.map +1 -1
  25. package/dist/query/hooks/index.cjs +3 -1
  26. package/dist/query/hooks/index.cjs.map +1 -1
  27. package/dist/query/hooks/index.d.cts +4 -5
  28. package/dist/query/hooks/index.d.ts +4 -5
  29. package/dist/query/hooks/index.js +3 -1
  30. package/dist/query/hooks/index.js.map +1 -1
  31. package/dist/query/index.cjs +3 -1
  32. package/dist/query/index.cjs.map +1 -1
  33. package/dist/query/index.d.cts +10 -9
  34. package/dist/query/index.d.ts +10 -9
  35. package/dist/query/index.js +3 -1
  36. package/dist/query/index.js.map +1 -1
  37. package/dist/resume/index.d.cts +1 -1
  38. package/dist/resume/index.d.ts +1 -1
  39. package/dist/schemas/index.cjs +6 -3
  40. package/dist/schemas/index.cjs.map +1 -1
  41. package/dist/schemas/index.d.cts +1 -1
  42. package/dist/schemas/index.d.ts +1 -1
  43. package/dist/schemas/index.js +6 -3
  44. package/dist/schemas/index.js.map +1 -1
  45. package/dist/schemas/write/index.cjs +4 -2
  46. package/dist/schemas/write/index.cjs.map +1 -1
  47. package/dist/schemas/write/index.d.cts +1 -0
  48. package/dist/schemas/write/index.d.ts +1 -0
  49. package/dist/schemas/write/index.js +4 -2
  50. package/dist/schemas/write/index.js.map +1 -1
  51. package/dist/{types-CWIfTV3N.d.cts → types-B6_rM5e1.d.cts} +255 -2
  52. package/dist/{types-CKqres0c.d.ts → types-BZSh8AHp.d.ts} +255 -2
  53. package/dist/{use-org-notification-emails-3m5Rit93.d.cts → use-org-notification-emails-CisY4oDQ.d.cts} +3 -3
  54. package/dist/{use-org-notification-emails-Cx-bDFpR.d.ts → use-org-notification-emails-N5UXg0Zg.d.ts} +3 -3
  55. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { w as PresentationLinkView, b as PdsProviderInfo } from './index-CH8NiQwH.cjs';
1
+ import { w as PresentationLinkView, b as PdsProviderInfo, T as SkillSuggestion } from './index-BMUJEOoA.cjs';
2
2
 
3
3
  /**
4
4
  * Types for the `id.sifa.getProfileView` XRPC query: the aggregated public
@@ -196,6 +196,7 @@ interface CourseView {
196
196
  startedAt?: string;
197
197
  endedAt?: string;
198
198
  positionRkey?: string;
199
+ educationRkey?: string;
199
200
  }
200
201
  interface DurationView {
201
202
  minMinutes: number;
@@ -340,6 +341,258 @@ interface ProfileView {
340
341
  claimed?: boolean;
341
342
  }
342
343
 
344
+ /**
345
+ * Foundation HTTP client for talking to the Sifa AppView.
346
+ *
347
+ * Stateless. Consumers supply a {@link SifaApiConfig} per call (the React
348
+ * hooks read it from context; non-React consumers pass it explicitly). No
349
+ * singletons, no module-level state.
350
+ */
351
+ /** Configuration passed to every fetcher. */
352
+ interface SifaApiConfig {
353
+ /** Base URL of the sifa-api AppView, e.g. `https://api.sifa.id`. No trailing slash. */
354
+ baseUrl: string;
355
+ /**
356
+ * Optional fetch implementation. Defaults to {@link globalThis.fetch}.
357
+ * Lets Next.js consumers pass their cache-enhanced fetch; node/Expo
358
+ * consumers can leave this unset.
359
+ */
360
+ fetch?: typeof fetch;
361
+ /**
362
+ * Optional per-request auth-token minter for auth-required reads. The NATIVE
363
+ * app supplies this (it has no sifa-api session cookie): given a method NSID
364
+ * (`lxm`), it mints a short-lived AT Protocol service-auth JWT on the user's
365
+ * PDS (see the SDK's `/atproto` `mintServiceAuthToken`) and returns it; the
366
+ * fetcher attaches it as `Authorization: Bearer`. Web omits this and relies on
367
+ * its session cookie (`credentials: 'include'`). Return `null` to send no
368
+ * token. See `sifa-api` `createIdentityMiddleware`.
369
+ */
370
+ getAuthToken?: (lxm: string) => Promise<string | null>;
371
+ }
372
+ /** Options accepted by {@link apiFetch}. */
373
+ interface ApiFetchOptions {
374
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
375
+ /** Request body. Serialized to JSON automatically. */
376
+ body?: unknown;
377
+ /** AbortSignal. Defaults to `AbortSignal.timeout(timeoutMs)` if `timeoutMs` is set. */
378
+ signal?: AbortSignal;
379
+ /** Per-call timeout in milliseconds. Default: 10_000. Ignored if `signal` is provided. */
380
+ timeoutMs?: number;
381
+ /** Retry on HTTP 429 up to 3 times with the server's `Retry-After` delay (capped at 3s). */
382
+ retryOn429?: boolean;
383
+ /** Additional headers. `Content-Type: application/json` is set automatically when `body` is present. */
384
+ headers?: Record<string, string>;
385
+ credentials?: RequestCredentials;
386
+ cache?: RequestCache;
387
+ /**
388
+ * Next.js-specific cache hints. Ignored on non-Next runtimes. Passed
389
+ * through transparently as part of {@link RequestInit}.
390
+ */
391
+ next?: {
392
+ revalidate?: number | false;
393
+ tags?: string[];
394
+ };
395
+ }
396
+ /** Error thrown by {@link apiFetch} on non-2xx responses. */
397
+ declare class ApiError extends Error {
398
+ readonly status: number;
399
+ readonly body: unknown;
400
+ constructor(message: string, status: number, body?: unknown);
401
+ }
402
+ /**
403
+ * Generic fetcher used by all SDK query and mutation functions.
404
+ *
405
+ * Returns parsed JSON typed as `T`. Throws {@link ApiError} on non-2xx
406
+ * responses. Use {@link apiFetchOrNull} when 404 should resolve to `null`
407
+ * instead.
408
+ */
409
+ declare function apiFetch<T = unknown>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T>;
410
+ /**
411
+ * Variant of {@link apiFetch} that resolves to `null` on HTTP 404 instead
412
+ * of throwing. Useful for "fetch by handle" reads where missing is
413
+ * expected (e.g. unknown profile).
414
+ */
415
+ declare function apiFetchOrNull<T>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T | null>;
416
+ /**
417
+ * Result returned by record-write mutations (create / update / delete).
418
+ *
419
+ * Never throws -- writes against the user's PDS can fail in many ways
420
+ * (network, PDS unreachable, rate limit) and the UI needs structured
421
+ * results to render appropriate messages.
422
+ */
423
+ interface WriteResult {
424
+ success: boolean;
425
+ error?: string;
426
+ /**
427
+ * PDS hostname returned by sifa-api when a write failed at the user's
428
+ * Personal Data Server (issue #167). Lets the UI render
429
+ * "Your data server (eurosky.social) isn't responding" instead of a
430
+ * generic "Request failed (500)".
431
+ */
432
+ pdsHost?: string;
433
+ }
434
+ /** Result returned by create mutations. Includes the newly created `rkey`. */
435
+ interface CreateResult extends WriteResult {
436
+ rkey?: string;
437
+ }
438
+ /**
439
+ * Write mutation against the Sifa AppView. Wraps {@link apiFetch} with the
440
+ * never-throws contract used by all sifa-web mutations: returns a
441
+ * structured {@link WriteResult} on both success and failure, and
442
+ * preserves the `pdsHost` field when the AppView reports a PDS-side
443
+ * failure (issue #167).
444
+ *
445
+ * On success: returns `{ success: true, ...payload }` where `payload` is
446
+ * whatever the server returned in JSON (or `{}` for 204).
447
+ *
448
+ * On failure: returns `{ success: false, error, pdsHost? }`. Never throws.
449
+ *
450
+ * Use {@link apiWriteCreate} when you specifically need the `rkey` from a
451
+ * create response folded into the result shape.
452
+ */
453
+ declare function apiWrite<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, method: 'POST' | 'PUT' | 'DELETE' | 'PATCH', options?: Omit<ApiFetchOptions, 'method'>): Promise<WriteResult & TExtra>;
454
+ /**
455
+ * Write mutation that expects the server to return a record key (`rkey`)
456
+ * in its response body. Wraps {@link apiWrite} and folds the `rkey` into
457
+ * the result shape so consumers get `{ success, rkey?, error?, pdsHost? }`.
458
+ *
459
+ * If the server returns additional fields (e.g. `feedUrl` from external
460
+ * account creation), pass them via the `TExtra` generic to keep them
461
+ * typed.
462
+ */
463
+ declare function apiWriteCreate<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, body: unknown, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<CreateResult & TExtra>;
464
+
465
+ /** Profile entry returned by the search endpoint. */
466
+ interface ProfileSearchResult {
467
+ did?: string;
468
+ handle: string;
469
+ displayName?: string;
470
+ headline?: string;
471
+ avatar?: string;
472
+ about?: string;
473
+ currentRole?: string;
474
+ currentCompany?: string;
475
+ industry?: string;
476
+ domain?: string;
477
+ countryCode?: string;
478
+ locationCountry?: string;
479
+ preferredWorkplace?: string[];
480
+ claimed?: boolean;
481
+ blueskyVerified?: boolean;
482
+ blueskyVerifiedAt?: string | null;
483
+ }
484
+ interface SearchFilters {
485
+ q?: string;
486
+ skill?: string;
487
+ country?: string;
488
+ industry?: string;
489
+ domain?: string;
490
+ workplace?: string;
491
+ app?: string;
492
+ /**
493
+ * Open-to filter. Values are short tokens (e.g. "fullTime", "mentor",
494
+ * "collab") matching `OPEN_TO_OPTIONS[].token` from the taxonomy. The
495
+ * API expands tokens to lex values server-side. Multiple tokens are
496
+ * OR-combined (profile matches if any selected token is set).
497
+ */
498
+ openTo?: string[];
499
+ limit?: number;
500
+ }
501
+ interface SearchResponse {
502
+ profiles: ProfileSearchResult[];
503
+ total: number;
504
+ limit: number;
505
+ offset: number;
506
+ }
507
+ /** Skill typeahead suggestion. */
508
+ interface SkillSearchResult {
509
+ name: string;
510
+ slug: string;
511
+ category: string;
512
+ userCount: number;
513
+ }
514
+ interface FilterOptions {
515
+ countries: {
516
+ countryCode: string;
517
+ country: string;
518
+ count: number;
519
+ }[];
520
+ industries: {
521
+ industry: string;
522
+ count: number;
523
+ }[];
524
+ apps: {
525
+ appId: string;
526
+ count: number;
527
+ }[];
528
+ /**
529
+ * Distribution of openTo selections across indexed profiles. Each entry
530
+ * maps a short token (see {@link SearchFilters.openTo}) to the number of
531
+ * profiles that have it set. Omitted from older API responses; treat
532
+ * absence as "no data" rather than "all zero".
533
+ */
534
+ openTo?: {
535
+ token: string;
536
+ count: number;
537
+ }[];
538
+ }
539
+ /** Company entry returned by company search (workspace#299). */
540
+ interface CompanySearchResult {
541
+ /** Immutable catalogue id; the durable `/c/{publicId}` link. */
542
+ publicId: string;
543
+ name: string;
544
+ domain: string | null;
545
+ country: string | null;
546
+ industry: string | null;
547
+ logoUrl: string | null;
548
+ employeeCount: number | null;
549
+ }
550
+ interface CompanySearchFilters {
551
+ q?: string;
552
+ /** ISO 3166-1 alpha-2. */
553
+ country?: string;
554
+ industry?: string;
555
+ limit?: number;
556
+ }
557
+ interface CompanySearchResponse {
558
+ results: CompanySearchResult[];
559
+ hasMore: boolean;
560
+ }
561
+ /**
562
+ * Search profiles by free-text query and optional filters. Returns an
563
+ * empty result set when no filters are provided (matching sifa-web's
564
+ * "no input, no fetch" behavior).
565
+ */
566
+ declare function fetchSearchProfiles(config: SifaApiConfig, filters: SearchFilters, options?: ApiFetchOptions): Promise<SearchResponse>;
567
+ /**
568
+ * Company search over the entity catalogue (workspace#299).
569
+ *
570
+ * A category of its own rather than part of profile search: the two rank
571
+ * differently and carry different filters, and a slow category should not hold
572
+ * up the rest of a blended results page.
573
+ *
574
+ * An empty query returns nothing without a network call. The API rejects a
575
+ * blank `q` rather than scanning ~200k rows, so asking would only spend a round
576
+ * trip to be told no.
577
+ */
578
+ declare function fetchSearchCompanies(config: SifaApiConfig, filters: CompanySearchFilters, options?: ApiFetchOptions): Promise<CompanySearchResponse>;
579
+ /**
580
+ * Skill typeahead. Returns up to 8 matches for the given prefix. Empty
581
+ * input returns an empty array without hitting the server.
582
+ */
583
+ declare function fetchSkillSuggestions(config: SifaApiConfig, query: string, options?: ApiFetchOptions): Promise<SkillSearchResult[]>;
584
+ /** Available filter facets (countries, industries, apps) for search UI. */
585
+ declare function fetchSearchFilters(config: SifaApiConfig, options?: ApiFetchOptions): Promise<FilterOptions>;
586
+ /**
587
+ * Canonical-skill search backing the position-editor and similar
588
+ * skill-pickers. Hits `/api/skills/search` (the canonical-skills DB
589
+ * lookup) which is distinct from {@link fetchSkillSuggestions}'s
590
+ * `/api/search/skills` (the profile-skill typeahead).
591
+ *
592
+ * Returns `[]` on empty input (no network call) or any error.
593
+ */
594
+ declare function searchSkills(config: SifaApiConfig, query: string, limit?: number, options?: ApiFetchOptions): Promise<SkillSuggestion[]>;
595
+
343
596
  /**
344
597
  * Adult-content gating for Bluesky activity items.
345
598
  *
@@ -545,4 +798,4 @@ interface RepoDeleteResult {
545
798
  };
546
799
  }
547
800
 
548
- export { ADULT_CONTENT_LABELS as A, describeSifaRecord as B, type CertificationView as C, type DurationView as D, type EducationView as E, hasAdultContent as F, repoGroupForCollection as G, type HonorView as H, type IndustryDomain as I, type LanguageView as L, type PositionView as P, type RepoCollectionGroup as R, SIFA_REPO_GROUPS as S, type VolunteeringView as V, type ActiveAppView as a, type ActivityLabel as b, type AdultContentLabel as c, type AtfundLinkView as d, type CoSpeakerView as e, type ContributorView as f, type CourseView as g, type ExternalAccountView as h, type InvolvementLinkView as i, type InvolvementView as j, type PresentationDeliveryView as k, type PresentationView as l, type ProfileLocationView as m, type ProfileView as n, type ProjectMemberView as o, type ProjectView as p, type PublicationView as q, type RepoDeleteOutcome as r, type RepoDeleteRecordResult as s, type RepoDeleteResult as t, type RepoGroupDefinition as u, type RepoGroupId as v, type RepoInventory as w, type RepoRecordLabel as x, type RepoRecordSummary as y, type SkillView as z };
801
+ export { apiWriteCreate as $, ADULT_CONTENT_LABELS as A, type SkillView as B, type CertificationView as C, type DurationView as D, type EducationView as E, describeSifaRecord as F, hasAdultContent as G, type HonorView as H, type IndustryDomain as I, repoGroupForCollection as J, type SifaApiConfig as K, type LanguageView as L, type ApiFetchOptions as M, type CreateResult as N, ApiError as O, type PositionView as P, type FilterOptions as Q, type RepoCollectionGroup as R, type SearchFilters as S, type ProfileSearchResult as T, type SearchResponse as U, type VolunteeringView as V, type WriteResult as W, type SkillSearchResult as X, apiFetch as Y, apiFetchOrNull as Z, apiWrite as _, type ActiveAppView as a, fetchSearchFilters as a0, fetchSearchProfiles as a1, fetchSkillSuggestions as a2, searchSkills as a3, type CompanySearchFilters as a4, type CompanySearchResponse as a5, type CompanySearchResult as a6, fetchSearchCompanies as a7, type ActivityLabel as b, type AdultContentLabel as c, type AtfundLinkView as d, type CoSpeakerView as e, type ContributorView as f, type CourseView as g, type ExternalAccountView as h, type InvolvementLinkView as i, type InvolvementView as j, type PresentationDeliveryView as k, type PresentationView as l, type ProfileLocationView as m, type ProfileView as n, type ProjectMemberView as o, type ProjectView as p, type PublicationView as q, type RepoDeleteOutcome as r, type RepoDeleteRecordResult as s, type RepoDeleteResult as t, type RepoGroupDefinition as u, type RepoGroupId as v, type RepoInventory as w, type RepoRecordLabel as x, type RepoRecordSummary as y, SIFA_REPO_GROUPS as z };
@@ -1,4 +1,4 @@
1
- import { w as PresentationLinkView, b as PdsProviderInfo } from './index-ayiu2kGy.js';
1
+ import { w as PresentationLinkView, b as PdsProviderInfo, T as SkillSuggestion } from './index-D7IufF6R.js';
2
2
 
3
3
  /**
4
4
  * Types for the `id.sifa.getProfileView` XRPC query: the aggregated public
@@ -196,6 +196,7 @@ interface CourseView {
196
196
  startedAt?: string;
197
197
  endedAt?: string;
198
198
  positionRkey?: string;
199
+ educationRkey?: string;
199
200
  }
200
201
  interface DurationView {
201
202
  minMinutes: number;
@@ -340,6 +341,258 @@ interface ProfileView {
340
341
  claimed?: boolean;
341
342
  }
342
343
 
344
+ /**
345
+ * Foundation HTTP client for talking to the Sifa AppView.
346
+ *
347
+ * Stateless. Consumers supply a {@link SifaApiConfig} per call (the React
348
+ * hooks read it from context; non-React consumers pass it explicitly). No
349
+ * singletons, no module-level state.
350
+ */
351
+ /** Configuration passed to every fetcher. */
352
+ interface SifaApiConfig {
353
+ /** Base URL of the sifa-api AppView, e.g. `https://api.sifa.id`. No trailing slash. */
354
+ baseUrl: string;
355
+ /**
356
+ * Optional fetch implementation. Defaults to {@link globalThis.fetch}.
357
+ * Lets Next.js consumers pass their cache-enhanced fetch; node/Expo
358
+ * consumers can leave this unset.
359
+ */
360
+ fetch?: typeof fetch;
361
+ /**
362
+ * Optional per-request auth-token minter for auth-required reads. The NATIVE
363
+ * app supplies this (it has no sifa-api session cookie): given a method NSID
364
+ * (`lxm`), it mints a short-lived AT Protocol service-auth JWT on the user's
365
+ * PDS (see the SDK's `/atproto` `mintServiceAuthToken`) and returns it; the
366
+ * fetcher attaches it as `Authorization: Bearer`. Web omits this and relies on
367
+ * its session cookie (`credentials: 'include'`). Return `null` to send no
368
+ * token. See `sifa-api` `createIdentityMiddleware`.
369
+ */
370
+ getAuthToken?: (lxm: string) => Promise<string | null>;
371
+ }
372
+ /** Options accepted by {@link apiFetch}. */
373
+ interface ApiFetchOptions {
374
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
375
+ /** Request body. Serialized to JSON automatically. */
376
+ body?: unknown;
377
+ /** AbortSignal. Defaults to `AbortSignal.timeout(timeoutMs)` if `timeoutMs` is set. */
378
+ signal?: AbortSignal;
379
+ /** Per-call timeout in milliseconds. Default: 10_000. Ignored if `signal` is provided. */
380
+ timeoutMs?: number;
381
+ /** Retry on HTTP 429 up to 3 times with the server's `Retry-After` delay (capped at 3s). */
382
+ retryOn429?: boolean;
383
+ /** Additional headers. `Content-Type: application/json` is set automatically when `body` is present. */
384
+ headers?: Record<string, string>;
385
+ credentials?: RequestCredentials;
386
+ cache?: RequestCache;
387
+ /**
388
+ * Next.js-specific cache hints. Ignored on non-Next runtimes. Passed
389
+ * through transparently as part of {@link RequestInit}.
390
+ */
391
+ next?: {
392
+ revalidate?: number | false;
393
+ tags?: string[];
394
+ };
395
+ }
396
+ /** Error thrown by {@link apiFetch} on non-2xx responses. */
397
+ declare class ApiError extends Error {
398
+ readonly status: number;
399
+ readonly body: unknown;
400
+ constructor(message: string, status: number, body?: unknown);
401
+ }
402
+ /**
403
+ * Generic fetcher used by all SDK query and mutation functions.
404
+ *
405
+ * Returns parsed JSON typed as `T`. Throws {@link ApiError} on non-2xx
406
+ * responses. Use {@link apiFetchOrNull} when 404 should resolve to `null`
407
+ * instead.
408
+ */
409
+ declare function apiFetch<T = unknown>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T>;
410
+ /**
411
+ * Variant of {@link apiFetch} that resolves to `null` on HTTP 404 instead
412
+ * of throwing. Useful for "fetch by handle" reads where missing is
413
+ * expected (e.g. unknown profile).
414
+ */
415
+ declare function apiFetchOrNull<T>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T | null>;
416
+ /**
417
+ * Result returned by record-write mutations (create / update / delete).
418
+ *
419
+ * Never throws -- writes against the user's PDS can fail in many ways
420
+ * (network, PDS unreachable, rate limit) and the UI needs structured
421
+ * results to render appropriate messages.
422
+ */
423
+ interface WriteResult {
424
+ success: boolean;
425
+ error?: string;
426
+ /**
427
+ * PDS hostname returned by sifa-api when a write failed at the user's
428
+ * Personal Data Server (issue #167). Lets the UI render
429
+ * "Your data server (eurosky.social) isn't responding" instead of a
430
+ * generic "Request failed (500)".
431
+ */
432
+ pdsHost?: string;
433
+ }
434
+ /** Result returned by create mutations. Includes the newly created `rkey`. */
435
+ interface CreateResult extends WriteResult {
436
+ rkey?: string;
437
+ }
438
+ /**
439
+ * Write mutation against the Sifa AppView. Wraps {@link apiFetch} with the
440
+ * never-throws contract used by all sifa-web mutations: returns a
441
+ * structured {@link WriteResult} on both success and failure, and
442
+ * preserves the `pdsHost` field when the AppView reports a PDS-side
443
+ * failure (issue #167).
444
+ *
445
+ * On success: returns `{ success: true, ...payload }` where `payload` is
446
+ * whatever the server returned in JSON (or `{}` for 204).
447
+ *
448
+ * On failure: returns `{ success: false, error, pdsHost? }`. Never throws.
449
+ *
450
+ * Use {@link apiWriteCreate} when you specifically need the `rkey` from a
451
+ * create response folded into the result shape.
452
+ */
453
+ declare function apiWrite<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, method: 'POST' | 'PUT' | 'DELETE' | 'PATCH', options?: Omit<ApiFetchOptions, 'method'>): Promise<WriteResult & TExtra>;
454
+ /**
455
+ * Write mutation that expects the server to return a record key (`rkey`)
456
+ * in its response body. Wraps {@link apiWrite} and folds the `rkey` into
457
+ * the result shape so consumers get `{ success, rkey?, error?, pdsHost? }`.
458
+ *
459
+ * If the server returns additional fields (e.g. `feedUrl` from external
460
+ * account creation), pass them via the `TExtra` generic to keep them
461
+ * typed.
462
+ */
463
+ declare function apiWriteCreate<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, body: unknown, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<CreateResult & TExtra>;
464
+
465
+ /** Profile entry returned by the search endpoint. */
466
+ interface ProfileSearchResult {
467
+ did?: string;
468
+ handle: string;
469
+ displayName?: string;
470
+ headline?: string;
471
+ avatar?: string;
472
+ about?: string;
473
+ currentRole?: string;
474
+ currentCompany?: string;
475
+ industry?: string;
476
+ domain?: string;
477
+ countryCode?: string;
478
+ locationCountry?: string;
479
+ preferredWorkplace?: string[];
480
+ claimed?: boolean;
481
+ blueskyVerified?: boolean;
482
+ blueskyVerifiedAt?: string | null;
483
+ }
484
+ interface SearchFilters {
485
+ q?: string;
486
+ skill?: string;
487
+ country?: string;
488
+ industry?: string;
489
+ domain?: string;
490
+ workplace?: string;
491
+ app?: string;
492
+ /**
493
+ * Open-to filter. Values are short tokens (e.g. "fullTime", "mentor",
494
+ * "collab") matching `OPEN_TO_OPTIONS[].token` from the taxonomy. The
495
+ * API expands tokens to lex values server-side. Multiple tokens are
496
+ * OR-combined (profile matches if any selected token is set).
497
+ */
498
+ openTo?: string[];
499
+ limit?: number;
500
+ }
501
+ interface SearchResponse {
502
+ profiles: ProfileSearchResult[];
503
+ total: number;
504
+ limit: number;
505
+ offset: number;
506
+ }
507
+ /** Skill typeahead suggestion. */
508
+ interface SkillSearchResult {
509
+ name: string;
510
+ slug: string;
511
+ category: string;
512
+ userCount: number;
513
+ }
514
+ interface FilterOptions {
515
+ countries: {
516
+ countryCode: string;
517
+ country: string;
518
+ count: number;
519
+ }[];
520
+ industries: {
521
+ industry: string;
522
+ count: number;
523
+ }[];
524
+ apps: {
525
+ appId: string;
526
+ count: number;
527
+ }[];
528
+ /**
529
+ * Distribution of openTo selections across indexed profiles. Each entry
530
+ * maps a short token (see {@link SearchFilters.openTo}) to the number of
531
+ * profiles that have it set. Omitted from older API responses; treat
532
+ * absence as "no data" rather than "all zero".
533
+ */
534
+ openTo?: {
535
+ token: string;
536
+ count: number;
537
+ }[];
538
+ }
539
+ /** Company entry returned by company search (workspace#299). */
540
+ interface CompanySearchResult {
541
+ /** Immutable catalogue id; the durable `/c/{publicId}` link. */
542
+ publicId: string;
543
+ name: string;
544
+ domain: string | null;
545
+ country: string | null;
546
+ industry: string | null;
547
+ logoUrl: string | null;
548
+ employeeCount: number | null;
549
+ }
550
+ interface CompanySearchFilters {
551
+ q?: string;
552
+ /** ISO 3166-1 alpha-2. */
553
+ country?: string;
554
+ industry?: string;
555
+ limit?: number;
556
+ }
557
+ interface CompanySearchResponse {
558
+ results: CompanySearchResult[];
559
+ hasMore: boolean;
560
+ }
561
+ /**
562
+ * Search profiles by free-text query and optional filters. Returns an
563
+ * empty result set when no filters are provided (matching sifa-web's
564
+ * "no input, no fetch" behavior).
565
+ */
566
+ declare function fetchSearchProfiles(config: SifaApiConfig, filters: SearchFilters, options?: ApiFetchOptions): Promise<SearchResponse>;
567
+ /**
568
+ * Company search over the entity catalogue (workspace#299).
569
+ *
570
+ * A category of its own rather than part of profile search: the two rank
571
+ * differently and carry different filters, and a slow category should not hold
572
+ * up the rest of a blended results page.
573
+ *
574
+ * An empty query returns nothing without a network call. The API rejects a
575
+ * blank `q` rather than scanning ~200k rows, so asking would only spend a round
576
+ * trip to be told no.
577
+ */
578
+ declare function fetchSearchCompanies(config: SifaApiConfig, filters: CompanySearchFilters, options?: ApiFetchOptions): Promise<CompanySearchResponse>;
579
+ /**
580
+ * Skill typeahead. Returns up to 8 matches for the given prefix. Empty
581
+ * input returns an empty array without hitting the server.
582
+ */
583
+ declare function fetchSkillSuggestions(config: SifaApiConfig, query: string, options?: ApiFetchOptions): Promise<SkillSearchResult[]>;
584
+ /** Available filter facets (countries, industries, apps) for search UI. */
585
+ declare function fetchSearchFilters(config: SifaApiConfig, options?: ApiFetchOptions): Promise<FilterOptions>;
586
+ /**
587
+ * Canonical-skill search backing the position-editor and similar
588
+ * skill-pickers. Hits `/api/skills/search` (the canonical-skills DB
589
+ * lookup) which is distinct from {@link fetchSkillSuggestions}'s
590
+ * `/api/search/skills` (the profile-skill typeahead).
591
+ *
592
+ * Returns `[]` on empty input (no network call) or any error.
593
+ */
594
+ declare function searchSkills(config: SifaApiConfig, query: string, limit?: number, options?: ApiFetchOptions): Promise<SkillSuggestion[]>;
595
+
343
596
  /**
344
597
  * Adult-content gating for Bluesky activity items.
345
598
  *
@@ -545,4 +798,4 @@ interface RepoDeleteResult {
545
798
  };
546
799
  }
547
800
 
548
- export { ADULT_CONTENT_LABELS as A, describeSifaRecord as B, type CertificationView as C, type DurationView as D, type EducationView as E, hasAdultContent as F, repoGroupForCollection as G, type HonorView as H, type IndustryDomain as I, type LanguageView as L, type PositionView as P, type RepoCollectionGroup as R, SIFA_REPO_GROUPS as S, type VolunteeringView as V, type ActiveAppView as a, type ActivityLabel as b, type AdultContentLabel as c, type AtfundLinkView as d, type CoSpeakerView as e, type ContributorView as f, type CourseView as g, type ExternalAccountView as h, type InvolvementLinkView as i, type InvolvementView as j, type PresentationDeliveryView as k, type PresentationView as l, type ProfileLocationView as m, type ProfileView as n, type ProjectMemberView as o, type ProjectView as p, type PublicationView as q, type RepoDeleteOutcome as r, type RepoDeleteRecordResult as s, type RepoDeleteResult as t, type RepoGroupDefinition as u, type RepoGroupId as v, type RepoInventory as w, type RepoRecordLabel as x, type RepoRecordSummary as y, type SkillView as z };
801
+ export { apiWriteCreate as $, ADULT_CONTENT_LABELS as A, type SkillView as B, type CertificationView as C, type DurationView as D, type EducationView as E, describeSifaRecord as F, hasAdultContent as G, type HonorView as H, type IndustryDomain as I, repoGroupForCollection as J, type SifaApiConfig as K, type LanguageView as L, type ApiFetchOptions as M, type CreateResult as N, ApiError as O, type PositionView as P, type FilterOptions as Q, type RepoCollectionGroup as R, type SearchFilters as S, type ProfileSearchResult as T, type SearchResponse as U, type VolunteeringView as V, type WriteResult as W, type SkillSearchResult as X, apiFetch as Y, apiFetchOrNull as Z, apiWrite as _, type ActiveAppView as a, fetchSearchFilters as a0, fetchSearchProfiles as a1, fetchSkillSuggestions as a2, searchSkills as a3, type CompanySearchFilters as a4, type CompanySearchResponse as a5, type CompanySearchResult as a6, fetchSearchCompanies as a7, type ActivityLabel as b, type AdultContentLabel as c, type AtfundLinkView as d, type CoSpeakerView as e, type ContributorView as f, type CourseView as g, type ExternalAccountView as h, type InvolvementLinkView as i, type InvolvementView as j, type PresentationDeliveryView as k, type PresentationView as l, type ProfileLocationView as m, type ProfileView as n, type ProjectMemberView as o, type ProjectView as p, type PublicationView as q, type RepoDeleteOutcome as r, type RepoDeleteRecordResult as s, type RepoDeleteResult as t, type RepoGroupDefinition as u, type RepoGroupId as v, type RepoInventory as w, type RepoRecordLabel as x, type RepoRecordSummary as y, SIFA_REPO_GROUPS as z };
@@ -1,10 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, aI as RefreshPdsResult, b0 as UpdateProfileOverrideInput, b1 as UpdateProfileSelfInput, b2 as UploadAvatarResult, b3 as UploadPronunciationAudioResult, C as CreateResult, ar as PrimarySection, aW as SubCategoryBulkResult, aw as ProfileLocationInput, r as ExternalAccountInput, p as CreateExternalAccountResult, b4 as VerifyExternalAccountResult, E as EndorsementInput, n as ConfirmationInput, o as ConfirmationSubjectInput, a1 as GivenConfirmation, aq as PendingConfirmationsPage, ac as InboxCounts, q as DismissUnlinkedPositionInput, a$ as UnlinkedPositionsResult, as as ProfileCompleteness, aH as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ab as HideProfileItemInput, a6 as HiddenActivityItem, aa as HideActivityItemInput, aZ as UnhideActivityItemInput, aV as StatsResponse, k as AppRegistryEntry, a7 as HiddenApp, d as AccountSummary, Q as FilterOptions, aQ as SearchFilters, aR as SearchResponse, aU as SkillSearchResult, cK as CompanySearchFilters, cL as CompanySearchResponse, t as FeaturedProfile, aT as SimilarProfile, O as FetchSuggestionsOptions, aY as SuggestionsResponse, V as FollowUserResult, y as FetchFollowListOptions, R as FollowListPage, _ as FollowingResponse, G as FetchFollowingFeedOptions, Z as FollowingFeedResponse, z as FetchFollowProfilePageOptions, U as FollowProfilePageResponse, F as FeatureAllowlistResponse, i as AdminReviewQueues, v as FetchActivityFeedOptions, e as ActivityFeedResponse, h as ActivityTeaserResponse, a5 as HeatmapResponse, ae as MyGithubPullRequestsResponse, c as AccountCheckResult, aG as ReactionStatus, aF as ReactionResult, aE as ReactionError, aP as RoadmapVotesResponse, l as CastRoadmapVoteResult, D as DeleteAccountResult, aK as ResetProfileResult, b5 as WipePreview, aJ as RepoDeleteInput, ag as OrgClaimResult, am as OrgProfileUpdateResult, ah as OrgDomainChallengeResult, ai as OrgDomainVerifyResult, aj as OrgNotificationEmailAddResult, ak as OrgNotificationEmailRemoveResult } from './org-D-zPVoep.cjs';
3
+ import { K as SifaApiConfig, n as ProfileView, W as WriteResult, N as CreateResult, Q as FilterOptions, S as SearchFilters, U as SearchResponse, X as SkillSearchResult, a4 as CompanySearchFilters, a5 as CompanySearchResponse, t as RepoDeleteResult, w as RepoInventory } from './types-B6_rM5e1.cjs';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
6
- import { c as Profile, d as ProfilePosition, S as SkillRef, p as ExternalAccount, T as SkillSuggestion, s as OrgFloorVerdict } from './index-CH8NiQwH.cjs';
7
- import { n as ProfileView, t as RepoDeleteResult, w as RepoInventory } from './types-CWIfTV3N.cjs';
6
+ import { c as Profile, d as ProfilePosition, S as SkillRef, p as ExternalAccount, T as SkillSuggestion, s as OrgFloorVerdict } from './index-BMUJEOoA.cjs';
7
+ import { s as sifaQueryKeys, aB as RefreshPdsResult, aS as UpdateProfileOverrideInput, aT as UpdateProfileSelfInput, aU as UploadAvatarResult, aV as UploadPronunciationAudioResult, al as PrimarySection, aM as SubCategoryBulkResult, aq as ProfileLocationInput, o as ExternalAccountInput, m as CreateExternalAccountResult, aW as VerifyExternalAccountResult, E as EndorsementInput, k as ConfirmationInput, l as ConfirmationSubjectInput, X as GivenConfirmation, ak as PendingConfirmationsPage, a6 as InboxCounts, n as DismissUnlinkedPositionInput, aR as UnlinkedPositionsResult, am as ProfileCompleteness, aA as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, a5 as HideProfileItemInput, a0 as HiddenActivityItem, a4 as HideActivityItemInput, aP as UnhideActivityItemInput, aL as StatsResponse, h as AppRegistryEntry, a1 as HiddenApp, b as AccountSummary, p as FeaturedProfile, aK as SimilarProfile, L as FetchSuggestionsOptions, aO as SuggestionsResponse, Q as FollowUserResult, v as FetchFollowListOptions, N as FollowListPage, U as FollowingResponse, x as FetchFollowingFeedOptions, T as FollowingFeedResponse, w as FetchFollowProfilePageOptions, P as FollowProfilePageResponse, F as FeatureAllowlistResponse, g as AdminReviewQueues, r as FetchActivityFeedOptions, c as ActivityFeedResponse, f as ActivityTeaserResponse, $ as HeatmapResponse, a8 as MyGithubPullRequestsResponse, A as AccountCheckResult, az as ReactionStatus, ay as ReactionResult, ax as ReactionError, aI as RoadmapVotesResponse, i as CastRoadmapVoteResult, D as DeleteAccountResult, aD as ResetProfileResult, aX as WipePreview, aC as RepoDeleteInput, aa as OrgClaimResult, ag as OrgProfileUpdateResult, ab as OrgDomainChallengeResult, ac as OrgDomainVerifyResult, ad as OrgNotificationEmailAddResult, ae as OrgNotificationEmailRemoveResult } from './org-BYL2yrSq.cjs';
8
8
  import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, n as EntitySelectResponse, l as EntitySelectRequest, r as FeatureFlag } from './follow-profile-D1l6pulB.cjs';
9
9
  import { O as OrgClaimRequestInput, a as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, c as OrgDomainVerifyRequestInput, d as OrgNotificationEmailRequestInput } from './org-settings-C73Sin5E.cjs';
10
10
 
@@ -1,10 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, aI as RefreshPdsResult, b0 as UpdateProfileOverrideInput, b1 as UpdateProfileSelfInput, b2 as UploadAvatarResult, b3 as UploadPronunciationAudioResult, C as CreateResult, ar as PrimarySection, aW as SubCategoryBulkResult, aw as ProfileLocationInput, r as ExternalAccountInput, p as CreateExternalAccountResult, b4 as VerifyExternalAccountResult, E as EndorsementInput, n as ConfirmationInput, o as ConfirmationSubjectInput, a1 as GivenConfirmation, aq as PendingConfirmationsPage, ac as InboxCounts, q as DismissUnlinkedPositionInput, a$ as UnlinkedPositionsResult, as as ProfileCompleteness, aH as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ab as HideProfileItemInput, a6 as HiddenActivityItem, aa as HideActivityItemInput, aZ as UnhideActivityItemInput, aV as StatsResponse, k as AppRegistryEntry, a7 as HiddenApp, d as AccountSummary, Q as FilterOptions, aQ as SearchFilters, aR as SearchResponse, aU as SkillSearchResult, cK as CompanySearchFilters, cL as CompanySearchResponse, t as FeaturedProfile, aT as SimilarProfile, O as FetchSuggestionsOptions, aY as SuggestionsResponse, V as FollowUserResult, y as FetchFollowListOptions, R as FollowListPage, _ as FollowingResponse, G as FetchFollowingFeedOptions, Z as FollowingFeedResponse, z as FetchFollowProfilePageOptions, U as FollowProfilePageResponse, F as FeatureAllowlistResponse, i as AdminReviewQueues, v as FetchActivityFeedOptions, e as ActivityFeedResponse, h as ActivityTeaserResponse, a5 as HeatmapResponse, ae as MyGithubPullRequestsResponse, c as AccountCheckResult, aG as ReactionStatus, aF as ReactionResult, aE as ReactionError, aP as RoadmapVotesResponse, l as CastRoadmapVoteResult, D as DeleteAccountResult, aK as ResetProfileResult, b5 as WipePreview, aJ as RepoDeleteInput, ag as OrgClaimResult, am as OrgProfileUpdateResult, ah as OrgDomainChallengeResult, ai as OrgDomainVerifyResult, aj as OrgNotificationEmailAddResult, ak as OrgNotificationEmailRemoveResult } from './org-Baoxl7ha.js';
3
+ import { K as SifaApiConfig, n as ProfileView, W as WriteResult, N as CreateResult, Q as FilterOptions, S as SearchFilters, U as SearchResponse, X as SkillSearchResult, a4 as CompanySearchFilters, a5 as CompanySearchResponse, t as RepoDeleteResult, w as RepoInventory } from './types-BZSh8AHp.js';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
6
- import { c as Profile, d as ProfilePosition, S as SkillRef, p as ExternalAccount, T as SkillSuggestion, s as OrgFloorVerdict } from './index-ayiu2kGy.js';
7
- import { n as ProfileView, t as RepoDeleteResult, w as RepoInventory } from './types-CKqres0c.js';
6
+ import { c as Profile, d as ProfilePosition, S as SkillRef, p as ExternalAccount, T as SkillSuggestion, s as OrgFloorVerdict } from './index-D7IufF6R.js';
7
+ import { s as sifaQueryKeys, aB as RefreshPdsResult, aS as UpdateProfileOverrideInput, aT as UpdateProfileSelfInput, aU as UploadAvatarResult, aV as UploadPronunciationAudioResult, al as PrimarySection, aM as SubCategoryBulkResult, aq as ProfileLocationInput, o as ExternalAccountInput, m as CreateExternalAccountResult, aW as VerifyExternalAccountResult, E as EndorsementInput, k as ConfirmationInput, l as ConfirmationSubjectInput, X as GivenConfirmation, ak as PendingConfirmationsPage, a6 as InboxCounts, n as DismissUnlinkedPositionInput, aR as UnlinkedPositionsResult, am as ProfileCompleteness, aA as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, a5 as HideProfileItemInput, a0 as HiddenActivityItem, a4 as HideActivityItemInput, aP as UnhideActivityItemInput, aL as StatsResponse, h as AppRegistryEntry, a1 as HiddenApp, b as AccountSummary, p as FeaturedProfile, aK as SimilarProfile, L as FetchSuggestionsOptions, aO as SuggestionsResponse, Q as FollowUserResult, v as FetchFollowListOptions, N as FollowListPage, U as FollowingResponse, x as FetchFollowingFeedOptions, T as FollowingFeedResponse, w as FetchFollowProfilePageOptions, P as FollowProfilePageResponse, F as FeatureAllowlistResponse, g as AdminReviewQueues, r as FetchActivityFeedOptions, c as ActivityFeedResponse, f as ActivityTeaserResponse, $ as HeatmapResponse, a8 as MyGithubPullRequestsResponse, A as AccountCheckResult, az as ReactionStatus, ay as ReactionResult, ax as ReactionError, aI as RoadmapVotesResponse, i as CastRoadmapVoteResult, D as DeleteAccountResult, aD as ResetProfileResult, aX as WipePreview, aC as RepoDeleteInput, aa as OrgClaimResult, ag as OrgProfileUpdateResult, ab as OrgDomainChallengeResult, ac as OrgDomainVerifyResult, ad as OrgNotificationEmailAddResult, ae as OrgNotificationEmailRemoveResult } from './org-BSHNseXX.js';
8
8
  import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, n as EntitySelectResponse, l as EntitySelectRequest, r as FeatureFlag } from './follow-profile-D1l6pulB.js';
9
9
  import { O as OrgClaimRequestInput, a as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, c as OrgDomainVerifyRequestInput, d as OrgNotificationEmailRequestInput } from './org-settings-C73Sin5E.js';
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singi-labs/sifa-sdk",
3
- "version": "0.19.33",
3
+ "version": "0.19.35",
4
4
  "description": "Sifa SDK — public client library for the Sifa AppView on AT Protocol. Shared by sifa-web and sifa-app.",
5
5
  "license": "MIT",
6
6
  "type": "module",