@noya-app/noya-api-client-react 0.1.19
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/.eslintrc.js +11 -0
- package/.turbo/turbo-build.log +17 -0
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +301 -0
- package/dist/index.d.ts +301 -0
- package/dist/index.js +321 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +266 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +20 -0
- package/src/index.ts +3 -0
- package/src/react/context.ts +41 -0
- package/src/react/hooks.ts +262 -0
- package/tsconfig.json +3 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
root: true,
|
|
4
|
+
extends: ["@repo/eslint-config/next.js"],
|
|
5
|
+
parser: "@typescript-eslint/parser",
|
|
6
|
+
rules: {
|
|
7
|
+
"no-unused-vars": "off",
|
|
8
|
+
"no-redeclare": "off",
|
|
9
|
+
},
|
|
10
|
+
ignorePatterns: ["dist/"],
|
|
11
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[0m[2m[35m$[0m [2m[1mtsup src/index.ts --format cjs,esm --dts --sourcemap[0m
|
|
2
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
3
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
4
|
+
[34mCLI[39m tsup v8.0.1
|
|
5
|
+
[34mCLI[39m Target: esnext
|
|
6
|
+
[34mCJS[39m Build start
|
|
7
|
+
[34mESM[39m Build start
|
|
8
|
+
[32mCJS[39m [1mdist/index.js [22m[32m11.59 KB[39m
|
|
9
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m14.55 KB[39m
|
|
10
|
+
[32mCJS[39m ⚡️ Build success in 31ms
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m8.05 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m14.33 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 32ms
|
|
14
|
+
[34mDTS[39m Build start
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 2733ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m8.31 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m8.31 KB[39m
|
package/CHANGELOG.md
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { NoyaAPI } from '@noya-app/noya-api';
|
|
2
|
+
export * from '@noya-app/noya-api';
|
|
3
|
+
|
|
4
|
+
type NoyaAPIContextValue = NoyaAPI.Client;
|
|
5
|
+
declare const NoyaAPIProvider: React.Provider<NoyaAPIContextValue | undefined>;
|
|
6
|
+
declare function useNoyaClient(): NoyaAPIContextValue;
|
|
7
|
+
declare function useOptionalNoyaClient(): NoyaAPIContextValue | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* If there's no client, fallback to a memory client.
|
|
10
|
+
* We do this to safely render content when logged out (e.g. when sharing).
|
|
11
|
+
*/
|
|
12
|
+
declare function useNoyaClientOrFallback(): NoyaAPIContextValue;
|
|
13
|
+
|
|
14
|
+
declare function useNoyaFiles(): {
|
|
15
|
+
files: NoyaAPI.File[];
|
|
16
|
+
loading: NoyaAPI.DataLoadingState;
|
|
17
|
+
};
|
|
18
|
+
declare function useNoyaIsOwnFile(fileId?: string): boolean;
|
|
19
|
+
declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
20
|
+
tools: {
|
|
21
|
+
addedById?: string | undefined;
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
id: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
tags: {
|
|
27
|
+
toolCount?: number | undefined;
|
|
28
|
+
name: string;
|
|
29
|
+
id: string;
|
|
30
|
+
rank: number;
|
|
31
|
+
}[];
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
slug: string | null;
|
|
35
|
+
tagline: string | null;
|
|
36
|
+
assets: string[];
|
|
37
|
+
homepageUrl: string | null;
|
|
38
|
+
platform: "noya" | "external";
|
|
39
|
+
verificationStatus: "pending" | "approved" | "rejected";
|
|
40
|
+
creator: {
|
|
41
|
+
name: string;
|
|
42
|
+
id: string;
|
|
43
|
+
image: string | null;
|
|
44
|
+
slug: string | null;
|
|
45
|
+
} | null;
|
|
46
|
+
}[];
|
|
47
|
+
loading: boolean;
|
|
48
|
+
};
|
|
49
|
+
declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
50
|
+
tools: {
|
|
51
|
+
addedById?: string | undefined;
|
|
52
|
+
name: string;
|
|
53
|
+
url: string;
|
|
54
|
+
id: string;
|
|
55
|
+
description: string | null;
|
|
56
|
+
tags: {
|
|
57
|
+
toolCount?: number | undefined;
|
|
58
|
+
name: string;
|
|
59
|
+
id: string;
|
|
60
|
+
rank: number;
|
|
61
|
+
}[];
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
slug: string | null;
|
|
65
|
+
tagline: string | null;
|
|
66
|
+
assets: string[];
|
|
67
|
+
homepageUrl: string | null;
|
|
68
|
+
platform: "noya" | "external";
|
|
69
|
+
verificationStatus: "pending" | "approved" | "rejected";
|
|
70
|
+
creator: {
|
|
71
|
+
name: string;
|
|
72
|
+
id: string;
|
|
73
|
+
image: string | null;
|
|
74
|
+
slug: string | null;
|
|
75
|
+
} | null;
|
|
76
|
+
}[];
|
|
77
|
+
loading: boolean;
|
|
78
|
+
};
|
|
79
|
+
declare function useNoyaTags(): {
|
|
80
|
+
tags: {
|
|
81
|
+
toolCount?: number | undefined;
|
|
82
|
+
name: string;
|
|
83
|
+
id: string;
|
|
84
|
+
rank: number;
|
|
85
|
+
}[];
|
|
86
|
+
loading: boolean;
|
|
87
|
+
};
|
|
88
|
+
declare function useOptionalNoyaTags(): {
|
|
89
|
+
tags: {
|
|
90
|
+
toolCount?: number | undefined;
|
|
91
|
+
name: string;
|
|
92
|
+
id: string;
|
|
93
|
+
rank: number;
|
|
94
|
+
}[];
|
|
95
|
+
loading: boolean;
|
|
96
|
+
};
|
|
97
|
+
declare function useNoyaCreators(): {
|
|
98
|
+
creators: {
|
|
99
|
+
name: string;
|
|
100
|
+
id: string;
|
|
101
|
+
image: string | null;
|
|
102
|
+
slug: string | null;
|
|
103
|
+
}[];
|
|
104
|
+
loading: boolean;
|
|
105
|
+
};
|
|
106
|
+
declare function useOptionalNoyaCreators(): {
|
|
107
|
+
creators: {
|
|
108
|
+
name: string;
|
|
109
|
+
id: string;
|
|
110
|
+
image: string | null;
|
|
111
|
+
slug: string | null;
|
|
112
|
+
}[];
|
|
113
|
+
loading: boolean;
|
|
114
|
+
};
|
|
115
|
+
declare function useNoyaAssets(fileId?: string): {
|
|
116
|
+
assets: {
|
|
117
|
+
id: string;
|
|
118
|
+
}[];
|
|
119
|
+
loading: boolean;
|
|
120
|
+
};
|
|
121
|
+
declare function useNoyaSession(): {
|
|
122
|
+
user: {
|
|
123
|
+
name: string | null;
|
|
124
|
+
id: string;
|
|
125
|
+
image: string | null;
|
|
126
|
+
email: string | null;
|
|
127
|
+
};
|
|
128
|
+
expires: string;
|
|
129
|
+
} | null;
|
|
130
|
+
declare function useOptionalNoyaSession(): {
|
|
131
|
+
user: {
|
|
132
|
+
name: string | null;
|
|
133
|
+
id: string;
|
|
134
|
+
image: string | null;
|
|
135
|
+
email: string | null;
|
|
136
|
+
};
|
|
137
|
+
expires: string;
|
|
138
|
+
} | null | undefined;
|
|
139
|
+
declare function useNoyaBilling(): {
|
|
140
|
+
subscriptions: {
|
|
141
|
+
items: {
|
|
142
|
+
id: string;
|
|
143
|
+
created: string;
|
|
144
|
+
price: {
|
|
145
|
+
type: string;
|
|
146
|
+
active: boolean;
|
|
147
|
+
id: string;
|
|
148
|
+
currency: string;
|
|
149
|
+
nickname: string | null;
|
|
150
|
+
recurringInterval: string;
|
|
151
|
+
recurringIntervalCount: number;
|
|
152
|
+
unitAmount: number;
|
|
153
|
+
created: string;
|
|
154
|
+
url?: string | undefined;
|
|
155
|
+
};
|
|
156
|
+
quantity: number;
|
|
157
|
+
}[];
|
|
158
|
+
id: string;
|
|
159
|
+
status: string;
|
|
160
|
+
currency: string;
|
|
161
|
+
created: string;
|
|
162
|
+
cancelAtPeriodEnd: boolean;
|
|
163
|
+
currentPeriodEnd: string;
|
|
164
|
+
currentPeriodStart: string;
|
|
165
|
+
cancelAt: string | null;
|
|
166
|
+
canceledAt: string | null;
|
|
167
|
+
endedAt: string | null;
|
|
168
|
+
trialEnd: string | null;
|
|
169
|
+
trialStart: string | null;
|
|
170
|
+
}[];
|
|
171
|
+
portalUrl: string | null;
|
|
172
|
+
availableProducts: {
|
|
173
|
+
active: boolean;
|
|
174
|
+
name: string;
|
|
175
|
+
id: string;
|
|
176
|
+
description: string | null;
|
|
177
|
+
created: string;
|
|
178
|
+
prices: {
|
|
179
|
+
type: string;
|
|
180
|
+
active: boolean;
|
|
181
|
+
id: string;
|
|
182
|
+
currency: string;
|
|
183
|
+
nickname: string | null;
|
|
184
|
+
recurringInterval: string;
|
|
185
|
+
recurringIntervalCount: number;
|
|
186
|
+
unitAmount: number;
|
|
187
|
+
created: string;
|
|
188
|
+
url?: string | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
}[];
|
|
191
|
+
} & {
|
|
192
|
+
loading: boolean;
|
|
193
|
+
};
|
|
194
|
+
declare function useNoyaEmailLists(): {
|
|
195
|
+
emailLists: {
|
|
196
|
+
name: string;
|
|
197
|
+
url: string;
|
|
198
|
+
id: string;
|
|
199
|
+
description: string | null;
|
|
200
|
+
optIn: boolean;
|
|
201
|
+
}[];
|
|
202
|
+
loading: boolean;
|
|
203
|
+
};
|
|
204
|
+
declare function useNoyaUserData(): {
|
|
205
|
+
userData: {
|
|
206
|
+
metadata: {
|
|
207
|
+
key: string;
|
|
208
|
+
url: string;
|
|
209
|
+
value?: unknown;
|
|
210
|
+
}[];
|
|
211
|
+
emailLists: {
|
|
212
|
+
name: string;
|
|
213
|
+
url: string;
|
|
214
|
+
id: string;
|
|
215
|
+
description: string | null;
|
|
216
|
+
optIn: boolean;
|
|
217
|
+
}[];
|
|
218
|
+
experiments: {};
|
|
219
|
+
beta?: boolean | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
loading: boolean;
|
|
222
|
+
};
|
|
223
|
+
declare function useOptionalNoyaUserData(): {
|
|
224
|
+
userData: {
|
|
225
|
+
metadata: {
|
|
226
|
+
key: string;
|
|
227
|
+
url: string;
|
|
228
|
+
value?: unknown;
|
|
229
|
+
}[];
|
|
230
|
+
emailLists: {
|
|
231
|
+
name: string;
|
|
232
|
+
url: string;
|
|
233
|
+
id: string;
|
|
234
|
+
description: string | null;
|
|
235
|
+
optIn: boolean;
|
|
236
|
+
}[];
|
|
237
|
+
experiments: {};
|
|
238
|
+
beta?: boolean | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
loading: boolean;
|
|
241
|
+
};
|
|
242
|
+
declare function useIsBeta(): boolean;
|
|
243
|
+
declare function useMetadata<T extends NoyaAPI.Json>(key: string): T | undefined;
|
|
244
|
+
declare function useGeneratedComponentNames(name: string): {
|
|
245
|
+
names: {
|
|
246
|
+
name: string;
|
|
247
|
+
}[];
|
|
248
|
+
loading: boolean;
|
|
249
|
+
};
|
|
250
|
+
declare function useGeneratedComponentDescriptions(): {
|
|
251
|
+
descriptions: Record<string, string>;
|
|
252
|
+
loading: Record<string, boolean>;
|
|
253
|
+
};
|
|
254
|
+
declare function useGeneratedComponentDescription(name: string): {
|
|
255
|
+
description: string | undefined;
|
|
256
|
+
loading: boolean;
|
|
257
|
+
};
|
|
258
|
+
declare function useRandomImages(): {
|
|
259
|
+
images: Record<string, {
|
|
260
|
+
url: string;
|
|
261
|
+
source: {
|
|
262
|
+
name: string;
|
|
263
|
+
url: string;
|
|
264
|
+
};
|
|
265
|
+
metadata: {
|
|
266
|
+
color: string;
|
|
267
|
+
};
|
|
268
|
+
user: {
|
|
269
|
+
name: string;
|
|
270
|
+
url: string;
|
|
271
|
+
};
|
|
272
|
+
}>;
|
|
273
|
+
loading: Record<string, boolean>;
|
|
274
|
+
};
|
|
275
|
+
declare function useRandomIcons(): {
|
|
276
|
+
icons: Record<string, {
|
|
277
|
+
url: string;
|
|
278
|
+
data: string;
|
|
279
|
+
}>;
|
|
280
|
+
loading: Record<string, boolean>;
|
|
281
|
+
};
|
|
282
|
+
declare function useNetworkRequests(): {
|
|
283
|
+
id: number;
|
|
284
|
+
method: string;
|
|
285
|
+
completed: boolean;
|
|
286
|
+
abort: () => void;
|
|
287
|
+
aborted: boolean;
|
|
288
|
+
isStreaming: boolean;
|
|
289
|
+
url: string;
|
|
290
|
+
status: number | undefined;
|
|
291
|
+
attempt: number;
|
|
292
|
+
abortStream: () => void;
|
|
293
|
+
}[];
|
|
294
|
+
type EnhancedGeneratedPageName = NoyaAPI.GeneratedName & {
|
|
295
|
+
index: number;
|
|
296
|
+
type: "suggestion";
|
|
297
|
+
};
|
|
298
|
+
declare function useGeneratedPageNames(): EnhancedGeneratedPageName[];
|
|
299
|
+
declare function useGeneratedPageComponentNames(): EnhancedGeneratedPageName[];
|
|
300
|
+
|
|
301
|
+
export { type EnhancedGeneratedPageName, NoyaAPIProvider, useGeneratedComponentDescription, useGeneratedComponentDescriptions, useGeneratedComponentNames, useGeneratedPageComponentNames, useGeneratedPageNames, useIsBeta, useMetadata, useNetworkRequests, useNoyaAssets, useNoyaBilling, useNoyaClient, useNoyaClientOrFallback, useNoyaCreators, useNoyaEmailLists, useNoyaFiles, useNoyaIsOwnFile, useNoyaSession, useNoyaTags, useNoyaTools, useNoyaUserData, useOptionalNoyaClient, useOptionalNoyaCreators, useOptionalNoyaSession, useOptionalNoyaTags, useOptionalNoyaTools, useOptionalNoyaUserData, useRandomIcons, useRandomImages };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { NoyaAPI } from '@noya-app/noya-api';
|
|
2
|
+
export * from '@noya-app/noya-api';
|
|
3
|
+
|
|
4
|
+
type NoyaAPIContextValue = NoyaAPI.Client;
|
|
5
|
+
declare const NoyaAPIProvider: React.Provider<NoyaAPIContextValue | undefined>;
|
|
6
|
+
declare function useNoyaClient(): NoyaAPIContextValue;
|
|
7
|
+
declare function useOptionalNoyaClient(): NoyaAPIContextValue | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* If there's no client, fallback to a memory client.
|
|
10
|
+
* We do this to safely render content when logged out (e.g. when sharing).
|
|
11
|
+
*/
|
|
12
|
+
declare function useNoyaClientOrFallback(): NoyaAPIContextValue;
|
|
13
|
+
|
|
14
|
+
declare function useNoyaFiles(): {
|
|
15
|
+
files: NoyaAPI.File[];
|
|
16
|
+
loading: NoyaAPI.DataLoadingState;
|
|
17
|
+
};
|
|
18
|
+
declare function useNoyaIsOwnFile(fileId?: string): boolean;
|
|
19
|
+
declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
20
|
+
tools: {
|
|
21
|
+
addedById?: string | undefined;
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
id: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
tags: {
|
|
27
|
+
toolCount?: number | undefined;
|
|
28
|
+
name: string;
|
|
29
|
+
id: string;
|
|
30
|
+
rank: number;
|
|
31
|
+
}[];
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
slug: string | null;
|
|
35
|
+
tagline: string | null;
|
|
36
|
+
assets: string[];
|
|
37
|
+
homepageUrl: string | null;
|
|
38
|
+
platform: "noya" | "external";
|
|
39
|
+
verificationStatus: "pending" | "approved" | "rejected";
|
|
40
|
+
creator: {
|
|
41
|
+
name: string;
|
|
42
|
+
id: string;
|
|
43
|
+
image: string | null;
|
|
44
|
+
slug: string | null;
|
|
45
|
+
} | null;
|
|
46
|
+
}[];
|
|
47
|
+
loading: boolean;
|
|
48
|
+
};
|
|
49
|
+
declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
50
|
+
tools: {
|
|
51
|
+
addedById?: string | undefined;
|
|
52
|
+
name: string;
|
|
53
|
+
url: string;
|
|
54
|
+
id: string;
|
|
55
|
+
description: string | null;
|
|
56
|
+
tags: {
|
|
57
|
+
toolCount?: number | undefined;
|
|
58
|
+
name: string;
|
|
59
|
+
id: string;
|
|
60
|
+
rank: number;
|
|
61
|
+
}[];
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
slug: string | null;
|
|
65
|
+
tagline: string | null;
|
|
66
|
+
assets: string[];
|
|
67
|
+
homepageUrl: string | null;
|
|
68
|
+
platform: "noya" | "external";
|
|
69
|
+
verificationStatus: "pending" | "approved" | "rejected";
|
|
70
|
+
creator: {
|
|
71
|
+
name: string;
|
|
72
|
+
id: string;
|
|
73
|
+
image: string | null;
|
|
74
|
+
slug: string | null;
|
|
75
|
+
} | null;
|
|
76
|
+
}[];
|
|
77
|
+
loading: boolean;
|
|
78
|
+
};
|
|
79
|
+
declare function useNoyaTags(): {
|
|
80
|
+
tags: {
|
|
81
|
+
toolCount?: number | undefined;
|
|
82
|
+
name: string;
|
|
83
|
+
id: string;
|
|
84
|
+
rank: number;
|
|
85
|
+
}[];
|
|
86
|
+
loading: boolean;
|
|
87
|
+
};
|
|
88
|
+
declare function useOptionalNoyaTags(): {
|
|
89
|
+
tags: {
|
|
90
|
+
toolCount?: number | undefined;
|
|
91
|
+
name: string;
|
|
92
|
+
id: string;
|
|
93
|
+
rank: number;
|
|
94
|
+
}[];
|
|
95
|
+
loading: boolean;
|
|
96
|
+
};
|
|
97
|
+
declare function useNoyaCreators(): {
|
|
98
|
+
creators: {
|
|
99
|
+
name: string;
|
|
100
|
+
id: string;
|
|
101
|
+
image: string | null;
|
|
102
|
+
slug: string | null;
|
|
103
|
+
}[];
|
|
104
|
+
loading: boolean;
|
|
105
|
+
};
|
|
106
|
+
declare function useOptionalNoyaCreators(): {
|
|
107
|
+
creators: {
|
|
108
|
+
name: string;
|
|
109
|
+
id: string;
|
|
110
|
+
image: string | null;
|
|
111
|
+
slug: string | null;
|
|
112
|
+
}[];
|
|
113
|
+
loading: boolean;
|
|
114
|
+
};
|
|
115
|
+
declare function useNoyaAssets(fileId?: string): {
|
|
116
|
+
assets: {
|
|
117
|
+
id: string;
|
|
118
|
+
}[];
|
|
119
|
+
loading: boolean;
|
|
120
|
+
};
|
|
121
|
+
declare function useNoyaSession(): {
|
|
122
|
+
user: {
|
|
123
|
+
name: string | null;
|
|
124
|
+
id: string;
|
|
125
|
+
image: string | null;
|
|
126
|
+
email: string | null;
|
|
127
|
+
};
|
|
128
|
+
expires: string;
|
|
129
|
+
} | null;
|
|
130
|
+
declare function useOptionalNoyaSession(): {
|
|
131
|
+
user: {
|
|
132
|
+
name: string | null;
|
|
133
|
+
id: string;
|
|
134
|
+
image: string | null;
|
|
135
|
+
email: string | null;
|
|
136
|
+
};
|
|
137
|
+
expires: string;
|
|
138
|
+
} | null | undefined;
|
|
139
|
+
declare function useNoyaBilling(): {
|
|
140
|
+
subscriptions: {
|
|
141
|
+
items: {
|
|
142
|
+
id: string;
|
|
143
|
+
created: string;
|
|
144
|
+
price: {
|
|
145
|
+
type: string;
|
|
146
|
+
active: boolean;
|
|
147
|
+
id: string;
|
|
148
|
+
currency: string;
|
|
149
|
+
nickname: string | null;
|
|
150
|
+
recurringInterval: string;
|
|
151
|
+
recurringIntervalCount: number;
|
|
152
|
+
unitAmount: number;
|
|
153
|
+
created: string;
|
|
154
|
+
url?: string | undefined;
|
|
155
|
+
};
|
|
156
|
+
quantity: number;
|
|
157
|
+
}[];
|
|
158
|
+
id: string;
|
|
159
|
+
status: string;
|
|
160
|
+
currency: string;
|
|
161
|
+
created: string;
|
|
162
|
+
cancelAtPeriodEnd: boolean;
|
|
163
|
+
currentPeriodEnd: string;
|
|
164
|
+
currentPeriodStart: string;
|
|
165
|
+
cancelAt: string | null;
|
|
166
|
+
canceledAt: string | null;
|
|
167
|
+
endedAt: string | null;
|
|
168
|
+
trialEnd: string | null;
|
|
169
|
+
trialStart: string | null;
|
|
170
|
+
}[];
|
|
171
|
+
portalUrl: string | null;
|
|
172
|
+
availableProducts: {
|
|
173
|
+
active: boolean;
|
|
174
|
+
name: string;
|
|
175
|
+
id: string;
|
|
176
|
+
description: string | null;
|
|
177
|
+
created: string;
|
|
178
|
+
prices: {
|
|
179
|
+
type: string;
|
|
180
|
+
active: boolean;
|
|
181
|
+
id: string;
|
|
182
|
+
currency: string;
|
|
183
|
+
nickname: string | null;
|
|
184
|
+
recurringInterval: string;
|
|
185
|
+
recurringIntervalCount: number;
|
|
186
|
+
unitAmount: number;
|
|
187
|
+
created: string;
|
|
188
|
+
url?: string | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
}[];
|
|
191
|
+
} & {
|
|
192
|
+
loading: boolean;
|
|
193
|
+
};
|
|
194
|
+
declare function useNoyaEmailLists(): {
|
|
195
|
+
emailLists: {
|
|
196
|
+
name: string;
|
|
197
|
+
url: string;
|
|
198
|
+
id: string;
|
|
199
|
+
description: string | null;
|
|
200
|
+
optIn: boolean;
|
|
201
|
+
}[];
|
|
202
|
+
loading: boolean;
|
|
203
|
+
};
|
|
204
|
+
declare function useNoyaUserData(): {
|
|
205
|
+
userData: {
|
|
206
|
+
metadata: {
|
|
207
|
+
key: string;
|
|
208
|
+
url: string;
|
|
209
|
+
value?: unknown;
|
|
210
|
+
}[];
|
|
211
|
+
emailLists: {
|
|
212
|
+
name: string;
|
|
213
|
+
url: string;
|
|
214
|
+
id: string;
|
|
215
|
+
description: string | null;
|
|
216
|
+
optIn: boolean;
|
|
217
|
+
}[];
|
|
218
|
+
experiments: {};
|
|
219
|
+
beta?: boolean | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
loading: boolean;
|
|
222
|
+
};
|
|
223
|
+
declare function useOptionalNoyaUserData(): {
|
|
224
|
+
userData: {
|
|
225
|
+
metadata: {
|
|
226
|
+
key: string;
|
|
227
|
+
url: string;
|
|
228
|
+
value?: unknown;
|
|
229
|
+
}[];
|
|
230
|
+
emailLists: {
|
|
231
|
+
name: string;
|
|
232
|
+
url: string;
|
|
233
|
+
id: string;
|
|
234
|
+
description: string | null;
|
|
235
|
+
optIn: boolean;
|
|
236
|
+
}[];
|
|
237
|
+
experiments: {};
|
|
238
|
+
beta?: boolean | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
loading: boolean;
|
|
241
|
+
};
|
|
242
|
+
declare function useIsBeta(): boolean;
|
|
243
|
+
declare function useMetadata<T extends NoyaAPI.Json>(key: string): T | undefined;
|
|
244
|
+
declare function useGeneratedComponentNames(name: string): {
|
|
245
|
+
names: {
|
|
246
|
+
name: string;
|
|
247
|
+
}[];
|
|
248
|
+
loading: boolean;
|
|
249
|
+
};
|
|
250
|
+
declare function useGeneratedComponentDescriptions(): {
|
|
251
|
+
descriptions: Record<string, string>;
|
|
252
|
+
loading: Record<string, boolean>;
|
|
253
|
+
};
|
|
254
|
+
declare function useGeneratedComponentDescription(name: string): {
|
|
255
|
+
description: string | undefined;
|
|
256
|
+
loading: boolean;
|
|
257
|
+
};
|
|
258
|
+
declare function useRandomImages(): {
|
|
259
|
+
images: Record<string, {
|
|
260
|
+
url: string;
|
|
261
|
+
source: {
|
|
262
|
+
name: string;
|
|
263
|
+
url: string;
|
|
264
|
+
};
|
|
265
|
+
metadata: {
|
|
266
|
+
color: string;
|
|
267
|
+
};
|
|
268
|
+
user: {
|
|
269
|
+
name: string;
|
|
270
|
+
url: string;
|
|
271
|
+
};
|
|
272
|
+
}>;
|
|
273
|
+
loading: Record<string, boolean>;
|
|
274
|
+
};
|
|
275
|
+
declare function useRandomIcons(): {
|
|
276
|
+
icons: Record<string, {
|
|
277
|
+
url: string;
|
|
278
|
+
data: string;
|
|
279
|
+
}>;
|
|
280
|
+
loading: Record<string, boolean>;
|
|
281
|
+
};
|
|
282
|
+
declare function useNetworkRequests(): {
|
|
283
|
+
id: number;
|
|
284
|
+
method: string;
|
|
285
|
+
completed: boolean;
|
|
286
|
+
abort: () => void;
|
|
287
|
+
aborted: boolean;
|
|
288
|
+
isStreaming: boolean;
|
|
289
|
+
url: string;
|
|
290
|
+
status: number | undefined;
|
|
291
|
+
attempt: number;
|
|
292
|
+
abortStream: () => void;
|
|
293
|
+
}[];
|
|
294
|
+
type EnhancedGeneratedPageName = NoyaAPI.GeneratedName & {
|
|
295
|
+
index: number;
|
|
296
|
+
type: "suggestion";
|
|
297
|
+
};
|
|
298
|
+
declare function useGeneratedPageNames(): EnhancedGeneratedPageName[];
|
|
299
|
+
declare function useGeneratedPageComponentNames(): EnhancedGeneratedPageName[];
|
|
300
|
+
|
|
301
|
+
export { type EnhancedGeneratedPageName, NoyaAPIProvider, useGeneratedComponentDescription, useGeneratedComponentDescriptions, useGeneratedComponentNames, useGeneratedPageComponentNames, useGeneratedPageNames, useIsBeta, useMetadata, useNetworkRequests, useNoyaAssets, useNoyaBilling, useNoyaClient, useNoyaClientOrFallback, useNoyaCreators, useNoyaEmailLists, useNoyaFiles, useNoyaIsOwnFile, useNoyaSession, useNoyaTags, useNoyaTools, useNoyaUserData, useOptionalNoyaClient, useOptionalNoyaCreators, useOptionalNoyaSession, useOptionalNoyaTags, useOptionalNoyaTools, useOptionalNoyaUserData, useRandomIcons, useRandomImages };
|