@tinycloud/share-sdk 1.5.0-beta.4 → 1.5.0-beta.5

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/index.d.cts CHANGED
@@ -320,6 +320,7 @@ interface NativeSharingService {
320
320
  readonly path: string;
321
321
  readonly actions: string[];
322
322
  readonly expiry: Date;
323
+ readonly includePlacement?: boolean;
323
324
  }): Promise<unknown>;
324
325
  receive(token: string, options: {
325
326
  readonly autoSubdelegate: false;
@@ -335,6 +336,7 @@ declare function createNativeShare(sharing: NativeSharingService, input: {
335
336
  readonly path: string;
336
337
  readonly expiresAt: Date;
337
338
  readonly viewerOrigin: string;
339
+ readonly includePlacement?: boolean;
338
340
  }): Promise<NativeShareResult>;
339
341
  /** Extract only a single tc1 fragment. Path/query/mixed legacy forms are refused. */
340
342
  declare function parseNativeShareUrl(value: string): string;
package/dist/index.d.ts CHANGED
@@ -320,6 +320,7 @@ interface NativeSharingService {
320
320
  readonly path: string;
321
321
  readonly actions: string[];
322
322
  readonly expiry: Date;
323
+ readonly includePlacement?: boolean;
323
324
  }): Promise<unknown>;
324
325
  receive(token: string, options: {
325
326
  readonly autoSubdelegate: false;
@@ -335,6 +336,7 @@ declare function createNativeShare(sharing: NativeSharingService, input: {
335
336
  readonly path: string;
336
337
  readonly expiresAt: Date;
337
338
  readonly viewerOrigin: string;
339
+ readonly includePlacement?: boolean;
338
340
  }): Promise<NativeShareResult>;
339
341
  /** Extract only a single tc1 fragment. Path/query/mixed legacy forms are refused. */
340
342
  declare function parseNativeShareUrl(value: string): string;
package/dist/index.js CHANGED
@@ -9405,7 +9405,7 @@ function canonicalViewerUrl(viewerOrigin) {
9405
9405
  }
9406
9406
  async function createNativeShare(sharing, input) {
9407
9407
  if (!input.path || input.path.startsWith("/") || input.path.endsWith("/") || input.path.includes("..") || input.path.includes("//")) throw new TypeError("native share path must be one canonical TinyCloud KV key");
9408
- const generated = await sharing.generate({ path: input.path, actions: ["tinycloud.kv/get"], expiry: input.expiresAt });
9408
+ const generated = await sharing.generate({ path: input.path, actions: ["tinycloud.kv/get"], expiry: input.expiresAt, ...input.includePlacement === void 0 ? {} : { includePlacement: input.includePlacement } });
9409
9409
  if (generated.ok !== true) {
9410
9410
  const error = new Error(typeof generated.error?.message === "string" ? generated.error.message : "TinyCloud sharing service rejected delegation generation");
9411
9411
  if (typeof generated.error?.code === "string") Object.assign(error, { code: generated.error.code });