@examplary/sdk 2.17.0 → 2.18.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/index.d.mts CHANGED
@@ -268,7 +268,7 @@ interface paths {
268
268
  put?: never;
269
269
  /**
270
270
  * OAuth token endpoint
271
- * @description Exchange authorization code for access token, or refresh an existing token.
271
+ * @description Exchange an authorization code for an access token, refresh an existing token, or obtain a client-credentials token (first-party clients only).
272
272
  */
273
273
  post: operations["oauth.token"];
274
274
  delete?: never;
@@ -1669,7 +1669,11 @@ interface paths {
1669
1669
  path?: never;
1670
1670
  cookie?: never;
1671
1671
  };
1672
- get?: never;
1672
+ /**
1673
+ * Get user
1674
+ * @description Get details of a specific user within the workspace.
1675
+ */
1676
+ get: operations["users.get"];
1673
1677
  put?: never;
1674
1678
  post?: never;
1675
1679
  /**
@@ -1680,8 +1684,8 @@ interface paths {
1680
1684
  options?: never;
1681
1685
  head?: never;
1682
1686
  /**
1683
- * Update user role
1684
- * @description Update a user's role within the workspace.
1687
+ * Update user
1688
+ * @description Update a user's details within the workspace.
1685
1689
  */
1686
1690
  patch: operations["users.update"];
1687
1691
  trace?: never;
@@ -5473,17 +5477,32 @@ interface operations {
5473
5477
  * @default teacher
5474
5478
  * @enum {string}
5475
5479
  */
5476
- role?: "owner" | "admin" | "teacher" | "student" | "member";
5480
+ role?: "admin" | "teacher" | "student" | "member";
5477
5481
  /**
5478
5482
  * @description Whether to send an invitation email. Defaults to false.
5479
5483
  * @default false
5480
5484
  */
5481
5485
  sendInvite?: boolean;
5486
+ metadata?: {
5487
+ [key: string]: string | number | boolean | null;
5488
+ };
5482
5489
  };
5483
5490
  };
5484
5491
  };
5485
5492
  responses: never;
5486
5493
  };
5494
+ "users.get": {
5495
+ parameters: {
5496
+ query?: never;
5497
+ header?: never;
5498
+ path: {
5499
+ id: string;
5500
+ };
5501
+ cookie?: never;
5502
+ };
5503
+ requestBody?: never;
5504
+ responses: never;
5505
+ };
5487
5506
  "users.delete": {
5488
5507
  parameters: {
5489
5508
  query?: never;
@@ -5505,7 +5524,23 @@ interface operations {
5505
5524
  };
5506
5525
  cookie?: never;
5507
5526
  };
5508
- requestBody?: never;
5527
+ requestBody?: {
5528
+ content: {
5529
+ "application/json": {
5530
+ /** @description The user's name */
5531
+ name?: string;
5532
+ /** @enum {string} */
5533
+ role?: "admin" | "teacher" | "student" | "member";
5534
+ /** @description A map of user preferences */
5535
+ preferences?: {
5536
+ [key: string]: unknown;
5537
+ };
5538
+ metadata?: {
5539
+ [key: string]: string | number | boolean | null;
5540
+ };
5541
+ };
5542
+ };
5543
+ };
5509
5544
  responses: never;
5510
5545
  };
5511
5546
  "users.resetTwoFactor": {
@@ -7434,6 +7469,9 @@ interface _PathOverrides {
7434
7469
  resource: string;
7435
7470
  actor: string;
7436
7471
  };
7472
+ "users.get": {
7473
+ id: string;
7474
+ };
7437
7475
  "users.update": {
7438
7476
  id: string;
7439
7477
  };
@@ -7772,7 +7810,7 @@ declare class Oauth {
7772
7810
  /**
7773
7811
  * OAuth token endpoint
7774
7812
  *
7775
- * Exchange authorization code for access token, or refresh an existing token.
7813
+ * Exchange an authorization code for an access token, refresh an existing token, or obtain a client-credentials token (first-party clients only).
7776
7814
  *
7777
7815
  * API endpoint: `POST /oauth/token`
7778
7816
  */
@@ -8631,13 +8669,21 @@ declare class Users {
8631
8669
  */
8632
8670
  create(args?: Args<"users.create">, options?: ExamplaryRequestOptions): Promise<Response<"users.create">>;
8633
8671
  /**
8634
- * Update user role
8672
+ * Get user
8673
+ *
8674
+ * Get details of a specific user within the workspace.
8675
+ *
8676
+ * API endpoint: `GET /users/{id}`
8677
+ */
8678
+ get(id: string, options?: ExamplaryRequestOptions): Promise<Response<"users.get">>;
8679
+ get(args: Args<"users.get">, options?: ExamplaryRequestOptions): Promise<Response<"users.get">>;
8680
+ /**
8681
+ * Update user
8635
8682
  *
8636
- * Update a user's role within the workspace.
8683
+ * Update a user's details within the workspace.
8637
8684
  *
8638
8685
  * API endpoint: `PATCH /users/{id}`
8639
8686
  */
8640
- update(id: string, options?: ExamplaryRequestOptions): Promise<Response<"users.update">>;
8641
8687
  update(args: Args<"users.update">, options?: ExamplaryRequestOptions): Promise<Response<"users.update">>;
8642
8688
  /**
8643
8689
  * Delete user
package/dist/index.d.ts CHANGED
@@ -268,7 +268,7 @@ interface paths {
268
268
  put?: never;
269
269
  /**
270
270
  * OAuth token endpoint
271
- * @description Exchange authorization code for access token, or refresh an existing token.
271
+ * @description Exchange an authorization code for an access token, refresh an existing token, or obtain a client-credentials token (first-party clients only).
272
272
  */
273
273
  post: operations["oauth.token"];
274
274
  delete?: never;
@@ -1669,7 +1669,11 @@ interface paths {
1669
1669
  path?: never;
1670
1670
  cookie?: never;
1671
1671
  };
1672
- get?: never;
1672
+ /**
1673
+ * Get user
1674
+ * @description Get details of a specific user within the workspace.
1675
+ */
1676
+ get: operations["users.get"];
1673
1677
  put?: never;
1674
1678
  post?: never;
1675
1679
  /**
@@ -1680,8 +1684,8 @@ interface paths {
1680
1684
  options?: never;
1681
1685
  head?: never;
1682
1686
  /**
1683
- * Update user role
1684
- * @description Update a user's role within the workspace.
1687
+ * Update user
1688
+ * @description Update a user's details within the workspace.
1685
1689
  */
1686
1690
  patch: operations["users.update"];
1687
1691
  trace?: never;
@@ -5473,17 +5477,32 @@ interface operations {
5473
5477
  * @default teacher
5474
5478
  * @enum {string}
5475
5479
  */
5476
- role?: "owner" | "admin" | "teacher" | "student" | "member";
5480
+ role?: "admin" | "teacher" | "student" | "member";
5477
5481
  /**
5478
5482
  * @description Whether to send an invitation email. Defaults to false.
5479
5483
  * @default false
5480
5484
  */
5481
5485
  sendInvite?: boolean;
5486
+ metadata?: {
5487
+ [key: string]: string | number | boolean | null;
5488
+ };
5482
5489
  };
5483
5490
  };
5484
5491
  };
5485
5492
  responses: never;
5486
5493
  };
