@indreamai/client 0.3.1 → 0.5.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/index.cjs +18 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +17 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
AuthError: () => AuthError,
|
|
40
40
|
EditorResource: () => EditorResource,
|
|
41
41
|
ExportsResource: () => ExportsResource,
|
|
42
|
+
IllustrationsResource: () => IllustrationsResource,
|
|
42
43
|
IndreamClient: () => IndreamClient,
|
|
43
44
|
ProjectsResource: () => ProjectsResource,
|
|
44
45
|
RateLimitError: () => RateLimitError,
|
|
@@ -244,6 +245,20 @@ var EditorResource = class {
|
|
|
244
245
|
}
|
|
245
246
|
};
|
|
246
247
|
|
|
248
|
+
// src/resources/illustrations.ts
|
|
249
|
+
var IllustrationsResource = class {
|
|
250
|
+
constructor(client) {
|
|
251
|
+
this.client = client;
|
|
252
|
+
}
|
|
253
|
+
async search(q, options = {}) {
|
|
254
|
+
const query = typeof q === "string" && q.trim() ? "?q=" + encodeURIComponent(q.trim()) : "";
|
|
255
|
+
return await this.client.request("/v1/illustrations" + query, {
|
|
256
|
+
method: "GET",
|
|
257
|
+
signal: options.signal
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
247
262
|
// src/resources/projects.ts
|
|
248
263
|
var ProjectsResource = class {
|
|
249
264
|
constructor(client) {
|
|
@@ -457,6 +472,7 @@ var IndreamClient = class {
|
|
|
457
472
|
this.fetchImpl = options.fetch || fetch;
|
|
458
473
|
this.exports = new ExportsResource(this);
|
|
459
474
|
this.editor = new EditorResource(this);
|
|
475
|
+
this.illustrations = new IllustrationsResource(this);
|
|
460
476
|
this.projects = new ProjectsResource(this);
|
|
461
477
|
this.uploads = new UploadsResource(this);
|
|
462
478
|
this.assets = new AssetsResource(this);
|
|
@@ -466,7 +482,7 @@ var IndreamClient = class {
|
|
|
466
482
|
return envelope.data;
|
|
467
483
|
}
|
|
468
484
|
async requestEnvelope(path, init) {
|
|
469
|
-
const url =
|
|
485
|
+
const url = this.baseURL + (path.startsWith("/") ? path : "/" + path);
|
|
470
486
|
const isJsonPayload = init.body !== void 0 && !isBodyInit(init.body);
|
|
471
487
|
let payload;
|
|
472
488
|
if (init.body !== void 0) {
|
|
@@ -722,6 +738,7 @@ var verifyExportWebhookRequest = async ({
|
|
|
722
738
|
AuthError,
|
|
723
739
|
EditorResource,
|
|
724
740
|
ExportsResource,
|
|
741
|
+
IllustrationsResource,
|
|
725
742
|
IndreamClient,
|
|
726
743
|
ProjectsResource,
|
|
727
744
|
RateLimitError,
|
package/dist/index.d.cts
CHANGED
|
@@ -1183,6 +1183,12 @@ declare class EditorResource {
|
|
|
1183
1183
|
validate(editorState: TEditorStateV1, options?: IRequestOptions): Promise<IEditorValidationResult>;
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
1186
|
+
declare class IllustrationsResource {
|
|
1187
|
+
private readonly client;
|
|
1188
|
+
constructor(client: IndreamClient);
|
|
1189
|
+
search(q?: string, options?: IRequestOptions): Promise<string[]>;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1186
1192
|
declare class ProjectsResource {
|
|
1187
1193
|
private readonly client;
|
|
1188
1194
|
constructor(client: IndreamClient);
|
|
@@ -1222,6 +1228,7 @@ declare class IndreamClient {
|
|
|
1222
1228
|
readonly fetchImpl: typeof fetch;
|
|
1223
1229
|
readonly exports: ExportsResource;
|
|
1224
1230
|
readonly editor: EditorResource;
|
|
1231
|
+
readonly illustrations: IllustrationsResource;
|
|
1225
1232
|
readonly projects: ProjectsResource;
|
|
1226
1233
|
readonly uploads: UploadsResource;
|
|
1227
1234
|
readonly assets: AssetsResource;
|
|
@@ -1286,4 +1293,4 @@ declare const parseExportWebhookEvent: (value: unknown) => IExportWebhookEvent;
|
|
|
1286
1293
|
declare const verifyExportWebhookSignature: ({ webhookSecret, timestamp, rawBody, signature, }: IVerifyExportWebhookSignatureParams) => Promise<boolean>;
|
|
1287
1294
|
declare const verifyExportWebhookRequest: ({ webhookSecret, rawBody, headers, maxSkewSeconds, nowTimestampSeconds, }: IVerifyExportWebhookRequestParams) => Promise<boolean>;
|
|
1288
1295
|
|
|
1289
|
-
export { APIError, AssetsResource, AuthError, EditorResource, ExportsResource, type IApiEnvelope, type IApiProblem, type IAsset, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateProjectExportRequest, type ICreateProjectRequest, type ICreateRequestOptions, type IDeleteAssetResponse, type IDeleteProjectAssetResponse, type IDeleteProjectResponse, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListAssetsResponse, type IListExportsResponse, type IListProjectsResponse, type IProjectAssetBindingResponse, type IProjectDetail, type IProjectMetadataResponse, type IProjectSummary, type IProjectSyncResponse, type IRequestOptions, type ISyncProjectRequest, type IUpdateProjectRequest, type IUploadOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, ProjectsResource, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TUploadBody, type TWebhookHeaders, UploadsResource, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
|
|
1296
|
+
export { APIError, AssetsResource, AuthError, EditorResource, ExportsResource, type IApiEnvelope, type IApiProblem, type IAsset, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateProjectExportRequest, type ICreateProjectRequest, type ICreateRequestOptions, type IDeleteAssetResponse, type IDeleteProjectAssetResponse, type IDeleteProjectResponse, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListAssetsResponse, type IListExportsResponse, type IListProjectsResponse, type IProjectAssetBindingResponse, type IProjectDetail, type IProjectMetadataResponse, type IProjectSummary, type IProjectSyncResponse, type IRequestOptions, type ISyncProjectRequest, type IUpdateProjectRequest, type IUploadOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IllustrationsResource, IndreamClient, ProjectsResource, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TUploadBody, type TWebhookHeaders, UploadsResource, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1183,6 +1183,12 @@ declare class EditorResource {
|
|
|
1183
1183
|
validate(editorState: TEditorStateV1, options?: IRequestOptions): Promise<IEditorValidationResult>;
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
1186
|
+
declare class IllustrationsResource {
|
|
1187
|
+
private readonly client;
|
|
1188
|
+
constructor(client: IndreamClient);
|
|
1189
|
+
search(q?: string, options?: IRequestOptions): Promise<string[]>;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1186
1192
|
declare class ProjectsResource {
|
|
1187
1193
|
private readonly client;
|
|
1188
1194
|
constructor(client: IndreamClient);
|
|
@@ -1222,6 +1228,7 @@ declare class IndreamClient {
|
|
|
1222
1228
|
readonly fetchImpl: typeof fetch;
|
|
1223
1229
|
readonly exports: ExportsResource;
|
|
1224
1230
|
readonly editor: EditorResource;
|
|
1231
|
+
readonly illustrations: IllustrationsResource;
|
|
1225
1232
|
readonly projects: ProjectsResource;
|
|
1226
1233
|
readonly uploads: UploadsResource;
|
|
1227
1234
|
readonly assets: AssetsResource;
|
|
@@ -1286,4 +1293,4 @@ declare const parseExportWebhookEvent: (value: unknown) => IExportWebhookEvent;
|
|
|
1286
1293
|
declare const verifyExportWebhookSignature: ({ webhookSecret, timestamp, rawBody, signature, }: IVerifyExportWebhookSignatureParams) => Promise<boolean>;
|
|
1287
1294
|
declare const verifyExportWebhookRequest: ({ webhookSecret, rawBody, headers, maxSkewSeconds, nowTimestampSeconds, }: IVerifyExportWebhookRequestParams) => Promise<boolean>;
|
|
1288
1295
|
|
|
1289
|
-
export { APIError, AssetsResource, AuthError, EditorResource, ExportsResource, type IApiEnvelope, type IApiProblem, type IAsset, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateProjectExportRequest, type ICreateProjectRequest, type ICreateRequestOptions, type IDeleteAssetResponse, type IDeleteProjectAssetResponse, type IDeleteProjectResponse, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListAssetsResponse, type IListExportsResponse, type IListProjectsResponse, type IProjectAssetBindingResponse, type IProjectDetail, type IProjectMetadataResponse, type IProjectSummary, type IProjectSyncResponse, type IRequestOptions, type ISyncProjectRequest, type IUpdateProjectRequest, type IUploadOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IndreamClient, ProjectsResource, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TUploadBody, type TWebhookHeaders, UploadsResource, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
|
|
1296
|
+
export { APIError, AssetsResource, AuthError, EditorResource, ExportsResource, type IApiEnvelope, type IApiProblem, type IAsset, type ICaptionAnimationPresetGroups, type ICaptionAnimationPresetItem, type IClientOptions, type ICreateExportRequest, type ICreateExportResponse, type ICreateProjectExportRequest, type ICreateProjectRequest, type ICreateRequestOptions, type IDeleteAssetResponse, type IDeleteProjectAssetResponse, type IDeleteProjectResponse, type IEditorCapabilities, type IEditorValidationError, type IEditorValidationResult, type IExportTask, type IExportWebhookEvent, type IListAssetsResponse, type IListExportsResponse, type IListProjectsResponse, type IProjectAssetBindingResponse, type IProjectDetail, type IProjectMetadataResponse, type IProjectSummary, type IProjectSyncResponse, type IRequestOptions, type ISyncProjectRequest, type IUpdateProjectRequest, type IUploadOptions, type IVerifyExportWebhookRequestParams, type IVerifyExportWebhookSignatureParams, type IWaitOptions, IllustrationsResource, IndreamClient, ProjectsResource, RateLimitError, type TEditorStateV1, type TExportFormat, type TExportRatio, type TExportWebhookEventType, type TTaskStatus, type TUploadBody, type TWebhookHeaders, UploadsResource, ValidationError, createApiError, isExportTaskSnapshot, isExportWebhookEvent, isExportWebhookEventType, isTaskStatus, parseExportWebhookEvent, toApiProblem, verifyExportWebhookRequest, verifyExportWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -203,6 +203,20 @@ var EditorResource = class {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
// src/resources/illustrations.ts
|
|
207
|
+
var IllustrationsResource = class {
|
|
208
|
+
constructor(client) {
|
|
209
|
+
this.client = client;
|
|
210
|
+
}
|
|
211
|
+
async search(q, options = {}) {
|
|
212
|
+
const query = typeof q === "string" && q.trim() ? "?q=" + encodeURIComponent(q.trim()) : "";
|
|
213
|
+
return await this.client.request("/v1/illustrations" + query, {
|
|
214
|
+
method: "GET",
|
|
215
|
+
signal: options.signal
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
206
220
|
// src/resources/projects.ts
|
|
207
221
|
var ProjectsResource = class {
|
|
208
222
|
constructor(client) {
|
|
@@ -416,6 +430,7 @@ var IndreamClient = class {
|
|
|
416
430
|
this.fetchImpl = options.fetch || fetch;
|
|
417
431
|
this.exports = new ExportsResource(this);
|
|
418
432
|
this.editor = new EditorResource(this);
|
|
433
|
+
this.illustrations = new IllustrationsResource(this);
|
|
419
434
|
this.projects = new ProjectsResource(this);
|
|
420
435
|
this.uploads = new UploadsResource(this);
|
|
421
436
|
this.assets = new AssetsResource(this);
|
|
@@ -425,7 +440,7 @@ var IndreamClient = class {
|
|
|
425
440
|
return envelope.data;
|
|
426
441
|
}
|
|
427
442
|
async requestEnvelope(path, init) {
|
|
428
|
-
const url =
|
|
443
|
+
const url = this.baseURL + (path.startsWith("/") ? path : "/" + path);
|
|
429
444
|
const isJsonPayload = init.body !== void 0 && !isBodyInit(init.body);
|
|
430
445
|
let payload;
|
|
431
446
|
if (init.body !== void 0) {
|
|
@@ -680,6 +695,7 @@ export {
|
|
|
680
695
|
AuthError,
|
|
681
696
|
EditorResource,
|
|
682
697
|
ExportsResource,
|
|
698
|
+
IllustrationsResource,
|
|
683
699
|
IndreamClient,
|
|
684
700
|
ProjectsResource,
|
|
685
701
|
RateLimitError,
|