@ptkl/sdk 0.9.12 → 0.9.15

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.cjs.js CHANGED
@@ -19083,27 +19083,6 @@ class Functions extends PlatformBaseClient {
19083
19083
  }
19084
19084
  }
19085
19085
 
19086
- class Roles extends PlatformBaseClient {
19087
- async create(role) {
19088
- return await this.client.post("/v1/user/role/create", role);
19089
- }
19090
- async delete(uuid) {
19091
- return await this.client.delete(`/v1/user/role/delete/${uuid}`);
19092
- }
19093
- async list() {
19094
- return await this.client.get(`/v1/user/role/list`);
19095
- }
19096
- async availablePermissions() {
19097
- return await this.client.get(`/v1/user/permissions/list`);
19098
- }
19099
- async permissions() {
19100
- return await this.client.get(`/v1/user/role/permissions`);
19101
- }
19102
- async edit(permissions, workspaces, level, uuid) {
19103
- return await this.client.post(`/v1/user/role/edit/${uuid}`, { permissions, workspaces, level });
19104
- }
19105
- }
19106
-
19107
19086
  class APIUser extends PlatformBaseClient {
19108
19087
  async auth(username, password, project) {
19109
19088
  return this.client.post("/v1/user/api/auth", {
@@ -19133,36 +19112,110 @@ class APIUser extends PlatformBaseClient {
19133
19112
  }
19134
19113
 
19135
19114
  class Users extends PlatformBaseClient {
19136
- async invite(email, roles) {
19137
- return await this.client.post("/v1/project/invite", {
19115
+ async auth(username, password, project) {
19116
+ return await this.client.post("/v1/user/login", {
19117
+ username,
19118
+ password,
19119
+ response_type: 'token',
19120
+ }, {
19121
+ headers: {
19122
+ 'X-Project-Uuid': project
19123
+ }
19124
+ });
19125
+ }
19126
+ /**
19127
+ * Resend confirmation email
19128
+ * @param email User email
19129
+ */
19130
+ async resendConfirmationEmail(email) {
19131
+ return await this.client.post("/v1/user/send/confirmation/email", {
19138
19132
  email,
19139
- roles,
19140
19133
  });
19141
19134
  }
19142
- //Gets the current user's claims
19143
- async getClaims() {
19144
- return await this.client.get("/v1/user/claims");
19135
+ // Password Reset (Request Only)
19136
+ // Note: Only the REQUEST is exposed, not the password reset completion
19137
+ // The actual password reset should be done through the official web interface
19138
+ /**
19139
+ * Request password reset email
19140
+ * This only sends an email with a reset link, does not expose or change passwords
19141
+ * @param email User email
19142
+ */
19143
+ async requestPasswordReset(email) {
19144
+ return await this.client.post("/v1/user/resetpassword", { email });
19145
19145
  }
19146
- //Gets the current user's model
19146
+ // User Profile & Management
19147
+ /**
19148
+ * Get current user's model
19149
+ */
19147
19150
  async getUser() {
19148
19151
  return await this.client.get("/v1/user/model");
19149
19152
  }
19150
- async delete(uuid) {
19151
- return await this.client.delete(`/v1/project/user/${uuid}`);
19153
+ /**
19154
+ * Get current user's claims
19155
+ */
19156
+ async getClaims() {
19157
+ return await this.client.get("/v1/user/claims");
19152
19158
  }
19153
- async permissions() {
19154
- return await this.client.delete(`/v1/user/role/permissions`);
19159
+ /**
19160
+ * Edit user profile
19161
+ * @param data Profile update data
19162
+ */
19163
+ async editProfile(data) {
19164
+ return await this.client.post("/v1/user/profile/edit", data);
19155
19165
  }
19156
- async auth(username, password, project) {
19157
- return await this.client.post("/v1/user/login", {
19158
- username,
19159
- password,
19160
- response_type: "token",
19161
- }, {
19162
- headers: {
19163
- "X-Project-Uuid": project,
19164
- }
19165
- });
19166
+ // Permissions & Roles
19167
+ /**
19168
+ * Get user permissions
19169
+ */
19170
+ async getPermissions() {
19171
+ return await this.client.get("/v1/user/role/permissions");
19172
+ }
19173
+ /**
19174
+ * Get list of available permissions
19175
+ */
19176
+ async listPermissions() {
19177
+ return await this.client.get("/v1/user/permissions/list");
19178
+ }
19179
+ /**
19180
+ * Create a new role
19181
+ * @param role Role data including name, permissions, workspaces, and level
19182
+ */
19183
+ async createRole(role) {
19184
+ return await this.client.post("/v1/user/role/create", role);
19185
+ }
19186
+ /**
19187
+ * Delete a role
19188
+ * @param uuid Role UUID
19189
+ */
19190
+ async deleteRole(uuid) {
19191
+ return await this.client.delete(`/v1/user/role/delete/${uuid}`);
19192
+ }
19193
+ /**
19194
+ * List all roles
19195
+ */
19196
+ async listRoles() {
19197
+ return await this.client.get(`/v1/user/role/list`);
19198
+ }
19199
+ /**
19200
+ * Get role details by UUID
19201
+ * @param uuid Role UUID
19202
+ */
19203
+ async getRoleModel(uuid) {
19204
+ return await this.client.get(`/v1/user/role/edit/${uuid}`);
19205
+ }
19206
+ /**
19207
+ * Edit a role
19208
+ * @param uuid Role UUID
19209
+ * @param data Role update data including permissions, workspaces, and level
19210
+ */
19211
+ async editRole(uuid, data) {
19212
+ return await this.client.post(`/v1/user/role/edit/${uuid}`, data);
19213
+ }
19214
+ /**
19215
+ * @deprecated Use getPermissions() instead
19216
+ */
19217
+ async permissions() {
19218
+ return await this.client.get(`/v1/user/role/permissions`);
19166
19219
  }
19167
19220
  }
19168
19221
 
@@ -19389,6 +19442,9 @@ class Component extends PlatformBaseClient {
19389
19442
  data: input
19390
19443
  });
19391
19444
  }
19445
+ async revisions(uuid) {
19446
+ return await this.client.get(`/v3/system/component/${this.ref}/model/${uuid}/revisions`);
19447
+ }
19392
19448
  }
19393
19449
 
19394
19450
  class ComponentUtils extends PlatformBaseClient {
@@ -19472,6 +19528,7 @@ class System extends PlatformBaseClient {
19472
19528
  async resourceResolver(ref, resourceName, format) {
19473
19529
  return await this.client.post("/v3/system/resource-resolver", {
19474
19530
  type: resourceName,
19531
+ ref,
19475
19532
  format,
19476
19533
  });
19477
19534
  }
@@ -19506,6 +19563,199 @@ class Forge extends PlatformBaseClient {
19506
19563
  }
19507
19564
  }
19508
19565
 
19566
+ class Project extends PlatformBaseClient {
19567
+ /**
19568
+ * Get list of all projects for the current user
19569
+ */
19570
+ async list() {
19571
+ return await this.client.get("/v1/project/list");
19572
+ }
19573
+ /**
19574
+ * Create a new project
19575
+ * @param data Project creation data
19576
+ */
19577
+ async create(data) {
19578
+ return await this.client.post("/v1/project/create", data);
19579
+ }
19580
+ /**
19581
+ * Get information about a specific project
19582
+ */
19583
+ async info() {
19584
+ return await this.client.get("/v1/project/info");
19585
+ }
19586
+ /**
19587
+ * Archive a project
19588
+ */
19589
+ async archive() {
19590
+ return await this.client.patch("/v1/project/archive");
19591
+ }
19592
+ /**
19593
+ * Invite a user to the project
19594
+ * @param email Array of emails
19595
+ * @param roles Array of role UUIDs
19596
+ */
19597
+ async invite(emails, roles) {
19598
+ return await this.client.post("/v1/project/invite", { emails: emails.join(","), roles });
19599
+ }
19600
+ /**
19601
+ * Get list of project invites
19602
+ */
19603
+ async getInvites() {
19604
+ return await this.client.get("/v1/project/invites");
19605
+ }
19606
+ /**
19607
+ * Get a specific invite by UUID
19608
+ * @param uuid Invite UUID
19609
+ */
19610
+ async getInvite(uuid) {
19611
+ return await this.client.get(`/v1/project/invite/${uuid}`);
19612
+ }
19613
+ /**
19614
+ * Accept an invite
19615
+ * @param uuid Invite UUID
19616
+ */
19617
+ async acceptInvite(uuid) {
19618
+ return await this.client.get(`/v1/project/invite/accept/${uuid}`);
19619
+ }
19620
+ /**
19621
+ * Register through an invite
19622
+ * @param uuid Invite UUID
19623
+ * @param data Registration data
19624
+ */
19625
+ async registerWithInvite(uuid, data) {
19626
+ return await this.client.post(`/v1/project/invite/register/${uuid}`, data);
19627
+ }
19628
+ /**
19629
+ * Get list of project users
19630
+ */
19631
+ async getUsers() {
19632
+ return await this.client.get("/v1/project/users");
19633
+ }
19634
+ /**
19635
+ * Get a specific project user
19636
+ * @param uuid User UUID
19637
+ */
19638
+ async getUser(uuid) {
19639
+ return await this.client.get(`/v1/project/user/${uuid}`);
19640
+ }
19641
+ /**
19642
+ * Update a project user
19643
+ * @param uuid User UUID
19644
+ * @param data Update data
19645
+ */
19646
+ async updateUser(uuid, data) {
19647
+ return await this.client.put(`/v1/project/user/${uuid}`, data);
19648
+ }
19649
+ /**
19650
+ * Delete a user from the project
19651
+ * @param uuid User UUID
19652
+ */
19653
+ async deleteUser(uuid) {
19654
+ return await this.client.delete(`/v1/project/user/${uuid}`);
19655
+ }
19656
+ /**
19657
+ * Update project settings
19658
+ * @param settings Settings data
19659
+ */
19660
+ async updateSettings(settings) {
19661
+ return await this.client.post("/v1/project/settings", settings);
19662
+ }
19663
+ // Workspace Methods
19664
+ /**
19665
+ * Create a new workspace
19666
+ * @param data Workspace data
19667
+ */
19668
+ async createWorkspace(data) {
19669
+ return await this.client.post("/v1/project/workspace", data);
19670
+ }
19671
+ /**
19672
+ * Update a workspace
19673
+ * @param uuid Workspace UUID
19674
+ * @param data Update data
19675
+ */
19676
+ async updateWorkspace(uuid, data) {
19677
+ return await this.client.put(`/v1/project/workspace/${uuid}`, data);
19678
+ }
19679
+ /**
19680
+ * Delete a workspace
19681
+ * @param uuid Workspace UUID
19682
+ */
19683
+ async deleteWorkspace(uuid) {
19684
+ return await this.client.delete(`/v1/project/workspace/${uuid}`);
19685
+ }
19686
+ // Template Methods
19687
+ /**
19688
+ * Get available templates
19689
+ */
19690
+ async getAvailableTemplates() {
19691
+ return await this.client.get("/v1/project/template/available");
19692
+ }
19693
+ /**
19694
+ * Search for templates
19695
+ * @param query Search query
19696
+ */
19697
+ async searchTemplates(query) {
19698
+ return await this.client.post("/v1/project/template/search", query);
19699
+ }
19700
+ /**
19701
+ * Get template by ID
19702
+ * @param id Template ID
19703
+ */
19704
+ async getTemplate(id) {
19705
+ return await this.client.get(`/v1/project/template/${id}`);
19706
+ }
19707
+ /**
19708
+ * Get template by activation code
19709
+ * @param code Activation code
19710
+ */
19711
+ async getTemplateByCode(code) {
19712
+ return await this.client.get(`/v1/project/template/activationCode/${code}`);
19713
+ }
19714
+ /**
19715
+ * Get templates for a workspace
19716
+ */
19717
+ async getWorkspaceTemplates() {
19718
+ return await this.client.get("/v1/project/template/workspace");
19719
+ }
19720
+ /**
19721
+ * Install a template
19722
+ * @param data Installation data
19723
+ */
19724
+ async installTemplate(data) {
19725
+ return await this.client.post("/v1/project/template/install", data);
19726
+ }
19727
+ /**
19728
+ * Uninstall a template
19729
+ * @param data Uninstallation data
19730
+ */
19731
+ async uninstallTemplate(data) {
19732
+ return await this.client.post("/v1/project/template/uninstall", data);
19733
+ }
19734
+ /**
19735
+ * Upgrade a template
19736
+ * @param data Upgrade data
19737
+ */
19738
+ async upgradeTemplate(data) {
19739
+ return await this.client.post("/v1/project/template/upgrade", data);
19740
+ }
19741
+ }
19742
+
19743
+ class Config extends PlatformBaseClient {
19744
+ /**
19745
+ * Get user configuration
19746
+ */
19747
+ async getUserConfig() {
19748
+ return await this.client.get("/v1/config/user");
19749
+ }
19750
+ /**
19751
+ * Update user configuration
19752
+ * @param config Configuration data
19753
+ */
19754
+ async updateUserConfig(config) {
19755
+ return await this.client.put("/v1/config/user", config);
19756
+ }
19757
+ }
19758
+
19509
19759
  // apis
19510
19760
  class Platform extends PlatformBaseClient {
19511
19761
  getPlatformClient() {
@@ -19521,9 +19771,6 @@ class Platform extends PlatformBaseClient {
19521
19771
  function() {
19522
19772
  return (new Functions()).setClient(this.client);
19523
19773
  }
19524
- role() {
19525
- return (new Roles()).setClient(this.client);
19526
- }
19527
19774
  user() {
19528
19775
  return (new Users()).setClient(this.client);
19529
19776
  }
@@ -19554,6 +19801,12 @@ class Platform extends PlatformBaseClient {
19554
19801
  thunder() {
19555
19802
  return (new Thunder()).setClient(this.client);
19556
19803
  }
19804
+ project() {
19805
+ return (new Project()).setClient(this.client);
19806
+ }
19807
+ config() {
19808
+ return (new Config()).setClient(this.client);
19809
+ }
19557
19810
  }
19558
19811
 
19559
19812
  class Invoicing extends PlatformBaseClient {
@@ -20294,7 +20547,7 @@ class DMS extends IntegrationsBaseClient {
20294
20547
  }
20295
20548
 
20296
20549
  class SerbiaUtil extends IntegrationsBaseClient {
20297
- async nsbSearch(params) {
20550
+ async nbsSearch(params) {
20298
20551
  return await this.services("GET", "nbs/search", { params });
20299
20552
  }
20300
20553
  async getReceiptFromUrl(url, source) {
@@ -20392,6 +20645,7 @@ exports.APIUser = APIUser;
20392
20645
  exports.Apps = Apps;
20393
20646
  exports.Component = Component;
20394
20647
  exports.ComponentUtils = ComponentUtils;
20648
+ exports.Config = Config;
20395
20649
  exports.DMS = DMS;
20396
20650
  exports.Forge = Forge;
20397
20651
  exports.Functions = Functions;
@@ -20399,8 +20653,8 @@ exports.Integration = Integrations;
20399
20653
  exports.Integrations = Integrations;
20400
20654
  exports.Invoicing = Invoicing;
20401
20655
  exports.Payments = Payments;
20656
+ exports.Project = Project;
20402
20657
  exports.Ratchet = Ratchet;
20403
- exports.Roles = Roles;
20404
20658
  exports.Sandbox = Sandbox;
20405
20659
  exports.SerbiaUtil = SerbiaUtil;
20406
20660
  exports.System = System;