@malevich-studio/strapi-sdk-typescript 1.2.27 → 1.2.29
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/cli.cjs +22543 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +22523 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/generator/attributes/base-relation.d.ts +11 -0
- package/dist/generator/attributes/base.d.ts +27 -0
- package/dist/generator/attributes/blocks.d.ts +13 -0
- package/dist/generator/attributes/boolean.d.ts +11 -0
- package/dist/generator/attributes/component.d.ts +20 -0
- package/dist/generator/attributes/date-time.d.ts +11 -0
- package/dist/generator/attributes/date.d.ts +11 -0
- package/dist/generator/attributes/dynamiczone.d.ts +18 -0
- package/dist/generator/attributes/enumeration.d.ts +13 -0
- package/dist/generator/attributes/index.d.ts +5 -0
- package/dist/generator/attributes/json.d.ts +12 -0
- package/dist/generator/attributes/media.d.ts +22 -0
- package/dist/generator/attributes/number.d.ts +13 -0
- package/dist/generator/attributes/relation.d.ts +48 -0
- package/dist/generator/attributes/string.d.ts +14 -0
- package/dist/generator/attributes/time.d.ts +11 -0
- package/dist/generator/index.d.ts +5 -0
- package/dist/generator/utils/get-component-name.d.ts +5 -0
- package/dist/generator/utils/get-content-type-name.d.ts +5 -0
- package/dist/index.cjs +21465 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +201 -0
- package/dist/index.mjs +21463 -0
- package/dist/index.mjs.map +1 -0
- package/dist/logger.d.ts +2 -0
- package/dist/server.d.ts +10 -0
- package/package.json +7 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base, { AttributeMode } from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export default class BaseRelation extends Base {
|
|
4
|
+
protected readonly name: string;
|
|
5
|
+
protected readonly attribute: BaseAttribute;
|
|
6
|
+
constructor(name: string, attribute: BaseAttribute);
|
|
7
|
+
getType(): string;
|
|
8
|
+
getFields(): string[];
|
|
9
|
+
getSortFields(): string[];
|
|
10
|
+
getMode(): AttributeMode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type BaseAttribute = {
|
|
2
|
+
configurable?: boolean;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
private?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare enum AttributeMode {
|
|
7
|
+
Field = "field",
|
|
8
|
+
Relation = "relation"
|
|
9
|
+
}
|
|
10
|
+
export type FieldType = {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
export default class Base {
|
|
15
|
+
protected readonly name: string;
|
|
16
|
+
protected readonly attribute: BaseAttribute;
|
|
17
|
+
constructor(name: string, attribute: BaseAttribute);
|
|
18
|
+
getType(): string;
|
|
19
|
+
getInputType(): string;
|
|
20
|
+
getImports(): string[];
|
|
21
|
+
getPackages(): string[];
|
|
22
|
+
getFields(): string[];
|
|
23
|
+
getSortFields(): string[];
|
|
24
|
+
getPopulates(): FieldType[];
|
|
25
|
+
getFilters(): FieldType[];
|
|
26
|
+
getMode(): AttributeMode;
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type BlocksAttribute = BaseAttribute & {
|
|
4
|
+
type: 'blocks';
|
|
5
|
+
};
|
|
6
|
+
export default class Blocks extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: BlocksAttribute;
|
|
9
|
+
constructor(name: string, attribute: BlocksAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
getImports(): string[];
|
|
12
|
+
getPackages(): string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type BooleanAttribute = BaseAttribute & {
|
|
4
|
+
type: 'boolean';
|
|
5
|
+
};
|
|
6
|
+
export default class Boolean extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: BooleanAttribute;
|
|
9
|
+
constructor(name: string, attribute: BooleanAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseAttribute, FieldType } from "@/generator/attributes/base";
|
|
2
|
+
import BaseRelation from "@/generator/attributes/base-relation";
|
|
3
|
+
export type ComponentAttribute = BaseAttribute & {
|
|
4
|
+
type: 'component';
|
|
5
|
+
repeatable: boolean;
|
|
6
|
+
component: string;
|
|
7
|
+
min?: number;
|
|
8
|
+
};
|
|
9
|
+
export default class Component extends BaseRelation {
|
|
10
|
+
protected readonly name: string;
|
|
11
|
+
protected readonly attribute: ComponentAttribute;
|
|
12
|
+
constructor(name: string, attribute: ComponentAttribute);
|
|
13
|
+
getType(): string;
|
|
14
|
+
getInputType(): string;
|
|
15
|
+
getPopulates(): {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[];
|
|
19
|
+
getFilters(): FieldType[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type DateTimeAttribute = BaseAttribute & {
|
|
4
|
+
type: 'datetime';
|
|
5
|
+
};
|
|
6
|
+
export default class DateTime extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: DateTimeAttribute;
|
|
9
|
+
constructor(name: string, attribute: DateTimeAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type DateAttribute = BaseAttribute & {
|
|
4
|
+
type: 'date';
|
|
5
|
+
};
|
|
6
|
+
export default class Date extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: DateAttribute;
|
|
9
|
+
constructor(name: string, attribute: DateAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BaseAttribute, FieldType } from "@/generator/attributes/base";
|
|
2
|
+
import BaseRelation from "@/generator/attributes/base-relation";
|
|
3
|
+
export type DynamiczoneAttribute = BaseAttribute & {
|
|
4
|
+
type: 'dynamiczone';
|
|
5
|
+
components: string[];
|
|
6
|
+
};
|
|
7
|
+
export default class Dynamiczone extends BaseRelation {
|
|
8
|
+
protected readonly name: string;
|
|
9
|
+
protected readonly attribute: DynamiczoneAttribute;
|
|
10
|
+
constructor(name: string, attribute: DynamiczoneAttribute);
|
|
11
|
+
getType(): string;
|
|
12
|
+
getInputType(): string;
|
|
13
|
+
getPopulates(): {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
}[];
|
|
17
|
+
getFilters(): FieldType[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type EnumerationAttribute = BaseAttribute & {
|
|
4
|
+
type: 'enumeration';
|
|
5
|
+
enum: string[];
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
export default class Enumeration extends Base {
|
|
9
|
+
protected readonly name: string;
|
|
10
|
+
protected readonly attribute: EnumerationAttribute;
|
|
11
|
+
constructor(name: string, attribute: EnumerationAttribute);
|
|
12
|
+
getType(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type JsonAttribute = BaseAttribute & {
|
|
4
|
+
type: 'json';
|
|
5
|
+
};
|
|
6
|
+
export default class Json extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: JsonAttribute;
|
|
9
|
+
constructor(name: string, attribute: JsonAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
getFilters(): never[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
2
|
+
import BaseRelation from "@/generator/attributes/base-relation";
|
|
3
|
+
export type MediaAttribute = BaseAttribute & {
|
|
4
|
+
type: 'media';
|
|
5
|
+
multiple: boolean;
|
|
6
|
+
allowedTypes: string[];
|
|
7
|
+
};
|
|
8
|
+
export default class Media extends BaseRelation {
|
|
9
|
+
protected readonly name: string;
|
|
10
|
+
protected readonly attribute: MediaAttribute;
|
|
11
|
+
constructor(name: string, attribute: MediaAttribute);
|
|
12
|
+
getType(): "File[]" | "File";
|
|
13
|
+
getInputType(): string;
|
|
14
|
+
getPopulates(): {
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}[];
|
|
18
|
+
getFilters(): {
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type NumberAttribute = BaseAttribute & {
|
|
4
|
+
type: 'integer' | 'biginteger' | 'decimal';
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
};
|
|
8
|
+
export default class Number extends Base {
|
|
9
|
+
protected readonly name: string;
|
|
10
|
+
protected readonly attribute: NumberAttribute;
|
|
11
|
+
constructor(name: string, attribute: NumberAttribute);
|
|
12
|
+
getType(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
2
|
+
import BaseRelation from "@/generator/attributes/base-relation";
|
|
3
|
+
export declare enum AttributeRelation {
|
|
4
|
+
MorphToMany = "morphToMany",
|
|
5
|
+
ManyToOne = "manyToOne",
|
|
6
|
+
ManyToMany = "manyToMany",
|
|
7
|
+
OneToMany = "oneToMany",
|
|
8
|
+
OneToOne = "oneToOne"
|
|
9
|
+
}
|
|
10
|
+
type RelationData = {
|
|
11
|
+
documentId: string;
|
|
12
|
+
before?: string;
|
|
13
|
+
after?: string;
|
|
14
|
+
start?: true;
|
|
15
|
+
end?: true;
|
|
16
|
+
locale?: string;
|
|
17
|
+
status?: 'published' | 'draft';
|
|
18
|
+
} | string;
|
|
19
|
+
export type RelationInput = {
|
|
20
|
+
connect?: RelationData[];
|
|
21
|
+
disconnect?: RelationData[];
|
|
22
|
+
set?: RelationData[];
|
|
23
|
+
} | RelationData[];
|
|
24
|
+
export type RelationAttribute = BaseAttribute & {
|
|
25
|
+
type: 'relation';
|
|
26
|
+
relation: AttributeRelation;
|
|
27
|
+
target: string;
|
|
28
|
+
targetAttribute?: string;
|
|
29
|
+
inversedBy?: string;
|
|
30
|
+
mappedBy?: string;
|
|
31
|
+
};
|
|
32
|
+
export default class Relation extends BaseRelation {
|
|
33
|
+
protected readonly name: string;
|
|
34
|
+
protected readonly attribute: RelationAttribute;
|
|
35
|
+
constructor(name: string, attribute: RelationAttribute);
|
|
36
|
+
getType(): string;
|
|
37
|
+
getInputType(): string;
|
|
38
|
+
getPopulates(): {
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
}[];
|
|
42
|
+
getFilters(): {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
}[];
|
|
46
|
+
getImports(): string[];
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type StringAttribute = BaseAttribute & {
|
|
4
|
+
type: 'text' | 'string' | 'password' | 'email';
|
|
5
|
+
minLength?: number;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
searchable?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export default class String extends Base {
|
|
10
|
+
protected readonly name: string;
|
|
11
|
+
protected readonly attribute: StringAttribute;
|
|
12
|
+
constructor(name: string, attribute: StringAttribute);
|
|
13
|
+
getType(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base from "@/generator/attributes/base";
|
|
2
|
+
import type { BaseAttribute } from "@/generator/attributes/base";
|
|
3
|
+
export type TimeAttribute = BaseAttribute & {
|
|
4
|
+
type: 'time';
|
|
5
|
+
};
|
|
6
|
+
export default class Time extends Base {
|
|
7
|
+
protected readonly name: string;
|
|
8
|
+
protected readonly attribute: TimeAttribute;
|
|
9
|
+
constructor(name: string, attribute: TimeAttribute);
|
|
10
|
+
getType(): string;
|
|
11
|
+
}
|