@cakemail-org/ui-components-v2 2.2.102 → 2.2.104

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.
Files changed (35) hide show
  1. package/dist/cjs/components/index.d.ts +1 -0
  2. package/dist/cjs/components/scopePicker/index.d.ts +8 -0
  3. package/dist/cjs/components/scopePicker/scopeGroups.d.ts +21 -0
  4. package/dist/cjs/components/scopePicker/types.d.ts +1 -0
  5. package/dist/cjs/components/textField/types.d.ts +1 -1
  6. package/dist/cjs/data/theme/MuiTextField.d.ts +27 -0
  7. package/dist/cjs/factories/index.d.ts +1 -0
  8. package/dist/cjs/factories/personalAccessTokens/index.d.ts +22 -0
  9. package/dist/cjs/factories/personalAccessTokens/types.d.ts +1 -0
  10. package/dist/cjs/index.js +470 -4
  11. package/dist/cjs/models/index.d.ts +1 -0
  12. package/dist/cjs/models/personalAccessToken/index.d.ts +21 -0
  13. package/dist/cjs/models/personalAccessToken/types.d.ts +10 -0
  14. package/dist/cjs/services/index.d.ts +1 -0
  15. package/dist/cjs/services/personalAccessTokens/index.d.ts +24 -0
  16. package/dist/cjs/services/personalAccessTokens/types.d.ts +1 -0
  17. package/dist/cjs/utils/posthog.d.ts +5 -1
  18. package/dist/esm/components/index.d.ts +1 -0
  19. package/dist/esm/components/scopePicker/index.d.ts +8 -0
  20. package/dist/esm/components/scopePicker/scopeGroups.d.ts +21 -0
  21. package/dist/esm/components/scopePicker/types.d.ts +1 -0
  22. package/dist/esm/components/textField/types.d.ts +1 -1
  23. package/dist/esm/data/theme/MuiTextField.d.ts +27 -0
  24. package/dist/esm/factories/index.d.ts +1 -0
  25. package/dist/esm/factories/personalAccessTokens/index.d.ts +22 -0
  26. package/dist/esm/factories/personalAccessTokens/types.d.ts +1 -0
  27. package/dist/esm/index.js +464 -6
  28. package/dist/esm/models/index.d.ts +1 -0
  29. package/dist/esm/models/personalAccessToken/index.d.ts +21 -0
  30. package/dist/esm/models/personalAccessToken/types.d.ts +10 -0
  31. package/dist/esm/services/index.d.ts +1 -0
  32. package/dist/esm/services/personalAccessTokens/index.d.ts +24 -0
  33. package/dist/esm/services/personalAccessTokens/types.d.ts +1 -0
  34. package/dist/esm/utils/posthog.d.ts +5 -1
  35. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ export declare function listPats({ page, perPage, status }: {
2
+ page?: number;
3
+ perPage?: number;
4
+ status?: string;
5
+ }): Promise<any>;
6
+ export declare function getPat({ keyPrefix }: {
7
+ keyPrefix: string;
8
+ }): Promise<any>;
9
+ export declare function createPat({ name, scopes, expiresAt, allowedAccountIds }: {
10
+ name: string;
11
+ scopes: string[];
12
+ expiresAt?: number | null;
13
+ allowedAccountIds?: string[] | null;
14
+ }): Promise<any>;
15
+ export declare function updatePat({ keyPrefix, name, scopes, allowedAccountIds }: {
16
+ keyPrefix: string;
17
+ name?: string;
18
+ scopes?: string[];
19
+ allowedAccountIds?: string[] | null;
20
+ }): Promise<any>;
21
+ export declare function revokePat({ keyPrefix }: {
22
+ keyPrefix: string;
23
+ }): Promise<any>;
24
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export {};
@@ -164,7 +164,11 @@ export declare enum EEvents {
164
164
  PAGE_PUBLISHED = "Page.Published",
165
165
  CUSTOM_DOMAIN_CREATED = "CustomDomain.Created",
166
166
  CUSTOM_DOMAIN_VERIFIED = "CustomDomain.Verified",
167
- CUSTOM_DOMAIN_DELETED = "CustomDomain.Deleted"
167
+ CUSTOM_DOMAIN_DELETED = "CustomDomain.Deleted",
168
+ PAT_CREATED = "PAT.Created",
169
+ PAT_UPDATED = "PAT.Updated",
170
+ PAT_REVOKED = "PAT.Revoked",
171
+ PAT_TOKEN_COPIED = "PAT.Token.Copied"
168
172
  }
169
173
  export declare function eventCondition(type: EEvents | string, disabledEvents?: string[]): boolean;
170
174
  export declare function trackEvent(type: EEvents | string, data?: any, dataParser?: (event: EEvents | string, data: any) => any, disabledEvents?: string[]): void;
@@ -37,6 +37,7 @@ export * from "./modal";
37
37
  export * from "./overlay";