5494
+ "users.get": {
5495
+ parameters: {
5496
+ query?: never;
5497
+ header?: never;
5498
+ path: {
5499
+ id: string;
5500
+ };
5501
+ cookie?: never;
5502
+ };
5503
+ requestBody?: never;
5504
+ responses: never;
5505
+ };
5487
5506
  "users.delete": {
5488
5507
  parameters: {
5489
5508
  query?: never;
@@ -5505,7 +5524,23 @@ interface operations {
5505
5524
  };
5506
5525
  cookie?: never;
5507
5526
  };
5508
- requestBody?: never;
5527
+ requestBody?: {
5528
+ content: {
5529
+ "application/json": {
5530
+ /** @description The user's name */
5531
+ name?: string;
5532
+ /** @enum {string} */
5533
+ role?: "admin" | "teacher" | "student" | "member";
5534
+ /** @description A map of user preferences */
5535
+ preferences?: {
5536
+ [key: string]: unknown;
5537
+ };
5538
+ metadata?: {
5539
+ [key: string]: string | number | boolean | null;
5540
+ };
5541
+ };
5542
+ };
5543
+ };
5509
5544
  responses: never;
5510
5545
  };
5511
5546
  "users.resetTwoFactor": {
@@ -7434,6 +7469,9 @@ interface _PathOverrides {
7434
7469
  resource: string;
7435
7470
  actor: string;
7436
7471
  };
7472
+ "users.get": {
7473
+ id: string;
7474
+ };
7437
7475
  "users.update": {
7438
7476
  id: string;
7439
7477
  };
@@ -7772,7 +7810,7 @@ declare class Oauth {
7772
7810
  /**
7773
7811
  * OAuth token endpoint
7774
7812
  *
7775
- * Exchange authorization code for access token, or refresh an existing token.
7813
+ * Exchange an authorization code for an access token, refresh an existing token, or obtain a client-credentials token (first-party clients only).
7776
7814
  *
7777
7815
  * API endpoint: `POST /oauth/token`
7778
7816
  */
@@ -8631,13 +8669,21 @@ declare class Users {
8631
8669
  */
8632
8670
  create(args?: Args<"users.create">, options?: ExamplaryRequestOptions): Promise<Response<"users.create">>;
8633
8671
  /**
8634
- * Update user role
8672
+ * Get user
8673
+ *
8674
+ * Get details of a specific user within the workspace.
8675
+ *
8676
+ * API endpoint: `GET /users/{id}`
8677
+ */
8678
+ get(id: string, options?: ExamplaryRequestOptions): Promise<Response<"users.get">>;
8679
+ get(args: Args<"users.get">, options?: ExamplaryRequestOptions): Promise<Response<"users.get">>;
8680
+ /**
8681
+ * Update user
8635
8682
  *
8636
- * Update a user's role within the workspace.
8683
+ * Update a user's details within the workspace.
8637
8684
  *
8638
8685
  * API endpoint: `PATCH /users/{id}`
8639
8686
  */
8640
- update(id: string, options?: ExamplaryRequestOptions): Promise<Response<"users.update">>;
8641
8687
  update(args: Args<"users.update">, options?: ExamplaryRequestOptions): Promise<Response<"users.update">>;
8642
8688
  /**
8643
8689
  * Delete user
package/dist/index.js CHANGED
@@ -774,9 +774,13 @@ var Users = class {
774
774
  const args = arg;
775
775
  return request(this.ctx, "POST", "/users", [], [], true, args, options);
776
776
  }
777
- update(arg, options) {
777
+ get(arg, options) {
778
778
  const args = typeof arg === "string" ? { id: arg } : arg;
779
- return request(this.ctx, "PATCH", "/users/{id}", ["id"], [], false, args, options);
779
+ return request(this.ctx, "GET", "/users/{id}", ["id"], [], false, args, options);
780
+ }
781
+ update(arg, options) {
782
+ const args = arg;
783
+ return request(this.ctx, "PATCH", "/users/{id}", ["id"], [], true, args, options);
780
784
  }
781
785
  delete(arg, options) {
782
786
  const args = typeof arg === "string" ? { id: arg } : arg;