@mcp-consultant-tools/powerplatform-core 26.0.0-beta.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.
Files changed (153) hide show
  1. package/build/auth/index.d.ts +64 -0
  2. package/build/auth/index.d.ts.map +1 -0
  3. package/build/auth/index.js +39 -0
  4. package/build/auth/index.js.map +1 -0
  5. package/build/auth/interactive-auth.d.ts +60 -0
  6. package/build/auth/interactive-auth.d.ts.map +1 -0
  7. package/build/auth/interactive-auth.js +429 -0
  8. package/build/auth/interactive-auth.js.map +1 -0
  9. package/build/auth/service-principal-auth.d.ts +26 -0
  10. package/build/auth/service-principal-auth.d.ts.map +1 -0
  11. package/build/auth/service-principal-auth.js +60 -0
  12. package/build/auth/service-principal-auth.js.map +1 -0
  13. package/build/auth/token-cache.d.ts +40 -0
  14. package/build/auth/token-cache.d.ts.map +1 -0
  15. package/build/auth/token-cache.js +108 -0
  16. package/build/auth/token-cache.js.map +1 -0
  17. package/build/client/PowerPlatformClient.d.ts +78 -0
  18. package/build/client/PowerPlatformClient.d.ts.map +1 -0
  19. package/build/client/PowerPlatformClient.js +198 -0
  20. package/build/client/PowerPlatformClient.js.map +1 -0
  21. package/build/client/index.d.ts +6 -0
  22. package/build/client/index.d.ts.map +1 -0
  23. package/build/client/index.js +6 -0
  24. package/build/client/index.js.map +1 -0
  25. package/build/client/types.d.ts +300 -0
  26. package/build/client/types.d.ts.map +1 -0
  27. package/build/client/types.js +5 -0
  28. package/build/client/types.js.map +1 -0
  29. package/build/index.d.ts +36 -0
  30. package/build/index.d.ts.map +1 -0
  31. package/build/index.js +55 -0
  32. package/build/index.js.map +1 -0
  33. package/build/services/AppManagementService.d.ts +95 -0
  34. package/build/services/AppManagementService.d.ts.map +1 -0
  35. package/build/services/AppManagementService.js +322 -0
  36. package/build/services/AppManagementService.js.map +1 -0
  37. package/build/services/AppService.d.ts +39 -0
  38. package/build/services/AppService.d.ts.map +1 -0
  39. package/build/services/AppService.js +173 -0
  40. package/build/services/AppService.js.map +1 -0
  41. package/build/services/AttributeService.d.ts +28 -0
  42. package/build/services/AttributeService.d.ts.map +1 -0
  43. package/build/services/AttributeService.js +86 -0
  44. package/build/services/AttributeService.js.map +1 -0
  45. package/build/services/BusinessRuleService.d.ts +22 -0
  46. package/build/services/BusinessRuleService.d.ts.map +1 -0
  47. package/build/services/BusinessRuleService.js +85 -0
  48. package/build/services/BusinessRuleService.js.map +1 -0
  49. package/build/services/DataService.d.ts +53 -0
  50. package/build/services/DataService.d.ts.map +1 -0
  51. package/build/services/DataService.js +204 -0
  52. package/build/services/DataService.js.map +1 -0
  53. package/build/services/DependencyService.d.ts +27 -0
  54. package/build/services/DependencyService.d.ts.map +1 -0
  55. package/build/services/DependencyService.js +47 -0
  56. package/build/services/DependencyService.js.map +1 -0
  57. package/build/services/EntityService.d.ts +42 -0
  58. package/build/services/EntityService.d.ts.map +1 -0
  59. package/build/services/EntityService.js +132 -0
  60. package/build/services/EntityService.js.map +1 -0
  61. package/build/services/FlowService.d.ts +55 -0
  62. package/build/services/FlowService.d.ts.map +1 -0
  63. package/build/services/FlowService.js +608 -0
  64. package/build/services/FlowService.js.map +1 -0
  65. package/build/services/FormService.d.ts +36 -0
  66. package/build/services/FormService.d.ts.map +1 -0
  67. package/build/services/FormService.js +55 -0
  68. package/build/services/FormService.js.map +1 -0
  69. package/build/services/MetadataService.d.ts +63 -0
  70. package/build/services/MetadataService.d.ts.map +1 -0
  71. package/build/services/MetadataService.js +176 -0
  72. package/build/services/MetadataService.js.map +1 -0
  73. package/build/services/OptionSetService.d.ts +40 -0
  74. package/build/services/OptionSetService.d.ts.map +1 -0
  75. package/build/services/OptionSetService.js +91 -0
  76. package/build/services/OptionSetService.js.map +1 -0
  77. package/build/services/PluginDeploymentService.d.ts +102 -0
  78. package/build/services/PluginDeploymentService.d.ts.map +1 -0
  79. package/build/services/PluginDeploymentService.js +412 -0
  80. package/build/services/PluginDeploymentService.js.map +1 -0
  81. package/build/services/PluginService.d.ts +61 -0
  82. package/build/services/PluginService.d.ts.map +1 -0
  83. package/build/services/PluginService.js +289 -0
  84. package/build/services/PluginService.js.map +1 -0
  85. package/build/services/PublishingService.d.ts +37 -0
  86. package/build/services/PublishingService.d.ts.map +1 -0
  87. package/build/services/PublishingService.js +65 -0
  88. package/build/services/PublishingService.js.map +1 -0
  89. package/build/services/RelationshipService.d.ts +29 -0
  90. package/build/services/RelationshipService.d.ts.map +1 -0
  91. package/build/services/RelationshipService.js +46 -0
  92. package/build/services/RelationshipService.js.map +1 -0
  93. package/build/services/SolutionService.d.ts +60 -0
  94. package/build/services/SolutionService.d.ts.map +1 -0
  95. package/build/services/SolutionService.js +125 -0
  96. package/build/services/SolutionService.js.map +1 -0
  97. package/build/services/ValidationService.d.ts +31 -0
  98. package/build/services/ValidationService.d.ts.map +1 -0
  99. package/build/services/ValidationService.js +391 -0
  100. package/build/services/ValidationService.js.map +1 -0
  101. package/build/services/ViewService.d.ts +36 -0
  102. package/build/services/ViewService.d.ts.map +1 -0
  103. package/build/services/ViewService.js +55 -0
  104. package/build/services/ViewService.js.map +1 -0
  105. package/build/services/WebResourceService.d.ts +40 -0
  106. package/build/services/WebResourceService.d.ts.map +1 -0
  107. package/build/services/WebResourceService.js +64 -0
  108. package/build/services/WebResourceService.js.map +1 -0
  109. package/build/services/WorkflowManagementService.d.ts +157 -0
  110. package/build/services/WorkflowManagementService.d.ts.map +1 -0
  111. package/build/services/WorkflowManagementService.js +567 -0
  112. package/build/services/WorkflowManagementService.js.map +1 -0
  113. package/build/services/WorkflowService.d.ts +28 -0
  114. package/build/services/WorkflowService.d.ts.map +1 -0
  115. package/build/services/WorkflowService.js +285 -0
  116. package/build/services/WorkflowService.js.map +1 -0
  117. package/build/services/index.d.ts +29 -0
  118. package/build/services/index.d.ts.map +1 -0
  119. package/build/services/index.js +31 -0
  120. package/build/services/index.js.map +1 -0
  121. package/build/utils/auditLogger.d.ts +76 -0
  122. package/build/utils/auditLogger.d.ts.map +1 -0
  123. package/build/utils/auditLogger.js +110 -0
  124. package/build/utils/auditLogger.js.map +1 -0
  125. package/build/utils/best-practices-formatters.d.ts +26 -0
  126. package/build/utils/best-practices-formatters.d.ts.map +1 -0
  127. package/build/utils/best-practices-formatters.js +238 -0
  128. package/build/utils/best-practices-formatters.js.map +1 -0
  129. package/build/utils/bestPractices.d.ts +150 -0
  130. package/build/utils/bestPractices.d.ts.map +1 -0
  131. package/build/utils/bestPractices.js +324 -0
  132. package/build/utils/bestPractices.js.map +1 -0
  133. package/build/utils/iconManager.d.ts +84 -0
  134. package/build/utils/iconManager.d.ts.map +1 -0
  135. package/build/utils/iconManager.js +338 -0
  136. package/build/utils/iconManager.js.map +1 -0
  137. package/build/utils/index.d.ts +11 -0
  138. package/build/utils/index.d.ts.map +1 -0
  139. package/build/utils/index.js +18 -0
  140. package/build/utils/index.js.map +1 -0
  141. package/build/utils/prompt-templates.d.ts +9 -0
  142. package/build/utils/prompt-templates.d.ts.map +1 -0
  143. package/build/utils/prompt-templates.js +31 -0
  144. package/build/utils/prompt-templates.js.map +1 -0
  145. package/build/utils/publisherConfig.d.ts +33 -0
  146. package/build/utils/publisherConfig.d.ts.map +1 -0
  147. package/build/utils/publisherConfig.js +54 -0
  148. package/build/utils/publisherConfig.js.map +1 -0
  149. package/build/utils/rate-limiter.d.ts +108 -0
  150. package/build/utils/rate-limiter.d.ts.map +1 -0
  151. package/build/utils/rate-limiter.js +242 -0
  152. package/build/utils/rate-limiter.js.map +1 -0
  153. package/package.json +65 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * FormService
