yungle-client 0.3.0 → 0.3.1

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.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Collection, CollectionFile, CollectionSummary, Contact, ContactInput, DownloadEvent, DownloadLinks, ImportInput, ImportStatus, Submission, UploadRequest, UploadRequestInput, FileInput, Folder, Guest, Me, PulledWebhookEvent, RecipientStatus, Transfer, TransferFile, TransferSummary, UploadTargets, WebhookDelivery, WebhookEndpoint, WebhookEventType } from './types.js';
1
+ import type { Collection, CollectionFile, CollectionSummary, Contact, ContactInput, DownloadEvent, DownloadLinks, ImportInput, ImportStatus, Submission, UploadRequest, UploadRequestInput, FileInput, Folder, Guest, Me, Referral, PulledWebhookEvent, RecipientStatus, Transfer, TransferFile, TransferSummary, UploadTargets, WebhookDelivery, WebhookEndpoint, WebhookEventType } from './types.js';
2
2
  import { type RenewOutcome as Renewal } from './upload-token.js';
3
3
  import { type UploadFileOptions } from './upload.js';
4
4
  export { chunkSize, uploadFile, UploadError, type UploadFileOptions } from './upload.js';
@@ -106,6 +106,8 @@ export declare class YungleClient {
106
106
  uploadUrl: string;
107
107
  }>;
108
108
  me(): Promise<Me>;
109
+ /** Your invite code and link, and the free months it has earned. */
110
+ getReferral(): Promise<Referral>;
109
111
  /**
110
112
  * One page of transfers, newest first — 100 by default, up to 500. Pass the
111
113
  * returned `nextCursor` back as `cursor` for the next page; it is null on the
package/dist/index.mjs CHANGED
@@ -220,7 +220,7 @@ function pageQuery(page, extra = {}) {
220
220
  const q = params.toString();
221
221
  return q ? `?${q}` : "";
222
222
  }
223
- var CLIENT_VERSION = true ? "0.3.0" : "dev";
223
+ var CLIENT_VERSION = true ? "0.3.1" : "dev";
224
224
  var YungleClient = class {
225
225
  baseUrl;
226
226
  apiKey;
@@ -260,6 +260,10 @@ var YungleClient = class {
260
260
  me() {
261
261
  return this.request("GET", "/me");
262
262
  }
263
+ /** Your invite code and link, and the free months it has earned. */
264
+ getReferral() {
265
+ return this.request("GET", "/me/referral");
266
+ }
263
267
  // ── Transfers ─────────────────────────────────────────────────────────────
264
268
  /**
265
269
  * One page of transfers, newest first — 100 by default, up to 500. Pass the
package/dist/types.d.ts CHANGED
@@ -40,6 +40,23 @@ export interface KeyInfo {
40
40
  /** Whether this credential may make Yungle email anyone. Absent on older servers. */
41
41
  canEmail?: boolean;
42
42
  }
43
+ /** Your invite code and what it has earned (`GET /me/referral`). */
44
+ export interface Referral {
45
+ /** Your invite code. A friend can type it in Settings › Plan. */
46
+ code: string;
47
+ /** Your invite link: the same code, as a page that signs them up. */
48
+ url: string;
49
+ /** Free months earned so far. */
50
+ earnedMonths: number;
51
+ /** Free months still available to earn. */
52
+ remainingMonths: number;
53
+ /** The most free months one person can earn, ever. */
54
+ cap: number;
55
+ /** True once `earnedMonths` reached `cap`. The link still gives friends their month. */
56
+ capped: boolean;
57
+ /** Friends in their free month, or inside the 14 days after their first payment. */
58
+ pending: number;
59
+ }
43
60
  export interface Me {
44
61
  workspace: Workspace;
45
62
  plan: PlanInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yungle-client",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {