@genation/sdk 0.1.0 → 0.2.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/README.md +31 -21
- package/dist/genation.cjs.js +1 -1
- package/dist/genation.cjs.js.map +1 -1
- package/dist/genation.es.js +144 -133
- package/dist/genation.es.js.map +1 -1
- package/dist/genation.umd.js +1 -1
- package/dist/genation.umd.js.map +1 -1
- package/dist/index.d.ts +15 -41
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -214,33 +214,13 @@ export declare class GenationClient {
|
|
|
214
214
|
* ```typescript
|
|
215
215
|
* // On your /callback page
|
|
216
216
|
* async function handleCallback() {
|
|
217
|
-
* const
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* if (code && state) {
|
|
222
|
-
* await client.handleCallback(code, state);
|
|
223
|
-
* // onAuthStateChange will fire with SIGNED_IN event
|
|
224
|
-
* }
|
|
217
|
+
* const url = window.location.href;
|
|
218
|
+
* await client.handleCallback(url);
|
|
219
|
+
* // onAuthStateChange will fire with SIGNED_IN event
|
|
225
220
|
* }
|
|
226
221
|
* ```
|
|
227
222
|
*/
|
|
228
|
-
handleCallback(
|
|
229
|
-
/**
|
|
230
|
-
* Sign out and revoke tokens
|
|
231
|
-
*
|
|
232
|
-
* Clears local session and revokes tokens on server.
|
|
233
|
-
* Triggers `SIGNED_OUT` event for all listeners.
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* ```typescript
|
|
237
|
-
* async function handleLogout() {
|
|
238
|
-
* await client.signOut();
|
|
239
|
-
* // onAuthStateChange will fire with SIGNED_OUT event
|
|
240
|
-
* }
|
|
241
|
-
* ```
|
|
242
|
-
*/
|
|
243
|
-
signOut(): Promise<void>;
|
|
223
|
+
handleCallback(url: string): Promise<TokenSet>;
|
|
244
224
|
/**
|
|
245
225
|
* Get current session
|
|
246
226
|
*
|
|
@@ -381,67 +361,61 @@ declare interface License {
|
|
|
381
361
|
* Example: 'b23f680b-968d-4db3-a1ef-1870eaa8b17e'
|
|
382
362
|
*/
|
|
383
363
|
id: string;
|
|
384
|
-
/**
|
|
385
|
-
* Alphanumeric code or token that represents the ownership or grant of this license.
|
|
386
|
-
* May be used for redeeming, activating, or looking up the license.
|
|
387
|
-
* Example: 'ACME-56T9-PX24-2024'
|
|
388
|
-
*/
|
|
389
|
-
code: string;
|
|
390
364
|
/**
|
|
391
365
|
* The foreign key referencing the license plan this license was issued under.
|
|
392
366
|
* This ties the license to a specific set of plan attributes/entitlements.
|
|
393
367
|
* Example: '15f24aa1-83e2-4f6c-af22-b2e159d56f98'
|
|
394
368
|
*/
|
|
395
|
-
|
|
369
|
+
appPlanId: string;
|
|
396
370
|
/**
|
|
397
371
|
* The total duration (in calendar days) for which the license is valid after being redeemed or activated.
|
|
398
372
|
* Example: 30 (for a one-month license), 365 (for annual licenses)
|
|
399
373
|
*/
|
|
400
|
-
|
|
374
|
+
durationDays: number;
|
|
401
375
|
/**
|
|
402
376
|
* Optionally, the UUID of a plan term or subscription cycle associated with the license, if applicable.
|
|
403
377
|
* Can be null if the license does not have distinct terms.
|
|
404
378
|
* Example: 'random<uuid>', or null for perpetual/server-issued licenses.
|
|
405
379
|
*/
|
|
406
|
-
|
|
380
|
+
planTermId: string | null;
|
|
407
381
|
/**
|
|
408
382
|
* The user UUID (or organization ID) of the purchaser who paid for or obtained the license.
|
|
409
383
|
* This identifies the buying entity. May be a UUID string.
|
|
410
384
|
* Example: 'uuid'
|
|
411
385
|
*/
|
|
412
|
-
|
|
386
|
+
purchaserId: string;
|
|
413
387
|
/**
|
|
414
388
|
* The user UUID of the account that redeemed or is assigned this license.
|
|
415
389
|
* For team or transferred licenses, this may differ from purchaser_id.
|
|
416
390
|
* Example: 'uuid'
|
|
417
391
|
*/
|
|
418
|
-
|
|
392
|
+
redeemedBy: string;
|
|
419
393
|
/**
|
|
420
394
|
* The ISO 8601 timestamp when the license was purchased, invoiced, or issued (by admin/tool).
|
|
421
395
|
* Format: 'YYYY-MM-DDTHH:mm:ss.sssZ'
|
|
422
396
|
* Example: '2024-06-05T14:00:13.001Z'
|
|
423
397
|
*/
|
|
424
|
-
|
|
398
|
+
purchasedAt: string;
|
|
425
399
|
/**
|
|
426
400
|
* The ISO 8601 timestamp when the license was redeemed or activated by a user for use.
|
|
427
401
|
* May be equal to purchased_at for immediate use, or later if redeemed by a team member.
|
|
428
402
|
* Format: 'YYYY-MM-DDTHH:mm:ss.sssZ'
|
|
429
403
|
* Example: '2024-06-05T16:20:27.330Z'
|
|
430
404
|
*/
|
|
431
|
-
|
|
405
|
+
redeemedAt: string;
|
|
432
406
|
/**
|
|
433
407
|
* Optional note from the purchaser (attached to the license at order time).
|
|
434
408
|
* Could contain recipient info, business notes, or a purpose for purchase.
|
|
435
409
|
* Example: 'For Emily - Happy birthday!', 'Procured by IT Services, invoice #2024-1091'
|
|
436
410
|
*/
|
|
437
|
-
|
|
411
|
+
purchaserNote: string;
|
|
438
412
|
/**
|
|
439
413
|
* The ISO 8601 timestamp for license expiration or end of entitlement.
|
|
440
414
|
* After this date, the license is considered expired and may not grant access.
|
|
441
415
|
* Format: 'YYYY-MM-DDTHH:mm:ss.sssZ'
|
|
442
416
|
* Example: '2025-06-05T16:20:27.000Z'
|
|
443
417
|
*/
|
|
444
|
-
|
|
418
|
+
expiresAt: string;
|
|
445
419
|
/**
|
|
446
420
|
* String representing the license status in the system.
|
|
447
421
|
* Common examples: 'available', 'active', 'expired'
|
|
@@ -470,7 +444,7 @@ declare interface LicensePlan {
|
|
|
470
444
|
* Maps to the application entity in the system.
|
|
471
445
|
* Example: 'app_003cd5870d'
|
|
472
446
|
*/
|
|
473
|
-
|
|
447
|
+
appId: string;
|
|
474
448
|
/**
|
|
475
449
|
* The public (human-readable or machine-friendly) code for the plan.
|
|
476
450
|
* Used for referencing the plan in APIs, admin panels, or order forms.
|
|
@@ -488,7 +462,7 @@ declare interface LicensePlan {
|
|
|
488
462
|
* Format: 'YYYY-MM-DDTHH:mm:ss.sssZ'
|
|
489
463
|
* Example: '2024-06-05T12:34:56.789Z'
|
|
490
464
|
*/
|
|
491
|
-
|
|
465
|
+
createdAt: string;
|
|
492
466
|
}
|
|
493
467
|
|
|
494
468
|
/**
|