38
38
  export * from "./radio";
39
39
  export * from "./resourceEdit";
40
+ export * from "./scopePicker";
40
41
  export * from "./search";
41
42
  export * from "./sideMenu";
42
43
  export * from "./sideMenu/sideMenuContainer";
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export type TScopePicker = {
3
+ value: string[];
4
+ onChange: (scopes: string[]) => void;
5
+ isPartner?: boolean;
6
+ disabled?: boolean;
7
+ };
8
+ export declare function ScopePicker({ value, onChange, isPartner, disabled }: TScopePicker): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ export type TScopeAction = "read" | "write" | "delete" | "send" | "import" | "export" | "admin";
2
+ export type TScopeResource = {
3
+ resource: string;
4
+ label: string;
5
+ actions: TScopeAction[];
6
+ };
7
+ export type TScopeCategory = {
8
+ id: string;
9
+ label: string;
10
+ adminOnly: boolean;
11
+ resources: TScopeResource[];
12
+ };
13
+ export declare const SCOPE_IMPLICATIONS: Record<string, string[]>;
14
+ export declare const SCOPE_CATEGORIES: TScopeCategory[];
15
+ export type TScopePreset = {
16
+ id: string;
17
+ label: string;
18
+ scopes: string[];
19
+ };
20
+ export declare function getCategoryScopes(categoryId: string): string[];
21
+ export declare const SCOPE_PRESETS: TScopePreset[];
@@ -0,0 +1 @@
1
+ export { TScopePicker } from ".";
@@ -1,7 +1,7 @@
1
1
  import { BaseTextFieldProps } from "@mui/material";
2
2
  import { ChangeEventHandler } from "react";
3
3
  import { TIconName } from "../icon/types";
4
- export interface TTextField extends Omit<BaseTextFieldProps, "onMouseUp" | "FormHelperTextProps" | "fullWidth" | "select" | "margin" | "component" | "InputLabelProps" | "SelectProps" | "classes" | "size" | "color"> {
4
+ export interface TTextField extends Omit<BaseTextFieldProps, "onMouseUp" | "FormHelperTextProps" | "fullWidth" | "select" | "margin" | "component" | "InputLabelProps" | "SelectProps" | "classes" | "color"> {
5
5
  onChange?: TTextFieldChange;
6
6
  labelTooltipText?: string;
7
7
  useBareBoneInput?: boolean;
@@ -1,5 +1,32 @@
1
1
  import { Theme } from "@mui/material";
2
2
  export default function getMuiTextField(theme: Theme): {
3
+ variants: ({
4
+ props: {
5
+ size: string;
6
+ };
7
+ style: {
8
+ ".MuiInputBase-root > input, .MuiInputBase-root > textarea": {
9
+ padding: string;
10
+ fontSize: import("csstype").Property.FontSize<string | number> | undefined;
11
+ lineHeight: import("csstype").Property.LineHeight<string | number> | undefined;
12
+ };
13
+ ".MuiSvgIcon-root": {
14
+ top: string;
15
+ };
16
+ };
17
+ } | {
18
+ props: {
19
+ size: string;
20
+ };
21
+ style: {
22
+ ".MuiInputBase-root > input, .MuiInputBase-root > textarea": {
23
+ padding: string;
24
+ fontSize?: undefined;
25
+ lineHeight?: undefined;
26
+ };
27
+ ".MuiSvgIcon-root"?: undefined;
28
+ };
29
+ })[];
3
30
  styleOverrides: {
4
31
  root: {
5
32
  ".MuiInputLabel-root": {
@@ -9,6 +9,7 @@ export * from "./emailAPI";
9
9
  export * from "./forms";
10
10
  export * from "./lists";
11
11
  export * from "./pages";
12
+ export * from "./personalAccessTokens";
12
13
  export * from "./popups";
13
14
  export * from "./senders";
14
15
  export * from "./suppressedEmails";
@@ -0,0 +1,22 @@
1
+ import { PersonalAccessTokenModel } from "../../models/personalAccessToken";
2
+ import { TGenericListReturn } from "../../types";
3
+ export declare class PersonalAccessTokensFactory {
4
+ static list({ page, perPage, status }?: {
5
+ page?: number;
6
+ perPage?: number;
7
+ status?: string;
8
+ }): Promise<TGenericListReturn<PersonalAccessTokenModel>>;
9
+ static get({ keyPrefix }: {
10
+ keyPrefix: string;
11
+ }): Promise<PersonalAccessTokenModel>;
12
+ static create({ name, scopes, expiresAt, allowedAccountIds }: {
13
+ name: string;
14
+ scopes: string[];
15
+ expiresAt?: number | null;
16
+ allowedAccountIds?: string[] | null;
17
+ }): Promise<{
18
+ pat: PersonalAccessTokenModel;
19
+ plaintext: string;
20
+ }>;
21
+ }
22
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export {};