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