@blueskyproject/tiled 0.0.30 → 0.0.32

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 (58) hide show
  1. package/dist/app/App.d.ts.map +1 -1
  2. package/dist/components/Tiled/PreviewNDArray.d.ts.map +1 -1
  3. package/dist/components/Tiled/PreviewStructuredArray.d.ts.map +1 -1
  4. package/dist/components/Tiled/PreviewTable.d.ts.map +1 -1
  5. package/dist/components/Tiled/PreviewXArray.d.ts.map +1 -1
  6. package/dist/components/Tiled/api/TiledApiClient.d.ts +228 -0
  7. package/dist/components/Tiled/api/TiledApiClient.d.ts.map +1 -0
  8. package/dist/components/Tiled/api/TiledArrayApi.d.ts +192 -0
  9. package/dist/components/Tiled/api/TiledArrayApi.d.ts.map +1 -0
  10. package/dist/components/Tiled/api/TiledClientTest.d.ts +2 -0
  11. package/dist/components/Tiled/api/TiledClientTest.d.ts.map +1 -0
  12. package/dist/components/Tiled/api/TiledConfigApi.d.ts +60 -0
  13. package/dist/components/Tiled/api/TiledConfigApi.d.ts.map +1 -0
  14. package/dist/components/Tiled/api/TiledFinchApi.d.ts +8 -0
  15. package/dist/components/Tiled/api/TiledFinchApi.d.ts.map +1 -0
  16. package/dist/components/Tiled/api/TiledInfoApi.d.ts +6 -0
  17. package/dist/components/Tiled/api/TiledInfoApi.d.ts.map +1 -0
  18. package/dist/components/Tiled/api/TiledMetadataApi.d.ts +6 -0
  19. package/dist/components/Tiled/api/TiledMetadataApi.d.ts.map +1 -0
  20. package/dist/components/Tiled/api/TiledSearchApi.d.ts +171 -0
  21. package/dist/components/Tiled/api/TiledSearchApi.d.ts.map +1 -0
  22. package/dist/components/Tiled/api/TiledTableApi.d.ts +89 -0
  23. package/dist/components/Tiled/api/TiledTableApi.d.ts.map +1 -0
  24. package/dist/components/Tiled/api/defaultTiledApiClient.d.ts +315 -0
  25. package/dist/components/Tiled/api/defaultTiledApiClient.d.ts.map +1 -0
  26. package/dist/components/Tiled/{apiClient.d.ts → archived_apiClient.d.ts} +9 -10
  27. package/dist/components/Tiled/archived_apiClient.d.ts.map +1 -0
  28. package/dist/components/Tiled/useTiled.d.ts.map +1 -1
  29. package/dist/components/Tiled/utils.d.ts +7 -0
  30. package/dist/components/Tiled/utils.d.ts.map +1 -1
  31. package/dist/index.d.ts +15 -3
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/mockServiceWorker.js +1 -1
  34. package/dist/tiled.css +1 -1
  35. package/dist/tiled.es.js +18774 -18532
  36. package/dist/tiled.umd.js +52 -49
  37. package/package.json +1 -2
  38. package/dist/components/Tiled/apiClient.d.ts.map +0 -1
  39. package/dist/stories/Tiled.stories.d.ts +0 -20
  40. package/dist/stories/Tiled.stories.d.ts.map +0 -1
  41. package/dist/testing/tests/PreviewComponents.test.d.ts +0 -2
  42. package/dist/testing/tests/PreviewComponents.test.d.ts.map +0 -1
  43. package/dist/testing/tests/Tiled.test.d.ts +0 -2
  44. package/dist/testing/tests/Tiled.test.d.ts.map +0 -1
  45. package/dist/testing/tests/TiledButtonMode.test.d.ts +0 -2
  46. package/dist/testing/tests/TiledButtonMode.test.d.ts.map +0 -1
  47. package/dist/testing/tests/TiledColumn.test.d.ts +0 -2
  48. package/dist/testing/tests/TiledColumn.test.d.ts.map +0 -1
  49. package/dist/testing/tests/TiledErrorHandling.test.d.ts +0 -2
  50. package/dist/testing/tests/TiledErrorHandling.test.d.ts.map +0 -1
  51. package/dist/testing/tests/TiledRowMode.test.d.ts +0 -2
  52. package/dist/testing/tests/TiledRowMode.test.d.ts.map +0 -1
  53. package/dist/testing/tests/TiledSearchBar.test.d.ts +0 -2
  54. package/dist/testing/tests/TiledSearchBar.test.d.ts.map +0 -1
  55. package/dist/testing/tests/TiledSearchSetup.test.d.ts +0 -2
  56. package/dist/testing/tests/TiledSearchSetup.test.d.ts.map +0 -1
  57. package/dist/testing/tests/TiledSelectCallback.test.d.ts +0 -2
  58. package/dist/testing/tests/TiledSelectCallback.test.d.ts.map +0 -1
