@redacto.io/consent-sdk-js 1.0.0-beta.0 → 1.0.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.
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Optional sandbox options shared by the SDK's public option shapes and the
3
+ * internal API params. When `token` is set the call sends the single
4
+ * `X-Consent-Token` header instead of `Authorization: Bearer`, injects the
5
+ * subject into each request's own payload, and takes org/workspace from these
6
+ * fields instead of decoding the JWT.
7
+ */
8
+ type SandboxOptions = {
9
+ token?: string;
10
+ /** UCIC — the client's own user id (`org_user_id`); takes precedence over the subject. */
11
+ sandboxUcic?: string;
12
+ sandboxSubject?: string;
13
+ organisationUuid?: string;
14
+ workspaceUuid?: string;
15
+ };
1
16
  type Settings = {
2
17
  button: {
3
18
  accept: {
@@ -24,10 +39,25 @@ type Settings = {
24
39
  font?: string;
25
40
  };
26
41
 
27
- type ModalOptions = {
42
+ type ModalOptions = SandboxOptions & {
28
43
  noticeId: string;
29
- accessToken: string;
30
- refreshToken: string;
44
+ /** JWT access token. Optional so sandbox mode (see `token`) can omit it. */
45
+ accessToken?: string;
46
+ /** JWT refresh token. Optional; accepted for source-compat, currently unused. */
47
+ refreshToken?: string;
48
+ /**
49
+ * Sandbox test subject email. The static `token` carries no identity, so the
50
+ * acting principal is read from `email` (or `mobile`) -- both optional, supply
51
+ * whichever you have. Mirrors the React SDK props.
52
+ */
53
+ email?: string;
54
+ /** Sandbox test subject mobile (used when `email` is absent). */
55
+ mobile?: string;
56
+ /**
57
+ * Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
58
+ * customer code; optional third identifier alongside email/mobile.
59
+ */
60
+ ucic?: string;
31
61
  baseUrl?: string;
32
62
  /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
33
63
  ledgerBaseUrl?: string;
package/dist/redacto.d.ts CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Optional sandbox options shared by the SDK's public option shapes and the
3
+ * internal API params. When `token` is set the call sends the single
4
+ * `X-Consent-Token` header instead of `Authorization: Bearer`, injects the
5
+ * subject into each request's own payload, and takes org/workspace from these
6
+ * fields instead of decoding the JWT.
7
+ */
8
+ type SandboxOptions = {
9
+ token?: string;
10
+ /** UCIC — the client's own user id (`org_user_id`); takes precedence over the subject. */
11
+ sandboxUcic?: string;
12
+ sandboxSubject?: string;
13
+ organisationUuid?: string;
14
+ workspaceUuid?: string;
15
+ };
1
16
  type Settings = {
2
17
  button: {
3
18
  accept: {
@@ -24,10 +39,25 @@ type Settings = {
24
39
  font?: string;
25
40
  };
26
41
 
27
- type ModalOptions = {
42
+ type ModalOptions = SandboxOptions & {
28
43
  noticeId: string;
29
- accessToken: string;
30
- refreshToken: string;
44
+ /** JWT access token. Optional so sandbox mode (see `token`) can omit it. */
45
+ accessToken?: string;
46
+ /** JWT refresh token. Optional; accepted for source-compat, currently unused. */
47
+ refreshToken?: string;
48
+ /**
49
+ * Sandbox test subject email. The static `token` carries no identity, so the
50
+ * acting principal is read from `email` (or `mobile`) -- both optional, supply
51
+ * whichever you have. Mirrors the React SDK props.
52
+ */
53
+ email?: string;
54
+ /** Sandbox test subject mobile (used when `email` is absent). */
55
+ mobile?: string;
56
+ /**
57
+ * Sandbox UCIC: the client's own user id / org_user_id, e.g. a UUID or
58
+ * customer code; optional third identifier alongside email/mobile.
59
+ */
60
+ ucic?: string;
31
61
  baseUrl?: string;
32
62
  /** Go ledger base URL — serves check-consent and the consent write; omit to use the legacy consent server. */
33
63
  ledgerBaseUrl?: string;