@nurama/types 1.4.6 → 1.4.7
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/asset.d.ts +200 -4
- package/dist/product.d.ts +25 -0
- package/dist/project.d.ts +21 -0
- package/package.json +1 -1
- package/src/asset.ts +192 -4
- package/src/product.ts +25 -0
- package/src/project.ts +22 -0
package/dist/asset.d.ts
CHANGED
|
@@ -106,14 +106,63 @@ export interface Asset {
|
|
|
106
106
|
*/
|
|
107
107
|
keyPath: string;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
109
|
+
* Client-supplied fingerprint of the original, used to spot duplicate uploads.
|
|
110
|
+
* The web and mobile apps send a SHA-256 of the whole file up to 4 MB and of
|
|
111
|
+
* its first 2 MB, last 2 MB and size beyond that; older SDK callers sent MD5.
|
|
112
|
+
* It is not a full-file hash — see `contentSha256`.
|
|
111
113
|
*/
|
|
112
114
|
checksum: string;
|
|
113
115
|
/**
|
|
114
|
-
* The algorithm used for computing the checksum.
|
|
116
|
+
* The algorithm used for computing the checksum, when recorded.
|
|
115
117
|
*/
|
|
116
|
-
checksumAlgorithm?:
|
|
118
|
+
checksumAlgorithm?: string | null;
|
|
119
|
+
/**
|
|
120
|
+
* Full-file SHA-256 of the original, computed server-side once the upload
|
|
121
|
+
* has been read. Null until then.
|
|
122
|
+
*/
|
|
123
|
+
contentSha256?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* The file name the original was uploaded under. Unlike `name` it does not
|
|
126
|
+
* change when the asset is renamed. Best effort for assets uploaded before it
|
|
127
|
+
* was recorded.
|
|
128
|
+
*/
|
|
129
|
+
originalName?: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Lower-case extension of the original file, without the dot.
|
|
132
|
+
*/
|
|
133
|
+
originalExtension?: string | null;
|
|
134
|
+
/**
|
|
135
|
+
* Size of the original file in bytes. Unlike `sizeInBytes`, which totals
|
|
136
|
+
* every file the asset holds, this is the upload alone.
|
|
137
|
+
*/
|
|
138
|
+
originalSizeInBytes?: number | null;
|
|
139
|
+
/**
|
|
140
|
+
* Where the original file is: `stored` while it is in storage, otherwise
|
|
141
|
+
* pruned or in transition.
|
|
142
|
+
*/
|
|
143
|
+
originalState?: 'stored' | 'pruneRequested' | 'pruning' | 'pruned' | 'restoring' | 'awaitingConfirmation';
|
|
144
|
+
/**
|
|
145
|
+
* When post-processing finished (Unix ms), or null while it is running or
|
|
146
|
+
* has not run.
|
|
147
|
+
*/
|
|
148
|
+
processingCompletedAt?: number | null;
|
|
149
|
+
/** True when the asset is exempt from pruning. */
|
|
150
|
+
keepOriginal?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* When a requested prune runs (Unix ms): the end of the undo window, or the
|
|
153
|
+
* next retry after a failed attempt.
|
|
154
|
+
*/
|
|
155
|
+
pruneAfter?: number | null;
|
|
156
|
+
/** Who requested the waiting prune; null for the project policy. */
|
|
157
|
+
pruneRequestedById?: string | null;
|
|
158
|
+
/** Whether a person or the project policy asked for the prune. */
|
|
159
|
+
pruneReason?: 'manual' | 'policy' | null;
|
|
160
|
+
/** When the original was pruned (Unix ms). */
|
|
161
|
+
prunedAt?: number | null;
|
|
162
|
+
/** Failed prune attempts since the last success or request. */
|
|
163
|
+
pruneAttempts?: number;
|
|
164
|
+
/** Why the last prune attempt failed, or why the policy set the asset aside. */
|
|
165
|
+
pruneError?: string | null;
|
|
117
166
|
/**
|
|
118
167
|
* The name of the asset used on the platform.
|
|
119
168
|
*/
|
|
@@ -390,6 +439,11 @@ export interface AssetReference {
|
|
|
390
439
|
/** Human-readable, e.g. "Submission / Round 2". */
|
|
391
440
|
label: string;
|
|
392
441
|
createdAt?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Public references only: whether the release is live (`active`) or has been
|
|
444
|
+
* `disabled`, has `expired` or hit an `error`. Null when the release is gone.
|
|
445
|
+
*/
|
|
446
|
+
releaseStatus?: 'active' | 'disabled' | 'expired' | 'error' | null;
|
|
393
447
|
}
|
|
394
448
|
/**
|
|
395
449
|
* One reference a pending delete would remove, with the asset it belongs to —
|
|
@@ -432,6 +486,8 @@ export interface AssetPrimaryReference {
|
|
|
432
486
|
export interface AssetReferences {
|
|
433
487
|
assetId: string;
|
|
434
488
|
assetName: string;
|
|
489
|
+
/** Whether the asset has ever been in a public release; stays true after it leaves. */
|
|
490
|
+
everPublic: boolean;
|
|
435
491
|
primaryRoot: string;
|
|
436
492
|
primary: AssetPrimaryReference[];
|
|
437
493
|
secondary: Record<AssetReferenceKind, AssetReference[]>;
|
|
@@ -439,3 +495,143 @@ export interface AssetReferences {
|
|
|
439
495
|
counts: Partial<Record<AssetReferenceKind, number>>;
|
|
440
496
|
secondaryCount: number;
|
|
441
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Whether an asset's original can be pruned, and what pruning would cost.
|
|
500
|
+
* `reasons` block the prune; `warnings` never do.
|
|
501
|
+
*/
|
|
502
|
+
export interface AssetPruneEligibility {
|
|
503
|
+
eligible: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* `notProjectMedia`, `unsupportedMediaType`, `notActive`,
|
|
506
|
+
* `processingNotFinished`, `processingFailed`, `renditionsPending`,
|
|
507
|
+
* `documentNotProcessed`, `missingOutputs`, `keepOriginal`, `noOriginal`,
|
|
508
|
+
* `originalNotStored`; for the policy only, `policyDisabled`,
|
|
509
|
+
* `mediaTypeExcluded`, `published`, `inSubmission`.
|
|
510
|
+
*/
|
|
511
|
+
reasons: string[];
|
|
512
|
+
/**
|
|
513
|
+
* `noDownloadableVersion`, `reducedResolution`, `compressedModelOnly`,
|
|
514
|
+
* `documentPreviewOnly`, `sharedElsewhere`, `cannotReprocess`.
|
|
515
|
+
*/
|
|
516
|
+
warnings: string[];
|
|
517
|
+
/** Where else the asset can be seen; every one of these loses the original too. */
|
|
518
|
+
references: {
|
|
519
|
+
reviewers: boolean;
|
|
520
|
+
publicLinks: boolean;
|
|
521
|
+
publicCollections: number;
|
|
522
|
+
submissions: number;
|
|
523
|
+
};
|
|
524
|
+
/** Storage the prune would free. */
|
|
525
|
+
bytesReclaimed: number;
|
|
526
|
+
}
|
|
527
|
+
/** Everything about an asset's original, from `GET /v1/assets/:assetId/original`. */
|
|
528
|
+
export interface AssetOriginalStatus {
|
|
529
|
+
assetId: string;
|
|
530
|
+
originalState: NonNullable<Asset['originalState']>;
|
|
531
|
+
keepOriginal: boolean;
|
|
532
|
+
pruneAfter: number | null;
|
|
533
|
+
pruneReason: 'manual' | 'policy' | null;
|
|
534
|
+
prunedAt: number | null;
|
|
535
|
+
pruneAttempts: number;
|
|
536
|
+
pruneError: string | null;
|
|
537
|
+
contentSha256: string | null;
|
|
538
|
+
originalName: string | null;
|
|
539
|
+
originalExtension: string | null;
|
|
540
|
+
originalSizeInBytes: number | null;
|
|
541
|
+
processingCompletedAt: number | null;
|
|
542
|
+
eligibility: AssetPruneEligibility;
|
|
543
|
+
policy: {
|
|
544
|
+
enabled: boolean;
|
|
545
|
+
mediaTypes: string[];
|
|
546
|
+
graceDays: number;
|
|
547
|
+
skipPublished: boolean;
|
|
548
|
+
skipInSubmissions: boolean;
|
|
549
|
+
/** Whether the policy covers this asset at all. */
|
|
550
|
+
appliesToAsset: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Why an enabled policy leaves the asset alone: `mediaTypeExcluded`,
|
|
553
|
+
* `published` (shared with reviewers or publicly), `inSubmission`. Empty
|
|
554
|
+
* when the policy is off or covers the asset. Optional for older servers.
|
|
555
|
+
*/
|
|
556
|
+
skippedBecause?: Array<'mediaTypeExcluded' | 'published' | 'inSubmission'>;
|
|
557
|
+
/** When the policy will consider the asset (Unix ms). */
|
|
558
|
+
eligibleFrom: number | null;
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
/** One event in an asset's original history. */
|
|
562
|
+
export interface AssetOriginalHistoryEntry {
|
|
563
|
+
id: string;
|
|
564
|
+
assetId: string;
|
|
565
|
+
action: 'hashed' | 'pruneRequested' | 'pruneCancelled' | 'pruned' | 'pruneFailed' | 'keepOriginalSet' | 'keepOriginalCleared';
|
|
566
|
+
/** Who acted; null when the system did. */
|
|
567
|
+
actor: {
|
|
568
|
+
id: string;
|
|
569
|
+
displayName: string | null;
|
|
570
|
+
} | null;
|
|
571
|
+
sha256: string | null;
|
|
572
|
+
sizeInBytes: number | null;
|
|
573
|
+
fileName: string | null;
|
|
574
|
+
relatedSha256: string | null;
|
|
575
|
+
relatedAssetId: string | null;
|
|
576
|
+
note: string | null;
|
|
577
|
+
createdAt: number;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Assets a bulk prune request acts on: ids, paths in the project's creator
|
|
581
|
+
* tree (a folder includes everything inside it), or both.
|
|
582
|
+
*/
|
|
583
|
+
export interface AssetPruneSelection {
|
|
584
|
+
assetIds?: string[];
|
|
585
|
+
itemPaths?: string[];
|
|
586
|
+
}
|
|
587
|
+
/** What pruning a selection would do. */
|
|
588
|
+
export interface AssetPrunePreview {
|
|
589
|
+
totals: {
|
|
590
|
+
selected: number;
|
|
591
|
+
eligible: number;
|
|
592
|
+
ineligible: number;
|
|
593
|
+
bytesReclaimed: number;
|
|
594
|
+
};
|
|
595
|
+
assets: Array<AssetPruneEligibility & {
|
|
596
|
+
assetId: string;
|
|
597
|
+
name: string;
|
|
598
|
+
mediaType: string;
|
|
599
|
+
originalState: string;
|
|
600
|
+
}>;
|
|
601
|
+
notFound: string[];
|
|
602
|
+
}
|
|
603
|
+
/** Which prunes a bulk request scheduled. */
|
|
604
|
+
export interface AssetPruneRequestResult {
|
|
605
|
+
requested: string[];
|
|
606
|
+
skipped: Array<{
|
|
607
|
+
assetId: string;
|
|
608
|
+
reasons: string[];
|
|
609
|
+
}>;
|
|
610
|
+
/** When the requested prunes run (Unix ms). */
|
|
611
|
+
pruneAfter: number;
|
|
612
|
+
notFound: string[];
|
|
613
|
+
}
|
|
614
|
+
/** Which prunes a bulk cancel stopped. */
|
|
615
|
+
export interface AssetPruneCancelResult {
|
|
616
|
+
cancelled: string[];
|
|
617
|
+
notCancelled: string[];
|
|
618
|
+
notFound: string[];
|
|
619
|
+
}
|
|
620
|
+
/** Pruning in a project at a glance. */
|
|
621
|
+
export interface ProjectPruningSummary {
|
|
622
|
+
policy: {
|
|
623
|
+
enabled: boolean;
|
|
624
|
+
mediaTypes: string[];
|
|
625
|
+
graceDays: number;
|
|
626
|
+
skipPublished: boolean;
|
|
627
|
+
skipInSubmissions: boolean;
|
|
628
|
+
};
|
|
629
|
+
/** Active media assets by `originalState`. */
|
|
630
|
+
counts: Record<string, number>;
|
|
631
|
+
/** Assets exempt from pruning. */
|
|
632
|
+
keepOriginal: number;
|
|
633
|
+
/** Size of the originals pruned so far. */
|
|
634
|
+
prunedBytes: number;
|
|
635
|
+
/** Assets the policy would prune on its next runs. */
|
|
636
|
+
policyCandidates: number;
|
|
637
|
+
}
|
package/dist/product.d.ts
CHANGED
|
@@ -116,6 +116,31 @@ export interface Product {
|
|
|
116
116
|
* Product status.
|
|
117
117
|
*/
|
|
118
118
|
status: 'active' | 'inactive';
|
|
119
|
+
/**
|
|
120
|
+
* True for a promo plan restricted to particular users or workspaces. The
|
|
121
|
+
* plan catalogue (`GET /v1/products/plans`) sends this instead of
|
|
122
|
+
* `restrictTo`, which stays server-side.
|
|
123
|
+
*/
|
|
124
|
+
restricted?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Nu Credits granted on top, once, when the plan is bought annually.
|
|
127
|
+
* Plan catalogue only.
|
|
128
|
+
*/
|
|
129
|
+
annualBonusCredits?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Whether `credits` is granted each billing cycle (`monthly`) or once
|
|
132
|
+
* (`oneTime`).
|
|
133
|
+
*/
|
|
134
|
+
grantMode?: 'monthly' | 'oneTime';
|
|
135
|
+
/**
|
|
136
|
+
* Price of one creator seat beyond `seats`, per currency and period. Empty
|
|
137
|
+
* when the plan sells no extra seats. Plan catalogue only.
|
|
138
|
+
*/
|
|
139
|
+
extraSeatPrices?: ProductPrice[];
|
|
140
|
+
/** Convo minutes included. */
|
|
141
|
+
convoMinutes?: number;
|
|
142
|
+
/** Support tier the plan includes. */
|
|
143
|
+
supportLevel?: 'standard' | 'priority' | 'dedicated';
|
|
119
144
|
/**
|
|
120
145
|
* Product creation timestamp.
|
|
121
146
|
* @format date-time
|
package/dist/project.d.ts
CHANGED
|
@@ -13,6 +13,27 @@ export interface ProjectSettings {
|
|
|
13
13
|
allowAiFeatures?: boolean | null;
|
|
14
14
|
aiPolishEnabled?: boolean | null;
|
|
15
15
|
aiCustomPreprompt?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Automatic pruning of originals. Null (or absent) leaves it off. Set per
|
|
18
|
+
* project; there is no workspace-wide policy.
|
|
19
|
+
*/
|
|
20
|
+
originalPruning?: OriginalPruningPolicy | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A project's automatic pruning of originals: deleting the uploaded file once
|
|
24
|
+
* post-processing has finished, keeping every processed version. Omitted
|
|
25
|
+
* fields take their defaults.
|
|
26
|
+
*/
|
|
27
|
+
export interface OriginalPruningPolicy {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
/** Media types the policy prunes. Defaults to every prunable type but documents. */
|
|
30
|
+
mediaTypes?: Array<'video' | 'audio' | 'image' | '3d' | 'document'>;
|
|
31
|
+
/** Days after post-processing finishes before an asset is pruned (0–90, default 7). */
|
|
32
|
+
graceDays?: number;
|
|
33
|
+
/** Leave alone assets reviewers, public links or public collections can see (default true). */
|
|
34
|
+
skipPublished?: boolean;
|
|
35
|
+
/** Leave alone assets included in a submission (default true). */
|
|
36
|
+
skipInSubmissions?: boolean;
|
|
16
37
|
}
|
|
17
38
|
/**
|
|
18
39
|
* Represents a project within a workspace.
|
package/package.json
CHANGED
package/src/asset.ts
CHANGED
|
@@ -117,14 +117,63 @@ export interface Asset {
|
|
|
117
117
|
*/
|
|
118
118
|
keyPath: string;
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
120
|
+
* Client-supplied fingerprint of the original, used to spot duplicate uploads.
|
|
121
|
+
* The web and mobile apps send a SHA-256 of the whole file up to 4 MB and of
|
|
122
|
+
* its first 2 MB, last 2 MB and size beyond that; older SDK callers sent MD5.
|
|
123
|
+
* It is not a full-file hash — see `contentSha256`.
|
|
122
124
|
*/
|
|
123
125
|
checksum: string;
|
|
124
126
|
/**
|
|
125
|
-
* The algorithm used for computing the checksum.
|
|
127
|
+
* The algorithm used for computing the checksum, when recorded.
|
|
126
128
|
*/
|
|
127
|
-
checksumAlgorithm?:
|
|
129
|
+
checksumAlgorithm?: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Full-file SHA-256 of the original, computed server-side once the upload
|
|
132
|
+
* has been read. Null until then.
|
|
133
|
+
*/
|
|
134
|
+
contentSha256?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* The file name the original was uploaded under. Unlike `name` it does not
|
|
137
|
+
* change when the asset is renamed. Best effort for assets uploaded before it
|
|
138
|
+
* was recorded.
|
|
139
|
+
*/
|
|
140
|
+
originalName?: string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Lower-case extension of the original file, without the dot.
|
|
143
|
+
*/
|
|
144
|
+
originalExtension?: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Size of the original file in bytes. Unlike `sizeInBytes`, which totals
|
|
147
|
+
* every file the asset holds, this is the upload alone.
|
|
148
|
+
*/
|
|
149
|
+
originalSizeInBytes?: number | null;
|
|
150
|
+
/**
|
|
151
|
+
* Where the original file is: `stored` while it is in storage, otherwise
|
|
152
|
+
* pruned or in transition.
|
|
153
|
+
*/
|
|
154
|
+
originalState?: 'stored' | 'pruneRequested' | 'pruning' | 'pruned' | 'restoring' | 'awaitingConfirmation';
|
|
155
|
+
/**
|
|
156
|
+
* When post-processing finished (Unix ms), or null while it is running or
|
|
157
|
+
* has not run.
|
|
158
|
+
*/
|
|
159
|
+
processingCompletedAt?: number | null;
|
|
160
|
+
/** True when the asset is exempt from pruning. */
|
|
161
|
+
keepOriginal?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* When a requested prune runs (Unix ms): the end of the undo window, or the
|
|
164
|
+
* next retry after a failed attempt.
|
|
165
|
+
*/
|
|
166
|
+
pruneAfter?: number | null;
|
|
167
|
+
/** Who requested the waiting prune; null for the project policy. */
|
|
168
|
+
pruneRequestedById?: string | null;
|
|
169
|
+
/** Whether a person or the project policy asked for the prune. */
|
|
170
|
+
pruneReason?: 'manual' | 'policy' | null;
|
|
171
|
+
/** When the original was pruned (Unix ms). */
|
|
172
|
+
prunedAt?: number | null;
|
|
173
|
+
/** Failed prune attempts since the last success or request. */
|
|
174
|
+
pruneAttempts?: number;
|
|
175
|
+
/** Why the last prune attempt failed, or why the policy set the asset aside. */
|
|
176
|
+
pruneError?: string | null;
|
|
128
177
|
/**
|
|
129
178
|
* The name of the asset used on the platform.
|
|
130
179
|
*/
|
|
@@ -408,6 +457,11 @@ export interface AssetReference {
|
|
|
408
457
|
/** Human-readable, e.g. "Submission / Round 2". */
|
|
409
458
|
label: string;
|
|
410
459
|
createdAt?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Public references only: whether the release is live (`active`) or has been
|
|
462
|
+
* `disabled`, has `expired` or hit an `error`. Null when the release is gone.
|
|
463
|
+
*/
|
|
464
|
+
releaseStatus?: 'active' | 'disabled' | 'expired' | 'error' | null;
|
|
411
465
|
}
|
|
412
466
|
|
|
413
467
|
/**
|
|
@@ -454,6 +508,8 @@ export interface AssetPrimaryReference {
|
|
|
454
508
|
export interface AssetReferences {
|
|
455
509
|
assetId: string;
|
|
456
510
|
assetName: string;
|
|
511
|
+
/** Whether the asset has ever been in a public release; stays true after it leaves. */
|
|
512
|
+
everPublic: boolean;
|
|
457
513
|
primaryRoot: string;
|
|
458
514
|
primary: AssetPrimaryReference[];
|
|
459
515
|
secondary: Record<AssetReferenceKind, AssetReference[]>;
|
|
@@ -461,3 +517,135 @@ export interface AssetReferences {
|
|
|
461
517
|
counts: Partial<Record<AssetReferenceKind, number>>;
|
|
462
518
|
secondaryCount: number;
|
|
463
519
|
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Whether an asset's original can be pruned, and what pruning would cost.
|
|
523
|
+
* `reasons` block the prune; `warnings` never do.
|
|
524
|
+
*/
|
|
525
|
+
export interface AssetPruneEligibility {
|
|
526
|
+
eligible: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* `notProjectMedia`, `unsupportedMediaType`, `notActive`,
|
|
529
|
+
* `processingNotFinished`, `processingFailed`, `renditionsPending`,
|
|
530
|
+
* `documentNotProcessed`, `missingOutputs`, `keepOriginal`, `noOriginal`,
|
|
531
|
+
* `originalNotStored`; for the policy only, `policyDisabled`,
|
|
532
|
+
* `mediaTypeExcluded`, `published`, `inSubmission`.
|
|
533
|
+
*/
|
|
534
|
+
reasons: string[];
|
|
535
|
+
/**
|
|
536
|
+
* `noDownloadableVersion`, `reducedResolution`, `compressedModelOnly`,
|
|
537
|
+
* `documentPreviewOnly`, `sharedElsewhere`, `cannotReprocess`.
|
|
538
|
+
*/
|
|
539
|
+
warnings: string[];
|
|
540
|
+
/** Where else the asset can be seen; every one of these loses the original too. */
|
|
541
|
+
references: {
|
|
542
|
+
reviewers: boolean;
|
|
543
|
+
publicLinks: boolean;
|
|
544
|
+
publicCollections: number;
|
|
545
|
+
submissions: number;
|
|
546
|
+
};
|
|
547
|
+
/** Storage the prune would free. */
|
|
548
|
+
bytesReclaimed: number;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/** Everything about an asset's original, from `GET /v1/assets/:assetId/original`. */
|
|
552
|
+
export interface AssetOriginalStatus {
|
|
553
|
+
assetId: string;
|
|
554
|
+
originalState: NonNullable<Asset['originalState']>;
|
|
555
|
+
keepOriginal: boolean;
|
|
556
|
+
pruneAfter: number | null;
|
|
557
|
+
pruneReason: 'manual' | 'policy' | null;
|
|
558
|
+
prunedAt: number | null;
|
|
559
|
+
pruneAttempts: number;
|
|
560
|
+
pruneError: string | null;
|
|
561
|
+
contentSha256: string | null;
|
|
562
|
+
originalName: string | null;
|
|
563
|
+
originalExtension: string | null;
|
|
564
|
+
originalSizeInBytes: number | null;
|
|
565
|
+
processingCompletedAt: number | null;
|
|
566
|
+
eligibility: AssetPruneEligibility;
|
|
567
|
+
policy: {
|
|
568
|
+
enabled: boolean;
|
|
569
|
+
mediaTypes: string[];
|
|
570
|
+
graceDays: number;
|
|
571
|
+
skipPublished: boolean;
|
|
572
|
+
skipInSubmissions: boolean;
|
|
573
|
+
/** Whether the policy covers this asset at all. */
|
|
574
|
+
appliesToAsset: boolean;
|
|
575
|
+
/**
|
|
576
|
+
* Why an enabled policy leaves the asset alone: `mediaTypeExcluded`,
|
|
577
|
+
* `published` (shared with reviewers or publicly), `inSubmission`. Empty
|
|
578
|
+
* when the policy is off or covers the asset. Optional for older servers.
|
|
579
|
+
*/
|
|
580
|
+
skippedBecause?: Array<'mediaTypeExcluded' | 'published' | 'inSubmission'>;
|
|
581
|
+
/** When the policy will consider the asset (Unix ms). */
|
|
582
|
+
eligibleFrom: number | null;
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/** One event in an asset's original history. */
|
|
587
|
+
export interface AssetOriginalHistoryEntry {
|
|
588
|
+
id: string;
|
|
589
|
+
assetId: string;
|
|
590
|
+
action: 'hashed' | 'pruneRequested' | 'pruneCancelled' | 'pruned' | 'pruneFailed' | 'keepOriginalSet' | 'keepOriginalCleared';
|
|
591
|
+
/** Who acted; null when the system did. */
|
|
592
|
+
actor: { id: string; displayName: string | null } | null;
|
|
593
|
+
sha256: string | null;
|
|
594
|
+
sizeInBytes: number | null;
|
|
595
|
+
fileName: string | null;
|
|
596
|
+
relatedSha256: string | null;
|
|
597
|
+
relatedAssetId: string | null;
|
|
598
|
+
note: string | null;
|
|
599
|
+
createdAt: number;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Assets a bulk prune request acts on: ids, paths in the project's creator
|
|
604
|
+
* tree (a folder includes everything inside it), or both.
|
|
605
|
+
*/
|
|
606
|
+
export interface AssetPruneSelection {
|
|
607
|
+
assetIds?: string[];
|
|
608
|
+
itemPaths?: string[];
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/** What pruning a selection would do. */
|
|
612
|
+
export interface AssetPrunePreview {
|
|
613
|
+
totals: { selected: number; eligible: number; ineligible: number; bytesReclaimed: number };
|
|
614
|
+
assets: Array<AssetPruneEligibility & { assetId: string; name: string; mediaType: string; originalState: string }>;
|
|
615
|
+
notFound: string[];
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/** Which prunes a bulk request scheduled. */
|
|
619
|
+
export interface AssetPruneRequestResult {
|
|
620
|
+
requested: string[];
|
|
621
|
+
skipped: Array<{ assetId: string; reasons: string[] }>;
|
|
622
|
+
/** When the requested prunes run (Unix ms). */
|
|
623
|
+
pruneAfter: number;
|
|
624
|
+
notFound: string[];
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** Which prunes a bulk cancel stopped. */
|
|
628
|
+
export interface AssetPruneCancelResult {
|
|
629
|
+
cancelled: string[];
|
|
630
|
+
notCancelled: string[];
|
|
631
|
+
notFound: string[];
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/** Pruning in a project at a glance. */
|
|
635
|
+
export interface ProjectPruningSummary {
|
|
636
|
+
policy: {
|
|
637
|
+
enabled: boolean;
|
|
638
|
+
mediaTypes: string[];
|
|
639
|
+
graceDays: number;
|
|
640
|
+
skipPublished: boolean;
|
|
641
|
+
skipInSubmissions: boolean;
|
|
642
|
+
};
|
|
643
|
+
/** Active media assets by `originalState`. */
|
|
644
|
+
counts: Record<string, number>;
|
|
645
|
+
/** Assets exempt from pruning. */
|
|
646
|
+
keepOriginal: number;
|
|
647
|
+
/** Size of the originals pruned so far. */
|
|
648
|
+
prunedBytes: number;
|
|
649
|
+
/** Assets the policy would prune on its next runs. */
|
|
650
|
+
policyCandidates: number;
|
|
651
|
+
}
|
package/src/product.ts
CHANGED
|
@@ -120,6 +120,31 @@ export interface Product {
|
|
|
120
120
|
* Product status.
|
|
121
121
|
*/
|
|
122
122
|
status: 'active' | 'inactive';
|
|
123
|
+
/**
|
|
124
|
+
* True for a promo plan restricted to particular users or workspaces. The
|
|
125
|
+
* plan catalogue (`GET /v1/products/plans`) sends this instead of
|
|
126
|
+
* `restrictTo`, which stays server-side.
|
|
127
|
+
*/
|
|
128
|
+
restricted?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Nu Credits granted on top, once, when the plan is bought annually.
|
|
131
|
+
* Plan catalogue only.
|
|
132
|
+
*/
|
|
133
|
+
annualBonusCredits?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Whether `credits` is granted each billing cycle (`monthly`) or once
|
|
136
|
+
* (`oneTime`).
|
|
137
|
+
*/
|
|
138
|
+
grantMode?: 'monthly' | 'oneTime';
|
|
139
|
+
/**
|
|
140
|
+
* Price of one creator seat beyond `seats`, per currency and period. Empty
|
|
141
|
+
* when the plan sells no extra seats. Plan catalogue only.
|
|
142
|
+
*/
|
|
143
|
+
extraSeatPrices?: ProductPrice[];
|
|
144
|
+
/** Convo minutes included. */
|
|
145
|
+
convoMinutes?: number;
|
|
146
|
+
/** Support tier the plan includes. */
|
|
147
|
+
supportLevel?: 'standard' | 'priority' | 'dedicated';
|
|
123
148
|
/**
|
|
124
149
|
* Product creation timestamp.
|
|
125
150
|
* @format date-time
|
package/src/project.ts
CHANGED
|
@@ -14,6 +14,28 @@ export interface ProjectSettings {
|
|
|
14
14
|
allowAiFeatures?: boolean | null;
|
|
15
15
|
aiPolishEnabled?: boolean | null;
|
|
16
16
|
aiCustomPreprompt?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Automatic pruning of originals. Null (or absent) leaves it off. Set per
|
|
19
|
+
* project; there is no workspace-wide policy.
|
|
20
|
+
*/
|
|
21
|
+
originalPruning?: OriginalPruningPolicy | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A project's automatic pruning of originals: deleting the uploaded file once
|
|
26
|
+
* post-processing has finished, keeping every processed version. Omitted
|
|
27
|
+
* fields take their defaults.
|
|
28
|
+
*/
|
|
29
|
+
export interface OriginalPruningPolicy {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
/** Media types the policy prunes. Defaults to every prunable type but documents. */
|
|
32
|
+
mediaTypes?: Array<'video' | 'audio' | 'image' | '3d' | 'document'>;
|
|
33
|
+
/** Days after post-processing finishes before an asset is pruned (0–90, default 7). */
|
|
34
|
+
graceDays?: number;
|
|
35
|
+
/** Leave alone assets reviewers, public links or public collections can see (default true). */
|
|
36
|
+
skipPublished?: boolean;
|
|
37
|
+
/** Leave alone assets included in a submission (default true). */
|
|
38
|
+
skipInSubmissions?: boolean;
|
|
17
39
|
}
|
|
18
40
|
|
|
19
41
|
/**
|