@betty-blocks/cli 26.0.0-alpha.2 → 26.0.0-alpha.4

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 (91) hide show
  1. package/build/bb-blocks-new.d.ts +1 -0
  2. package/build/bb-blocks-publish.d.ts +1 -0
  3. package/build/bb-blocks-publish.js +6 -6
  4. package/build/bb-blocks-publish.js.map +1 -1
  5. package/build/bb-blocks-release.d.ts +1 -0
  6. package/build/bb-blocks.d.ts +1 -0
  7. package/build/bb-bundle-init.d.ts +1 -0
  8. package/build/bb-bundle.d.ts +1 -0
  9. package/build/bb-components-build.d.ts +1 -0
  10. package/build/bb-components-create.d.ts +1 -0
  11. package/build/bb-components-generate.d.ts +1 -0
  12. package/build/bb-components-publish-bundle.d.ts +1 -0
  13. package/build/bb-components-publish.d.ts +1 -0
  14. package/build/bb-components-serve.d.ts +1 -0
  15. package/build/bb-components.d.ts +1 -0
  16. package/build/bb-functions-bump.d.ts +1 -0
  17. package/build/bb-functions-init.d.ts +1 -0
  18. package/build/bb-functions-login.d.ts +1 -0
  19. package/build/bb-functions-logout.d.ts +1 -0
  20. package/build/bb-functions-new.d.ts +1 -0
  21. package/build/bb-functions-publish.d.ts +1 -0
  22. package/build/bb-functions-publish.js +2 -20
  23. package/build/bb-functions-publish.js.map +1 -1
  24. package/build/bb-functions-validate.d.ts +1 -0
  25. package/build/bb-functions.d.ts +1 -0
  26. package/build/bb.d.ts +2 -0
  27. package/build/blocks/blockDefinitions.d.ts +10 -0
  28. package/build/blocks/blockDefinitions.js +13 -6
  29. package/build/blocks/blockDefinitions.js.map +1 -1
  30. package/build/blocks/publishBlocks.d.ts +2 -0
  31. package/build/blocks/publishBlocks.js +1 -1
  32. package/build/blocks/publishBlocks.js.map +1 -1
  33. package/build/blocks/releaseBlocks.d.ts +5 -0
  34. package/build/components/bb-components-functions.d.ts +10 -0
  35. package/build/components/comments.d.ts +3 -0
  36. package/build/components/compatibility.d.ts +7 -0
  37. package/build/components/transformers/index.d.ts +3 -0
  38. package/build/components-build/index.d.ts +2 -0
  39. package/build/components-build/reportDiagnostics.d.ts +2 -0
  40. package/build/components-build/styles.d.ts +4 -0
  41. package/build/functions/config.d.ts +67 -0
  42. package/build/functions/createWasmDefinitionFiles.d.ts +4 -0
  43. package/build/functions/functionDefinitions.d.ts +23 -0
  44. package/build/functions/functionDefinitions.js +25 -12
  45. package/build/functions/functionDefinitions.js.map +1 -1
  46. package/build/functions/functionVersionBump.d.ts +19 -0
  47. package/build/functions/functionVersionBump.js +16 -13
  48. package/build/functions/functionVersionBump.js.map +1 -1
  49. package/build/functions/publishAppFunctions.d.ts +13 -0
  50. package/build/functions/publishAppFunctions.js +2 -2
  51. package/build/functions/publishAppFunctions.js.map +1 -1
  52. package/build/functions/publishWasmBlockStoreFunctions.d.ts +1 -0
  53. package/build/functions/publishWasmBlockStoreFunctions.js +2 -1
  54. package/build/functions/publishWasmBlockStoreFunctions.js.map +1 -1
  55. package/build/functions/utils.d.ts +2 -0
  56. package/build/functions/validateFunctions.d.ts +3 -0
  57. package/build/functions/validateFunctions.js +20 -0
  58. package/build/functions/validateFunctions.js.map +1 -0
  59. package/build/functions/validations.d.ts +30 -0
  60. package/build/functions/validations.js +1 -1
  61. package/build/functions/validations.js.map +1 -1
  62. package/build/interactions/compatibility.d.ts +3 -0
  63. package/build/interactions/diagnostics.d.ts +2 -0
  64. package/build/types.d.ts +377 -0
  65. package/build/utils/arguments.d.ts +2 -0
  66. package/build/utils/checkPackageVersion.d.ts +1 -0
  67. package/build/utils/checkUpdateAvailable.d.ts +1 -0
  68. package/build/utils/fusionAuth.d.ts +21 -0
  69. package/build/utils/hash.d.ts +2 -0
  70. package/build/utils/login.d.ts +15 -0
  71. package/build/utils/pick.d.ts +7 -0
  72. package/build/utils/readFilesByType.d.ts +2 -0
  73. package/build/utils/rootDir.d.ts +2 -0
  74. package/build/utils/serveComponentSet.d.ts +3 -0
  75. package/build/utils/transpile.d.ts +2 -0
  76. package/build/utils/uploadBlob.d.ts +24 -0
  77. package/build/utils/validation.d.ts +4 -0
  78. package/build/validations/component.d.ts +3 -0
  79. package/build/validations/constants.d.ts +16 -0
  80. package/build/validations/function-block-validations/index.d.ts +22 -0
  81. package/build/validations/interaction.d.ts +3 -0
  82. package/build/validations/prefab/action.d.ts +2 -0
  83. package/build/validations/prefab/component.d.ts +10 -0
  84. package/build/validations/prefab/componentOption.d.ts +3 -0
  85. package/build/validations/prefab/interaction.d.ts +2 -0
  86. package/build/validations/prefab/linkedOption.d.ts +3 -0
  87. package/build/validations/prefab/linkedPartial.d.ts +3 -0
  88. package/build/validations/prefab/variable.d.ts +3 -0
  89. package/build/validations/prefab.d.ts +17 -0
  90. package/build/validations/styles.d.ts +6 -0
  91. package/package.json +1 -3
