swell-js 5.3.0 → 5.4.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.
- package/dist/api.mjs +1 -1
- package/dist/swell.cjs +1 -1
- package/dist/swell.umd.min.js +1 -1
- package/package.json +1 -1
- package/types/category/camel.ts +6 -2
- package/types/category/snake.ts +2 -2
- package/types/content/camel.ts +33 -2
- package/types/content/index.ts +33 -3
- package/types/content/snake.ts +44 -1
- package/types/index.d.ts +19 -0
- package/types/product/camel.ts +5 -3
- package/types/product/index.ts +0 -4
- package/types/product/snake.ts +1 -18
- package/types/user/camel.ts +4 -0
- package/types/user/index.ts +8 -0
- package/types/user/snake.ts +6 -0
package/dist/api.mjs
CHANGED
package/dist/swell.cjs
CHANGED
|
@@ -12172,7 +12172,7 @@ function swell(initStore = undefined, initKey, initOptions = {}) {
|
|
|
12172
12172
|
const api = {};
|
|
12173
12173
|
|
|
12174
12174
|
Object.assign(api, {
|
|
12175
|
-
version: '5.
|
|
12175
|
+
version: '5.4.0',
|
|
12176
12176
|
options,
|
|
12177
12177
|
request,
|
|
12178
12178
|
|
package/dist/swell.umd.min.js
CHANGED
|
@@ -17617,7 +17617,7 @@
|
|
|
17617
17617
|
const api = {};
|
|
17618
17618
|
|
|
17619
17619
|
Object.assign(api, {
|
|
17620
|
-
version: '5.
|
|
17620
|
+
version: '5.4.0',
|
|
17621
17621
|
options,
|
|
17622
17622
|
request,
|
|
17623
17623
|
|
package/package.json
CHANGED
package/types/category/camel.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ConvertSnakeToCamelCase,
|
|
3
|
+
ResultsResponseCamel,
|
|
4
|
+
ImageCamel,
|
|
5
|
+
} from '..';
|
|
2
6
|
import type { Replace } from '../utils';
|
|
3
7
|
|
|
4
|
-
import type { ProductCamel
|
|
8
|
+
import type { ProductCamel } from '../product/camel';
|
|
5
9
|
|
|
6
10
|
import type { Category } from './snake';
|
|
7
11
|
|
package/types/category/snake.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BaseModel, ResultsResponse } from '..';
|
|
1
|
+
import type { BaseModel, ResultsResponse, Image } from '..';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Product } from '../product';
|
|
4
4
|
|
|
5
5
|
export interface Category extends BaseModel {
|
|
6
6
|
active?: boolean;
|
package/types/content/camel.ts
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
import type { ConvertSnakeToCamelCase } from '..';
|
|
1
|
+
import type { ConvertSnakeToCamelCase, ImageCamel } from '..';
|
|
2
|
+
import type { Replace } from '../utils';
|
|
2
3
|
|
|
3
|
-
import type {
|
|
4
|
+
import type { CategoryCamel } from '../category';
|
|
5
|
+
import type { UserCamel } from '../user';
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
Content,
|
|
9
|
+
ContentSection,
|
|
10
|
+
ContentPage,
|
|
11
|
+
ContentBlog,
|
|
12
|
+
ContentBlogCategory,
|
|
13
|
+
} from './snake';
|
|
4
14
|
|
|
5
15
|
export type ContentCamel = ConvertSnakeToCamelCase<Content>;
|
|
6
16
|
export type ContentSectionCamel = ConvertSnakeToCamelCase<ContentSection>;
|
|
17
|
+
export type ContentPageCamel = ConvertSnakeToCamelCase<ContentPage>;
|
|
18
|
+
|
|
19
|
+
export type ContentBlogCamel = ConvertSnakeToCamelCase<
|
|
20
|
+
Replace<
|
|
21
|
+
ContentBlog,
|
|
22
|
+
{
|
|
23
|
+
author?: UserCamel;
|
|
24
|
+
category?: CategoryCamel;
|
|
25
|
+
image?: ImageCamel;
|
|
26
|
+
}
|
|
27
|
+
>
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export type ContentBlogCategoryCamel = ConvertSnakeToCamelCase<
|
|
31
|
+
Replace<
|
|
32
|
+
ContentBlogCategory,
|
|
33
|
+
{
|
|
34
|
+
blogs?: ContentBlogCamel[];
|
|
35
|
+
}
|
|
36
|
+
>
|
|
37
|
+
>;
|
package/types/content/index.ts
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import type { MakeCase } from '../utils';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type {
|
|
4
|
+
Content,
|
|
5
|
+
ContentSection,
|
|
6
|
+
ContentPage,
|
|
7
|
+
ContentBlog,
|
|
8
|
+
ContentBlogCategory,
|
|
9
|
+
} from './snake';
|
|
10
|
+
import type {
|
|
11
|
+
ContentCamel,
|
|
12
|
+
ContentSectionCamel,
|
|
13
|
+
ContentPageCamel,
|
|
14
|
+
ContentBlogCamel,
|
|
15
|
+
ContentBlogCategoryCamel,
|
|
16
|
+
} from './camel';
|
|
5
17
|
|
|
6
18
|
export type ContentCase = MakeCase<Content, ContentCamel>;
|
|
19
|
+
export type ContentSectionCase = MakeCase<ContentSection, ContentSectionCamel>;
|
|
20
|
+
export type ContentPageCase = MakeCase<ContentPage, ContentPageCamel>;
|
|
21
|
+
export type ContentBlogCase = MakeCase<ContentBlog, ContentBlogCamel>;
|
|
22
|
+
export type ContentBlogCategoryCase = MakeCase<
|
|
23
|
+
ContentBlogCategory,
|
|
24
|
+
ContentBlogCategoryCamel
|
|
25
|
+
>;
|
|
7
26
|
|
|
8
|
-
export type {
|
|
27
|
+
export type {
|
|
28
|
+
Content,
|
|
29
|
+
ContentSection,
|
|
30
|
+
ContentPage,
|
|
31
|
+
ContentBlog,
|
|
32
|
+
ContentBlogCategory,
|
|
33
|
+
ContentCamel,
|
|
34
|
+
ContentSectionCamel,
|
|
35
|
+
ContentPageCamel,
|
|
36
|
+
ContentBlogCamel,
|
|
37
|
+
ContentBlogCategoryCamel,
|
|
38
|
+
};
|
package/types/content/snake.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { BaseModel } from '..';
|
|
1
|
+
import type { BaseModel, Image } from '..';
|
|
2
|
+
|
|
3
|
+
import type { Category } from '../category';
|
|
4
|
+
import type { User } from '../user';
|
|
2
5
|
|
|
3
6
|
export interface ContentSection {
|
|
4
7
|
id: string;
|
|
@@ -15,3 +18,43 @@ export interface Content extends BaseModel {
|
|
|
15
18
|
slug?: string;
|
|
16
19
|
sections?: ContentSection[];
|
|
17
20
|
}
|
|
21
|
+
|
|
22
|
+
export interface ContentPage extends BaseModel {
|
|
23
|
+
title: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
published?: boolean;
|
|
28
|
+
date_published?: string;
|
|
29
|
+
meta_title?: string;
|
|
30
|
+
meta_description?: string;
|
|
31
|
+
meta_keywords?: string;
|
|
32
|
+
theme_template?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ContentBlog extends BaseModel {
|
|
36
|
+
title: string;
|
|
37
|
+
slug: string;
|
|
38
|
+
author_id: string;
|
|
39
|
+
author?: User;
|
|
40
|
+
category_id: string;
|
|
41
|
+
category?: Category;
|
|
42
|
+
content?: string;
|
|
43
|
+
summary?: string;
|
|
44
|
+
image?: Image;
|
|
45
|
+
tags?: string[];
|
|
46
|
+
published?: boolean;
|
|
47
|
+
meta_title?: string;
|
|
48
|
+
meta_description?: string;
|
|
49
|
+
meta_keywords?: string;
|
|
50
|
+
theme_template?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ContentBlogCategory extends BaseModel {
|
|
54
|
+
title: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
blogs?: ContentBlog[];
|
|
57
|
+
meta_title?: string;
|
|
58
|
+
meta_description?: string;
|
|
59
|
+
meta_keywords?: string;
|
|
60
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -162,6 +162,25 @@ export interface ItemDiscount {
|
|
|
162
162
|
amount?: number;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
export interface Image {
|
|
166
|
+
caption?: string;
|
|
167
|
+
file?: {
|
|
168
|
+
content_type?: string;
|
|
169
|
+
date_uploaded?: string;
|
|
170
|
+
filename?: string;
|
|
171
|
+
height?: number;
|
|
172
|
+
length?: number;
|
|
173
|
+
metadata?: object;
|
|
174
|
+
md5?: string;
|
|
175
|
+
private?: boolean;
|
|
176
|
+
url?: string;
|
|
177
|
+
width?: number;
|
|
178
|
+
};
|
|
179
|
+
id?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type ImageCamel = ConvertSnakeToCamelCase<Image>;
|
|
183
|
+
|
|
165
184
|
export interface SwellError {
|
|
166
185
|
code: string;
|
|
167
186
|
message: string;
|
package/types/product/camel.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ConvertSnakeToCamelCase,
|
|
3
|
+
ResultsResponseCamel,
|
|
4
|
+
ImageCamel,
|
|
5
|
+
} from '..';
|
|
2
6
|
import type { Replace } from '../utils';
|
|
3
7
|
|
|
4
8
|
import type { AttributeCamel } from '../attribute/camel';
|
|
@@ -6,7 +10,6 @@ import type { AttributeCamel } from '../attribute/camel';
|
|
|
6
10
|
import type {
|
|
7
11
|
Product,
|
|
8
12
|
Variant,
|
|
9
|
-
Image,
|
|
10
13
|
Price,
|
|
11
14
|
Upsell,
|
|
12
15
|
ProductOption,
|
|
@@ -54,7 +57,6 @@ export type ProductOptionCamel = ConvertSnakeToCamelCase<
|
|
|
54
57
|
>;
|
|
55
58
|
|
|
56
59
|
export type UpsellCamel = ConvertSnakeToCamelCase<Upsell>;
|
|
57
|
-
export type ImageCamel = ConvertSnakeToCamelCase<Image>;
|
|
58
60
|
export type PriceCamel = ConvertSnakeToCamelCase<Price>;
|
|
59
61
|
|
|
60
62
|
export type VariantCamel = ConvertSnakeToCamelCase<
|
package/types/product/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { MakeCase } from '../utils';
|
|
|
4
4
|
import type {
|
|
5
5
|
Product,
|
|
6
6
|
Variant,
|
|
7
|
-
Image,
|
|
8
7
|
Price,
|
|
9
8
|
Upsell,
|
|
10
9
|
ProductOption,
|
|
@@ -16,7 +15,6 @@ import type {
|
|
|
16
15
|
import type {
|
|
17
16
|
ProductCamel,
|
|
18
17
|
VariantCamel,
|
|
19
|
-
ImageCamel,
|
|
20
18
|
PriceCamel,
|
|
21
19
|
UpsellCamel,
|
|
22
20
|
ProductOptionCamel,
|
|
@@ -53,7 +51,6 @@ export type ProductCase = MakeCase<Product, ProductCamel>;
|
|
|
53
51
|
export type {
|
|
54
52
|
Product,
|
|
55
53
|
Variant,
|
|
56
|
-
Image,
|
|
57
54
|
Price,
|
|
58
55
|
Upsell,
|
|
59
56
|
ProductOption,
|
|
@@ -62,7 +59,6 @@ export type {
|
|
|
62
59
|
CrossSell,
|
|
63
60
|
ProductCamel,
|
|
64
61
|
VariantCamel,
|
|
65
|
-
ImageCamel,
|
|
66
62
|
PriceCamel,
|
|
67
63
|
UpsellCamel,
|
|
68
64
|
ProductOptionCamel,
|
package/types/product/snake.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseModel, ResultsResponse } from '../index';
|
|
1
|
+
import type { BaseModel, ResultsResponse, Image } from '../index';
|
|
2
2
|
|
|
3
3
|
import type { Attribute } from '../attribute';
|
|
4
4
|
|
|
@@ -70,23 +70,6 @@ export interface Upsell {
|
|
|
70
70
|
product_id?: string;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export interface Image {
|
|
74
|
-
caption?: string;
|
|
75
|
-
file?: {
|
|
76
|
-
content_type?: string;
|
|
77
|
-
date_uploaded?: string;
|
|
78
|
-
filename?: string;
|
|
79
|
-
height?: number;
|
|
80
|
-
length?: number;
|
|
81
|
-
metadata?: object;
|
|
82
|
-
md5?: string;
|
|
83
|
-
private?: boolean;
|
|
84
|
-
url?: string;
|
|
85
|
-
width?: number;
|
|
86
|
-
};
|
|
87
|
-
id?: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
73
|
export interface Price {
|
|
91
74
|
account_group?: string;
|
|
92
75
|
price?: number;
|