@malevich-studio/strapi-sdk-typescript 1.0.3 → 1.0.5

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 (48) hide show
  1. package/dist/cli.cjs +22278 -0
  2. package/dist/cli.cjs.map +1 -0
  3. package/dist/cli.d.ts +0 -1
  4. package/dist/cli.mjs +22258 -0
  5. package/dist/cli.mjs.map +1 -0
  6. package/dist/generate-strapi-types.d.ts +1 -1
  7. package/dist/generator/attributes/base-relation.d.ts +2 -1
  8. package/dist/generator/attributes/blocks.d.ts +2 -1
  9. package/dist/generator/attributes/boolean.d.ts +2 -1
  10. package/dist/generator/attributes/component.d.ts +2 -2
  11. package/dist/generator/attributes/date-time.d.ts +2 -1
  12. package/dist/generator/attributes/enumeration.d.ts +2 -1
  13. package/dist/generator/attributes/index.d.ts +2 -1
  14. package/dist/generator/attributes/json.d.ts +3 -2
  15. package/dist/generator/attributes/media.d.ts +3 -2
  16. package/dist/generator/attributes/number.d.ts +2 -1
  17. package/dist/generator/attributes/relation.d.ts +2 -2
  18. package/dist/generator/attributes/string.d.ts +2 -1
  19. package/dist/generator/index.d.ts +5 -0
  20. package/dist/index.cjs +21309 -0
  21. package/dist/index.cjs.map +1 -0
  22. package/dist/{main.d.ts → index.d.ts} +55 -7
  23. package/dist/index.mjs +21307 -0
  24. package/dist/index.mjs.map +1 -0
  25. package/dist/test.cjs +114 -0
  26. package/dist/test.cjs.map +1 -0
  27. package/dist/test.d.ts +1 -0
  28. package/dist/test.mjs +112 -0
  29. package/dist/test.mjs.map +1 -0
  30. package/package.json +27 -8
  31. package/dist/cli.js +0 -10
  32. package/dist/generate-strapi-types.js +0 -205
  33. package/dist/generator/attributes/base-relation.js +0 -56
  34. package/dist/generator/attributes/base.js +0 -53
  35. package/dist/generator/attributes/blocks.js +0 -29
  36. package/dist/generator/attributes/boolean.js +0 -17
  37. package/dist/generator/attributes/component.js +0 -36
  38. package/dist/generator/attributes/date-time.js +0 -17
  39. package/dist/generator/attributes/enumeration.js +0 -17
  40. package/dist/generator/attributes/index.js +0 -40
  41. package/dist/generator/attributes/json.js +0 -20
  42. package/dist/generator/attributes/media.js +0 -29
  43. package/dist/generator/attributes/number.js +0 -17
  44. package/dist/generator/attributes/relation.js +0 -66
  45. package/dist/generator/attributes/string.js +0 -17
  46. package/dist/generator/utils/get-component-name.js +0 -13
  47. package/dist/generator/utils/get-content-type-name.js +0 -18
  48. package/dist/main.js +0 -67
@@ -1,4 +1,4 @@
1
- import { Strapi } from "./main";
1
+ import { Strapi } from "./index.ts";
2
2
  /**
3
3
  * Main function to fetch Strapi (v5) data and generate the d.ts file
4
4
  */
@@ -1,4 +1,5 @@
1
- import Base, { AttributeMode, BaseAttribute } from "./base";
1
+ import Base, { AttributeMode } from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export default class BaseRelation extends Base {
3
4
  protected readonly name: string;
4
5
  protected readonly attribute: BaseAttribute;
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type BlocksAttribute = BaseAttribute & {
3
4
  type: 'blocks';
4
5
  };
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type BooleanAttribute = BaseAttribute & {
3
4
  type: 'boolean';
4
5
  };
@@ -1,5 +1,5 @@
1
- import { BaseAttribute, FieldType } from "./base";
2
- import BaseRelation from "./base-relation";
1
+ import type { BaseAttribute, FieldType } from "@/generator/attributes/base";
2
+ import BaseRelation from "@/generator/attributes/base-relation";
3
3
  export type ComponentAttribute = BaseAttribute & {
4
4
  type: 'component';
5
5
  repeatable: boolean;
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type DateTimeAttribute = BaseAttribute & {
3
4
  type: 'datetime';
4
5
  };
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type EnumerationAttribute = BaseAttribute & {
3
4
  type: 'enumeration';
4
5
  enum: string[];
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export default function getAttributeGenerator(name: string, attribute: BaseAttribute & {
3
4
  type: string;
4
5
  }): Base;
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type JsonAttribute = BaseAttribute & {
3
4
  type: 'json';
4
5
  };
@@ -7,5 +8,5 @@ export default class Json extends Base {
7
8
  protected readonly attribute: JsonAttribute;
8
9
  constructor(name: string, attribute: JsonAttribute);
9
10
  getType(): string;
10
- getFilters(): any[];
11
+ getFilters(): never[];
11
12
  }
@@ -1,5 +1,5 @@
1
- import { BaseAttribute } from "./base";
2
- import BaseRelation from "./base-relation";
1
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
+ import BaseRelation from "@/generator/attributes/base-relation";
3
3
  export type MediaAttribute = BaseAttribute & {
4
4
  type: 'media';
5
5
  multiple: boolean;
@@ -10,6 +10,7 @@ export default class Media extends BaseRelation {
10
10
  protected readonly attribute: MediaAttribute;
11
11
  constructor(name: string, attribute: MediaAttribute);
12
12
  getType(): "File[]" | "File";
13
+ getInputType(): string;
13
14
  getPopulates(): {
14
15
  name: string;
15
16
  type: string;
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type NumberAttribute = BaseAttribute & {
3
4
  type: 'integer' | 'biginteger' | 'decimal';
4
5
  min?: number;
@@ -1,5 +1,5 @@
1
- import { BaseAttribute } from "./base";
2
- import BaseRelation from "./base-relation";
1
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
+ import BaseRelation from "@/generator/attributes/base-relation";
3
3
  export declare enum AttributeRelation {
4
4
  MorphToMany = "morphToMany",
5
5
  ManyToOne = "manyToOne",
@@ -1,4 +1,5 @@
1
- import Base, { BaseAttribute } from "./base";
1
+ import Base from "@/generator/attributes/base";
2
+ import type { BaseAttribute } from "@/generator/attributes/base";
2
3
  export type StringAttribute = BaseAttribute & {
3
4
  type: 'text' | 'string' | 'password' | 'email';
4
5
  minLength?: number;
@@ -0,0 +1,5 @@
1
+ import { Strapi } from "@/index.ts";
2
+ /**
3
+ * Main function to fetch Strapi (v5) data and generate the d.ts file
4
+ */
5
+ export declare function generateStrapiTypes(strapi: Strapi): Promise<void>;