shred-api-client 2.12.2 → 2.13.1

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<{
@@ -5061,10 +5072,50 @@ declare const ScoreProgressMetricSchema: z.ZodObject<{
5061
5072
  target: number;
5062
5073
  available: boolean;
5063
5074
  }>;
5075
+ declare const ScoreProjectionSchema: z.ZodObject<{
5076
+ value: z.ZodNumber;
5077
+ band: z.ZodOptional<z.ZodObject<{
5078
+ key: z.ZodString;
5079
+ label: z.ZodString;
5080
+ min: z.ZodNumber;
5081
+ max: z.ZodNumber;
5082
+ }, "strip", z.ZodTypeAny, {
5083
+ label: string;
5084
+ min: number;
5085
+ max: number;
5086
+ key: string;
5087
+ }, {
5088
+ label: string;
5089
+ min: number;
5090
+ max: number;
5091
+ key: string;
5092
+ }>>;
5093
+ }, "strip", z.ZodTypeAny, {
5094
+ value: number;
5095
+ band?: {
5096
+ label: string;
5097
+ min: number;
5098
+ max: number;
5099
+ key: string;
5100
+ } | undefined;
5101
+ }, {
5102
+ value: number;
5103
+ band?: {
5104
+ label: string;
5105
+ min: number;
5106
+ max: number;
5107
+ key: string;
5108
+ } | undefined;
5109
+ }>;
5064
5110
  declare const ScoreProgressSchema: z.ZodObject<{
5065
5111
  period: z.ZodString;
5066
5112
  periodLabel: z.ZodString;
5067
5113
  computedAt: z.ZodNumber;
5114
+ /** The day of the month in the customer's timezone. */
5115
+ day: z.ZodNumber;
5116
+ daysInMonth: z.ZodNumber;
5117
+ /** No closed month in `history` yet. */
5118
+ isFirstMonth: z.ZodBoolean;
5068
5119
  value: z.ZodNumber;
5069
5120
  hasData: z.ZodBoolean;
5070
5121
  band: z.ZodOptional<z.ZodObject<{
@@ -5083,6 +5134,42 @@ declare const ScoreProgressSchema: z.ZodObject<{
5083
5134
  max: number;
5084
5135
  key: string;
5085
5136
  }>>;
5137
+ /** Where the month closes at the pace so far. Absent early in the month, in the first month, or with nothing to measure. */
5138
+ projection: z.ZodOptional<z.ZodObject<{
5139
+ value: z.ZodNumber;
5140
+ band: z.ZodOptional<z.ZodObject<{
5141
+ key: z.ZodString;
5142
+ label: z.ZodString;
5143
+ min: z.ZodNumber;
5144
+ max: z.ZodNumber;
5145
+ }, "strip", z.ZodTypeAny, {
5146
+ label: string;
5147
+ min: number;
5148
+ max: number;
5149
+ key: string;
5150
+ }, {
5151
+ label: string;
5152
+ min: number;
5153
+ max: number;
5154
+ key: string;
5155
+ }>>;
5156
+ }, "strip", z.ZodTypeAny, {
5157
+ value: number;
5158
+ band?: {
5159
+ label: string;
5160
+ min: number;
5161
+ max: number;
5162
+ key: string;
5163
+ } | undefined;
5164
+ }, {
5165
+ value: number;
5166
+ band?: {
5167
+ label: string;
5168
+ min: number;
5169
+ max: number;
5170
+ key: string;
5171
+ } | undefined;
5172
+ }>>;
5086
5173
  metrics: z.ZodArray<z.ZodObject<{
5087
5174
  key: z.ZodString;
5088
5175
  value: z.ZodNumber;
@@ -5163,12 +5250,24 @@ declare const ScoreProgressSchema: z.ZodObject<{
5163
5250
  target: number;
5164
5251
  available: boolean;
5165
5252
  }[];
5253
+ day: number;
5254
+ daysInMonth: number;
5255
+ isFirstMonth: boolean;
5166
5256
  band?: {
5167
5257
  label: string;
5168
5258
  min: number;
5169
5259
  max: number;
5170
5260
  key: string;
5171
5261
  } | undefined;
5262
+ projection?: {
5263
+ value: number;
5264
+ band?: {
5265
+ label: string;
5266
+ min: number;
5267
+ max: number;
5268
+ key: string;
5269
+ } | undefined;
5270
+ } | undefined;
5172
5271
  }, {
5173
5272
  value: number;
5174
5273
  history: {
@@ -5192,12 +5291,24 @@ declare const ScoreProgressSchema: z.ZodObject<{
5192
5291
  target: number;
5193
5292
  available: boolean;
5194
5293
  }[];
5294
+ day: number;
5295
+ daysInMonth: number;
5296
+ isFirstMonth: boolean;
5195
5297
  band?: {
5196
5298
  label: string;
5197
5299
  min: number;
5198
5300
  max: number;
5199
5301
  key: string;
5200
5302
  } | undefined;
5303
+ projection?: {
5304
+ value: number;
5305
+ band?: {
5306
+ label: string;
5307
+ min: number;
5308
+ max: number;
5309
+ key: string;
5310
+ } | undefined;
5311
+ } | undefined;
5201
5312
  }>;
5202
5313
  type ScoreMetricKey = z.infer<typeof ScoreMetricKeySchema>;
5203
5314
  type ScoreBand = z.infer<typeof ScoreBandSchema>;
@@ -5206,6 +5317,7 @@ type Score = z.infer<typeof ScoreSchema>;
5206
5317
  type ScoreHistoryEntry = z.infer<typeof ScoreHistoryEntrySchema>;
5207
5318
  type ScoreRecap = z.infer<typeof ScoreRecapSchema>;
5208
5319
  type ScoreProgressMetric = z.infer<typeof ScoreProgressMetricSchema>;
5320
+ type ScoreProjection = z.infer<typeof ScoreProjectionSchema>;
5209
5321
  type ScoreProgress = z.infer<typeof ScoreProgressSchema>;
5210
5322
  type ScoreGoalOption = z.infer<typeof ScoreGoalOptionSchema>;
5211
5323
  type ScoreGoal = z.infer<typeof ScoreGoalSchema>;
@@ -5262,10 +5374,12 @@ type index$3_ScoreProgress = ScoreProgress;
5262
5374
  type index$3_ScoreProgressMetric = ScoreProgressMetric;
5263
5375
  declare const index$3_ScoreProgressMetricSchema: typeof ScoreProgressMetricSchema;
5264
5376
  declare const index$3_ScoreProgressSchema: typeof ScoreProgressSchema;
5377
+ type index$3_ScoreProjection = ScoreProjection;
5378
+ declare const index$3_ScoreProjectionSchema: typeof ScoreProjectionSchema;
5265
5379
  declare const index$3_ScoreRecapSchema: typeof ScoreRecapSchema;
5266
5380
  declare const index$3_ScoreSchema: typeof ScoreSchema;
5267
5381
  declare namespace index$3 {
5268
- export { Endpoints$1 as Endpoints, type ScoreRecap as Entity, type IAPI$1 as IAPI, type index$3_Score as Score, type index$3_ScoreBand as ScoreBand, index$3_ScoreBandSchema as ScoreBandSchema, type index$3_ScoreGoal as ScoreGoal, type index$3_ScoreGoalOption as ScoreGoalOption, index$3_ScoreGoalOptionSchema as ScoreGoalOptionSchema, index$3_ScoreGoalSchema as ScoreGoalSchema, type index$3_ScoreHistoryEntry as ScoreHistoryEntry, index$3_ScoreHistoryEntrySchema as ScoreHistoryEntrySchema, type index$3_ScoreMetric as ScoreMetric, type index$3_ScoreMetricKey as ScoreMetricKey, index$3_ScoreMetricKeySchema as ScoreMetricKeySchema, index$3_ScoreMetricSchema as ScoreMetricSchema, type index$3_ScoreProgress as ScoreProgress, type index$3_ScoreProgressMetric as ScoreProgressMetric, index$3_ScoreProgressMetricSchema as ScoreProgressMetricSchema, index$3_ScoreProgressSchema as ScoreProgressSchema, index$3_ScoreRecapSchema as ScoreRecapSchema, index$3_ScoreSchema as ScoreSchema };
5382
+ export { Endpoints$1 as Endpoints, type ScoreRecap as Entity, type IAPI$1 as IAPI, type index$3_Score as Score, type index$3_ScoreBand as ScoreBand, index$3_ScoreBandSchema as ScoreBandSchema, type index$3_ScoreGoal as ScoreGoal, type index$3_ScoreGoalOption as ScoreGoalOption, index$3_ScoreGoalOptionSchema as ScoreGoalOptionSchema, index$3_ScoreGoalSchema as ScoreGoalSchema, type index$3_ScoreHistoryEntry as ScoreHistoryEntry, index$3_ScoreHistoryEntrySchema as ScoreHistoryEntrySchema, type index$3_ScoreMetric as ScoreMetric, type index$3_ScoreMetricKey as ScoreMetricKey, index$3_ScoreMetricKeySchema as ScoreMetricKeySchema, index$3_ScoreMetricSchema as ScoreMetricSchema, type index$3_ScoreProgress as ScoreProgress, type index$3_ScoreProgressMetric as ScoreProgressMetric, index$3_ScoreProgressMetricSchema as ScoreProgressMetricSchema, index$3_ScoreProgressSchema as ScoreProgressSchema, type index$3_ScoreProjection as ScoreProjection, index$3_ScoreProjectionSchema as ScoreProjectionSchema, index$3_ScoreRecapSchema as ScoreRecapSchema, index$3_ScoreSchema as ScoreSchema };
5269
5383
  }
5270
5384
 
5271
5385
  /**
@@ -5318,6 +5432,7 @@ declare const Actions: {
5318
5432
  readonly TENANT_LIST: "tenant.list";
5319
5433
  readonly TENANT_VIEW: "tenant.view";
5320
5434
  readonly TENANT_UPDATE: "tenant.update";
5435
+ readonly TENANT_DELETE: "tenant.delete";
5321
5436
  readonly TENANT_VIEW_MEMBERS: "tenant.view_members";
5322
5437
  readonly TENANT_UPDATE_MEMBERS: "tenant.update_members";
5323
5438
  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
 
@@ -6369,13 +6382,24 @@ var ScoreProgressMetricSchema = external_exports.object({
6369
6382
  target: external_exports.number(),
6370
6383
  available: external_exports.boolean()
6371
6384
  });
6385
+ var ScoreProjectionSchema = external_exports.object({
6386
+ value: external_exports.number(),
6387
+ band: ScoreBandSchema.optional()
6388
+ });
6372
6389
  var ScoreProgressSchema = external_exports.object({
6373
6390
  period: external_exports.string(),
6374
6391
  periodLabel: external_exports.string(),
6375
6392
  computedAt: external_exports.number(),
6393
+ /** The day of the month in the customer's timezone. */
6394
+ day: external_exports.number(),
6395
+ daysInMonth: external_exports.number(),
6396
+ /** No closed month in `history` yet. */
6397
+ isFirstMonth: external_exports.boolean(),
6376
6398
  value: external_exports.number(),
6377
6399
  hasData: external_exports.boolean(),
6378
6400
  band: ScoreBandSchema.optional(),
6401
+ /** Where the month closes at the pace so far. Absent early in the month, in the first month, or with nothing to measure. */
6402
+ projection: ScoreProjectionSchema.optional(),
6379
6403
  metrics: external_exports.array(ScoreProgressMetricSchema),
6380
6404
  history: external_exports.array(ScoreHistoryEntrySchema)
6381
6405
  });
@@ -6476,6 +6500,7 @@ var Actions = {
6476
6500
  TENANT_LIST: "tenant.list",
6477
6501
  TENANT_VIEW: "tenant.view",
6478
6502
  TENANT_UPDATE: "tenant.update",
6503
+ TENANT_DELETE: "tenant.delete",
6479
6504
  TENANT_VIEW_MEMBERS: "tenant.view_members",
6480
6505
  TENANT_UPDATE_MEMBERS: "tenant.update_members",
6481
6506
  TENANT_VIEW_REPORT: "tenant.view_report",
@@ -6572,6 +6597,7 @@ var ActionCatalog = {
6572
6597
  [Actions.TENANT_LIST]: { label: "List all tenants", group: "Tenants" },
6573
6598
  [Actions.TENANT_VIEW]: { label: "View any tenant", group: "Tenants" },
6574
6599
  [Actions.TENANT_UPDATE]: { label: "Update any tenant", group: "Tenants" },
6600
+ [Actions.TENANT_DELETE]: { label: "Delete a tenant", group: "Tenants" },
6575
6601
  [Actions.TENANT_VIEW_MEMBERS]: { label: "View a tenant's members", group: "Tenants" },
6576
6602
  [Actions.TENANT_UPDATE_MEMBERS]: { label: "Manage a tenant's members", group: "Tenants" },
6577
6603
  [Actions.TENANT_VIEW_REPORT]: { label: "View a tenant's report", group: "Tenants", scopeable: true },
@@ -6999,6 +7025,10 @@ var Endpoints13 = {
6999
7025
  UpdateMembers: {
7000
7026
  uri: "/tenants/:tenantId/members",
7001
7027
  method: "PUT"
7028
+ },
7029
+ DeleteTenant: {
7030
+ uri: "/tenants/:tenantId",
7031
+ method: "DELETE"
7002
7032
  }
7003
7033
  };
7004
7034
 
@@ -7224,6 +7254,7 @@ __export(score_exports, {
7224
7254
  ScoreMetricSchema: () => ScoreMetricSchema,
7225
7255
  ScoreProgressMetricSchema: () => ScoreProgressMetricSchema,
7226
7256
  ScoreProgressSchema: () => ScoreProgressSchema,
7257
+ ScoreProjectionSchema: () => ScoreProjectionSchema,
7227
7258
  ScoreRecapSchema: () => ScoreRecapSchema,
7228
7259
  ScoreSchema: () => ScoreSchema
7229
7260
  });