@@ -0,0 +1,21 @@
1
+ import { type WebheadRequestOptions } from 'webhead';
2
+ import Config from '../functions/config';
3
+ declare class FusionAuth {
4
+ private configFile;
5
+ private config;
6
+ loginId?: string;
7
+ password?: string;
8
+ private relogin;
9
+ private webhead;
10
+ constructor(config: Config, relogin: () => Promise<void>);
11
+ ensureLogin(): Promise<void>;
12
+ login(): Promise<void>;
13
+ complete2FA(twoFactorId: string): Promise<void>;
14
+ upload(config: Config, zipFile: string, functionsJson: string): Promise<boolean>;
15
+ get<T>(urlPath: string, options: WebheadRequestOptions): Promise<T>;
16
+ post<T>(urlPath: string, options: WebheadRequestOptions): Promise<T>;
17
+ private request;
18
+ private storeTokens;
19
+ private jwt;
20
+ }
21
+ export default FusionAuth;
@@ -0,0 +1,2 @@
1
+ declare const _default: (map: unknown) => string;
2
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import Config from '../functions/config';
2
+ declare class FusionAuth {
3
+ private config;
4
+ constructor(config: Config);
5
+ logout(): void;
6
+ login(): Promise<boolean>;
7
+ ensureLogin(): Promise<void>;
8
+ jwt(): string | undefined;
9
+ ensure2FA(twoFactorId: string): Promise<void>;
10
+ storeToken(token: string): void;
11
+ clearTokens(): void;
12
+ tokenExists(): boolean;
13
+ jwtKey(): string;
14
+ }
15
+ export default FusionAuth;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates an object composed of the picked object properties.
3
+ * @param object The source object.
4
+ * @param keys The property keys to pick.
5
+ * @returns The new object.
6
+ */
7
+ export declare const pick: <T extends Record<string, unknown>, K extends keyof T>(object: T, keys: K[]) => Pick<T, K>;
@@ -0,0 +1,2 @@
1
+ declare const _default: (dir: string, extension?: string, buildAllFiles?: boolean) => Promise<string[]>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const rootDir: () => string;
2
+ export default rootDir;
@@ -0,0 +1,3 @@
1
+ import type { ServeOptions } from '../types';
2
+ declare const _default: (options: ServeOptions, hasOfflineFlag: boolean) => Promise<void>;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (code: string, keys: string[]) => string;
2
+ export default _default;
@@ -0,0 +1,24 @@
1
+ interface UploadBlobProps {
2
+ blobContainerName: string;
3
+ blobName: string;
4
+ blobContent: string;
5
+ blobContentType: string;
6
+ }
7
+ interface BlockBlobUploadResponse {
8
+ clientRequestId?: string;
9
+ contentMD5?: Uint8Array;
10
+ date?: Date;
11
+ encryptionKeySha256?: string;
12
+ encryptionScope?: string;
13
+ errorCode?: string;
14
+ eTag?: string;
15
+ isServerEncrypted?: boolean;
16
+ lastModified?: Date;
17
+ requestId?: string;
18
+ version?: string;
19
+ }
20
+ export interface BlockBlobUploadResponseExtended extends BlockBlobUploadResponse {
21
+ url: string;
22
+ }
23
+ declare const _default: ({ blobContainerName, blobName, blobContent, blobContentType, }: UploadBlobProps) => Promise<BlockBlobUploadResponseExtended>;
24
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import type { Component, Prefab } from '../types';
2
+ export declare const findDuplicates: <KString extends string & keyof T, KObject extends Record<string, KString | KObject>, K extends KString | KObject, T extends object>(list: T[], type: string, structure: K) => void;
3
+ export declare const checkNameReferences: (prefabs: Prefab[], components: Component[]) => void;
4
+ export declare const checkOptionCategoryReferences: (prefabs: Prefab[]) => void;
@@ -0,0 +1,3 @@
1
+ import type { Component } from '../types';
2
+ declare const _default: (components: Component[], validStyleTypes: string[]) => void;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ export declare const MAX_ACTIONS = 5;
2
+ export declare const MAX_VARIABLES = 20;
3
+ export declare const MAX_INTERACTIONS = 60;
4
+ export declare const MAX_ACTION_EVENTS = 50;
5
+ export declare const ICONS: string[];
6
+ export declare const OPTIONS: string[];
7
+ export declare const MEDIA_TYPES: string[];
8
+ export declare const CONDITION_TYPE: string[];
9
+ export declare const COMPARATORS: string[];
10
+ export declare const MODAL_TYPE: string[];
11
+ export declare const INHERIT_TYPES: string[];
12
+ export declare const CONFIGURATION_AS: string[];
13
+ export declare const INTERACTION_TYPE: string[];
14
+ export declare const EVENT_KIND_NEW_RUNTIME = "authenticate_user";
15
+ export declare const EVENT_KIND: string[];
16
+ export declare const VARIABLE_KIND: string[];
@@ -0,0 +1,22 @@
1
+ import { type Block } from '../../blocks/blockDefinitions';
2
+ import { type FunctionDefinition } from '../../functions/functionDefinitions';
3
+ export declare const validateBlockConfig: ({ functions }: Block) => boolean;
4
+ export declare const validateBlockDependencies: (dependencies: string[]) => {
5
+ valid: boolean;
6
+ invalidDependencies: string[];
7
+ };
8
+ export declare const getErrorMessage: ({ validFunctions, validBlockDependencies, validBlockName, invalidDependencies, blockName, }: {
9
+ blockName: string;
10
+ validFunctions: boolean;
11
+ validBlockDependencies: boolean;
12
+ validBlockName: boolean;
13
+ invalidDependencies: string[];
14
+ }) => string;
15
+ export declare const validateBlock: ({ block: { dependencies }, blockFunctions, blockName, }: {
16
+ block: Block;
17
+ blockFunctions: FunctionDefinition[];
18
+ blockName: string;
19
+ }) => Promise<{
20
+ errorMessage: string;
21
+ valid: boolean;
22
+ }>;
@@ -0,0 +1,3 @@
1
+ import type { Interaction } from '../types';
2
+ declare const _default: (interactions: Interaction[]) => void;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import Joi from 'joi';
2
+ export declare const actionSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,10 @@
1
+ import type { ComponentStyleMap, GroupedStyles, Prefab, PrefabReference } from '../../types';
2
+ type PrefabTypes = 'partial' | 'page' | undefined;
3
+ interface ValidateComponentProps {
4
+ styles: GroupedStyles;
5
+ componentStyleMap?: ComponentStyleMap;
6
+ availableComponentNames?: string[];
7
+ prefabType?: PrefabTypes;
8
+ }
9
+ export declare const validateComponent: ({ styles, componentStyleMap, availableComponentNames, prefabType, }: ValidateComponentProps) => (component: PrefabReference) => Prefab | unknown;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import Joi from 'joi';
2
+ export declare const optionSchema: Joi.ObjectSchema<any>;
3
+ export declare const optionCategorySchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,2 @@
1
+ import Joi from 'joi';
2
+ export declare const interactionSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,3 @@
1
+ import Joi from 'joi';
2
+ export declare const linkedOptionConfigurationSchema: Joi.ObjectSchema<any>;
3
+ export declare const linkedOptionSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,3 @@
1
+ import Joi from 'joi';
2
+ export declare const linkedPartialConfigurationSchema: Joi.ObjectSchema<any>;
3
+ export declare const linkedPartialSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,3 @@
1
+ import Joi from 'joi';
2
+ export declare const variableKindSchema: Joi.AlternativesSchema<any>;
3
+ export declare const variableSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,17 @@
1
+ import type { ComponentStyleMap, GroupedStyles, Prefab } from '../types';
2
+ interface ValidatePrefabProps extends SchemaProviderProps {
3
+ prefabs: Prefab[];
4
+ styles: GroupedStyles;
5
+ componentStyleMap?: ComponentStyleMap;
6
+ availableComponentNames?: string[];
7
+ prefabType?: PrefabTypes;
8
+ }
9
+ interface SchemaProviderProps {
10
+ styles: GroupedStyles;
11
+ componentStyleMap?: ComponentStyleMap;
12
+ availableComponentNames?: string[];
13
+ prefabType?: PrefabTypes;
14
+ }
15
+ export type PrefabTypes = 'partial' | 'page' | undefined;
16
+ declare const _default: ({ prefabs, styles, componentStyleMap, availableComponentNames, prefabType, }: ValidatePrefabProps) => void;
17
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import Joi from 'joi';
2
+ import { type StyleDefinition } from '../types';
3
+ export declare const contentSchema: Joi.ObjectSchema<any>;
4
+ export declare const overwriteSchema: Joi.ArraySchema<any[]>;
5
+ declare const _default: (styles: StyleDefinition[], componentNames: string[]) => void;
6
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betty-blocks/cli",
3
- "version": "26.0.0-alpha.2",
3
+ "version": "26.0.0-alpha.4",
4
4
  "description": "A Betty Blocks CLI",
5
5
  "module": "./build/bb.js",
6
6
  "type": "module",
@@ -32,7 +32,6 @@
32
32
  "@types/babel__traverse": "7.28.0",
33
33
  "@types/bun": "^1.2.23",
34
34
  "@types/fs-extra": "^8.0.0",
35
- "@types/glob": "^7.2.0",
36
35
  "@types/promise-sequential": "^1.1.2",
37
36
  "@types/semver": "^7.7.1",
38
37
  "app-root-path": "^2.2.1",
@@ -62,7 +61,6 @@
62
61
  "chalk": "^5.6.2",
63
62
  "commander": "^14.0.1",
64
63
  "fs-extra": "11.3.2",
65
- "glob": "^11.0.3",
66
64
  "joi": "18.0.1",
67
65
  "jsdoc-api": "^7.1.0",
68
66
  "jsonschema": "^1.5.0",