@magiclabs.ai/magicbook-client 0.2.1 → 0.3.3

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,5 +1,5 @@
1
- import DesignRequest, { DesignRequestProps } from './design-request';
2
- export default class MagicBookClient {
1
+ import { DesignRequest, DesignRequestProps } from './design-request';
2
+ export declare class MagicBookClient {
3
3
  apiKey: string;
4
4
  constructor(apiKey: string);
5
5
  createDesignRequest(designRequestProps?: DesignRequestProps): Promise<DesignRequest>;
@@ -0,0 +1,15 @@
1
+ export type ImageDensityOption = {
2
+ maxPageCount: number;
3
+ minPageCount: number;
4
+ maxImageCount: number;
5
+ avgImageCount: number;
6
+ minImageCount: number;
7
+ };
8
+ export type ImageDensityOptions = {
9
+ high: ImageDensityOption;
10
+ medium: ImageDensityOption;
11
+ low: ImageDensityOption;
12
+ };
13
+ export type DesignOptions = {
14
+ densities: ImageDensityOptions;
15
+ };
@@ -0,0 +1,49 @@
1
+ import { BookCreationRequest } from '../galleon';
2
+ import { BookSizes, CoverTypes, EmbellishmentLevels, ImageDensities, ImageFilterings, Occasions, PageTypes, States, Styles, TextStickerLevels } from '../../data/design-request';
3
+ import { DesignOptions } from './design-options';
4
+ import { Images } from './image';
5
+ export type Occasion = typeof Occasions[number];
6
+ export type Style = typeof Styles[number];
7
+ export type BookSize = typeof BookSizes[number];
8
+ export type CoverType = typeof CoverTypes[number];
9
+ export type PageType = typeof PageTypes[number];
10
+ export type ImageDensity = typeof ImageDensities[number];
11
+ export type ImageFiltering = typeof ImageFilterings[number];
12
+ export type EmbellishmentLevel = typeof EmbellishmentLevels[number];
13
+ export type TextStickerLevel = typeof TextStickerLevels[number];
14
+ export type DesignRequestProps = {
15
+ title?: string;
16
+ occasion?: Occasion;
17
+ style?: Style;
18
+ bookSize?: BookSize;
19
+ coverType?: CoverType;
20
+ pageType?: PageType;
21
+ imageDensity?: ImageDensity;
22
+ imageFiltering?: ImageFiltering;
23
+ embellishmentLevel?: EmbellishmentLevel;
24
+ textStickerLevel?: TextStickerLevel;
25
+ };
26
+ export type State = typeof States[number];
27
+ export type DesignRequestEventDetail = {
28
+ state: State;
29
+ };
30
+ export type DesignRequestEvent = CustomEvent<DesignRequestEventDetail>;
31
+ export declare class DesignRequest {
32
+ id: string;
33
+ title?: string;
34
+ occasion?: Occasion;
35
+ style?: Style;
36
+ bookSize?: BookSize;
37
+ coverType?: CoverType;
38
+ pageType?: PageType;
39
+ imageDensity?: ImageDensity;
40
+ imageFiltering?: ImageFiltering;
41
+ embellishmentLevel?: EmbellishmentLevel;
42
+ textStickerLevel?: TextStickerLevel;
43
+ images: Images;
44
+ constructor(id: string, designRequestProps?: DesignRequestProps);
45
+ getOptions(imageCount: number): Promise<DesignOptions>;
46
+ submit(submitDesignRequest?: DesignRequestProps): Promise<DesignRequest>;
47
+ getJSON(): Promise<BookCreationRequest>;
48
+ startFakeProgress(): void;
49
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magiclabs.ai/magicbook-client",
3
3
  "private": false,
4
- "version": "0.2.1",
4
+ "version": "0.3.3",
5
5
  "description": "TypeScript package to create photo books with the Magicbook API.",
6
6
  "type": "module",
7
7
  "main": "./magicbook-client.umd.cjs",
@@ -26,21 +26,21 @@
26
26
  "coverage": "vitest run --coverage"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^18.15.10",
30
- "@typescript-eslint/eslint-plugin": "^5.57.0",
31
- "@typescript-eslint/parser": "^5.57.0",
32
- "@vitest/coverage-c8": "^0.29.8",
33
- "@vitest/coverage-istanbul": "^0.29.8",
34
- "@vitest/ui": "^0.29.8",
29
+ "@types/node": "^18.15.11",
30
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
31
+ "@typescript-eslint/parser": "^5.58.0",
32
+ "@vitest/coverage-c8": "^0.30.1",
33
+ "@vitest/coverage-istanbul": "^0.30.1",
34
+ "@vitest/ui": "^0.30.1",
35
35
  "eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
36
36
  "jsdom": "^21.1.1",
37
- "typescript": "^5.0.2",
37
+ "typescript": "^5.0.4",
38
38
  "vite": "^4.2.1",
39
- "vite-plugin-dts": "^2.1.0",
40
- "vitest": "^0.29.8"
39
+ "vite-plugin-dts": "^2.3.0",
40
+ "vitest": "^0.30.1"
41
41
  },
42
42
  "dependencies": {
43
43
  "@faker-js/faker": "^7.6.0",
44
- "axios": "^1.3.4"
44
+ "axios": "^1.3.5"
45
45
  }
46
46
  }
@@ -1,2 +0,0 @@
1
- import { BookCreationRequest } from '../models/nautilus';
2
- export declare const nautilusJSON: BookCreationRequest;
@@ -1,34 +0,0 @@
1
- import { BookCreationRequest } from './nautilus';
2
- import { Images } from './image';
3
- export type DesignRequestProps = {
4
- title?: string;
5
- occasion?: string;
6
- style?: string;
7
- bookFormat?: string;
8
- coverType?: string;
9
- pageType?: string;
10
- imageDensity?: string;
11
- embellishmentLevel?: string;
12
- textStickerLevel?: string;
13
- };
14
- export type DesignRequestEventDetail = {
15
- state: 'new' | 'designing' | 'completed' | 'canceled' | 'error';
16
- };
17
- export type DesignRequestEvent = CustomEvent<DesignRequestEventDetail>;
18
- export default class DesignRequest {
19
- id: string;
20
- title?: string;
21
- occasion?: string;
22
- style?: string;
23
- bookFormat?: string;
24
- coverType?: string;
25
- pageType?: string;
26
- imageDensity?: string;
27
- embellishmentLevel?: string;
28
- textStickerLevel?: string;
29
- images: Images;
30
- constructor(id: string, designRequestProps?: DesignRequestProps);
31
- submit(submitDesignRequest?: DesignRequestProps): Promise<DesignRequest>;
32
- getJSON(): Promise<BookCreationRequest>;
33
- startFakeProgress(): void;
34
- }
File without changes