shred-api-client 2.8.0 → 2.9.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.js CHANGED
@@ -6009,6 +6009,276 @@ var SpecialOfferAPI = class {
6009
6009
  };
6010
6010
  var SpecialOffer_api_default = SpecialOfferAPI;
6011
6011
 
6012
+ // src/model/rbac/index.ts
6013
+ var rbac_exports = {};
6014
+ __export(rbac_exports, {
6015
+ ActionCatalog: () => ActionCatalog,
6016
+ Actions: () => Actions,
6017
+ Endpoints: () => Endpoints9,
6018
+ RoleAssignmentSchema: () => RoleAssignmentSchema,
6019
+ RoleGrantSchema: () => RoleGrantSchema,
6020
+ RoleSchema: () => RoleSchema,
6021
+ ScopeSchema: () => ScopeSchema,
6022
+ listActionCatalog: () => listActionCatalog
6023
+ });
6024
+
6025
+ // src/model/rbac/Actions.ts
6026
+ var Actions = {
6027
+ // — Projects (staff) —
6028
+ PROJECT_APPROVE: "project.approve",
6029
+ PROJECT_DENY: "project.deny",
6030
+ PROJECT_ASSIGN: "project.assign",
6031
+ PROJECT_ROLLBACK: "project.rollback",
6032
+ PROJECT_SCHEDULE: "project.schedule",
6033
+ PROJECT_UNSCHEDULE: "project.unschedule",
6034
+ PROJECT_GET_NEXT_IN_QUEUE: "project.get_next_in_queue",
6035
+ PROJECT_VIEW_ALL: "project.view_all",
6036
+ PROJECT_VIEW_HISTORY: "project.view_history",
6037
+ PROJECT_START: "project.start",
6038
+ PROJECT_SEND_TO_APPROVAL: "project.send_to_approval",
6039
+ PROJECT_VIEW_POOL: "project.view_pool",
6040
+ PROJECT_STREAM: "project.stream",
6041
+ // — Projects (customer self-service) —
6042
+ PROJECT_CREATE: "project.create",
6043
+ PROJECT_CANCEL: "project.cancel",
6044
+ PROJECT_REORDER: "project.reorder",
6045
+ PROJECT_REQUEST_REVIEW: "project.request_review",
6046
+ PROJECT_RECORD_INTERACTION: "project.record_interaction",
6047
+ PROJECT_CHECK_FREE_QUOTA: "project.check_free_quota",
6048
+ PROJECT_LIST_OWN: "project.list_own",
6049
+ PROJECT_VIEW_OWN: "project.view_own",
6050
+ // — Editors —
6051
+ EDITOR_LIST: "editor.list",
6052
+ EDITOR_GET: "editor.get",
6053
+ // — Goals —
6054
+ GOAL_VIEW_OWN: "goal.view_own",
6055
+ GOAL_VIEW_EDITOR: "goal.view_editor",
6056
+ // — Notes —
6057
+ NOTE_VIEW: "note.view",
6058
+ NOTE_CREATE: "note.create",
6059
+ NOTE_UPDATE: "note.update",
6060
+ NOTE_DELETE: "note.delete",
6061
+ // — Tenants —
6062
+ TENANT_CREATE: "tenant.create",
6063
+ TENANT_LIST: "tenant.list",
6064
+ TENANT_VIEW: "tenant.view",
6065
+ TENANT_UPDATE: "tenant.update",
6066
+ TENANT_VIEW_MEMBERS: "tenant.view_members",
6067
+ TENANT_UPDATE_MEMBERS: "tenant.update_members",
6068
+ TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers",
6069
+ TENANT_VIEW_REPORT: "tenant.view_report",
6070
+ TENANT_VIEW_MINE: "tenant.view_mine",
6071
+ // — Offers —
6072
+ OFFER_LIST: "offer.list",
6073
+ OFFER_CREATE: "offer.create",
6074
+ OFFER_UPDATE: "offer.update",
6075
+ OFFER_ENABLE: "offer.enable",
6076
+ OFFER_DISABLE: "offer.disable",
6077
+ OFFER_GET_MINE: "offer.get_mine",
6078
+ OFFER_CLAIM: "offer.claim",
6079
+ // — Subscriptions —
6080
+ SUBSCRIPTION_VIEW_USER: "subscription.view_user",
6081
+ SUBSCRIPTION_VIEW_SUMMARY: "subscription.view_summary",
6082
+ SUBSCRIPTION_LIST_PROMO_CODES: "subscription.list_promo_codes",
6083
+ SUBSCRIPTION_CHECKOUT: "subscription.checkout",
6084
+ SUBSCRIPTION_PORTAL: "subscription.portal",
6085
+ SUBSCRIPTION_VIEW_ACTIVE: "subscription.view_active",
6086
+ SUBSCRIPTION_LIST_PRODUCTS: "subscription.list_products",
6087
+ // — Scripts —
6088
+ SCRIPT_LIST: "script.list",
6089
+ SCRIPT_CREATE: "script.create",
6090
+ SCRIPT_UPDATE: "script.update",
6091
+ SCRIPT_DELETE: "script.delete",
6092
+ SCRIPT_GENERATE: "script.generate",
6093
+ // — Prompts —
6094
+ PROMPT_GET: "prompt.get",
6095
+ // — Email —
6096
+ EMAIL_SEND: "email.send",
6097
+ // — Users —
6098
+ USER_SEARCH: "user.search",
6099
+ USER_UPDATE: "user.update",
6100
+ USER_DELETE: "user.delete",
6101
+ USER_CHANGE_EMAIL: "user.change_email",
6102
+ USER_GET_TOKEN: "user.get_token",
6103
+ USER_CREATE_TOKEN: "user.create_token",
6104
+ // — RBAC administration —
6105
+ ROLE_MANAGE: "role.manage",
6106
+ USER_ASSIGN_ROLE: "user.assign_role"
6107
+ };
6108
+ var ActionCatalog = {
6109
+ // Projects
6110
+ [Actions.PROJECT_APPROVE]: { label: "Approve project", group: "Projects" },
6111
+ [Actions.PROJECT_DENY]: { label: "Deny project", group: "Projects" },
6112
+ [Actions.PROJECT_ASSIGN]: { label: "Assign project", group: "Projects" },
6113
+ [Actions.PROJECT_ROLLBACK]: { label: "Rollback project", group: "Projects" },
6114
+ [Actions.PROJECT_SCHEDULE]: { label: "Schedule project", group: "Projects" },
6115
+ [Actions.PROJECT_UNSCHEDULE]: { label: "Unschedule project", group: "Projects" },
6116
+ [Actions.PROJECT_GET_NEXT_IN_QUEUE]: { label: "Get next project in queue", group: "Projects" },
6117
+ [Actions.PROJECT_VIEW_ALL]: { label: "View all projects", group: "Projects" },
6118
+ [Actions.PROJECT_VIEW_HISTORY]: { label: "View project history", group: "Projects" },
6119
+ [Actions.PROJECT_START]: { label: "Start project (pull from pool)", group: "Projects" },
6120
+ [Actions.PROJECT_SEND_TO_APPROVAL]: { label: "Send project to approval", group: "Projects" },
6121
+ [Actions.PROJECT_VIEW_POOL]: { label: "View pool size", group: "Projects" },
6122
+ [Actions.PROJECT_STREAM]: { label: "Stream projects (realtime)", group: "Projects" },
6123
+ [Actions.PROJECT_CREATE]: { label: "Create project", group: "Projects" },
6124
+ [Actions.PROJECT_CANCEL]: { label: "Cancel project", group: "Projects" },
6125
+ [Actions.PROJECT_REORDER]: { label: "Reorder projects", group: "Projects" },
6126
+ [Actions.PROJECT_REQUEST_REVIEW]: { label: "Request project review", group: "Projects" },
6127
+ [Actions.PROJECT_RECORD_INTERACTION]: { label: "Record project interaction", group: "Projects" },
6128
+ [Actions.PROJECT_CHECK_FREE_QUOTA]: { label: "Check free project quota", group: "Projects" },
6129
+ [Actions.PROJECT_LIST_OWN]: { label: "List own projects", group: "Projects" },
6130
+ [Actions.PROJECT_VIEW_OWN]: { label: "View own project", group: "Projects" },
6131
+ // Editors
6132
+ [Actions.EDITOR_LIST]: { label: "List editors", group: "Editors" },
6133
+ [Actions.EDITOR_GET]: { label: "View editor", group: "Editors" },
6134
+ // Goals
6135
+ [Actions.GOAL_VIEW_OWN]: { label: "View own goals", group: "Goals" },
6136
+ [Actions.GOAL_VIEW_EDITOR]: { label: "View editor goals", group: "Goals" },
6137
+ // Notes
6138
+ [Actions.NOTE_VIEW]: { label: "View notes", group: "Notes" },
6139
+ [Actions.NOTE_CREATE]: { label: "Create note", group: "Notes" },
6140
+ [Actions.NOTE_UPDATE]: { label: "Update note", group: "Notes" },
6141
+ [Actions.NOTE_DELETE]: { label: "Delete note", group: "Notes" },
6142
+ // Tenants
6143
+ [Actions.TENANT_CREATE]: { label: "Create tenant", group: "Tenants" },
6144
+ [Actions.TENANT_LIST]: { label: "List tenants", group: "Tenants" },
6145
+ [Actions.TENANT_VIEW]: { label: "View tenant", group: "Tenants" },
6146
+ [Actions.TENANT_UPDATE]: { label: "Update tenant", group: "Tenants" },
6147
+ [Actions.TENANT_VIEW_MEMBERS]: { label: "View tenant members", group: "Tenants" },
6148
+ [Actions.TENANT_UPDATE_MEMBERS]: { label: "Update tenant members", group: "Tenants" },
6149
+ [Actions.TENANT_UPDATE_REPORT_VIEWERS]: { label: "Update tenant report viewers", group: "Tenants" },
6150
+ [Actions.TENANT_VIEW_REPORT]: { label: "View tenant report", group: "Tenants" },
6151
+ [Actions.TENANT_VIEW_MINE]: { label: "View my tenant", group: "Tenants" },
6152
+ // Offers
6153
+ [Actions.OFFER_LIST]: { label: "List offers", group: "Offers" },
6154
+ [Actions.OFFER_CREATE]: { label: "Create offer", group: "Offers" },
6155
+ [Actions.OFFER_UPDATE]: { label: "Update offer", group: "Offers" },
6156
+ [Actions.OFFER_ENABLE]: { label: "Enable offer", group: "Offers" },
6157
+ [Actions.OFFER_DISABLE]: { label: "Disable offer", group: "Offers" },
6158
+ [Actions.OFFER_GET_MINE]: { label: "View my offer", group: "Offers" },
6159
+ [Actions.OFFER_CLAIM]: { label: "Claim offer", group: "Offers" },
6160
+ // Subscriptions
6161
+ [Actions.SUBSCRIPTION_VIEW_USER]: { label: "View user subscription", group: "Subscriptions" },
6162
+ [Actions.SUBSCRIPTION_VIEW_SUMMARY]: { label: "View subscription summary", group: "Subscriptions" },
6163
+ [Actions.SUBSCRIPTION_LIST_PROMO_CODES]: { label: "List promo codes", group: "Subscriptions" },
6164
+ [Actions.SUBSCRIPTION_CHECKOUT]: { label: "Checkout subscription", group: "Subscriptions" },
6165
+ [Actions.SUBSCRIPTION_PORTAL]: { label: "Open subscription portal", group: "Subscriptions" },
6166
+ [Actions.SUBSCRIPTION_VIEW_ACTIVE]: { label: "View active subscription", group: "Subscriptions" },
6167
+ [Actions.SUBSCRIPTION_LIST_PRODUCTS]: { label: "List subscription products", group: "Subscriptions" },
6168
+ // Scripts
6169
+ [Actions.SCRIPT_LIST]: { label: "List scripts", group: "Scripts" },
6170
+ [Actions.SCRIPT_CREATE]: { label: "Create script", group: "Scripts" },
6171
+ [Actions.SCRIPT_UPDATE]: { label: "Update script", group: "Scripts" },
6172
+ [Actions.SCRIPT_DELETE]: { label: "Delete script", group: "Scripts" },
6173
+ [Actions.SCRIPT_GENERATE]: { label: "Generate script", group: "Scripts" },
6174
+ // Prompts
6175
+ [Actions.PROMPT_GET]: { label: "Get prompt", group: "Prompts" },
6176
+ // Email
6177
+ [Actions.EMAIL_SEND]: { label: "Send email", group: "Email" },
6178
+ // Users
6179
+ [Actions.USER_SEARCH]: { label: "Search users", group: "Users" },
6180
+ [Actions.USER_UPDATE]: { label: "Update own profile", group: "Users" },
6181
+ [Actions.USER_DELETE]: { label: "Delete own account", group: "Users" },
6182
+ [Actions.USER_CHANGE_EMAIL]: { label: "Change own email", group: "Users" },
6183
+ [Actions.USER_GET_TOKEN]: { label: "Get API token", group: "Users" },
6184
+ [Actions.USER_CREATE_TOKEN]: { label: "Create API token", group: "Users" },
6185
+ // Administration
6186
+ [Actions.ROLE_MANAGE]: { label: "Manage roles", group: "Administration" },
6187
+ [Actions.USER_ASSIGN_ROLE]: { label: "Assign roles to users", group: "Administration" }
6188
+ };
6189
+ function listActionCatalog() {
6190
+ return Object.entries(ActionCatalog).map(([key, meta]) => ({
6191
+ key,
6192
+ ...meta
6193
+ }));
6194
+ }
6195
+
6196
+ // src/model/rbac/Role.schema.ts
6197
+ var RoleSchema = external_exports.object({
6198
+ id: external_exports.string(),
6199
+ name: external_exports.string(),
6200
+ actions: external_exports.array(external_exports.string())
6201
+ });
6202
+
6203
+ // src/model/rbac/RoleAssignment.schema.ts
6204
+ var ScopeSchema = external_exports.discriminatedUnion("type", [
6205
+ external_exports.object({ type: external_exports.literal("global") }),
6206
+ external_exports.object({ type: external_exports.literal("tenant"), id: external_exports.string() })
6207
+ ]);
6208
+ var RoleGrantSchema = external_exports.object({
6209
+ roleId: external_exports.string(),
6210
+ scope: ScopeSchema
6211
+ });
6212
+ var RoleAssignmentSchema = external_exports.object({
6213
+ id: external_exports.string(),
6214
+ roles: external_exports.array(RoleGrantSchema)
6215
+ });
6216
+
6217
+ // src/model/rbac/RBAC.api.ts
6218
+ var Endpoints9 = {
6219
+ GetActions: { uri: "/rbac/actions", method: "GET" },
6220
+ ListRoles: { uri: "/rbac/roles", method: "GET" },
6221
+ CreateRole: { uri: "/rbac/roles", method: "POST" },
6222
+ UpdateRole: { uri: "/rbac/roles/:roleId", method: "PUT" },
6223
+ DeleteRole: { uri: "/rbac/roles/:roleId", method: "DELETE" },
6224
+ GetAssignments: { uri: "/rbac/assignments/:uid", method: "GET" },
6225
+ Assign: { uri: "/rbac/assignments/:uid", method: "POST" },
6226
+ Unassign: { uri: "/rbac/assignments/:uid", method: "DELETE" }
6227
+ };
6228
+
6229
+ // src/api/RBAC.api.ts
6230
+ var RBACAPI = class {
6231
+ constructor(env) {
6232
+ this.env = env;
6233
+ this.clientHTTP = new HTTPClient();
6234
+ }
6235
+ async getActions(c) {
6236
+ const e = Endpoints9.GetActions;
6237
+ return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c);
6238
+ }
6239
+ async listRoles(c) {
6240
+ const e = Endpoints9.ListRoles;
6241
+ return this.clientHTTP.makeRequest(this.env, e.uri, e.method, null, c, external_exports.array(RoleSchema));
6242
+ }
6243
+ async createRole(c, input) {
6244
+ const e = Endpoints9.CreateRole;
6245
+ return this.clientHTTP.makeRequest(this.env, e.uri, e.method, input, c, RoleSchema);
6246
+ }
6247
+ async updateRole(c, roleId, input) {
6248
+ const e = Endpoints9.UpdateRole;
6249
+ const uri = e.uri.replace(":roleId", roleId);
6250
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleSchema);
6251
+ }
6252
+ async deleteRole(c, roleId) {
6253
+ const e = Endpoints9.DeleteRole;
6254
+ const uri = e.uri.replace(":roleId", roleId);
6255
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, null, c, external_exports.boolean());
6256
+ }
6257
+ async getAssignments(c, uid) {
6258
+ const e = Endpoints9.GetAssignments;
6259
+ const uri = e.uri.replace(":uid", uid);
6260
+ return this.clientHTTP.makeRequest(
6261
+ this.env,
6262
+ uri,
6263
+ e.method,
6264
+ null,
6265
+ c,
6266
+ RoleAssignmentSchema.nullable()
6267
+ );
6268
+ }
6269
+ async assign(c, uid, input) {
6270
+ const e = Endpoints9.Assign;
6271
+ const uri = e.uri.replace(":uid", uid);
6272
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
6273
+ }
6274
+ async unassign(c, uid, input) {
6275
+ const e = Endpoints9.Unassign;
6276
+ const uri = e.uri.replace(":uid", uid);
6277
+ return this.clientHTTP.makeRequest(this.env, uri, e.method, input, c, RoleAssignmentSchema);
6278
+ }
6279
+ };
6280
+ var RBAC_api_default = RBACAPI;
6281
+
6012
6282
  // src/model/Api.ts
