shred-api-client 2.12.1 → 2.13.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.d.ts CHANGED
@@ -1713,11 +1713,17 @@ type Preferences = z.infer<typeof PreferencesSchema>;
1713
1713
  interface IAPI$c {
1714
1714
  getByInviteCode: (code: string, context?: Context) => Promise<Tenant | null>;
1715
1715
  create: (tenant: Tenant, context: Context) => Promise<boolean>;
1716
- list: (context: Context) => Promise<Tenant[]>;
1716
+ /** Deleted tenants are left out unless `includeInactive` is true. */
1717
+ list: (context: Context, options?: ListOptions) => Promise<Tenant[]>;
1717
1718
  getTenant: (context: Context, tenantId?: string) => Promise<Tenant | null>;
1718
1719
  getMembers: (context: Context, tenantId: string) => Promise<Member[]>;
1719
1720
  update: (tenantId: string, data: TenantUpdate, context: Context) => Promise<boolean>;
1720
1721
  updateMembers: (tenantId: string, memberUpdate: MemberUpdate, context: Context) => Promise<boolean>;
1722
+ /** Logical delete: the tenant becomes inactive and every member leaves it. */
1723
+ delete: (tenantId: string, context: Context) => Promise<boolean>;
1724
+ }
1725
+ interface ListOptions {
1726
+ includeInactive?: boolean;
1721
1727
  }
