shred-api-client 2.5.0 → 2.5.2

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", 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,
@@ -5795,6 +5843,42 @@ var NoteAPI = class {
5795
5843
  };
5796
5844
  var Note_api_default = NoteAPI;
5797
5845
 
5846
+ // src/model/special-offer/SpecialOffer.api.ts
5847
+ var Endpoints8 = {
5848
+ List: {
5849
+ uri: "/special-offers/",
5850
+ method: "GET"
5851
+ },
5852
+ GetActive: {
5853
+ uri: "/special-offers/active",
5854
+ method: "GET"
5855
+ },
5856
+ Create: {
5857
+ uri: "/special-offers/",
5858
+ method: "POST"
5859
+ },
5860
+ Update: {
5861
+ uri: "/special-offers/:id",
5862
+ method: "PUT"
5863
+ },
5864
+ Enable: {
5865
+ uri: "/special-offers/:id/enable",
5866
+ method: "PUT"
5867
+ },
5868
+ Disable: {
5869
+ uri: "/special-offers/:id/disable",
5870
+ method: "PUT"
5871
+ },
5872
+ GetMyOffer: {
5873
+ uri: "/special-offers/my-offer",
5874
+ method: "GET"
5875
+ },
5876
+ Claim: {
5877
+ uri: "/special-offers/claim",
5878
+ method: "POST"
5879
+ }
5880
+ };
5881
+
5798
5882
  // src/model/special-offer/SpecialOffer.schema.ts
5799
5883
  var SpecialOfferSchema = external_exports.object({
5800
5884
  id: external_exports.string(),
@@ -5840,35 +5924,35 @@ var SpecialOfferAPI = class {
5840
5924
  this.clientHTTP = new HTTPClient();
5841
5925
  }
5842
5926
  async list(ctx) {
5843
- const { uri, method } = special_offer_exports.Endpoints.List;
5927
+ const { uri, method } = Endpoints8.List;
5844
5928
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, external_exports.array(SpecialOfferSchema));
5845
5929
  }
5846
5930
  async getActive(ctx) {
5847
- const { uri, method } = special_offer_exports.Endpoints.GetActive;
5931
+ const { uri, method } = Endpoints8.GetActive;
5848
5932
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, SpecialOfferSchema.nullable());
5849
5933
  }
5850
5934
  async create(ctx, data) {
5851
- const { uri, method } = special_offer_exports.Endpoints.Create;
5935
+ const { uri, method } = Endpoints8.Create;
5852
5936
  return this.clientHTTP.makeRequest(this.env, uri, method, data, ctx, SpecialOfferSchema);
5853
5937
  }
5854
5938
  async update(ctx, id, data) {
5855
- const { uri, method } = special_offer_exports.Endpoints.Update;
5939
+ const { uri, method } = Endpoints8.Update;
5856
5940
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, data, ctx);
5857
5941
  }
5858
5942
  async enable(ctx, id) {
5859
- const { uri, method } = special_offer_exports.Endpoints.Enable;
5943
+ const { uri, method } = Endpoints8.Enable;
5860
5944
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx);
5861
5945
  }
5862
5946
  async disable(ctx, id) {
5863
- const { uri, method } = special_offer_exports.Endpoints.Disable;
5947
+ const { uri, method } = Endpoints8.Disable;
5864
5948
  await this.clientHTTP.makeRequest(this.env, uri.replace(":id", id), method, null, ctx);
5865
5949
  }
5866
5950
  async getMyOffer(ctx) {
5867
- const { uri, method } = special_offer_exports.Endpoints.GetMyOffer;
5951
+ const { uri, method } = Endpoints8.GetMyOffer;
5868
5952
  return this.clientHTTP.makeRequest(this.env, uri, method, null, ctx, UserOfferDetailsSchema.nullable());
5869
5953
  }
5870
5954
  async claim(ctx, callbackUrl) {
5871
- const { uri, method } = special_offer_exports.Endpoints.Claim;
5955
+ const { uri, method } = Endpoints8.Claim;
5872
5956
  const data = await this.clientHTTP.makeRequest(this.env, uri, method, { callbackUrl }, ctx);
5873
5957
  return data.url;
5874
5958
  }
