shred-api-client 2.5.1 → 2.5.3

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.js CHANGED
@@ -32,6 +32,7 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  Asset: () => asset_exports,
34
34
  Core: () => core_exports,
35
+ Editor: () => editor_exports,
35
36
  Email: () => email_exports,
36
37
  Exceptions: () => exceptions_exports,
37
38
  Goal: () => goal_exports,
@@ -5660,8 +5661,55 @@ var GoalAPI = class {
5660
5661
  };
5661
5662
  var Goal_api_default = GoalAPI;
5662
5663
 
5663
- // src/model/app-config/AppConfig.api.ts
5664
+ // src/model/editor/index.ts
5665
+ var editor_exports = {};
5666
+ __export(editor_exports, {
5667
+ EditorSchema: () => EditorSchema,
5668
+ Endpoints: () => Endpoints5
5669
+ });
5670
+
5671
+ // src/model/editor/Editor.schema.ts
5672
+ var EditorSchema = external_exports.object({
5673
+ id: external_exports.string(),
5674
+ email: external_exports.string(),
5675
+ isEnabled: external_exports.boolean(),
5676
+ type: external_exports.enum(["FT", "PT"]),
5677
+ goal: external_exports.number(),
5678
+ maxHold: external_exports.number(),
5679
+ lastBind: external_exports.number()
5680
+ });
5681
+
5682
+ // src/model/editor/Editor.api.ts
5664
5683
  var Endpoints5 = {
5684
+ GetAll: { uri: "/editors/list", method: "GET" },
5685
+ GetById: { uri: "/editors/:editorId", method: "GET" }
5686
+ };
5687
+
5688
+ // src/api/Editor.api.ts
5689
+ var EditorAPI = class {
5690
+ constructor(env) {
5691
+ this.env = env;
5692
+ this.clientHTTP = new HTTPClient();
5693
+ }
5694
+ async getAll(context) {
5695
+ const { uri, method } = Endpoints5.GetAll;
5696
+ return this.clientHTTP.makeRequest(this.env, uri, method, null, context);
5697
+ }
5698
+ async getById(context, editorId) {
5699
+ const { uri, method } = Endpoints5.GetById;
5700
+ return this.clientHTTP.makeRequest(
5701
+ this.env,
5702
+ uri.replace(":editorId", editorId),
5703
+ method,
5704
+ null,
5705
+ context
5706
+ );
5707
+ }
5708
+ };
5709
+ var Editor_api_default = EditorAPI;
5710
+
5711
+ // src/model/app-config/AppConfig.api.ts
5712
+ var Endpoints6 = {
5665
5713
  Version: {
5666
5714
  uri: "/app-config/public/version/latest",
5667
5715
  method: "GET"
@@ -5675,7 +5723,7 @@ var AppConfigAPI = class {
5675
5723
  this.clientHTTP = new HTTPClient();
5676
5724
  }
5677
5725
  async version() {
5678
- const endpointInfo = Endpoints5.Version;
5726
+ const endpointInfo = Endpoints6.Version;
5679
5727
  const data = await this.clientHTTP.makeRequest(
5680
5728
  this.env,
5681
5729
  endpointInfo.uri,
@@ -5689,7 +5737,7 @@ var AppConfig_api_default = AppConfigAPI;
5689
5737
  // src/model/note/index.ts
5690
5738
  var note_exports = {};
5691
5739
  __export(note_exports, {
5692
- Endpoints: () => Endpoints6,
5740
+ Endpoints: () => Endpoints7,
5693
5741
  NoteHistorySchema: () => NoteHistorySchema,
5694
5742
  NoteSchema: () => NoteSchema
5695
5743
  });
@@ -5720,7 +5768,7 @@ var NoteSchema = external_exports.object({
5720
5768
  });
5721
5769
 
5722
5770
  // src/model/note/Note.api.ts
5723
- var Endpoints6 = {
5771
+ var Endpoints7 = {
5724
5772
  GetNotes: {
5725
5773
  uri: "/user-context/notes/user/:userId/",
5726
5774
  method: "GET"
@@ -5746,7 +5794,7 @@ var NoteAPI = class {
5746
5794
  this.clientHTTP = new HTTPClient();
5747
5795
  }
5748
5796
  async list(c, userId) {
5749
- const endpointData = Endpoints6.GetNotes;
5797
+ const endpointData = Endpoints7.GetNotes;
5750
5798
  const endpoint = endpointData.uri.replace(":userId", userId);
5751
5799
  const data = await this.clientHTTP.makeRequest(
5752
5800
  this.env,
@@ -5758,7 +5806,7 @@ var NoteAPI = class {
5758
5806
  return data;
5759
5807
  }
5760
5808
  async add(c, note) {
5761
- const endpointData = Endpoints6.AddNote;
5809
+ const endpointData = Endpoints7.AddNote;
5762
5810
  const data = await this.clientHTTP.makeRequest(
5763
5811
  this.env,
5764
5812
  endpointData.uri,
@@ -5769,7 +5817,7 @@ var NoteAPI = class {
5769
5817
  return data;
5770
5818
  }
5771
5819
  async update(c, id, toUpdate) {
5772
- const endpointData = Endpoints6.UpdateNote;
5820
+ const endpointData = Endpoints7.UpdateNote;
5773
5821
  const endpoint = endpointData.uri.replace(":id", id);
5774
5822
  const data = await this.clientHTTP.makeRequest(
5775
5823
  this.env,
@@ -5781,7 +5829,7 @@ var NoteAPI = class {
5781
5829
  return data;
5782
5830
  }
5783
5831
  async delete(c, id) {
5784
- const endpointData = Endpoints6.DeleteNote;
5832
+ const endpointData = Endpoints7.DeleteNote;
5785
5833
  const endpoint = endpointData.uri.replace(":id", id);
5786
5834
  const data = await this.clientHTTP.makeRequest(
5787
5835
  this.env,
@@ -5796,7 +5844,7 @@ var NoteAPI = class {
5796
5844
  var Note_api_default = NoteAPI;
5797
5845
 
5798
5846
  // src/model/special-offer/SpecialOffer.api.ts
5799
- var Endpoints7 = {
5847
+ var Endpoints8 = {
5800
5848
  List: {
5801
5849
  uri: "/special-offers/",
5802
5850
  method: "GET"
@@ -5876,35 +5924,35 @@ var SpecialOfferAPI = class {
5876
5924
  this.clientHTTP = new HTTPClient();
5877
5925
  }
5878
5926
  async list(ctx) {
5879
- const { uri, method } = Endpoints7.List;
5927
+ const { uri, method } = Endpoints8.List;
5880
5928
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, external_exports.array(SpecialOfferSchema));
5881
5929
  }
5882
5930
  async getActive(ctx) {
5883
- const { uri, method } = Endpoints7.GetActive;
5931
+ const { uri, method } = Endpoints8.GetActive;
5884
5932
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, SpecialOfferSchema.nullable());
5885
5933
  }
5886
5934
  async create(ctx, data) {
5887
- const { uri, method } = Endpoints7.Create;
5935
+ const { uri, method } = Endpoints8.Create;
5888
5936
  return this.clientHTTP.makeRequest(this.env, uri, method, data, ctx, SpecialOfferSchema);
5889
5937
  }
5890
5938
  async update(ctx, id, data) {
5891
- const { uri, method } = Endpoints7.Update;
5939
+ const { uri, method } = Endpoints8.Update;
5892
5940
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, data, ctx);
5893
5941
  }
5894
5942
  async enable(ctx, id) {
5895
- const { uri, method } = Endpoints7.Enable;
5943
+ const { uri, method } = Endpoints8.Enable;
5896
5944
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx);
5897
5945
  }
5898
5946
  async disable(ctx, id) {
5899
- const { uri, method } = Endpoints7.Disable;
5947
+ const { uri, method } = Endpoints8.Disable;
5900
5948
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx);
5901
5949
  }
5902
5950
  async getMyOffer(ctx) {
5903
- const { uri, method } = Endpoints7.GetMyOffer;
5951
+ const { uri, method } = Endpoints8.GetMyOffer;
5904
5952
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, UserOfferDetailsSchema.nullable());
5905
5953
  }
5906
5954
  async claim(ctx, callbackUrl) {
5907
- const { uri, method } = Endpoints7.Claim;
5955
+ const { uri, method } = Endpoints8.Claim;
5908
5956
  const data = await this.clientHTTP.makeRequest(this.env, uri, method, { callbackUrl }, ctx);
5909
5957
  return data.url;
5910
5958
  }
@@ -5916,6 +5964,7 @@ var ShredAPI = class {
5916
5964
  constructor(env) {
5917
5965
  this.user = new User_api_default(env);
5918
5966
  this.goal = new Goal_api_default(env);
5967
+ this.editor = new Editor_api_default(env);
5919
5968
  this.prompt = new Prompt_api_default(env);
5920
5969
  this.subscription = new Subscription_api_default(env);
5921
5970
  this.pushNotification = new Notification_api_default(env);
@@ -5944,7 +5993,7 @@ __export(exceptions_exports, {
5944
5993
  var prompt_exports = {};
5945
5994
  __export(prompt_exports, {
5946
5995
  CategorySchema: () => CategorySchema,
5947
- Endpoints: () => Endpoints8,
5996
+ Endpoints: () => Endpoints9,
5948
5997
  PromptSchema: () => PromptSchema,
5949
5998
  ScriptIARequestSchema: () => ScriptIARequestSchema,
5950
5999
  ScriptSchema: () => ScriptSchema
@@ -5980,7 +6029,7 @@ var PromptSchema = external_exports.object({
5980
6029
  });
5981
6030
 
5982
6031
  // src/model/prompt/Prompt.api.ts
5983
- var Endpoints8 = {
6032
+ var Endpoints9 = {
5984
6033
  GetPrompt: {
5985
6034
  uri: "/prompts/getPrompt",
5986
6035
  method: "GET"
@@ -6011,7 +6060,7 @@ var Endpoints8 = {
6011
6060
  var tenant_exports = {};
6012
6061
  __export(tenant_exports, {
6013
6062
  Action: () => Action,
6014
- Endpoints: () => Endpoints9,
6063
+ Endpoints: () => Endpoints10,
6015
6064
  MemberSchema: () => MemberSchema,
6016
6065
  PreferencesSchema: () => PreferencesSchema,
6017
6066
  ReportViewerUpdateSchema: () => ReportViewerUpdateSchema,
@@ -6125,7 +6174,7 @@ var ReportViewerUpdateSchema = external_exports.object({
6125
6174
  });
6126
6175
 
6127
6176
  // src/model/tenant/Tenant.api.ts
6128
- var Endpoints9 = {
6177
+ var Endpoints10 = {
6129
6178
  GetByInviteCode: {
6130
6179
  uri: "/tenants/public/invitation/",
6131
6180
  method: "GET"
@@ -6163,7 +6212,7 @@ var Endpoints9 = {
6163
6212
  // src/model/user/index.ts
6164
6213
  var user_exports = {};
6165
6214
  __export(user_exports, {
6166
- Endpoints: () => Endpoints10,
6215
+ Endpoints: () => Endpoints11,
6167
6216
  PreferencesSchema: () => PreferencesSchema2,
6168
6217
  Role: () => Role,
6169
6218
  System: () => System,
@@ -6218,7 +6267,7 @@ var UserSchema = external_exports.object({
6218
6267
  });
6219
6268
 
6220
6269
  // src/model/user/User.api.ts
6221
- var Endpoints10 = {
6270
+ var Endpoints11 = {
6222
6271
  ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
6223
6272
  GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
6224
6273
  GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
@@ -6241,7 +6290,7 @@ var Endpoints10 = {
6241
6290
  var subscription_exports = {};
6242
6291
  __export(subscription_exports, {
6243
6292
  ChargeSchema: () => ChargeSchema,
6244
- Endpoints: () => Endpoints11,
6293
+ Endpoints: () => Endpoints12,
6245
6294
  PlanSchema: () => PlanSchema,
6246
6295
  ProductSchema: () => ProductSchema,
6247
6296
  SubscriptionSchema: () => SubscriptionSchema,
@@ -6250,7 +6299,7 @@ __export(subscription_exports, {
6250
6299
  });
6251
6300
 
6252
6301
  // src/model/subscription/Subscription.api.ts
6253
- var Endpoints11 = {
6302
+ var Endpoints12 = {
6254
6303
  GetPortal: {
6255
6304
  uri: "/subscriptions/portal/",
6256
6305
  method: "GET"
@@ -6308,7 +6357,7 @@ var Endpoints11 = {
6308
6357
  // src/model/track/index.ts
6309
6358
  var track_exports = {};
6310
6359
  __export(track_exports, {
6311
- Endpoints: () => Endpoints12,
6360
+ Endpoints: () => Endpoints13,
6312
6361
  TrackParamSchema: () => TrackParamSchema,
6313
6362
  TrackSchema: () => TrackSchema
6314
6363
  });
@@ -6326,7 +6375,7 @@ var TrackSchema = external_exports.object({
6326
6375
  });
6327
6376
 
6328
6377
  // src/model/track/Track.api.ts
6329
- var Endpoints12 = {
6378
+ var Endpoints13 = {
6330
6379
  Track: {
6331
6380
  uri: "/track/public/send/",
6332
6381
  method: "POST"
@@ -6340,7 +6389,7 @@ var core_exports = {};
6340
6389
  var special_offer_exports = {};
6341
6390
  __export(special_offer_exports, {
6342
6391
  CreateSpecialOfferSchema: () => CreateSpecialOfferSchema,
6343
- Endpoints: () => Endpoints7,
6392
+ Endpoints: () => Endpoints8,
6344
6393
  SpecialOfferSchema: () => SpecialOfferSchema,
6345
6394
  UpdateSpecialOfferSchema: () => UpdateSpecialOfferSchema,
6346
6395
  UserOfferDetailsSchema: () => UserOfferDetailsSchema