3
+ *
4
+ * Service for form customization operations.
5
+ * Note: This service should only be used by powerplatform-customization package.
6
+ */
7
+ import type { PowerPlatformClient } from '../client/PowerPlatformClient.js';
8
+ export declare class FormService {
9
+ private client;
10
+ constructor(client: PowerPlatformClient);
11
+ /**
12
+ * Create a form (systemform)
13
+ */
14
+ createForm(form: Record<string, unknown>, solutionUniqueName?: string): Promise<unknown>;
15
+ /**
16
+ * Update a form
17
+ */
18
+ updateForm(formId: string, updates: Record<string, unknown>, solutionUniqueName?: string): Promise<void>;
19
+ /**
20
+ * Delete a form
21
+ */
22
+ deleteForm(formId: string): Promise<void>;
23
+ /**
24
+ * Get forms for an entity
25
+ */
26
+ getForms(entityLogicalName: string): Promise<unknown>;
27
+ /**
28
+ * Activate a form (set statecode=1)
29
+ */
30
+ activateForm(formId: string): Promise<void>;
31
+ /**
32
+ * Deactivate a form (set statecode=0)
33
+ */
34
+ deactivateForm(formId: string): Promise<void>;
35
+ }
36
+ //# sourceMappingURL=FormService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormService.d.ts","sourceRoot":"","sources":["../../src/services/FormService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAE/C;;OAEG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC;IAahB;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C;;OAEG;IACG,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM3D;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOpD"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * FormService
3
+ *
4
+ * Service for form customization operations.
5
+ * Note: This service should only be used by powerplatform-customization package.
6
+ */
7
+ export class FormService {
8
+ client;
9
+ constructor(client) {
10
+ this.client = client;
11
+ }
12
+ /**
13
+ * Create a form (systemform)
14
+ */
15
+ async createForm(form, solutionUniqueName) {
16
+ const headers = solutionUniqueName
17
+ ? { 'MSCRM.SolutionUniqueName': solutionUniqueName }
18
+ : undefined;
19
+ return this.client.makeRequest('api/data/v9.2/systemforms', 'POST', form, headers);
20
+ }
21
+ /**
22
+ * Update a form
23
+ */
24
+ async updateForm(formId, updates, solutionUniqueName) {
25
+ const headers = solutionUniqueName
26
+ ? { 'MSCRM.SolutionUniqueName': solutionUniqueName }
27
+ : undefined;
28
+ await this.client.makeRequest(`api/data/v9.2/systemforms(${formId})`, 'PATCH', updates, headers);
29
+ }
30
+ /**
31
+ * Delete a form
32
+ */
33
+ async deleteForm(formId) {
34
+ await this.client.makeRequest(`api/data/v9.2/systemforms(${formId})`, 'DELETE');
35
+ }
36
+ /**
37
+ * Get forms for an entity
38
+ */
39
+ async getForms(entityLogicalName) {
40
+ return this.client.makeRequest(`api/data/v9.2/systemforms?$filter=objecttypecode eq '${entityLogicalName}'&$orderby=type`);
41
+ }
42
+ /**
43
+ * Activate a form (set statecode=1)
44
+ */
45
+ async activateForm(formId) {
46
+ await this.client.makeRequest(`api/data/v9.2/systemforms(${formId})`, 'PATCH', { statecode: 1, statuscode: 1 });
47
+ }
48
+ /**
49
+ * Deactivate a form (set statecode=0)
50
+ */
51
+ async deactivateForm(formId) {
52
+ await this.client.makeRequest(`api/data/v9.2/systemforms(${formId})`, 'PATCH', { statecode: 0, statuscode: 2 });
53
+ }
54
+ }
55
+ //# sourceMappingURL=FormService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormService.js","sourceRoot":"","sources":["../../src/services/FormService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG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;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,MAAc;QACjC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3B,6BAA6B,MAAM,GAAG,EACtC,OAAO,EACP,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAChC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * MetadataService
3
+ *
4
+ * Read-only service for entity metadata, attributes, relationships, and option sets.
5
+ */
6
+ import type { PowerPlatformClient } from '../client/PowerPlatformClient.js';
7
+ import type { ApiCollectionResponse } from '../client/types.js';
8
+ export declare class MetadataService {
9
+ private client;
10
+ constructor(client: PowerPlatformClient);
11
+ /**
12
+ * Get metadata about an entity
13
+ */
14
+ getEntityMetadata(entityName: string): Promise<unknown>;
15
+ /**
16
+ * Get metadata about entity attributes/fields
17
+ */
18
+ getEntityAttributes(entityName: string, options?: {
19
+ prefix?: string;
20
+ attributeType?: string;
21
+ maxAttributes?: number;
22
+ }): Promise<{
23
+ value: unknown[];
24
+ hasMore: boolean;
25
+ returnedCount: number;
26
+ totalBeforeFilter?: number;
27
+ }>;
28
+ /**
29
+ * Get metadata about a specific entity attribute/field
30
+ */
31
+ getEntityAttribute(entityName: string, attributeName: string): Promise<unknown>;
32
+ /**
33
+ * Get one-to-many relationships for an entity
34
+ */
35
+ getEntityOneToManyRelationships(entityName: string): Promise<ApiCollectionResponse<unknown>>;
36
+ /**
37
+ * Get many-to-many relationships for an entity
38
+ */
39
+ getEntityManyToManyRelationships(entityName: string): Promise<ApiCollectionResponse<unknown>>;
40
+ /**
41
+ * Get all relationships for an entity
42
+ */
43
+ getEntityRelationships(entityName: string): Promise<{
44
+ oneToMany: ApiCollectionResponse<unknown>;
45
+ manyToMany: ApiCollectionResponse<unknown>;
46
+ }>;
47
+ /**
48
+ * Get a global option set definition by name
49
+ */
50
+ getGlobalOptionSet(optionSetName: string): Promise<unknown>;
51
+ /**
52
+ * Get all global option sets
53
+ */
54
+ getGlobalOptionSets(options?: {
55
+ maxRecords?: number;
56
+ prefix?: string;
57
+ }): Promise<{
58
+ value: unknown[];
59
+ hasMore: boolean;
60
+ totalCount: number;
61
+ }>;
62
+ }
63
+ //# sourceMappingURL=MetadataService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetadataService.d.ts","sourceRoot":"","sources":["../../src/services/MetadataService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAE/C;;OAEG;IACG,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAa7D;;OAEG;IACG,mBAAmB,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GACA,OAAO,CAAC;QACT,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAwFF;;OAEG;IACG,kBAAkB,CACtB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;IAMnB;;OAEG;IACG,+BAA+B,CACnC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IA+B1C;;OAEG;IACG,gCAAgC,CACpC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAiB1C;;OAEG;IACG,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QACxD,SAAS,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAC1C,UAAU,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;KAC5C,CAAC;IASF;;OAEG;IACG,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMjE;;OAEG;IACG,mBAAmB,CAAC,OAAO,CAAC,EAAE;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAwBxE"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * MetadataService
3
+ *
4
+ * Read-only service for entity metadata, attributes, relationships, and option sets.
5
+ */
6
+ export class MetadataService {
7
+ client;
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get metadata about an entity
13
+ */
14
+ async getEntityMetadata(entityName) {
15
+ const response = await this.client.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')`);
16
+ // Remove Privileges property if it exists
17
+ if (response && typeof response === 'object' && 'Privileges' in response) {
18
+ delete response.Privileges;
19
+ }
20
+ return response;
21
+ }
22
+ /**
23
+ * Get metadata about entity attributes/fields
24
+ */
25
+ async getEntityAttributes(entityName, options) {
26
+ const selectProperties = [
27
+ 'LogicalName',
28
+ 'AttributeType',
29
+ 'DisplayName',
30
+ 'RequiredLevel',
31
+ ].join(',');
32
+ const filters = ["AttributeType ne 'Virtual'"];
33
+ if (options?.attributeType) {
34
+ filters.push(`AttributeType eq '${options.attributeType}'`);
35
+ }
36
+ const filterString = filters.join(' and ');
37
+ const response = await this.client.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')/Attributes?$select=${selectProperties}&$filter=${filterString}`);
38
+ let attributes = response.value || [];
39
+ // Filter out yominame attributes
40
+ attributes = attributes.filter((attr) => {
41
+ const logicalName = attr.LogicalName || '';
42
+ return !logicalName.endsWith('yominame');
43
+ });
44
+ // Filter out *name attributes when base attribute exists
45
+ const baseNames = new Set();
46
+ const namesAttributes = new Map();
47
+ for (const attribute of attributes) {
48
+ const logicalName = attribute.LogicalName || '';
49
+ if (logicalName.endsWith('name') && logicalName.length > 4) {
50
+ const baseName = logicalName.slice(0, -4);
51
+ namesAttributes.set(baseName, attribute);
52
+ }
53
+ else {
54
+ baseNames.add(logicalName);
55
+ }
56
+ }
57
+ const attributesToRemove = new Set();
58
+ for (const [baseName, nameAttribute] of namesAttributes.entries()) {
59
+ if (baseNames.has(baseName)) {
60
+ attributesToRemove.add(nameAttribute);
61
+ }
62
+ }
63
+ attributes = attributes.filter((attr) => !attributesToRemove.has(attr));
64
+ // Apply prefix filter
65
+ if (options?.prefix) {
66
+ const prefix = options.prefix.toLowerCase();
67
+ attributes = attributes.filter((attr) => (attr.LogicalName || '').toLowerCase().startsWith(prefix));
68
+ }
69
+ const totalBeforeLimit = attributes.length;
70
+ // Apply maxAttributes limit
71
+ let hasMore = false;
72
+ if (options?.maxAttributes && attributes.length > options.maxAttributes) {
73
+ hasMore = true;
74
+ attributes = attributes.slice(0, options.maxAttributes);
75
+ }
76
+ // Format the response
77
+ const formattedAttributes = attributes.map((attr) => ({
78
+ logicalName: attr.LogicalName,
79
+ attributeType: attr.AttributeType,
80
+ displayName: attr.DisplayName
81
+ ?.UserLocalizedLabel?.Label || attr.LogicalName,
82
+ requiredLevel: attr.RequiredLevel?.Value || 'None',
83
+ }));
84
+ return {
85
+ value: formattedAttributes,
86
+ hasMore,
87
+ returnedCount: formattedAttributes.length,
88
+ totalBeforeFilter: totalBeforeLimit,
89
+ };
90
+ }
91
+ /**
92
+ * Get metadata about a specific entity attribute/field
93
+ */
94
+ async getEntityAttribute(entityName, attributeName) {
95
+ return this.client.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')/Attributes(LogicalName='${attributeName}')`);
96
+ }
97
+ /**
98
+ * Get one-to-many relationships for an entity
99
+ */
100
+ async getEntityOneToManyRelationships(entityName) {
101
+ const selectProperties = [
102
+ 'SchemaName',
103
+ 'RelationshipType',
104
+ 'ReferencedAttribute',
105
+ 'ReferencedEntity',
106
+ 'ReferencingAttribute',
107
+ 'ReferencingEntity',
108
+ 'ReferencedEntityNavigationPropertyName',
109
+ 'ReferencingEntityNavigationPropertyName',
110
+ ].join(',');
111
+ const response = await this.client.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')/OneToManyRelationships?$select=${selectProperties}&$filter=ReferencingAttribute ne 'regardingobjectid'`);
112
+ // Filter out msdyn_ and adx_ prefixed entities
113
+ if (response?.value) {
114
+ response.value = response.value.filter((relationship) => {
115
+ const referencingEntity = relationship.ReferencingEntity || '';
116
+ return !(referencingEntity.startsWith('msdyn_') ||
117
+ referencingEntity.startsWith('adx_'));
118
+ });
119
+ }
120
+ return response;
121
+ }
122
+ /**
123
+ * Get many-to-many relationships for an entity
124
+ */
125
+ async getEntityManyToManyRelationships(entityName) {
126
+ const selectProperties = [
127
+ 'SchemaName',
128
+ 'RelationshipType',
129
+ 'Entity1LogicalName',
130
+ 'Entity2LogicalName',
131
+ 'Entity1IntersectAttribute',
132
+ 'Entity2IntersectAttribute',
133
+ 'Entity1NavigationPropertyName',
134
+ 'Entity2NavigationPropertyName',
135
+ ].join(',');
136
+ return this.client.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')/ManyToManyRelationships?$select=${selectProperties}`);
137
+ }
138
+ /**
139
+ * Get all relationships for an entity
140
+ */
141
+ async getEntityRelationships(entityName) {
142
+ const [oneToMany, manyToMany] = await Promise.all([
143
+ this.getEntityOneToManyRelationships(entityName),
144
+ this.getEntityManyToManyRelationships(entityName),
145
+ ]);
146
+ return { oneToMany, manyToMany };
147
+ }
148
+ /**
149
+ * Get a global option set definition by name
150
+ */
151
+ async getGlobalOptionSet(optionSetName) {
152
+ return this.client.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions(Name='${optionSetName}')`);
153
+ }
154
+ /**
155
+ * Get all global option sets
156
+ */
157
+ async getGlobalOptionSets(options) {
158
+ const maxRecords = options?.maxRecords || 100;
159
+ const requestLimit = maxRecords + 1;
160
+ let filter = '';
161
+ if (options?.prefix) {
162
+ filter = `&$filter=startswith(Name,'${options.prefix}')`;
163
+ }
164
+ const response = await this.client.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions?$select=Name,DisplayName,MetadataId,OptionSetType${filter}&$top=${requestLimit}`);
165
+ const hasMore = response.value.length > maxRecords;
166
+ const trimmedValue = hasMore
167
+ ? response.value.slice(0, maxRecords)
168
+ : response.value;
169
+ return {
170
+ value: trimmedValue,
171
+ hasMore,
172
+ totalCount: trimmedValue.length,
173
+ };
174
+ }
175
+ }
176
+ //# sourceMappingURL=MetadataService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetadataService.js","sourceRoot":"","sources":["../../src/services/MetadataService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,OAAO,eAAe;IACN;IAApB,YAAoB,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CAAC;IAEnD;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,UAAkB;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC5C,gDAAgD,UAAU,IAAI,CAC/D,CAAC;QAEF,0CAA0C;QAC1C,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,YAAY,IAAI,QAAQ,EAAE,CAAC;YACzE,OAAO,QAAQ,CAAC,UAAU,CAAC;QAC7B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CACvB,UAAkB,EAClB,OAIC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AED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC5C,6FAA6F,MAAM,SAAS,YAAY,EAAE,CAC3H,CAAC;QAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACnD,MAAM,YAAY,GAAG,OAAO;YAC1B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;YACrC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAEnB,OAAO;YACL,KAAK,EAAE,YAAY;YACnB,OAAO;YACP,UAAU,EAAE,YAAY,CAAC,MAAM;SAChC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * OptionSetService
3
+ *
4
+ * Service for option set customization operations.
5
+ * Note: This service should only be used by powerplatform-customization package.
6
+ */
7
+ import type { PowerPlatformClient } from '../client/PowerPlatformClient.js';
8
+ export declare class OptionSetService {
9
+ private client;
10
+ constructor(client: PowerPlatformClient);
11
+ /**
12
+ * Create a global option set
13
+ */
14
+ createGlobalOptionSet(optionSetDefinition: Record<string, unknown>, solutionUniqueName?: string): Promise<unknown>;
15
+ /**
16
+ * Update a global option set
17
+ */
18
+ updateGlobalOptionSet(metadataId: string, updates: Record<string, unknown>, solutionUniqueName?: string): Promise<void>;
19
+ /**
20
+ * Delete a global option set
21
+ */
22
+ deleteGlobalOptionSet(metadataId: string): Promise<void>;
23
+ /**
24
+ * Add a value to a global option set
25
+ */
26
+ addOptionSetValue(optionSetName: string, value: number, label: string, solutionUniqueName?: string): Promise<unknown>;
27
+ /**
28
+ * Update an option set value
29
+ */
30
+ updateOptionSetValue(optionSetName: string, value: number, label: string, solutionUniqueName?: string): Promise<void>;
31
+ /**
32
+ * Delete an option set value
33
+ */
34
+ deleteOptionSetValue(optionSetName: string, value: number): Promise<void>;
35
+ /**
36
+ * Reorder option set values
37
+ */
38
+ reorderOptionSetValues(optionSetName: string, values: number[], solutionUniqueName?: string): Promise<void>;
39
+ }
40
+ //# sourceMappingURL=OptionSetService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionSetService.d.ts","sourceRoot":"","sources":["../../src/services/OptionSetService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAE/C;;OAEG;IACG,qBAAqB,CACzB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5C,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,OAAO,CAAC;IAcnB;;OAEG;IACG,qBAAqB,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC;IAahB;;OAEG;IACG,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9D;;OAEG;IACG,iBAAiB,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,OAAO,CAAC;IAmBnB;;OAEG;IACG,oBAAoB,CACxB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC;IAqBhB;;OAEG;IACG,oBAAoB,CACxB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;IAOhB;;OAEG;IACG,sBAAsB,CAC1B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EAAE,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC;CAejB"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * OptionSetService
3
+ *
4
+ * Service for option set customization operations.
5
+ * Note: This service should only be used by powerplatform-customization package.
6
+ */
7
+ export class OptionSetService {
8
+ client;
9
+ constructor(client) {
10
+ this.client = client;
11
+ }
12
+ /**
13
+ * Create a global option set
14
+ */
15
+ async createGlobalOptionSet(optionSetDefinition, solutionUniqueName) {
16
+ const headers = {};
17
+ if (solutionUniqueName) {
18
+ headers['MSCRM.SolutionUniqueName'] = solutionUniqueName;
19
+ }
20
+ return this.client.makeRequest('api/data/v9.2/GlobalOptionSetDefinitions', 'POST', optionSetDefinition, headers);
21
+ }
22
+ /**
23
+ * Update a global option set
24
+ */
25
+ async updateGlobalOptionSet(metadataId, updates, solutionUniqueName) {
26
+ const headers = solutionUniqueName
27
+ ? { 'MSCRM.SolutionUniqueName': solutionUniqueName }
28
+ : undefined;
29
+ await this.client.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions(${metadataId})`, 'PUT', updates, headers);
30
+ }
31
+ /**
32
+ * Delete a global option set
33
+ */
34
+ async deleteGlobalOptionSet(metadataId) {
35
+ await this.client.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions(${metadataId})`, 'DELETE');
36
+ }
37
+ /**
38
+ * Add a value to a global option set
39
+ */
40
+ async addOptionSetValue(optionSetName, value, label, solutionUniqueName) {
41
+ const headers = solutionUniqueName
42
+ ? { 'MSCRM.SolutionUniqueName': solutionUniqueName }
43
+ : undefined;
44
+ return this.client.makeRequest('api/data/v9.2/InsertOptionValue', 'POST', {
45
+ OptionSetName: optionSetName,
46
+ Value: value,
47
+ Label: {
48
+ LocalizedLabels: [{ Label: label, LanguageCode: 1033 }],
49
+ },
50
+ }, headers);
51
+ }
52
+ /**
53
+ * Update an option set value
54
+ */
55
+ async updateOptionSetValue(optionSetName, value, label, solutionUniqueName) {
56
+ const headers = { 'MSCRM.MergeLabels': 'true' };
57
+ if (solutionUniqueName) {
58
+ headers['MSCRM.SolutionUniqueName'] = solutionUniqueName;
59
+ }
60
+ await this.client.makeRequest('api/data/v9.2/UpdateOptionValue', 'POST', {
61
+ OptionSetName: optionSetName,
62
+ Value: value,
63
+ Label: {
64
+ LocalizedLabels: [{ Label: label, LanguageCode: 1033 }],
65
+ },
66
+ MergeLabels: true,
67
+ }, headers);
68
+ }
69
+ /**
70
+ * Delete an option set value
71
+ */
72
+ async deleteOptionSetValue(optionSetName, value) {
73
+ await this.client.makeRequest('api/data/v9.2/DeleteOptionValue', 'POST', {
74
+ OptionSetName: optionSetName,
75
+ Value: value,
76
+ });
77
+ }
78
+ /**
79
+ * Reorder option set values
80
+ */
81
+ async reorderOptionSetValues(optionSetName, values, solutionUniqueName) {
82
+ const headers = solutionUniqueName
83
+ ? { 'MSCRM.SolutionUniqueName': solutionUniqueName }
84
+ : undefined;
85
+ await this.client.makeRequest('api/data/v9.2/OrderOption', 'POST', {
86
+ OptionSetName: optionSetName,
87
+ Values: values,
88
+ }, headers);
89
+ }
90
+ }
91
+ //# sourceMappingURL=OptionSetService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionSetService.js","sourceRoot":"","sources":["../../src/services/OptionSetService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,OAAO,gBAAgB;IACP;IAApB,YAAoB,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CAAC;IAEnD;;OAEG;IACH,KAAK,CAAC,qBAAqB,CACzB,mBAA4C,EAC5C,kBAA2B;QAE3B,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,kBAAkB,EAAE,CAAC;YACvB,OAAO,CAAC,0BAA0B,CAAC,GAAG,kBAAkB,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAC5B,0CAA0C,EAC1C,MAAM,EACN,mBAAmB,EACnB,OA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AED,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3B,iCAAiC,EACjC,MAAM,EACN;YACE,aAAa,EAAE,aAAa;YAC5B,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE;gBACL,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;aACxD;YACD,WAAW,EAAE,IAAI;SAClB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CACxB,aAAqB,EACrB,KAAa;QAEb,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,iCAAiC,EAAE,MAAM,EAAE;YACvE,aAAa,EAAE,aAAa;YAC5B,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,aAAqB,EACrB,MAAgB,EAChB,kBAA2B;QAE3B,MAAM,OAAO,GAAuC,kBAAkB;YACpE,CAAC,CAAC,EAAE,0BAA0B,EAAE,kBAAkB,EAAE;YACpD,CAAC,CAAC,SAAS,CAAC;QAEd,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3B,2BAA2B,EAC3B,MAAM,EACN;YACE,aAAa,EAAE,aAAa;YAC5B,MAAM,EAAE,MAAM;SACf,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * PluginDeploymentService
3
+ *
4
+ * Service for plugin deployment operations.
5
+ * Note: This service should only be used by powerplatform-customization package.
6
+ */
7
+ import type { PowerPlatformClient } from '../client/PowerPlatformClient.js';
8
+ export interface PluginTypeInfo {
9
+ pluginTypeId: string;
10
+ typeName: string;
11
+ friendlyName: string;
12
+ }
13
+ export interface CreatePluginAssemblyOptions {
14
+ name: string;
15
+ content: string;
16
+ version: string;
17
+ isolationMode?: number;
18
+ sourceType?: number;
19
+ description?: string;
20
+ solutionUniqueName?: string;
21
+ }
22
+ export interface RegisterPluginStepOptions {
23
+ pluginTypeId: string;
24
+ name: string;
25
+ messageName: string;
26
+ primaryEntityName: string;
27
+ stage: number;
28
+ executionMode: number;
29
+ rank?: number;
30
+ filteringAttributes?: string;
31
+ configuration?: string;
32
+ supportedDeployment?: number;
33
+ solutionUniqueName?: string;
34
+ }
35
+ export interface RegisterPluginImageOptions {
36
+ stepId: string;
37
+ name: string;
38
+ imageType: number;
39
+ entityAlias: string;
40
+ attributes?: string;
41
+ messagePropertyName?: string;
42
+ }
43
+ export declare class PluginDeploymentService {
44
+ private client;
45
+ private addComponentToSolution;
46
+ constructor(client: PowerPlatformClient, addComponentToSolution: (solutionUniqueName: string, componentId: string, componentType: number) => Promise<void>);
47
+ /**
48
+ * Extract assembly version from .NET DLL
49
+ */
50
+ extractAssemblyVersion(assemblyPath: string): Promise<string>;
51
+ /**
52
+ * Query plugin type by typename
53
+ */
54
+ queryPluginTypeByTypename(typename: string): Promise<string>;
55
+ /**
56
+ * Query plugin assembly by name
57
+ */
58
+ queryPluginAssemblyByName(assemblyName: string): Promise<string | null>;
59
+ /**
60
+ * Get plugin types for an assembly
61
+ */
62
+ getPluginTypesForAssembly(assemblyId: string): Promise<PluginTypeInfo[]>;
63
+ /**
64
+ * Resolve SDK Message and Filter IDs
65
+ */
66
+ resolveSdkMessageAndFilter(messageName: string, entityName: string): Promise<{
67
+ messageId: string;
68
+ filterId: string;
69
+ }>;
70
+ /**
71
+ * Create a new plugin assembly
72
+ */
73
+ createPluginAssembly(options: CreatePluginAssemblyOptions): Promise<{
74
+ pluginAssemblyId: string;
75
+ pluginTypes: PluginTypeInfo[];
76
+ }>;
77
+ /**
78
+ * Update an existing plugin assembly
79
+ */
80
+ updatePluginAssembly(assemblyId: string, content: string, version: string, solutionUniqueName?: string): Promise<void>;
81
+ /**
82
+ * Delete a plugin assembly
83
+ */
84
+ deletePluginAssembly(assemblyId: string): Promise<void>;
85
+ /**
86
+ * Delete a plugin step
87
+ */
88
+ deletePluginStep(stepId: string): Promise<void>;
89
+ /**
90
+ * Register a plugin step
91
+ */
92
+ registerPluginStep(options: RegisterPluginStepOptions): Promise<{
93
+ stepId: string;
94
+ }>;
95
+ /**
96
+ * Register a plugin image
97
+ */
98
+ registerPluginImage(options: RegisterPluginImageOptions): Promise<{
99
+ imageId: string;
100
+ }>;
101
+ }
102
+ //# sourceMappingURL=PluginDeploymentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginDeploymentService.d.ts","sourceRoot":"","sources":["../../src/services/PluginDeploymentService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAI5E,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7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