@myapihq/sdk 2.28.2 → 2.29.0

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.
package/dist/storage.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface Asset {
13
13
  export declare function ingestAsset(apiKey: string, orgId: string, url: string, name?: string): Promise<Asset>;
14
14
  export type UploadContentType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'application/pdf' | 'video/mp4' | 'video/webm';
15
15
  export type UploadContentTypeInput = UploadContentType | (string & {});
16
- export declare function uploadAsset(apiKey: string, orgId: string, file: Blob | Buffer, contentType: UploadContentTypeInput, name?: string, visibility?: Visibility): Promise<Asset>;
16
+ export declare function uploadAsset(apiKey: string, orgId: string, file: Blob | Buffer, contentType: UploadContentTypeInput, name?: string, visibility?: Visibility, description?: string): Promise<Asset>;
17
17
  /** Flip an existing asset between public and private. Making it private takes
18
18
  * effect at once — the plain URL stops serving and only signed links work. */
19
19
  export declare function setAssetVisibility(apiKey: string, orgId: string, assetId: string, visibility: Visibility): Promise<Asset>;
package/dist/storage.js CHANGED
@@ -23,7 +23,7 @@ exports.EXPOSES = [
23
23
  async function ingestAsset(apiKey, orgId, url, name) {
24
24
  return (0, client_1.request)('POST', `${config_1.STORAGE_BASE}/storage/orgs/${encodeURIComponent(orgId)}/assets/ingest`, apiKey, { url, name });
25
25
  }
26
- async function uploadAsset(apiKey, orgId, file, contentType, name, visibility) {
26
+ async function uploadAsset(apiKey, orgId, file, contentType, name, visibility, description) {
27
27
  const headers = {
28
28
  'Authorization': `Bearer ${apiKey}`
29
29
  };
@@ -37,6 +37,12 @@ async function uploadAsset(apiKey, orgId, file, contentType, name, visibility) {
37
37
  if (visibility) {
38
38
  formData.append('visibility', visibility);
39
39
  }
40
+ // The API has read this since the route existed and nothing sent it, so an
41
+ // asset could be stored and never labelled — a list of filenames is a poor
42
+ // answer to "what is this". Found by the query-parameter gate.
43
+ if (description) {
44
+ formData.append('description', description);
45
+ }
40
46
  const response = await fetch(`${config_1.STORAGE_BASE}/storage/orgs/${encodeURIComponent(orgId)}/assets/upload`, {
41
47
  method: 'POST',
42
48
  headers,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.28.2";
1
+ export declare const SDK_VERSION = "2.29.0";
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
8
8
  // Why a constant and not a package.json read: the SDK runs inside edge
9
9
  // functions (Cloudflare Workers), so it must not import node:fs. A literal
10
10
  // is the only version source that works in every runtime we ship to.
11
- exports.SDK_VERSION = '2.28.2';
11
+ exports.SDK_VERSION = '2.29.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.28.2",
4
+ "version": "2.29.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",