andesine 0.0.1-alpha.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.
@@ -0,0 +1,201 @@
1
+ interface APIFetcherConfig {
2
+ token: string;
3
+ baseURL?: string;
4
+ extensionId?: string;
5
+ headers?: Record<string, string>;
6
+ }
7
+ type PaginationParams = {
8
+ perPage?: number;
9
+ page?: number;
10
+ };
11
+ type PaginationMeta = {
12
+ total: number;
13
+ pages: number;
14
+ perPage: number;
15
+ page: number;
16
+ };
17
+
18
+ interface Profile {
19
+ /**
20
+ * User ID
21
+ */
22
+ id: string;
23
+ /**
24
+ * User avatar URL
25
+ */
26
+ avatar?: string;
27
+ /**
28
+ * Username
29
+ */
30
+ username: string;
31
+ /**
32
+ * User's personal bio
33
+ */
34
+ bio?: string;
35
+ /**
36
+ * User's full name
37
+ */
38
+ fullName?: string;
39
+ /**
40
+ * User's email
41
+ */
42
+ email: string;
43
+ /**
44
+ * Whether the user's new email is verified in the email change process
45
+ */
46
+ newEmailChangeInVerification?: boolean;
47
+ /**
48
+ * Whether the user's old email is verified in the email change process
49
+ */
50
+ oldEmailChangeInVerification?: boolean;
51
+ /**
52
+ * Whether the user's password is verified in the password change process
53
+ */
54
+ passwordChangeInVerification?: boolean;
55
+ /**
56
+ * Whether the user's email is verified
57
+ */
58
+ emailInVerification?: boolean;
59
+ }
60
+ interface ProfileEndpoints {
61
+ get(): Promise<Profile>;
62
+ }
63
+
64
+ type TagColor = "gray" | "red" | "pink" | "orange" | "amber" | "purple" | "indigo" | "blue" | "cyan" | "green" | "teal" | "lime" | "fuchsia" | "emerald";
65
+ type Tag = {
66
+ /**
67
+ * Label describing the tag
68
+ */
69
+ label?: string;
70
+ /**
71
+ * Tag color
72
+ */
73
+ color: TagColor;
74
+ /**
75
+ * Tag ID
76
+ */
77
+ id: string;
78
+ };
79
+ interface TagsEndpoints {
80
+ get(input: Pick<Tag, "id">): Promise<Tag>;
81
+ update(input: Partial<Tag> & Pick<Tag, "id">): Promise<void>;
82
+ create(input: Omit<Tag, "id">): Promise<Pick<Tag, "id">>;
83
+ delete(input: Pick<Tag, "id">): Promise<void>;
84
+ list(input: PaginationParams): Promise<Tag[] & {
85
+ meta: {
86
+ pagination: PaginationMeta;
87
+ };
88
+ }>;
89
+ }
90
+
91
+ type JSONContentAttrs = Record<string, string | number | boolean>;
92
+ type JSONContent = {
93
+ type: string;
94
+ content?: JSONContent[];
95
+ text?: string;
96
+ attrs?: JSONContentAttrs;
97
+ marks?: Array<{
98
+ type: string;
99
+ attrs: JSONContentAttrs;
100
+ }>;
101
+ };
102
+ type ContentPiece<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false> = {
103
+ /**
104
+ * Content piece ID
105
+ */
106
+ id: string;
107
+ /**
108
+ * ISO date
109
+ */
110
+ date?: string | null;
111
+ /**
112
+ * Title
113
+ */
114
+ title: string;
115
+ /**
116
+ * Content piece description - can be HTML or plain text
117
+ */
118
+ description?: string | null;
119
+ /**
120
+ * URL of the cover image
121
+ */
122
+ coverUrl?: string | null;
123
+ /**
124
+ * Alt description of the cover image
125
+ */
126
+ coverAlt?: string | null;
127
+ /**
128
+ * ID of the content group to assign the piece to
129
+ */
130
+ contentGroupId: string;
131
+ /**
132
+ * JSON object containing custom metadata
133
+ */
134
+ customData?: CustomData | null;
135
+ /**
136
+ * Canonical link
137
+ */
138
+ canonicalLink?: string | null;
139
+ /**
140
+ * IDs of assigned tags
141
+ */
142
+ tags: string[];
143
+ /**
144
+ * IDs of assigned members
145
+ */
146
+ members: string[];
147
+ /**
148
+ * Content piece slug
149
+ */
150
+ slug: string;
151
+ /**
152
+ * Content piece filename
153
+ */
154
+ filename?: string | null;
155
+ /**
156
+ * Cover image width - percentage value string (only meant for resizing image inside Vrite editor)
157
+ */
158
+ coverWidth?: string;
159
+ } & (IncludeContent extends true ? {
160
+ /**
161
+ * JSON content
162
+ */
163
+ content: JSONContent;
164
+ } : {});
165
+ type ContentPieceWithAdditionalData<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false> = Omit<ContentPiece<CustomData, IncludeContent>, "tags" | "members"> & {
166
+ tags: Tag[];
167
+ members: Array<{
168
+ id: string;
169
+ profile: Omit<Profile, "bio">;
170
+ }>;
171
+ };
172
+ interface ContentPiecesEndpoints {
173
+ get<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false>(input: Pick<ContentPiece, "id"> & {
174
+ content?: IncludeContent;
175
+ description?: "html" | "text";
176
+ variant?: string;
177
+ }): Promise<ContentPieceWithAdditionalData<CustomData, IncludeContent>>;
178
+ create<CustomData extends Record<string, any> = Record<string, any>>(input: Pick<ContentPiece<CustomData>, "date" | "title" | "description" | "tags" | "members" | "coverUrl" | "coverAlt" | "contentGroupId" | "customData" | "canonicalLink"> & {
179
+ referenceId?: string;
180
+ slug?: string;
181
+ content?: string;
182
+ }): Promise<Pick<ContentPiece<CustomData>, "id">>;
183
+ update<CustomData extends Record<string, any> = Record<string, any>>(input: Partial<Pick<ContentPiece<CustomData>, "date" | "title" | "description" | "tags" | "members" | "slug" | "coverUrl" | "coverAlt" | "contentGroupId" | "customData" | "canonicalLink" | "coverWidth"> & {
184
+ content?: string;
185
+ variant?: string;
186
+ }> & Pick<ContentPiece<CustomData>, "id">): Promise<void>;
187
+ delete(input: Pick<ContentPiece, "id">): Promise<void>;
188
+ list<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false>(input: PaginationParams & {
189
+ content?: IncludeContent;
190
+ contentGroupId?: string | string[];
191
+ tagId?: string;
192
+ slug?: string;
193
+ variant?: string;
194
+ }): Promise<Array<ContentPieceWithAdditionalData<CustomData, IncludeContent>> & {
195
+ meta: {
196
+ pagination: PaginationMeta;
197
+ };
198
+ }>;
199
+ }
200
+
201
+ export type { APIFetcherConfig as A, ContentPiece as C, JSONContent as J, Profile as P, Tag as T, ContentPieceWithAdditionalData as a, JSONContentAttrs as b, TagColor as c, PaginationParams as d, PaginationMeta as e, ContentPiecesEndpoints as f, TagsEndpoints as g, ProfileEndpoints as h };
@@ -0,0 +1,201 @@
1
+ interface APIFetcherConfig {
2
+ token: string;
3
+ baseURL?: string;
4
+ extensionId?: string;
5
+ headers?: Record<string, string>;
6
+ }
7
+ type PaginationParams = {
8
+ perPage?: number;
9
+ page?: number;
10
+ };
11
+ type PaginationMeta = {
12
+ total: number;
13
+ pages: number;
14
+ perPage: number;
15
+ page: number;
16
+ };
17
+
18
+ interface Profile {
19
+ /**
20
+ * User ID
21
+ */
22
+ id: string;
23
+ /**
24
+ * User avatar URL
25
+ */
26
+ avatar?: string;
27
+ /**
28
+ * Username
29
+ */
30
+ username: string;
31
+ /**
32
+ * User's personal bio
33
+ */
34
+ bio?: string;
35
+ /**
36
+ * User's full name
37
+ */
38
+ fullName?: string;
39
+ /**
40
+ * User's email
41
+ */
42
+ email: string;
43
+ /**
44
+ * Whether the user's new email is verified in the email change process
45
+ */
46
+ newEmailChangeInVerification?: boolean;
47
+ /**
48
+ * Whether the user's old email is verified in the email change process
49
+ */
50
+ oldEmailChangeInVerification?: boolean;
51
+ /**
52
+ * Whether the user's password is verified in the password change process
53
+ */
54
+ passwordChangeInVerification?: boolean;
55
+ /**
56
+ * Whether the user's email is verified
57
+ */
58
+ emailInVerification?: boolean;
59
+ }
60
+ interface ProfileEndpoints {
61
+ get(): Promise<Profile>;
62
+ }
63
+
64
+ type TagColor = "gray" | "red" | "pink" | "orange" | "amber" | "purple" | "indigo" | "blue" | "cyan" | "green" | "teal" | "lime" | "fuchsia" | "emerald";
65
+ type Tag = {
66
+ /**
67
+ * Label describing the tag
68
+ */
69
+ label?: string;
70
+ /**
71
+ * Tag color
72
+ */
73
+ color: TagColor;
74
+ /**
75
+ * Tag ID
76
+ */
77
+ id: string;
78
+ };
79
+ interface TagsEndpoints {
80
+ get(input: Pick<Tag, "id">): Promise<Tag>;
81
+ update(input: Partial<Tag> & Pick<Tag, "id">): Promise<void>;
82
+ create(input: Omit<Tag, "id">): Promise<Pick<Tag, "id">>;
83
+ delete(input: Pick<Tag, "id">): Promise<void>;
84
+ list(input: PaginationParams): Promise<Tag[] & {
85
+ meta: {
86
+ pagination: PaginationMeta;
87
+ };
88
+ }>;
89
+ }
90
+
91
+ type JSONContentAttrs = Record<string, string | number | boolean>;
92
+ type JSONContent = {
93
+ type: string;
94
+ content?: JSONContent[];
95
+ text?: string;
96
+ attrs?: JSONContentAttrs;
97
+ marks?: Array<{
98
+ type: string;
99
+ attrs: JSONContentAttrs;
100
+ }>;
101
+ };
102
+ type ContentPiece<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false> = {
103
+ /**
104
+ * Content piece ID
105
+ */
106
+ id: string;
107
+ /**
108
+ * ISO date
109
+ */
110
+ date?: string | null;
111
+ /**
112
+ * Title
113
+ */
114
+ title: string;
115
+ /**
116
+ * Content piece description - can be HTML or plain text
117
+ */
118
+ description?: string | null;
119
+ /**
120
+ * URL of the cover image
121
+ */
122
+ coverUrl?: string | null;
123
+ /**
124
+ * Alt description of the cover image
125
+ */
126
+ coverAlt?: string | null;
127
+ /**
128
+ * ID of the content group to assign the piece to
129
+ */
130
+ contentGroupId: string;
131
+ /**
132
+ * JSON object containing custom metadata
133
+ */
134
+ customData?: CustomData | null;
135
+ /**
136
+ * Canonical link
137
+ */
138
+ canonicalLink?: string | null;
139
+ /**
140
+ * IDs of assigned tags
141
+ */
142
+ tags: string[];
143
+ /**
144
+ * IDs of assigned members
145
+ */
146
+ members: string[];
147
+ /**
148
+ * Content piece slug
149
+ */
150
+ slug: string;
151
+ /**
152
+ * Content piece filename
153
+ */
154
+ filename?: string | null;
155
+ /**
156
+ * Cover image width - percentage value string (only meant for resizing image inside Vrite editor)
157
+ */
158
+ coverWidth?: string;
159
+ } & (IncludeContent extends true ? {
160
+ /**
161
+ * JSON content
162
+ */
163
+ content: JSONContent;
164
+ } : {});
165
+ type ContentPieceWithAdditionalData<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false> = Omit<ContentPiece<CustomData, IncludeContent>, "tags" | "members"> & {
166
+ tags: Tag[];
167
+ members: Array<{
168
+ id: string;
169
+ profile: Omit<Profile, "bio">;
170
+ }>;
171
+ };
172
+ interface ContentPiecesEndpoints {
173
+ get<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false>(input: Pick<ContentPiece, "id"> & {
174
+ content?: IncludeContent;
175
+ description?: "html" | "text";
176
+ variant?: string;
177
+ }): Promise<ContentPieceWithAdditionalData<CustomData, IncludeContent>>;
178
+ create<CustomData extends Record<string, any> = Record<string, any>>(input: Pick<ContentPiece<CustomData>, "date" | "title" | "description" | "tags" | "members" | "coverUrl" | "coverAlt" | "contentGroupId" | "customData" | "canonicalLink"> & {
179
+ referenceId?: string;
180
+ slug?: string;
181
+ content?: string;
182
+ }): Promise<Pick<ContentPiece<CustomData>, "id">>;
183
+ update<CustomData extends Record<string, any> = Record<string, any>>(input: Partial<Pick<ContentPiece<CustomData>, "date" | "title" | "description" | "tags" | "members" | "slug" | "coverUrl" | "coverAlt" | "contentGroupId" | "customData" | "canonicalLink" | "coverWidth"> & {
184
+ content?: string;
185
+ variant?: string;
186
+ }> & Pick<ContentPiece<CustomData>, "id">): Promise<void>;
187
+ delete(input: Pick<ContentPiece, "id">): Promise<void>;
188
+ list<CustomData extends Record<string, any> = Record<string, any>, IncludeContent extends true | false = false>(input: PaginationParams & {
189
+ content?: IncludeContent;
190
+ contentGroupId?: string | string[];
191
+ tagId?: string;
192
+ slug?: string;
193
+ variant?: string;
194
+ }): Promise<Array<ContentPieceWithAdditionalData<CustomData, IncludeContent>> & {
195
+ meta: {
196
+ pagination: PaginationMeta;
197
+ };
198
+ }>;
199
+ }
200
+
201
+ export type { APIFetcherConfig as A, ContentPiece as C, JSONContent as J, Profile as P, Tag as T, ContentPieceWithAdditionalData as a, JSONContentAttrs as b, TagColor as c, PaginationParams as d, PaginationMeta as e, ContentPiecesEndpoints as f, TagsEndpoints as g, ProfileEndpoints as h };