@@ -0,0 +1,171 @@
1
+ import { TiledRequestOptions } from './TiledConfigApi';
2
+ import { TiledSearchResult } from '../types';
3
+ export interface TiledSearchApi {
4
+ getSearch(searchPath: string, config?: TiledSearchConfig, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
5
+ }
6
+ /**
7
+ * Serializes a `TiledSearchConfig` into a flat params object using the
8
+ * bracket-notation keys expected by the Tiled REST API.
9
+ *
10
+ * @param config - Search configuration including filters and pagination options.
11
+ * @returns A flat record suitable for use as Axios `params`.
12
+ *
13
+ * @example
14
+ * buildSearchParams({
15
+ * searchFilters: { fulltext: { text: 'myrun' } },
16
+ * searchOptions: { sort: '-', pageLimit: 10 },
17
+ * });
18
+ * // → { 'filter[fulltext][condition][text]': 'myrun', sort: '-', 'page[limit]': '10' }
19
+ */
20
+ export declare function buildSearchParams(config?: TiledSearchConfig): Record<string, string | string[]>;
21
+ /**
22
+ * Configuration object for comprehensive Tiled search functionality
23
+ */
24
+ export interface TiledSearchConfig {
25
+ searchFilters?: TiledSearchFilters;
26
+ searchOptions?: TiledSearchOptions;
27
+ }
28
+ /**
29
+ * Options for search requests (pagination, sorting, field selection, etc.)
30
+ */
31
+ export interface TiledSearchOptions {
32
+ /** Fields to include in response */
33
+ fields?: string[];
34
+ /** Metadata selection pattern */
35
+ selectMetadata?: string;
36
+ /** Page offset for pagination */
37
+ pageOffset?: number;
38
+ /** Page limit for pagination */
39
+ pageLimit?: number;
40
+ /** Sort field */
41
+ sort?: string;
42
+ /** Whether to omit links in response */
43
+ omitLinks?: boolean;
44
+ /** Whether to include data sources */
45
+ includeDataSources?: boolean;
46
+ }
47
+ /**
48
+ * All available search filters for Tiled API
49
+ */
50
+ export interface TiledSearchFilters {
51
+ /** Full-text search filter */
52
+ fulltext?: TiledFulltextFilter;
53
+ /** Lookup filter for metadata keys */
54
+ lookup?: TiledLookupFilter;
55
+ /** Keys filter */
56
+ keysFilter?: TiledKeysFilter;
57
+ /** Regular expression filter */
58
+ regex?: TiledRegexFilter;
59
+ /** Equality filter */
60
+ eq?: TiledEqualityFilter;
61
+ /** Not equal filter */
62
+ noteq?: TiledEqualityFilter;
63
+ /** Comparison filter */
64
+ comparison?: TiledComparisonFilter;
65
+ /** Contains filter */
66
+ contains?: TiledContainsFilter;
67
+ /** In filter */
68
+ in?: TiledInFilter;
69
+ /** Not in filter */
70
+ notin?: TiledInFilter;
71
+ /** Key present filter */
72
+ keyPresent?: TiledKeyPresentFilter;
73
+ /** Like filter */
74
+ like?: TiledLikeFilter;
75
+ /** Specs filter */
76
+ specs?: TiledSpecsFilter;
77
+ /** Access blob filter */
78
+ accessBlob?: TiledAccessBlobFilter;
79
+ /** Structure family filter */
80
+ structureFamily?: TiledStructureFamilyFilter;
81
+ }
82
+ /**
83
+ * Full-text search filter
84
+ */
85
+ export interface TiledFulltextFilter {
86
+ text: string;
87
+ }
88
+ /**
89
+ * Lookup filter for metadata keys
90
+ */
91
+ export interface TiledLookupFilter {
92
+ key: string;
93
+ }
94
+ /**
95
+ * Keys filter
96
+ */
97
+ export interface TiledKeysFilter {
98
+ keys: string[];
99
+ }
100
+ /**
101
+ * Regular expression filter
102
+ */
103
+ export interface TiledRegexFilter {
104
+ key: string;
105
+ pattern: string;
106
+ caseSensitive?: boolean;
107
+ }
108
+ /**
109
+ * Equality filter (eq/noteq)
110
+ */
111
+ export interface TiledEqualityFilter {
112
+ key: string;
113
+ value: string;
114
+ }
115
+ /**
116
+ * Comparison filter (gt, gte, lt, lte)
117
+ */
118
+ export interface TiledComparisonFilter {
119
+ operator: 'gt' | 'gte' | 'lt' | 'lte';
120
+ key: string;
121
+ value: string;
122
+ }
123
+ /**
124
+ * Contains filter
125
+ */
126
+ export interface TiledContainsFilter {
127
+ key: string;
128
+ value: string;
129
+ }
130
+ /**
131
+ * In/not in filter
132
+ */
133
+ export interface TiledInFilter {
134
+ key: string;
135
+ value: string[];
136
+ }
137
+ /**
138
+ * Key present filter
139
+ */
140
+ export interface TiledKeyPresentFilter {
141
+ key: string;
142
+ exists: boolean;
143
+ }
144
+ /**
145
+ * Like filter
146
+ */
147
+ export interface TiledLikeFilter {
148
+ key: string;
149
+ pattern: string;
150
+ }
151
+ /**
152
+ * Specs filter with include/exclude arrays
153
+ */
154
+ export interface TiledSpecsFilter {
155
+ include: string[];
156
+ exclude: string[];
157
+ }
158
+ /**
159
+ * Access blob filter
160
+ */
161
+ export interface TiledAccessBlobFilter {
162
+ userId?: string;
163
+ tags?: string[];
164
+ }
165
+ /**
166
+ * Structure family filter
167
+ */
168
+ export interface TiledStructureFamilyFilter {
169
+ value: 'container' | 'array' | 'table' | 'awkward' | 'sparse';
170
+ }
171
+ //# sourceMappingURL=TiledSearchApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TiledSearchApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledSearchApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,iBAAiB,EAC1B,cAAc,CAAC,EAAE,mBAAmB,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,GAAE,iBAAsB,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CA4FnC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iCAAiC;IACjC,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IACvC,KAAK,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;CACjE"}
@@ -0,0 +1,89 @@
1
+ import { TiledRequestOptions } from './TiledConfigApi';
2
+ import { TiledSearchItem, TiledTableRow, TableStructure } from '../types';
3
+ /**
4
+ * Tiled's application/json table format is usually column-oriented.
5
+ *
6
+ * Example:
7
+ * {
8
+ * A: [0.5699, 0.1234],
9
+ * B: [1.1398, 0.2468],
10
+ * C: [1.7098, 0.3702]
11
+ * }
12
+ */
13
+ export type TiledTableJSONResponse = Record<string, unknown[]>;
14
+ /**
15
+ * A Tiled search item whose structure is specifically a TableStructure.
16
+ */
17
+ export type TiledTableItem = TiledSearchItem<TableStructure>;
18
+ export type TiledTableReturnType = 'JSON' | 'JSON_SEQ';
19
+ export type TiledTableEndpoint = 'partition' | 'full';
20
+ export type TiledTableReturnMap = {
21
+ /**
22
+ * Column-oriented JSON response.
23
+ */
24
+ JSON: TiledTableJSONResponse;
25
+ /**
26
+ * Row-oriented JSON sequence response.
27
+ */
28
+ JSON_SEQ: TiledTableRow[];
29
+ };
30
+ export interface TiledTableRequestOptions extends TiledRequestOptions {
31
+ /**
32
+ * The table partition to retrieve.
33
+ *
34
+ * Tiled partitions are 0-based.
35
+ */
36
+ partition?: number;
37
+ /**
38
+ * Table structure information from Tiled.
39
+ *
40
+ * Passing this can avoid a secondary structure request later.
41
+ */
42
+ structure?: TableStructure;
43
+ /**
44
+ * Full Tiled item for a table.
45
+ */
46
+ tableItem?: TiledTableItem;
47
+ }
48
+ export type GetTableAsOptionsMap = {
49
+ JSON: TiledTableRequestOptions & {
50
+ format?: 'application/json';
51
+ };
52
+ JSON_SEQ: TiledTableRequestOptions & {
53
+ format?: 'application/json-seq';
54
+ };
55
+ };
56
+ export interface TiledTableApi {
57
+ getTableAs<T extends TiledTableReturnType>(tablePath: string, type: T, endpoint: TiledTableEndpoint, options?: GetTableAsOptionsMap[T]): Promise<TiledTableReturnMap[T]>;
58
+ getTablePartitionAsJSON(tablePath: string, options?: GetTableAsOptionsMap['JSON']): Promise<TiledTableJSONResponse>;
59
+ getTablePartitionAsJSONSequence(tablePath: string, options?: GetTableAsOptionsMap['JSON_SEQ']): Promise<TiledTableRow[]>;
60
+ getTableFullAsJSON(tablePath: string, options?: GetTableAsOptionsMap['JSON']): Promise<TiledTableJSONResponse>;
61
+ getTableFullAsJSONSequence(tablePath: string, options?: GetTableAsOptionsMap['JSON_SEQ']): Promise<TiledTableRow[]>;
62
+ }
63
+ /**
64
+ * Returns the `TableStructure` from either `options.structure` or
65
+ * `options.tableItem.attributes.structure`, whichever is present.
66
+ *
67
+ * @param options - Table request options that may contain structure info.
68
+ * @returns The resolved `TableStructure`, or `undefined` if neither is present.
69
+ */
70
+ export declare function resolveTableStructure(options?: TiledTableRequestOptions): TableStructure | undefined;
71
+ /**
72
+ * Returns `true` when the caller has already provided enough table structure
73
+ * information (via `options.structure` or `options.tableItem`) to skip a
74
+ * secondary metadata request.
75
+ *
76
+ * @param options - Table request options.
77
+ * @returns `true` if structure info is available, `false` otherwise.
78
+ */
79
+ export declare function hasTableStructure(options?: TiledTableRequestOptions): boolean;
80
+ /**
81
+ * Parses Tiled's application/json-seq response.
82
+ *
83
+ * Depending on the server/client behavior, Axios may give you:
84
+ * - a string containing newline-separated JSON objects
85
+ * - a single object for one-row results
86
+ * - an array, if something upstream already parsed it
87
+ */
88
+ export declare function parseJsonSequenceTableResponse(data: unknown): TiledTableRow[];
89
+ //# sourceMappingURL=TiledTableApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TiledTableApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/TiledTableApi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,M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AAC;IAEnC,+BAA+B,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,GACzC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAE5B,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,GACrC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEnC,0BAA0B,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,GACzC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,wBAA6B,GACrC,cAAc,GAAG,SAAS,CAE5B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,OAAO,GACZ,aAAa,EAAE,CAuBjB"}
@@ -0,0 +1,315 @@
1
+ import { TiledApiClient } from './TiledApiClient';
2
+ import { TiledTableRow, TiledSearchItem, TiledStructures, TiledSearchResult, TiledInfoResponse, TiledAuthProvider } from '../types';
3
+ import { TiledArrayReturnType, TiledArrayReturnMap, GetArrayAsOptionsMap } from './TiledArrayApi';
4
+ import { GetTableAsOptionsMap, TiledTableJSONResponse, TiledTableReturnMap, TiledTableReturnType, TiledTableEndpoint } from './TiledTableApi';
5
+ import { TiledRequestOptions } from './TiledConfigApi';
6
+ import { TiledSearchConfig, TiledSearchOptions } from './TiledSearchApi';
7
+ export type { TiledAuthProvider };
8
+ /** Callback invoked when a token-refresh attempt fails (e.g. to show a login prompt). */
9
+ export type AuthErrorCallback = (error: unknown) => void;
10
+ /**
11
+ * Returns the active module-level `TiledApiClient` singleton used by all
12
+ * `getTiled*` / `setDefault*` functions in this module.
13
+ *
14
+ * @returns The current `TiledApiClient` instance.
15
+ */
16
+ export declare function getDefaultTiledApiClient(): TiledApiClient;
17
+ /**
18
+ * Replaces the active singleton with a custom `TiledApiClient` instance.
19
+ *
20
+ * Useful when you need fine-grained control over the Axios client (e.g.
21
+ * injecting a mock in tests or pre-configuring auth).
22
+ *
23
+ * @param client - The `TiledApiClient` instance to use from this point on.
24
+ */
25
+ export declare function setDefaultTiledApiClient(client: TiledApiClient): void;
26
+ /**
27
+ * Resets the singleton to a fresh `TiledApiClient` with the default base URL
28
+ * derived from `window.location` (port 8000, `/api/v1`).
29
+ *
30
+ * Call this in test `beforeEach` / `afterEach` to prevent state leaking between
31
+ * test cases.
32
+ *
33
+ * @example
34
+ * beforeEach(() => { resetDefaultTiledApiClient(); });
35
+ */
36
+ export declare function resetDefaultTiledApiClient(): void;
37
+ /**
38
+ * Sets the Tiled server base URL on the singleton.
39
+ *
40
+ * Must include the API version path, e.g. `"https://myserver.example.com/api/v1"`.
41
+ *
42
+ * @param baseUrl - Full base URL of the Tiled server.
43
+ */
44
+ export declare function setDefaultTiledUrl(baseUrl: string): void;
45
+ /**
46
+ * Sets the global `initialPath` prefix on the singleton.
47
+ *
48
+ * All subsequent relative-path requests are automatically prefixed with this
49
+ * value. Pass `pathMode: 'absolute'` in request options to bypass it for a
50
+ * single call.
51
+ *
52
+ * @param initialPath - Path prefix, e.g. `"data/project"`.
53
+ */
54
+ export declare function setDefaultInitialPath(initialPath: string): void;
55
+ /**
56
+ * Reads the current `initialPath` prefix from the singleton.
57
+ *
58
+ * @returns The current initial path string (may be empty).
59
+ */
60
+ export declare function getDefaultTiledInitialPath(): string;
61
+ /**
62
+ * Sets the API key on the singleton.
63
+ *
64
+ * The request interceptor automatically attaches it as
65
+ * `Authorization: ApiKey <key>` to every request that does not already have an
66
+ * `Authorization` header.
67
+ *
68
+ * @param apiKey - The API key string, or `null` to clear it.
69
+ */
70
+ export declare function setGlobalApiKey(apiKey: string | null): void;
71
+ /**
72
+ * Sets a global maximum payload size for array requests on the singleton.
73
+ *
74
+ * When set, the client auto-computes a downsample step ratio so that the
75
+ * returned array data stays under this byte limit.
76
+ *
77
+ * @param maxBytes - Maximum bytes for array payloads, or `undefined` to disable
78
+ * the global limit (per-request `maxBytesAllowed` still applies).
79
+ */
80
+ export declare function setGlobalMaxArrayBytes(maxBytes: number | undefined): void;
81
+ /**
82
+ * Fetches a Tiled array in the specified format.
83
+ *
84
+ * This is the generic dispatcher; prefer the typed convenience helpers
85
+ * (`getTiledArrayAsJSON`, `getTiledArrayAsPng`, etc.) for cleaner call sites.
86
+ *
87
+ * @param arrayPath - Tiled path to the array.
88
+ * @param type - Return format: `'JSON'`, `'PNG'`, `'BUFFER'`, or `'IMAGE_PATH'`. Defaults to `'BUFFER'`.
89
+ * @param options - Format-specific array request options.
90
+ * @returns A promise resolving to the array data in the requested format.
91
+ *
92
+ * @example
93
+ * const buf = await getTiledArrayAs('scans/run1/detector');
94
+ * const img = await getTiledArrayAs('scans/run1/detector', 'PNG', { stack: [0] });
95
+ */
96
+ export declare function getTiledArrayAs<T extends TiledArrayReturnType = 'BUFFER'>(arrayPath: string, type?: T, options?: GetArrayAsOptionsMap[T]): Promise<TiledArrayReturnMap[T]>;
97
+ /**
98
+ * Fetches a Tiled array as JSON data.
99
+ *
100
+ * @param arrayPath - Tiled path to the array.
101
+ * @param options - Array request options (stack, downsampling, format, etc.).
102
+ * @returns A promise resolving to the array data. Defaults to `number[][]`.
103
+ *
104
+ * @example
105
+ * const frame = await getTiledArrayAsJSON<number[][]>('scans/run1/detector', { stack: [0] });
106
+ */
107
+ export declare function getTiledArrayAsJSON<T = number[][]>(arrayPath: string, options?: GetArrayAsOptionsMap['JSON']): Promise<T>;
108
+ /**
109
+ * Fetches a Tiled array as a PNG `Blob`.
110
+ *
111
+ * @param arrayPath - Tiled path to the array.
112
+ * @param options - Array request options (stack, downsampling, format, etc.).
113
+ * @returns A promise resolving to a PNG `Blob`.
114
+ */
115
+ export declare function getTiledArrayAsPng(arrayPath: string, options?: GetArrayAsOptionsMap['PNG']): Promise<Blob>;
116
+ /**
117
+ * Builds and returns the full URL for a Tiled array image without making a
118
+ * network request. Use the returned string as an `<img src>` attribute.
119
+ *
120
+ * This function is synchronous — it uses any structure already present in
121
+ * `options`; it does not fetch metadata from the server.
122
+ *
123
+ * @param arrayPath - Tiled path to the array.
124
+ * @param options - Array request options (stack, format, downsampling, etc.).
125
+ * @returns A URL string pointing to the array image endpoint.
126
+ *
127
+ * @example
128
+ * const src = getTiledArrayAsImagePath('scans/run1/detector', { stack: [0] });
129
+ * return <img src={src} />;
130
+ */
131
+ export declare function getTiledArrayAsImagePath(arrayPath: string, options?: GetArrayAsOptionsMap['IMAGE_PATH']): string;
132
+ /**
133
+ * Fetches a Tiled array as a raw `ArrayBuffer`.
134
+ *
135
+ * @param arrayPath - Tiled path to the array.
136
+ * @param options - Array request options (stack, downsampling, format, etc.).
137
+ * @returns A promise resolving to an `ArrayBuffer` of the raw bytes.
138
+ */
139
+ export declare function getTiledArrayAsBuffer(arrayPath: string, options?: GetArrayAsOptionsMap['BUFFER']): Promise<ArrayBuffer>;
140
+ /**
141
+ * Fetches a Tiled table in the specified format and endpoint variant.
142
+ *
143
+ * This is the generic dispatcher; prefer the typed convenience helpers
144
+ * (`getTiledTablePartitionAsJSON`, etc.) for cleaner call sites.
145
+ *
146
+ * @param tablePath - Tiled path to the table.
147
+ * @param type - Return format: `'JSON'` (column-oriented) or `'JSON_SEQ'` (row-oriented).
148
+ * @param endpoint - `'partition'` (single partition) or `'full'` (entire table).
149
+ * @param options - Table request options (partition index, format, etc.).
150
+ * @returns A promise resolving to the table data in the requested format.
151
+ */
152
+ export declare function getTiledTableAs<T extends TiledTableReturnType>(tablePath: string, type?: T, endpoint?: TiledTableEndpoint, options?: GetTableAsOptionsMap[T]): Promise<TiledTableReturnMap[T]>;
153
+ /**
154
+ * Fetches a single partition of a Tiled table as column-oriented JSON.
155
+ *
156
+ * The response is a `Record<string, unknown[]>` where each key is a column name
157
+ * and each value is an array of column values.
158
+ *
159
+ * @param tablePath - Tiled path to the table.
160
+ * @param options - Table request options (partition index defaults to `0`).
161
+ * @returns A promise resolving to the column-oriented JSON response.
162
+ */
163
+ export declare function getTiledTablePartitionAsJSON(tablePath: string, options?: GetTableAsOptionsMap['JSON']): Promise<TiledTableJSONResponse>;
164
+ /**
165
+ * Fetches a single partition of a Tiled table as a row-oriented JSON sequence.
166
+ *
167
+ * Each element in the returned array is one row represented as a plain object.
168
+ *
169
+ * @param tablePath - Tiled path to the table.
170
+ * @param options - Table request options (partition index defaults to `0`).
171
+ * @returns A promise resolving to an array of row objects.
172
+ */
173
+ export declare function getTiledTablePartitionAsJSONSequence(tablePath: string, options?: GetTableAsOptionsMap['JSON_SEQ']): Promise<TiledTableRow[]>;
174
+ /**
175
+ * Fetches the full (all partitions) Tiled table as column-oriented JSON.
176
+ *
177
+ * @param tablePath - Tiled path to the table.
178
+ * @param options - Table request options.
179
+ * @returns A promise resolving to the column-oriented JSON response.
180
+ */
181
+ export declare function getTiledTableFullAsJSON(tablePath: string, options?: GetTableAsOptionsMap['JSON']): Promise<TiledTableJSONResponse>;
182
+ /**
183
+ * Fetches the full (all partitions) Tiled table as a row-oriented JSON sequence.
184
+ *
185
+ * @param tablePath - Tiled path to the table.
186
+ * @param options - Table request options.
187
+ * @returns A promise resolving to an array of row objects.
188
+ */
189
+ export declare function getTiledTableFullAsJSONSequence(tablePath: string, options?: GetTableAsOptionsMap['JSON_SEQ']): Promise<TiledTableRow[]>;
190
+ /**
191
+ * Fetches Tiled server information (authentication providers, version, etc.).
192
+ *
193
+ * Returns `null` if the server is unreachable or the response is malformed.
194
+ *
195
+ * @param options - Request options (e.g. `baseUrl` override).
196
+ * @returns A promise resolving to `TiledInfoResponse` or `null`.
197
+ */
198
+ export declare function getTiledServerInfo(options?: TiledRequestOptions): Promise<TiledInfoResponse | null>;
199
+ /**
200
+ * Fetches Tiled item metadata for the given path.
201
+ *
202
+ * Returns the `TiledSearchItem` directly (not a `{ data, error }` wrapper).
203
+ * Access the item path via `item.id` and its structure via
204
+ * `item.attributes.structure`.
205
+ *
206
+ * @param path - Tiled path to the item.
207
+ * @param options - Request options (e.g. `baseUrl` override).
208
+ * @returns A promise resolving to the typed `TiledSearchItem`.
209
+ *
210
+ * @example
211
+ * const item = await getTiledMetadata<ArrayStructure>('scans/run1/detector');
212
+ * console.log(item.attributes.structure.shape);
213
+ */
214
+ export declare function getTiledMetadata<S extends TiledStructures = TiledStructures>(path: string, options?: TiledRequestOptions): Promise<TiledSearchItem<S>>;
215
+ /**
216
+ * Performs a Tiled search at the given path with optional filters and options.
217
+ *
218
+ * @param searchPath - Container path to search within (empty string for root).
219
+ * @param config - Search configuration including `searchFilters` and `searchOptions`.
220
+ * @param requestOptions - Per-request HTTP options (baseUrl, initialPath, etc.).
221
+ * @returns A promise resolving to a `TiledSearchResult` with paginated items.
222
+ *
223
+ * @example
224
+ * const results = await getTiledSearch('experiments', {
225
+ * searchFilters: { specs: { include: ['BlueskyRun'], exclude: [] } },
226
+ * searchOptions: { sort: '-', pageLimit: 25 },
227
+ * });
228
+ */
229
+ export declare function getTiledSearch(searchPath: string, config?: TiledSearchConfig, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
230
+ /**
231
+ * Searches a Tiled container, filtering by item specs (tags).
232
+ *
233
+ * @param searchPath - Container path to search within.
234
+ * @param include - Spec strings that items must match (e.g. `['BlueskyRun']`).
235
+ * @param exclude - Spec strings that items must not have. Defaults to `[]`.
236
+ * @param searchOptions - Pagination and sorting options.
237
+ * @param requestOptions - Per-request HTTP options.
238
+ * @returns A promise resolving to a `TiledSearchResult`.
239
+ */
240
+ export declare function getTiledSearchBySpecs(searchPath: string, include: string[], exclude?: string[], searchOptions?: TiledSearchOptions, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
241
+ /**
242
+ * Searches a Tiled container using full-text search across item metadata.
243
+ *
244
+ * @param searchPath - Container path to search within.
245
+ * @param text - Text to search for.
246
+ * @param searchOptions - Pagination and sorting options.
247
+ * @param requestOptions - Per-request HTTP options.
248
+ * @returns A promise resolving to a `TiledSearchResult`.
249
+ */
250
+ export declare function getTiledSearchByFullText(searchPath: string, text: string, searchOptions?: TiledSearchOptions, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
251
+ /**
252
+ * Searches a Tiled container for items where a metadata key equals a value.
253
+ *
254
+ * @param searchPath - Container path to search within.
255
+ * @param key - Metadata key to match against.
256
+ * @param value - Expected value for the metadata key.
257
+ * @param searchOptions - Pagination and sorting options.
258
+ * @param requestOptions - Per-request HTTP options.
259
+ * @returns A promise resolving to a `TiledSearchResult`.
260
+ */
261
+ export declare function getTiledSearchByMetadataEquals(searchPath: string, key: string, value: string, searchOptions?: TiledSearchOptions, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
262
+ /**
263
+ * Searches a Tiled container, filtering by structure family.
264
+ *
265
+ * @param searchPath - Container path to search within.
266
+ * @param family - Structure family to filter by: `'container'`, `'array'`,
267
+ * `'table'`, `'awkward'`, or `'sparse'`.
268
+ * @param searchOptions - Pagination and sorting options.
269
+ * @param requestOptions - Per-request HTTP options.
270
+ * @returns A promise resolving to a `TiledSearchResult`.
271
+ */
272
+ export declare function getTiledSearchByStructureFamily(searchPath: string, family: 'container' | 'array' | 'table' | 'awkward' | 'sparse', searchOptions?: TiledSearchOptions, requestOptions?: TiledRequestOptions): Promise<TiledSearchResult>;
273
+ /**
274
+ * Sets or clears the bearer token on the singleton.
275
+ *
276
+ * Once set, every request includes `Authorization: Bearer <token>`. The token
277
+ * is also automatically refreshed on 401 responses using the refresh token
278
+ * stored in localStorage.
279
+ *
280
+ * @param token - Bearer token string, or `null` to clear it.
281
+ */
282
+ export declare function setDefaultBearerToken(token: string | null): void;
283
+ /**
284
+ * Registers a callback that is invoked when a token-refresh attempt fails.
285
+ *
286
+ * Use this to show a login prompt or redirect the user. Called with the error
287
+ * that caused the refresh to fail (or `null` if no stored tokens were found).
288
+ *
289
+ * @param callback - Function to call on auth failure, or `undefined` to clear it.
290
+ */
291
+ export declare function setDefaultAuthErrorCallback(callback: AuthErrorCallback | undefined): void;
292
+ /**
293
+ * Authenticates with the Tiled server using a username and password.
294
+ *
295
+ * Fetches the server's auth endpoint (via `getServerInfo`), POSTs credentials
296
+ * as `multipart/form-data`, saves the returned tokens to localStorage, and
297
+ * sets the bearer token on the singleton.
298
+ *
299
+ * @param username - The user's login name.
300
+ * @param password - The user's password.
301
+ * @param url - Optional server URL override (defaults to the singleton's base URL).
302
+ * @param provider - Optional pre-fetched auth provider. If omitted, the first
303
+ * password/internal provider from server info is used.
304
+ * @returns A promise resolving to `{ access_token, refresh_token }` on success,
305
+ * or `null` on failure.
306
+ *
307
+ * @example
308
+ * const tokens = await loginWithDefaultTiledClient('alice', 'secret');
309
+ * if (!tokens) console.error('Login failed');
310
+ */
311
+ export declare function loginWithDefaultTiledClient(username: string, password: string, url?: string, provider?: TiledAuthProvider): Promise<{
312
+ access_token: string;
313
+ refresh_token: string;
314
+ } | null>;
315
+ //# sourceMappingURL=defaultTiledApiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultTiledApiClient.d.ts","sourceRoot":"","sources":["../../../../src/components/Tiled/api/defaultTiledApiClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,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AAE,MAAM,EAClB,MAAM,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,EAC9D,aAAa,GAAE,kBAAuB,EACtC,cAAc,GAAE,mBAAwB,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAID;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAEzF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAEjE"}
@@ -1,5 +1,11 @@
1
1
  import { TiledInfoResponse, TiledSearchResult, TiledAuthProvider, TiledTableRow, TiledStructuredArrayData, TiledTableJSONResponse, TiledBlueskyPlanMetadataResponse, TiledSearchMetadataResult } from './types';
2
2
  import { TiledSearchConfig, TiledSearchOptions } from './apiTypes';
3
+ /**
4
+ * Sets the global Tiled server URL that will be used for all subsequent API requests
5
+ * @param url - The Tiled server URL to set, or null to clear it
6
+ * @returns The Tiled server URL that was set
7
+ */
8
+ export declare const setGlobalUrl: (url: string | null) => string | null;
3
9
  /**
4
10
  * Sets the global initial path that will be prepended to all search paths
5
11
  * Automatically removes leading slash to ensure proper path formatting
@@ -63,15 +69,8 @@ type AuthErrorCallback = (error: any) => void;
63
69
  */
64
70
  export declare const setAuthErrorCallback: (callback: AuthErrorCallback) => void;
65
71
  /**
66
- * Determines the default Tiled server URL based on environment variables or current location
67
- * First checks for VITE_API_TILED_URL environment variable, otherwise constructs URL from current hostname
68
- * @returns The default Tiled server URL string
69
- * @example
70
- * ```typescript
71
- * const url = getDefaultTiledUrl();
72
- * // If VITE_API_TILED_URL is set: returns that value
73
- * // Otherwise: returns "http://localhost:8000/api/v1" (or current hostname)
74
- * ```
72
+ * Returns the active Tiled server URL: globalUrl if set, otherwise constructs one from current hostname
73
+ * @returns The Tiled server URL string
75
74
  */
76
75
  export declare const getDefaultTiledUrl: () => string;
77
76
  /**
@@ -375,4 +374,4 @@ export declare const searchByStructureFamily: (baseUrl: string, structureFamily:
375
374
  */
376
375
  export declare const searchById: (config: TiledSearchConfig, cb?: (res: TiledSearchResult) => void) => Promise<TiledSearchResult | null>;
377
376
  export {};
378
- //# sourceMappingURL=apiClient.d.ts.map
377
+ //# sourceMappingURL=archived_apiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archived_apiClient.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/archived_apiClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAC1O,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAcnE;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,GAAG,IAAI,kBAG9C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,SAAS,MAAM,GAAG,IAAI,kBAOhD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,YAAY,OAAO,GAAG,SAAS,SAEzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,qBAE1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,WAAW,MAAM,GAAG,IAAI,kBAGnD,CAAC;AAwCF,KAAK,iBAA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G,QAAQ,SACjE,MAAM,YACH,kBAAkB,WAClB,MAAM,gBACD,MAAM,KACrB,OAAO,CAAC,iBAAiB,CAa3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,UAAU,WAAkB,iBAAiB,OAAM,CAAC,GAAG,EAAC,iBAAiB,KAAG,IAAI,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAkC/H,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTiled.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/useTiled.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,iBAAiB,EACjB,eAAe,EAEf,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EAMX,eAAe,EACjB,MAAM,SAAS,CAAC;AAGlB,MAAM,MAAM,aAAa,GAAG;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAA;AACD,KAAK,GAAG,GAAG,MAAM,CAAC;AA8BlB,eAAO,MAAM,QAAQ,iHAA+G,aAAa;;;;;;;;kCA8G7F,eAAe,CAAC,eAAe,CAAC;+BAOlC,eAAe,CAAC,eAAe,CAAC,SAAS,MAAM;gCArG7D,IAAI;iCACH,IAAI;;;+BA6TJ,GAAG,eAAc,MAAM,kBAAiB,MAAM;yBAlGlC,MAAM;qCA2BM,MAAM;6BAgBd,MAAM;CAuI1D,CAAA"}
1
+ {"version":3,"file":"useTiled.d.ts","sourceRoot":"","sources":["../../../src/components/Tiled/useTiled.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EAMX,eAAe,EACjB,MAAM,SAAS,CAAC;AAGlB,MAAM,MAAM,aAAa,GAAG;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAA;AACD,KAAK,GAAG,GAAG,MAAM,CAAC;AA8BlB,eAAO,MAAM,QAAQ,iHAA+G,aAAa;;;;;;;;kCA8G7F,eAAe,CAAC,eAAe,CAAC;+BAOlC,eAAe,CAAC,eAAe,CAAC,SAAS,MAAM;gCArG7D,IAAI;iCACH,IAAI;;;+BA8TJ,GAAG,eAAc,MAAM,kBAAiB,MAAM;yBAjGlC,MAAM;qCA2BM,MAAM;6BAgBd,MAAM;CAsI1D,CAAA"}
@@ -180,4 +180,11 @@ export declare const generateStepsForImagePath: (arrayItem: TiledSearchItem<Arra
180
180
  * ```
181
181
  */
182
182
  export declare const isItemBlueskyRun: (item: TiledSearchItem<TiledStructures>) => boolean;
183
+ /**
184
+ * Normalizes and validates a URL
185
+ * @param url - Raw URL that might be malformed
186
+ * @param label - Human-readable name for error messages
187
+ * @returns Cleaned URL or undefined if invalid
188
+ */
189
+ export declare function cleanUrl(url: string | undefined, label: string): string | null;
183
190
  //# sourceMappingURL=utils.d.ts.map