@cubist-labs/cubesigner-sdk 0.4.267 → 0.4.268

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/cubist-labs/CubeSigner-TypeScript-SDK.git",
6
6
  "directory": "packages/sdk"
7
7
  },
8
- "version": "0.4.267",
8
+ "version": "0.4.268",
9
9
  "type": "module",
10
10
  "description": "CubeSigner TypeScript SDK",
11
11
  "license": "MIT OR Apache-2.0",
package/src/audit_log.ts CHANGED
@@ -47,7 +47,12 @@ export const auditLogEntrySchema = z.discriminatedUnion("event", [
47
47
  membership: schemaString<MemberRole>(),
48
48
  email: z.optional(z.string()),
49
49
  username: z.optional(z.string()),
50
- scopes: z.array(z.string()),
50
+ // `scopes` is stored as a comma-joined string, so we parse it as a string and split it back
51
+ // into an array.
52
+ scopes: z.pipe(
53
+ z.string(),
54
+ z.transform((s) => s.split(",")),
55
+ ),
51
56
  }),
52
57
  z.object({
53
58
  ...baseFields,
@@ -62,6 +62,7 @@ import type {
62
62
  ContactLabel,
63
63
  ContactAddressData,
64
64
  AuditLogRequest,
65
+ AuditLogResponse,
65
66
  ValidatedAuditLogResponse,
66
67
  AuditLogEntry,
67
68
  RoleInfoJwt,
@@ -624,6 +625,30 @@ export class ApiClient extends BaseClient {
624
625
  );
625
626
  }
626
627
 
628
+ /**
629
+ * Query the audit log, returning the raw (unparsed) entries.
630
+ *
631
+ * Unlike {@link orgQueryAuditLog}, this method does not attempt to validate or
632
+ * parse the audit log entries against `auditLogEntrySchema`; entries are
633
+ * returned exactly as received from the server.
634
+ *
635
+ * @param body The query.
636
+ * @param page Pagination options. Default to fetching the entire result set.
637
+ * @returns Requested audit log with raw entries.
638
+ */
639
+ orgQueryAuditLogRaw(
640
+ body: AuditLogRequest,
641
+ page?: PageOpts,
642
+ ): Paginator<AuditLogResponse, AuditLogResponse["entries"]> {
643
+ const o = op("/v0/org/{org_id}/audit", "post");
644
+ return Paginator.items(
645
+ page ?? Page.default(),
646
+ (query) => this.exec(o, { body, params: { query } }),
647
+ (r) => r.entries,
648
+ (r) => r.last_evaluated_key,
649
+ );
650
+ }
651
+
627
652
  /**
628
653
  * Query org metrics.
629
654
  *