@@ -5880,6 +5964,7 @@ var ShredAPI = class {
5880
5964
  constructor(env) {
5881
5965
  this.user = new User_api_default(env);
5882
5966
  this.goal = new Goal_api_default(env);
5967
+ this.editor = new Editor_api_default(env);
5883
5968
  this.prompt = new Prompt_api_default(env);
5884
5969
  this.subscription = new Subscription_api_default(env);
5885
5970
  this.pushNotification = new Notification_api_default(env);
@@ -5908,7 +5993,7 @@ __export(exceptions_exports, {
5908
5993
  var prompt_exports = {};
5909
5994
  __export(prompt_exports, {
5910
5995
  CategorySchema: () => CategorySchema,
5911
- Endpoints: () => Endpoints7,
5996
+ Endpoints: () => Endpoints9,
5912
5997
  PromptSchema: () => PromptSchema,
5913
5998
  ScriptIARequestSchema: () => ScriptIARequestSchema,
5914
5999
  ScriptSchema: () => ScriptSchema
@@ -5944,7 +6029,7 @@ var PromptSchema = external_exports.object({
5944
6029
  });
5945
6030
 
5946
6031
  // src/model/prompt/Prompt.api.ts
5947
- var Endpoints7 = {
6032
+ var Endpoints9 = {
5948
6033
  GetPrompt: {
5949
6034
  uri: "/prompts/getPrompt",
5950
6035
  method: "GET"
@@ -5975,7 +6060,7 @@ var Endpoints7 = {
5975
6060
  var tenant_exports = {};
5976
6061
  __export(tenant_exports, {
5977
6062
  Action: () => Action,
5978
- Endpoints: () => Endpoints8,
6063
+ Endpoints: () => Endpoints10,
5979
6064
  MemberSchema: () => MemberSchema,
5980
6065
  PreferencesSchema: () => PreferencesSchema,
5981
6066
  ReportViewerUpdateSchema: () => ReportViewerUpdateSchema,
@@ -6089,7 +6174,7 @@ var ReportViewerUpdateSchema = external_exports.object({
6089
6174
  });
6090
6175
 
6091
6176
  // src/model/tenant/Tenant.api.ts
6092
- var Endpoints8 = {
6177
+ var Endpoints10 = {
6093
6178
  GetByInviteCode: {
6094
6179
  uri: "/tenants/public/invitation/",
6095
6180
  method: "GET"
@@ -6127,7 +6212,7 @@ var Endpoints8 = {
6127
6212
  // src/model/user/index.ts
6128
6213
  var user_exports = {};
6129
6214
  __export(user_exports, {
6130
- Endpoints: () => Endpoints9,
6215
+ Endpoints: () => Endpoints11,
6131
6216
  PreferencesSchema: () => PreferencesSchema2,
6132
6217
  Role: () => Role,
6133
6218
  System: () => System,
@@ -6182,7 +6267,7 @@ var UserSchema = external_exports.object({
6182
6267
  });
6183
6268
 
6184
6269
  // src/model/user/User.api.ts
6185
- var Endpoints9 = {
6270
+ var Endpoints11 = {
6186
6271
  ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
6187
6272
  GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
6188
6273
  GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
@@ -6205,7 +6290,7 @@ var Endpoints9 = {
6205
6290
  var subscription_exports = {};
6206
6291
  __export(subscription_exports, {
6207
6292
  ChargeSchema: () => ChargeSchema,
6208
- Endpoints: () => Endpoints10,
6293
+ Endpoints: () => Endpoints12,
6209
6294
  PlanSchema: () => PlanSchema,
6210
6295
  ProductSchema: () => ProductSchema,
6211
6296
  SubscriptionSchema: () => SubscriptionSchema,
@@ -6214,7 +6299,7 @@ __export(subscription_exports, {
6214
6299
  });
6215
6300
 
6216
6301
  // src/model/subscription/Subscription.api.ts
6217
- var Endpoints10 = {
6302
+ var Endpoints12 = {
6218
6303
  GetPortal: {
6219
6304
  uri: "/subscriptions/portal/",
6220
6305
  method: "GET"
@@ -6272,7 +6357,7 @@ var Endpoints10 = {
6272
6357
  // src/model/track/index.ts
6273
6358
  var track_exports = {};
6274
6359
  __export(track_exports, {
6275
- Endpoints: () => Endpoints11,
6360
+ Endpoints: () => Endpoints13,
6276
6361
  TrackParamSchema: () => TrackParamSchema,
6277
6362
  TrackSchema: () => TrackSchema
6278
6363
  });
@@ -6290,7 +6375,7 @@ var TrackSchema = external_exports.object({
6290
6375
  });
6291
6376
 
6292
6377
  // src/model/track/Track.api.ts
6293
- var Endpoints11 = {
6378
+ var Endpoints13 = {
6294
6379
  Track: {
6295
6380
  uri: "/track/public/send/",
6296
6381
  method: "POST"
@@ -6304,48 +6389,12 @@ var core_exports = {};
6304
6389
  var special_offer_exports = {};
6305
6390
  __export(special_offer_exports, {
6306
6391
  CreateSpecialOfferSchema: () => CreateSpecialOfferSchema,
6307
- Endpoints: () => Endpoints12,
6392
+ Endpoints: () => Endpoints8,
6308
6393
  SpecialOfferSchema: () => SpecialOfferSchema,
6309
6394
  UpdateSpecialOfferSchema: () => UpdateSpecialOfferSchema,
6310
6395
  UserOfferDetailsSchema: () => UserOfferDetailsSchema
6311
6396
  });
6312
6397
 
6313
- // src/model/special-offer/SpecialOffer.api.ts
6314
- var Endpoints12 = {
6315
- List: {
6316
- uri: "/special-offers/",
6317
- method: "GET"
6318
- },
6319
- GetActive: {
6320
- uri: "/special-offers/active",
6321
- method: "GET"
6322
- },
6323
- Create: {
6324
- uri: "/special-offers/",
6325
- method: "POST"
6326
- },
6327
- Update: {
6328
- uri: "/special-offers/:id",
6329
- method: "PUT"
6330
- },
6331
- Enable: {
6332
- uri: "/special-offers/:id/enable",
6333
- method: "PUT"
6334
- },
6335
- Disable: {
6336
- uri: "/special-offers/:id/disable",
6337
- method: "PUT"
6338
- },
6339
- GetMyOffer: {
6340
- uri: "/special-offers/my-offer",
6341
- method: "GET"
6342
- },
6343
- Claim: {
6344
- uri: "/special-offers/claim",
6345
- method: "POST"
6346
- }
6347
- };
6348
-
6349
6398
  // src/index.ts
6350
6399
  var index_default = ShredAPI;
6351
6400
  //# sourceMappingURL=index.js.map