@ophelio/sdk 0.2.1 → 0.2.2

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.mjs CHANGED
@@ -534,6 +534,44 @@ var MembersResource = class extends APIResource {
534
534
  options
535
535
  })).entitlements;
536
536
  }
537
+ /**
538
+ * Updates a member's details. Accepts `name`, `date_of_birth` and `role`
539
+ * (a member-role code). To reassign the primary member use `setPrimary`;
540
+ * to rotate a card use `reissueCard`.
541
+ */
542
+ update(id, params, options) {
543
+ return this.transport.request({
544
+ method: "PATCH",
545
+ path: `/api/v1/members/${encodeURIComponent(id)}`,
546
+ body: params,
547
+ retryable: false,
548
+ options
549
+ });
550
+ }
551
+ /**
552
+ * Remove a member from its membership. Rejected if it is the last member
553
+ * or the sole primary — reassign the primary first with `setPrimary`.
554
+ */
555
+ remove(id, options) {
556
+ return this.transport.request({
557
+ method: "DELETE",
558
+ path: `/api/v1/members/${encodeURIComponent(id)}`,
559
+ retryable: false,
560
+ options
561
+ });
562
+ }
563
+ /**
564
+ * Make this member the primary of its membership, demoting the current
565
+ * primary atomically. A no-op if it is already primary.
566
+ */
567
+ setPrimary(id, options) {
568
+ return this.transport.request({
569
+ method: "POST",
570
+ path: `/api/v1/members/${encodeURIComponent(id)}/set-primary`,
571
+ retryable: false,
572
+ options
573
+ });
574
+ }
537
575
  /** Issue a fresh card id, invalidating the old card at the gate. */
538
576
  reissueCard(id, params = {}, options) {
539
577
  return this.transport.request({
@@ -656,6 +694,20 @@ var MembershipsResource = class extends APIResource {
656
694
  })).members;
657
695
  }
658
696
  /**
697
+ * Add a member to an existing membership, up to the plan's max party size.
698
+ * `role` is a member-role code; an optional `email` links the member to a
699
+ * customer record. Rejected on cancelled or expired memberships.
700
+ */
701
+ addMember(id, params, options) {
702
+ return this.transport.request({
703
+ method: "POST",
704
+ path: `/api/v1/memberships/${encodeURIComponent(id)}/members`,
705
+ body: params,
706
+ retryable: false,
707
+ options
708
+ });
709
+ }
710
+ /**
659
711
  * Open the next term. Rejected (409) while cancelled or cancellation-pending.
660
712
  * Idempotent: the Idempotency-Key is generated once per call (and reused
661
713
  * across the SDK's internal retries), so a retried renewal returns the
@@ -1217,7 +1269,9 @@ const WEBHOOK_EVENT_CODES = [
1217
1269
  "membership.downgraded",
1218
1270
  "scheduled_change.failed",
1219
1271
  "entitlement.used",
1272
+ "member.added",
1220
1273
  "member.card_issued",
1274
+ "member.updated",
1221
1275
  "member.removed",
1222
1276
  "plan.updated"
1223
1277
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ophelio/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Official JavaScript / TypeScript SDK for the Ophel.io membership & entitlement API.",
5
5
  "license": "MIT",
6
6
  "author": "Ophel.io",