1722
1728
  declare const Endpoints$b: {
1723
1729
  GetByInviteCode: {
@@ -1752,8 +1758,13 @@ declare const Endpoints$b: {
1752
1758
  uri: string;
1753
1759
  method: string;
1754
1760
  };
1761
+ DeleteTenant: {
1762
+ uri: string;
1763
+ method: string;
1764
+ };
1755
1765
  };
1756
1766
 
1767
+ type index$d_ListOptions = ListOptions;
1757
1768
  type index$d_Member = Member;
1758
1769
  declare const index$d_MemberSchema: typeof MemberSchema;
1759
1770
  type index$d_MemberUpdate = MemberUpdate;
@@ -1764,7 +1775,7 @@ declare const index$d_TenantSchema: typeof TenantSchema;
1764
1775
  type index$d_TenantUpdate = TenantUpdate;
1765
1776
  declare const index$d_TenantUpdateSchema: typeof TenantUpdateSchema;
1766
1777
  declare namespace index$d {
1767
- export { Action$1 as Action, Endpoints$b as Endpoints, type Tenant as Entity, type IAPI$c as IAPI, type index$d_Member as Member, index$d_MemberSchema as MemberSchema, type index$d_MemberUpdate as MemberUpdate, index$d_MemberUpdateSchema as MemberUpdateSchema, type index$d_Preferences as Preferences, index$d_PreferencesSchema as PreferencesSchema, index$d_TenantSchema as TenantSchema, type index$d_TenantUpdate as TenantUpdate, index$d_TenantUpdateSchema as TenantUpdateSchema };
1778
+ export { Action$1 as Action, Endpoints$b as Endpoints, type Tenant as Entity, type IAPI$c as IAPI, type index$d_ListOptions as ListOptions, type index$d_Member as Member, index$d_MemberSchema as MemberSchema, type index$d_MemberUpdate as MemberUpdate, index$d_MemberUpdateSchema as MemberUpdateSchema, type index$d_Preferences as Preferences, index$d_PreferencesSchema as PreferencesSchema, index$d_TenantSchema as TenantSchema, type index$d_TenantUpdate as TenantUpdate, index$d_TenantUpdateSchema as TenantUpdateSchema };
1768
1779
  }
1769
1780
 
1770
1781
  declare const TrackParamSchema: z.ZodObject<{
@@ -5065,6 +5076,24 @@ declare const ScoreProgressSchema: z.ZodObject<{
5065
5076
  period: z.ZodString;
5066
5077
  periodLabel: z.ZodString;
5067
5078
  computedAt: z.ZodNumber;
5079
+ value: z.ZodNumber;
5080
+ hasData: z.ZodBoolean;
5081
+ band: z.ZodOptional<z.ZodObject<{
5082
+ key: z.ZodString;
5083
+ label: z.ZodString;
5084
+ min: z.ZodNumber;
5085
+ max: z.ZodNumber;
5086
+ }, "strip", z.ZodTypeAny, {
5087
+ label: string;
5088
+ min: number;
5089
+ max: number;
5090
+ key: string;
5091
+ }, {
5092
+ label: string;
5093
+ min: number;
5094
+ max: number;
5095
+ key: string;
5096
+ }>>;
5068
5097
  metrics: z.ZodArray<z.ZodObject<{
5069
5098
  key: z.ZodString;
5070
5099
  value: z.ZodNumber;
@@ -5081,7 +5110,61 @@ declare const ScoreProgressSchema: z.ZodObject<{
5081
5110
  target: number;
5082
5111
  available: boolean;
5083
5112
  }>, "many">;
5113
+ history: z.ZodArray<z.ZodObject<{
5114
+ period: z.ZodString;
5115
+ label: z.ZodString;
5116
+ value: z.ZodNumber;
5117
+ band: z.ZodOptional<z.ZodObject<{
5118
+ key: z.ZodString;
5119
+ label: z.ZodString;
5120
+ min: z.ZodNumber;
5121
+ max: z.ZodNumber;
5122
+ }, "strip", z.ZodTypeAny, {
5123
+ label: string;
5124
+ min: number;
5125
+ max: number;
5126
+ key: string;
5127
+ }, {
5128
+ label: string;
5129
+ min: number;
5130
+ max: number;
5131
+ key: string;
5132
+ }>>;
5133
+ }, "strip", z.ZodTypeAny, {
5134
+ value: number;
5135
+ label: string;
5136
+ period: string;
5137
+ band?: {
5138
+ label: string;
5139
+ min: number;
5140
+ max: number;
5141
+ key: string;
5142
+ } | undefined;
5143
+ }, {
5144
+ value: number;
5145
+ label: string;
5146
+ period: string;
5147
+ band?: {
5148
+ label: string;
5149
+ min: number;
5150
+ max: number;
5151
+ key: string;
5152
+ } | undefined;
5153
+ }>, "many">;
5084
5154
  }, "strip", z.ZodTypeAny, {
5155
+ value: number;
5156
+ history: {
5157
+ value: number;
5158
+ label: string;
5159
+ period: string;
5160
+ band?: {
5161
+ label: string;
5162
+ min: number;
5163
+ max: number;
5164
+ key: string;
5165
+ } | undefined;
5166
+ }[];
5167
+ hasData: boolean;
5085
5168
  period: string;
5086
5169
  periodLabel: string;
5087
5170
  computedAt: number;
@@ -5091,7 +5174,26 @@ declare const ScoreProgressSchema: z.ZodObject<{
5091
5174
  target: number;
5092
5175
  available: boolean;
5093
5176
  }[];
5177
+ band?: {
5178
+ label: string;
5179
+ min: number;
5180
+ max: number;
5181
+ key: string;
5182
+ } | undefined;
5094
5183
  }, {
5184
+ value: number;
5185
+ history: {
5186
+ value: number;
5187
+ label: string;
5188
+ period: string;
5189
+ band?: {
5190
+ label: string;
5191
+ min: number;
5192
+ max: number;
5193
+ key: string;
5194
+ } | undefined;
5195
+ }[];
5196
+ hasData: boolean;
5095
5197
  period: string;
5096
5198
  periodLabel: string;
5097
5199
  computedAt: number;
@@ -5101,6 +5203,12 @@ declare const ScoreProgressSchema: z.ZodObject<{
5101
5203
  target: number;
5102
5204
  available: boolean;
5103
5205
  }[];
5206
+ band?: {
5207
+ label: string;
5208
+ min: number;
5209
+ max: number;
5210
+ key: string;
5211
+ } | undefined;
5104
5212
  }>;
5105
5213
  type ScoreMetricKey = z.infer<typeof ScoreMetricKeySchema>;
5106
5214
  type ScoreBand = z.infer<typeof ScoreBandSchema>;
@@ -5221,6 +5329,7 @@ declare const Actions: {
5221
5329
  readonly TENANT_LIST: "tenant.list";
5222
5330
  readonly TENANT_VIEW: "tenant.view";
5223
5331
  readonly TENANT_UPDATE: "tenant.update";
5332
+ readonly TENANT_DELETE: "tenant.delete";
5224
5333
  readonly TENANT_VIEW_MEMBERS: "tenant.view_members";
5225
5334
  readonly TENANT_UPDATE_MEMBERS: "tenant.update_members";
5226
5335
  readonly TENANT_VIEW_REPORT: "tenant.view_report";
package/dist/index.js CHANGED
@@ -4747,11 +4747,12 @@ var TenantAPI = class {
4747
4747
  );
4748
4748
  return data;
4749
4749
  }
4750
- async list(context) {
4750
+ async list(context, options) {
4751
4751
  const endpointInfo = tenant_exports.Endpoints.ListAll;
4752
+ const endpoint = (options == null ? void 0 : options.includeInactive) ? `${endpointInfo.uri}?includeInactive=true` : endpointInfo.uri;
4752
4753
  const data = await this.clientHTTP.makeRequest(
4753
4754
  this.env,
4754
- `${endpointInfo.uri}`,
4755
+ endpoint,
4755
4756
  endpointInfo.method,
4756
4757
  null,
4757
4758
  context
@@ -4793,6 +4794,18 @@ var TenantAPI = class {
4793
4794
  );
4794
4795
  return data;
4795
4796
  }
4797
+ async delete(tenantId, context) {
4798
+ const endpointInfo = tenant_exports.Endpoints.DeleteTenant;
4799
+ const endpoint = endpointInfo.uri.replace(":tenantId", tenantId);
4800
+ const data = await this.clientHTTP.makeRequest(
4801
+ this.env,
4802
+ endpoint,
4803
+ endpointInfo.method,
4804
+ null,
4805
+ context
4806
+ );
4807
+ return data;
4808
+ }
4796
4809
  };
4797
4810
  var Tenant_api_default = TenantAPI;
4798
4811
 
@@ -6373,7 +6386,11 @@ var ScoreProgressSchema = external_exports.object({
6373
6386
  period: external_exports.string(),
6374
6387
  periodLabel: external_exports.string(),
6375
6388
  computedAt: external_exports.number(),
6376
- metrics: external_exports.array(ScoreProgressMetricSchema)
6389
+ value: external_exports.number(),
6390
+ hasData: external_exports.boolean(),
6391
+ band: ScoreBandSchema.optional(),
6392
+ metrics: external_exports.array(ScoreProgressMetricSchema),
6393
+ history: external_exports.array(ScoreHistoryEntrySchema)
6377
6394
  });
6378
6395
 
6379
6396
  // src/api/Score.api.ts
@@ -6472,6 +6489,7 @@ var Actions = {
6472
6489
  TENANT_LIST: "tenant.list",
6473
6490
  TENANT_VIEW: "tenant.view",
6474
6491
  TENANT_UPDATE: "tenant.update",
6492
+ TENANT_DELETE: "tenant.delete",
6475
6493
  TENANT_VIEW_MEMBERS: "tenant.view_members",
6476
6494
  TENANT_UPDATE_MEMBERS: "tenant.update_members",
6477
6495
  TENANT_VIEW_REPORT: "tenant.view_report",
@@ -6568,6 +6586,7 @@ var ActionCatalog = {
6568
6586
  [Actions.TENANT_LIST]: { label: "List all tenants", group: "Tenants" },
6569
6587
  [Actions.TENANT_VIEW]: { label: "View any tenant", group: "Tenants" },
6570
6588
  [Actions.TENANT_UPDATE]: { label: "Update any tenant", group: "Tenants" },
6589
+ [Actions.TENANT_DELETE]: { label: "Delete a tenant", group: "Tenants" },
6571
6590
  [Actions.TENANT_VIEW_MEMBERS]: { label: "View a tenant's members", group: "Tenants" },
6572
6591
  [Actions.TENANT_UPDATE_MEMBERS]: { label: "Manage a tenant's members", group: "Tenants" },
6573
6592
  [Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants", scopeable: true },
@@ -6995,6 +7014,10 @@ var Endpoints13 = {
6995
7014
  UpdateMembers: {
6996
7015
  uri: "/tenants/:tenantId/members",
6997
7016
  method: "PUT"
7017
+ },
7018
+ DeleteTenant: {
7019
+ uri: "/tenants/:tenantId",
7020
+ method: "DELETE"
6998
7021
  }
6999
7022
  };
7000
7023