Skip to content

Commit

Permalink
wip: Continue working on supporting packages
Browse files Browse the repository at this point in the history
  • Loading branch information
KallynGowdy committed Nov 11, 2024
1 parent 236c881 commit 6d29992
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 402 deletions.
28 changes: 28 additions & 0 deletions src/aux-records/SubscriptionConfigBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
FileFeaturesConfiguration,
InstsFeaturesConfiguration,
NotificationFeaturesConfiguration,
PackageFeaturesConfiguration,
PublicInstsConfiguration,
RecordFeaturesConfiguration,
StudioComIdFeaturesConfiguration,
Expand Down Expand Up @@ -239,6 +240,33 @@ export class FeaturesBuilder {
return this;
}

withPackages(features?: PackageFeaturesConfiguration): this {
this._features.packages = features ?? {
allowed: true,
};
return this;
}

withPackagesMaxItems(maxItems: number): this {
this._features.packages.maxItems = maxItems;
return this;
}

withPackagesMaxVersions(maxVersions: number): this {
this._features.packages.maxPackageVersions = maxVersions;
return this;
}

withPackagesMaxVersionSizeInBytes(maxSize: number): this {
this._features.packages.maxPackageVersionSizeInBytes = maxSize;
return this;
}

withPackagesMaxBytesTotal(maxBytes: number): this {
this._features.packages.maxPackageBytesTotal = maxBytes;
return this;
}

get features() {
return this._features;
}
Expand Down
2 changes: 1 addition & 1 deletion src/aux-records/SubscriptionConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export const subscriptionFeaturesSchema = z.object({
.boolean()
.describe('Whether packages are allowed for the subscription.'),

maxPackages: z
maxItems: z
.number()
.describe(
'The maximum number of packages that are allowed for the subscription. If not specified, then there is no limit.'
Expand Down
Loading

0 comments on commit 6d29992

Please sign in to comment.