6013
6283
  var ShredAPI = class {
6014
6284
  constructor(env) {
@@ -6025,6 +6295,7 @@ var ShredAPI = class {
6025
6295
  this.track = new Track_api_default(env);
6026
6296
  this.note = new Note_api_default(env);
6027
6297
  this.specialOffer = new SpecialOffer_api_default(env);
6298
+ this.rbac = new RBAC_api_default(env);
6028
6299
  }
6029
6300
  };
6030
6301
 
@@ -6043,7 +6314,7 @@ __export(exceptions_exports, {
6043
6314
  var prompt_exports = {};
6044
6315
  __export(prompt_exports, {
6045
6316
  CategorySchema: () => CategorySchema,
6046
- Endpoints: () => Endpoints9,
6317
+ Endpoints: () => Endpoints10,
6047
6318
  PromptSchema: () => PromptSchema,
6048
6319
  ScriptIARequestSchema: () => ScriptIARequestSchema,
6049
6320
  ScriptSchema: () => ScriptSchema
@@ -6079,7 +6350,7 @@ var PromptSchema = external_exports.object({
6079
6350
  });
6080
6351
 
6081
6352
  // src/model/prompt/Prompt.api.ts
6082
- var Endpoints9 = {
6353
+ var Endpoints10 = {
6083
6354
  GetPrompt: {
6084
6355
  uri: "/prompts/getPrompt",
6085
6356
  method: "GET"
@@ -6110,7 +6381,7 @@ var Endpoints9 = {
6110
6381
  var tenant_exports = {};
6111
6382
  __export(tenant_exports, {
6112
6383
  Action: () => Action,
6113
- Endpoints: () => Endpoints10,
6384
+ Endpoints: () => Endpoints11,
6114
6385
  MemberSchema: () => MemberSchema,
6115
6386
  MemberUpdateSchema: () => MemberUpdateSchema,
6116
6387
  PreferencesSchema: () => PreferencesSchema,
@@ -6243,7 +6514,7 @@ var TenantUpdateSchema = TenantSchema.pick({
6243
6514
  }).partial();
6244
6515
 
6245
6516
  // src/model/tenant/Tenant.api.ts
6246
- var Endpoints10 = {
6517
+ var Endpoints11 = {
6247
6518
  GetByInviteCode: {
6248
6519
  uri: "/tenants/public/invitation/",
6249
6520
  method: "GET"
@@ -6285,7 +6556,7 @@ var Endpoints10 = {
6285
6556
  // src/model/user/index.ts
6286
6557
  var user_exports = {};
6287
6558
  __export(user_exports, {
6288
- Endpoints: () => Endpoints11,
6559
+ Endpoints: () => Endpoints12,
6289
6560
  PreferencesSchema: () => PreferencesSchema2,
6290
6561
  Role: () => Role,
6291
6562
  System: () => System,
@@ -6340,7 +6611,7 @@ var UserSchema = external_exports.object({
6340
6611
  });
6341
6612
 
6342
6613
  // src/model/user/User.api.ts
6343
- var Endpoints11 = {
6614
+ var Endpoints12 = {
6344
6615
  ChangeEmail: { uri: "/accounts/user/changeEmail", method: "PUT" },
6345
6616
  GetUserInfo: { uri: "/accounts/user/info", method: "GET" },
6346
6617
  GetBindedUsers: { uri: "/accounts/binded/list", method: "GET" },
@@ -6363,7 +6634,7 @@ var Endpoints11 = {
6363
6634
  var subscription_exports = {};
6364
6635
  __export(subscription_exports, {
6365
6636
  ChargeSchema: () => ChargeSchema,
6366
- Endpoints: () => Endpoints12,
6637
+ Endpoints: () => Endpoints13,
6367
6638
  PlanSchema: () => PlanSchema,
6368
6639
  ProductSchema: () => ProductSchema,
6369
6640
  SubscriptionSchema: () => SubscriptionSchema,
@@ -6372,7 +6643,7 @@ __export(subscription_exports, {
6372
6643
  });
6373
6644
 
6374
6645
  // src/model/subscription/Subscription.api.ts
6375
- var Endpoints12 = {
6646
+ var Endpoints13 = {
6376
6647
  GetPortal: {
6377
6648
  uri: "/subscriptions/portal/",
6378
6649
  method: "GET"
@@ -6434,7 +6705,7 @@ var Endpoints12 = {
6434
6705
  // src/model/track/index.ts
6435
6706
  var track_exports = {};
6436
6707
  __export(track_exports, {
6437
- Endpoints: () => Endpoints13,
6708
+ Endpoints: () => Endpoints14,
6438
6709
  TrackParamSchema: () => TrackParamSchema,
6439
6710
  TrackSchema: () => TrackSchema
6440
6711
  });
@@ -6452,7 +6723,7 @@ var TrackSchema = external_exports.object({
6452
6723
  });
6453
6724
 
6454
6725
  // src/model/track/Track.api.ts
6455
- var Endpoints13 = {
6726
+ var Endpoints14 = {
6456
6727
  Track: {
6457
6728
  uri: "/track/public/send/",
6458
6729
  method: "POST"
@@ -6472,180 +6743,6 @@ __export(special_offer_exports, {
6472
6743
  UserOfferDetailsSchema: () => UserOfferDetailsSchema
6473
6744
  });
6474
6745
 
6475
- // src/model/rbac/index.ts
6476
- var rbac_exports = {};
6477
- __export(rbac_exports, {
6478
- ActionCatalog: () => ActionCatalog,
6479
- Actions: () => Actions
6480
- });
6481
-
6482
- // src/model/rbac/Actions.ts
6483
- var Actions = {
6484
- // — Projects (staff) —
6485
- PROJECT_APPROVE: "project.approve",
6486
- PROJECT_DENY: "project.deny",
6487
- PROJECT_ASSIGN: "project.assign",
6488
- PROJECT_ROLLBACK: "project.rollback",
6489
- PROJECT_SCHEDULE: "project.schedule",
6490
- PROJECT_UNSCHEDULE: "project.unschedule",
6491
- PROJECT_GET_NEXT_IN_QUEUE: "project.get_next_in_queue",
6492
- PROJECT_VIEW_ALL: "project.view_all",
6493
- PROJECT_VIEW_HISTORY: "project.view_history",
6494
- PROJECT_START: "project.start",
6495
- PROJECT_SEND_TO_APPROVAL: "project.send_to_approval",
6496
- PROJECT_VIEW_POOL: "project.view_pool",
6497
- PROJECT_STREAM: "project.stream",
6498
- // — Projects (customer self-service) —
6499
- PROJECT_CREATE: "project.create",
6500
- PROJECT_CANCEL: "project.cancel",
6501
- PROJECT_REORDER: "project.reorder",
6502
- PROJECT_REQUEST_REVIEW: "project.request_review",
6503
- PROJECT_RECORD_INTERACTION: "project.record_interaction",
6504
- PROJECT_CHECK_FREE_QUOTA: "project.check_free_quota",
6505
- PROJECT_LIST_OWN: "project.list_own",
6506
- PROJECT_VIEW_OWN: "project.view_own",
6507
- // — Editors —
6508
- EDITOR_LIST: "editor.list",
6509
- EDITOR_GET: "editor.get",
6510
- // — Goals —
6511
- GOAL_VIEW_OWN: "goal.view_own",
6512
- GOAL_VIEW_EDITOR: "goal.view_editor",
6513
- // — Notes —
6514
- NOTE_VIEW: "note.view",
6515
- NOTE_CREATE: "note.create",
6516
- NOTE_UPDATE: "note.update",
6517
- NOTE_DELETE: "note.delete",
6518
- // — Tenants —
6519
- TENANT_CREATE: "tenant.create",
6520
- TENANT_LIST: "tenant.list",
6521
- TENANT_VIEW: "tenant.view",
6522
- TENANT_UPDATE: "tenant.update",
6523
- TENANT_VIEW_MEMBERS: "tenant.view_members",
6524
- TENANT_UPDATE_MEMBERS: "tenant.update_members",
6525
- TENANT_UPDATE_REPORT_VIEWERS: "tenant.update_report_viewers",
6526
- TENANT_VIEW_REPORT: "tenant.view_report",
6527
- TENANT_VIEW_MINE: "tenant.view_mine",
6528
- // — Offers —
6529
- OFFER_LIST: "offer.list",
6530
- OFFER_CREATE: "offer.create",
6531
- OFFER_UPDATE: "offer.update",
6532
- OFFER_ENABLE: "offer.enable",
6533
- OFFER_DISABLE: "offer.disable",
6534
- OFFER_GET_MINE: "offer.get_mine",
6535
- OFFER_CLAIM: "offer.claim",
6536
- // — Subscriptions —
6537
- SUBSCRIPTION_VIEW_USER: "subscription.view_user",
6538
- SUBSCRIPTION_VIEW_SUMMARY: "subscription.view_summary",
6539
- SUBSCRIPTION_LIST_PROMO_CODES: "subscription.list_promo_codes",
6540
- SUBSCRIPTION_CHECKOUT: "subscription.checkout",
6541
- SUBSCRIPTION_PORTAL: "subscription.portal",
6542
- SUBSCRIPTION_VIEW_ACTIVE: "subscription.view_active",
6543
- SUBSCRIPTION_LIST_PRODUCTS: "subscription.list_products",
6544
- // — Scripts —
6545
- SCRIPT_LIST: "script.list",
6546
- SCRIPT_CREATE: "script.create",
6547
- SCRIPT_UPDATE: "script.update",
6548
- SCRIPT_DELETE: "script.delete",
6549
- SCRIPT_GENERATE: "script.generate",
6550
- // — Prompts —
6551
- PROMPT_GET: "prompt.get",
6552
- // — Email —
6553
- EMAIL_SEND: "email.send",
6554
- // — Users —
6555
- USER_SEARCH: "user.search",
6556
- USER_CREATE_PRIVILEGED: "user.create_privileged",
6557
- USER_UPDATE: "user.update",
6558
- USER_DELETE: "user.delete",
6559
- USER_CHANGE_EMAIL: "user.change_email",
6560
- USER_GET_TOKEN: "user.get_token",
6561
- USER_CREATE_TOKEN: "user.create_token",
6562
- // — RBAC administration —
6563
- ROLE_MANAGE: "role.manage",
6564
- USER_ASSIGN_ROLE: "user.assign_role"
6565
- };
6566
- var ActionCatalog = [
6567
- // Projects
6568
- { key: Actions.PROJECT_APPROVE, label: "Approve project", group: "Projects" },
6569
- { key: Actions.PROJECT_DENY, label: "Deny project", group: "Projects" },
6570
- { key: Actions.PROJECT_ASSIGN, label: "Assign project", group: "Projects" },
6571
- { key: Actions.PROJECT_ROLLBACK, label: "Rollback project", group: "Projects" },
6572
- { key: Actions.PROJECT_SCHEDULE, label: "Schedule project", group: "Projects" },
6573
- { key: Actions.PROJECT_UNSCHEDULE, label: "Unschedule project", group: "Projects" },
6574
- { key: Actions.PROJECT_GET_NEXT_IN_QUEUE, label: "Get next project in queue", group: "Projects" },
6575
- { key: Actions.PROJECT_VIEW_ALL, label: "View all projects", group: "Projects" },
6576
- { key: Actions.PROJECT_VIEW_HISTORY, label: "View project history", group: "Projects" },
6577
- { key: Actions.PROJECT_START, label: "Start project (pull from pool)", group: "Projects" },
6578
- { key: Actions.PROJECT_SEND_TO_APPROVAL, label: "Send project to approval", group: "Projects" },
6579
- { key: Actions.PROJECT_VIEW_POOL, label: "View pool size", group: "Projects" },
6580
- { key: Actions.PROJECT_STREAM, label: "Stream projects (realtime)", group: "Projects" },
6581
- { key: Actions.PROJECT_CREATE, label: "Create project", group: "Projects" },
6582
- { key: Actions.PROJECT_CANCEL, label: "Cancel project", group: "Projects" },
6583
- { key: Actions.PROJECT_REORDER, label: "Reorder projects", group: "Projects" },
6584
- { key: Actions.PROJECT_REQUEST_REVIEW, label: "Request project review", group: "Projects" },
6585
- { key: Actions.PROJECT_RECORD_INTERACTION, label: "Record project interaction", group: "Projects" },
6586
- { key: Actions.PROJECT_CHECK_FREE_QUOTA, label: "Check free project quota", group: "Projects" },
6587
- { key: Actions.PROJECT_LIST_OWN, label: "List own projects", group: "Projects" },
6588
- { key: Actions.PROJECT_VIEW_OWN, label: "View own project", group: "Projects" },
6589
- // Editors
6590
- { key: Actions.EDITOR_LIST, label: "List editors", group: "Editors" },
6591
- { key: Actions.EDITOR_GET, label: "View editor", group: "Editors" },
6592
- // Goals
6593
- { key: Actions.GOAL_VIEW_OWN, label: "View own goals", group: "Goals" },
6594
- { key: Actions.GOAL_VIEW_EDITOR, label: "View editor goals", group: "Goals" },
6595
- // Notes
6596
- { key: Actions.NOTE_VIEW, label: "View notes", group: "Notes" },
6597
- { key: Actions.NOTE_CREATE, label: "Create note", group: "Notes" },
6598
- { key: Actions.NOTE_UPDATE, label: "Update note", group: "Notes" },
6599
- { key: Actions.NOTE_DELETE, label: "Delete note", group: "Notes" },
6600
- // Tenants
6601
- { key: Actions.TENANT_CREATE, label: "Create tenant", group: "Tenants" },
6602
- { key: Actions.TENANT_LIST, label: "List tenants", group: "Tenants" },
6603
- { key: Actions.TENANT_VIEW, label: "View tenant", group: "Tenants" },
6604
- { key: Actions.TENANT_UPDATE, label: "Update tenant", group: "Tenants" },
6605
- { key: Actions.TENANT_VIEW_MEMBERS, label: "View tenant members", group: "Tenants" },
6606
- { key: Actions.TENANT_UPDATE_MEMBERS, label: "Update tenant members", group: "Tenants" },
6607
- { key: Actions.TENANT_UPDATE_REPORT_VIEWERS, label: "Update tenant report viewers", group: "Tenants" },
6608
- { key: Actions.TENANT_VIEW_REPORT, label: "View tenant report", group: "Tenants" },
6609
- { key: Actions.TENANT_VIEW_MINE, label: "View my tenant", group: "Tenants" },
6610
- // Offers
6611
- { key: Actions.OFFER_LIST, label: "List offers", group: "Offers" },
6612
- { key: Actions.OFFER_CREATE, label: "Create offer", group: "Offers" },
6613
- { key: Actions.OFFER_UPDATE, label: "Update offer", group: "Offers" },
6614
- { key: Actions.OFFER_ENABLE, label: "Enable offer", group: "Offers" },
6615
- { key: Actions.OFFER_DISABLE, label: "Disable offer", group: "Offers" },
6616
- { key: Actions.OFFER_GET_MINE, label: "View my offer", group: "Offers" },
6617
- { key: Actions.OFFER_CLAIM, label: "Claim offer", group: "Offers" },
6618
- // Subscriptions
6619
- { key: Actions.SUBSCRIPTION_VIEW_USER, label: "View user subscription", group: "Subscriptions" },
6620
- { key: Actions.SUBSCRIPTION_VIEW_SUMMARY, label: "View subscription summary", group: "Subscriptions" },
6621
- { key: Actions.SUBSCRIPTION_LIST_PROMO_CODES, label: "List promo codes", group: "Subscriptions" },
6622
- { key: Actions.SUBSCRIPTION_CHECKOUT, label: "Checkout subscription", group: "Subscriptions" },
6623
- { key: Actions.SUBSCRIPTION_PORTAL, label: "Open subscription portal", group: "Subscriptions" },
6624
- { key: Actions.SUBSCRIPTION_VIEW_ACTIVE, label: "View active subscription", group: "Subscriptions" },
6625
- { key: Actions.SUBSCRIPTION_LIST_PRODUCTS, label: "List subscription products", group: "Subscriptions" },
6626
- // Scripts
6627
- { key: Actions.SCRIPT_LIST, label: "List scripts", group: "Scripts" },
6628
- { key: Actions.SCRIPT_CREATE, label: "Create script", group: "Scripts" },
6629
- { key: Actions.SCRIPT_UPDATE, label: "Update script", group: "Scripts" },
6630
- { key: Actions.SCRIPT_DELETE, label: "Delete script", group: "Scripts" },
6631
- { key: Actions.SCRIPT_GENERATE, label: "Generate script", group: "Scripts" },
6632
- // Prompts
6633
- { key: Actions.PROMPT_GET, label: "Get prompt", group: "Prompts" },
6634
- // Email
6635
- { key: Actions.EMAIL_SEND, label: "Send email", group: "Email" },
6636
- // Users
6637
- { key: Actions.USER_SEARCH, label: "Search users", group: "Users" },
6638
- { key: Actions.USER_CREATE_PRIVILEGED, label: "Create privileged user", group: "Users" },
6639
- { key: Actions.USER_UPDATE, label: "Update own profile", group: "Users" },
6640
- { key: Actions.USER_DELETE, label: "Delete own account", group: "Users" },
6641
- { key: Actions.USER_CHANGE_EMAIL, label: "Change own email", group: "Users" },
6642
- { key: Actions.USER_GET_TOKEN, label: "Get API token", group: "Users" },
6643
- { key: Actions.USER_CREATE_TOKEN, label: "Create API token", group: "Users" },
6644
- // Administration
6645
- { key: Actions.ROLE_MANAGE, label: "Manage roles", group: "Administration" },
6646
- { key: Actions.USER_ASSIGN_ROLE, label: "Assign roles to users", group: "Administration" }
6647
- ];
6648
-
6649
6746
  // src/index.ts
6650
6747
  var index_default = ShredAPI;
6651
6748
  //# sourceMappingURL=index.js.map