@microsoft/managed-apps-codegen 0.2.19 → 0.2.20
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/LICENSE
CHANGED
|
@@ -1,153 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
MICROSOFT POWER PLATFORM – @MICROSOFT/APPS-CODEGEN
|
|
1
|
+
MIT License
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They
|
|
6
|
-
apply to the software named above and any Microsoft services or software updates (except to the extent such
|
|
7
|
-
services or updates are accompanied by new or additional terms, in which case those different terms apply
|
|
8
|
-
prospectively and do not alter your or Microsoft's rights relating to pre-updated software or services). IF YOU
|
|
9
|
-
COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU
|
|
10
|
-
ACCEPT THESE TERMS.
|
|
11
|
-
1. INSTALLATION AND USE RIGHTS.
|
|
12
|
-
a) General. You may install and use any number of copies of the software to develop and test your
|
|
13
|
-
applications.
|
|
14
|
-
b) Third Party Components. The software may include third party components with separate legal
|
|
15
|
-
notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s)
|
|
16
|
-
accompanying the software.
|
|
17
|
-
c) Work or School Accounts. You can sign into the software with a work or school email address. If
|
|
18
|
-
you do, you agree that the owner of the domain associated with your email address may control and
|
|
19
|
-
administer your account, and access and process your data, including the contents of your
|
|
20
|
-
communications and files. You further agree that your use of the software may be subject to: i) your
|
|
21
|
-
organization's guidelines and policies regarding the use of the software; and ii) the agreements
|
|
22
|
-
Microsoft has with you or your organization, and in such case these terms may not apply. If you
|
|
23
|
-
already have a Microsoft account and you use a separate work or school email address to access the
|
|
24
|
-
software, you may be prompted to update the email address associated with your Microsoft account to
|
|
25
|
-
continue accessing the software.
|
|
26
|
-
2. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless
|
|
27
|
-
applicable law gives you more rights despite this limitation, you will not (and have no right to):
|
|
28
|
-
a) work around any technical limitations in the software that only allow you to use it in certain ways;
|
|
29
|
-
b) reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source
|
|
30
|
-
code for the software, except and to the extent required by third party licensing terms governing use
|
|
31
|
-
of certain open source components that may be included in the software;
|
|
32
|
-
c) remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software;
|
|
33
|
-
d) use the software in any way that is against the law or to create or propagate malware; or
|
|
34
|
-
e) share, publish, distribute, or lease the software (except for any distributable code, subject to the
|
|
35
|
-
terms above), provide the software as a stand-alone offering for others to use, or transfer the
|
|
36
|
-
software or this agreement to any third party.
|
|
37
|
-
3. DATA.
|
|
38
|
-
a) Data Collection. The software may collect information about you and your use of the software, and
|
|
39
|
-
send that to Microsoft. Microsoft may use this information to provide services and improve our
|
|
40
|
-
products and services. You may opt-out of many of these scenarios, but not all, as described in the
|
|
41
|
-
product documentation. There are also some features in the software that may enable you to collect
|
|
42
|
-
data from users of your applications. If you use these features to enable data collection in your
|
|
43
|
-
applications, you must comply with applicable law, including providing appropriate notices to users of
|
|
44
|
-
your applications. You can learn more about data collection and use in the help documentation and
|
|
45
|
-
the privacy statement at https://go.microsoft.com/fwlink/?linkid=521839. Your use of the software
|
|
46
|
-
operates as your consent to these practices.
|
|
47
|
-
b) Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of personal
|
|
48
|
-
data in connection with the software, Microsoft makes the commitments in the European Union
|
|
49
|
-
General Data Protection Regulation Terms of the Microsoft Products and Services Data Protection
|
|
50
|
-
Addendum to all customers effective May 25, 2018, at
|
|
51
|
-
https://go.microsoft.com/fwlink/?linkid=2135030.
|
|
52
|
-
4. COMPLIANCE WITH TRADE LAWS. Microsoft products, software, technology, and services ("Items")
|
|
53
|
-
may be subject to U.S. and other countries' export jurisdictions. Each party will comply with all laws and
|
|
54
|
-
regulations applicable to the import or export of the Items, including, without limitation, trade laws of the
|
|
55
|
-
U.S., EU, and UK, such as the U.S. Export Administration Regulations, sanctions regulations administered
|
|
56
|
-
by the U.S. Office of Foreign Assets Control, the EU Dual Use Regulation 2021/821, and/or other end-user,
|
|
57
|
-
end use, and destination restrictions ("Trade Laws") as well as the global legal compliance standards
|
|
58
|
-
detailed in the Microsoft Standards of Business Conduct. Customer will not, and will ensure its Affiliates
|
|
59
|
-
will not, take any action that causes Microsoft to violate applicable Trade Laws. Microsoft may suspend or
|
|
60
|
-
terminate this agreement immediately without notice to the extent that Microsoft reasonably believes that
|
|
61
|
-
performance would cause it to violate Trade Laws or put it at risk of becoming subject to sanctions and
|
|
62
|
-
penalties under such laws. Customer remains responsible for its and for its Affiliates' compliance with this
|
|
63
|
-
section and, to the extent applicable, the Regional Trade Compliance Addendum incorporated herein by
|
|
64
|
-
reference.
|
|
65
|
-
5. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for
|
|
66
|
-
the software. Any support provided is "as is", "with all faults", and without warranty of any kind.
|
|
67
|
-
6. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements,
|
|
68
|
-
updates, or third-party applications, is the entire agreement for the software.
|
|
69
|
-
7. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United
|
|
70
|
-
States or Canada, the laws of the state or province where you live (or, if a business, where your principal
|
|
71
|
-
place of business is located) govern the interpretation of this agreement, claims for its breach, and all
|
|
72
|
-
other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of
|
|
73
|
-
laws principles. If you acquired the software in any other country, its laws apply. If U.S. federal jurisdiction
|
|
74
|
-
exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County,
|
|
75
|
-
Washington for all disputes heard in court. If not, you and Microsoft consent to exclusive jurisdiction and
|
|
76
|
-
venue in the Superior Court of King County, Washington for all disputes heard in court.
|
|
77
|
-
8. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You
|
|
78
|
-
may have other rights, including consumer rights, under the laws of your state or country. Separate and
|
|
79
|
-
apart from your relationship with Microsoft, you may also have rights with respect to the party from which
|
|
80
|
-
you acquired the software. This agreement does not change those other rights if the laws of your state or
|
|
81
|
-
country do not permit it to do so. For example, if you acquired the software in one of the below regions, or
|
|
82
|
-
mandatory country law applies, then the following provisions apply to you:
|
|
83
|
-
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this
|
|
84
|
-
agreement is intended to affect those rights.
|
|
85
|
-
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the
|
|
86
|
-
automatic update feature, disconnecting your device from the Internet (if and when you re-connect to
|
|
87
|
-
the Internet, however, the software will resume checking for and installing updates), or uninstalling
|
|
88
|
-
the software. The product documentation, if any, may also specify how to turn off updates for your
|
|
89
|
-
specific device or software.
|
|
90
|
-
c) Germany and Austria.
|
|
91
|
-
i. Warranty. The properly licensed software will perform substantially as described in any Microsoft
|
|
92
|
-
materials that accompany the software. However, Microsoft gives no contractual guarantee in
|
|
93
|
-
relation to the licensed software.
|
|
94
|
-
ii. Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the
|
|
95
|
-
Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable
|
|
96
|
-
according to the statutory law.
|
|
97
|
-
Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in
|
|
98
|
-
breach of such material contractual obligations, the fulfillment of which facilitate the due performance
|
|
99
|
-
of this agreement, the breach of which would endanger the purpose of this agreement and the
|
|
100
|
-
compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases
|
|
101
|
-
of slight negligence, Microsoft will not be liable for slight negligence.
|
|
102
|
-
9. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED "AS IS." YOU BEAR THE RISK OF
|
|
103
|
-
USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS.
|
|
104
|
-
TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED
|
|
105
|
-
WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
|
|
106
|
-
NON-INFRINGEMENT.
|
|
107
|
-
10. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING
|
|
108
|
-
DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM
|
|
109
|
-
MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT
|
|
110
|
-
RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL,
|
|
111
|
-
INDIRECT, OR INCIDENTAL DAMAGES.
|
|
112
|
-
This limitation applies to (a) anything related to the software, services, content (including
|
|
113
|
-
code) on third party Internet sites, or third party applications; and (b) claims for breach of
|
|
114
|
-
contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any
|
|
115
|
-
other claim; in each case to the extent permitted by applicable law.
|
|
116
|
-
It also applies even if Microsoft knew or should have known about the possibility of the
|
|
117
|
-
damages. The above limitation or exclusion may not apply to you because your state,
|
|
118
|
-
province, or country may not allow the exclusion or limitation of incidental, consequential, or
|
|
119
|
-
other damages.
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
120
4
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la
|
|
128
|
-
protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le
|
|
129
|
-
droit locale, les garanties implicites de qualité marchande, d'adéquation à un usage particulier et
|
|
130
|
-
d'absence de contrefaçon sont exclues.
|
|
131
|
-
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES
|
|
132
|
-
DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de
|
|
133
|
-
dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune
|
|
134
|
-
indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou
|
|
135
|
-
accessoires et pertes de bénéfices.
|
|
136
|
-
Cette limitation concerne:
|
|
137
|
-
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur
|
|
138
|
-
des sites Internet tiers ou dans des programmes tiers; et
|
|
139
|
-
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité
|
|
140
|
-
stricte, de négligence ou d'une autre faute dans la limite autorisée par la loi en vigueur.
|
|
141
|
-
Elle s'applique également, même si Microsoft connaissait ou devrait connaître l'éventualité d'un
|
|
142
|
-
tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilité pour les
|
|
143
|
-
dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou
|
|
144
|
-
l'exclusion ci-dessus ne s'appliquera pas à votre égard.
|
|
145
|
-
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir
|
|
146
|
-
d'autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que
|
|
147
|
-
vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
148
11
|
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
149
14
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -12,6 +12,13 @@ export declare function isDataverseLookupProperty(propValue: JsonObject): boolea
|
|
|
12
12
|
export declare function getDataverseLookupColumns(propertiesNode: JsonObject): Map<string, JsonObject>;
|
|
13
13
|
/** Returns true if the property is an auto-generated name field for a lookup column (e.g. `owneridname` for `ownerid`). */
|
|
14
14
|
export declare function isLookupRelatedProperty(propName: string, lookupColumns: Map<string, unknown>): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if the property is a system-managed Dataverse column that cannot be written on
|
|
17
|
+
* create or update, and therefore must be excluded from the write (Base) interface. Covers the
|
|
18
|
+
* system-managed attribute types (`OwnerType`, `EntityNameType`) as well as the derived,
|
|
19
|
+
* denormalized name columns of an owner column (e.g. `owneridname`, `owneridyominame`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDataverseSystemManagedProperty(propName: string, propValue: JsonObject, ownerColumnNames: ReadonlySet<string>): boolean;
|
|
15
22
|
/** Returns the write-form property name for a lookup column, used when creating or updating Dataverse records. */
|
|
16
23
|
export declare function generateODataBindPropertyName(schemaName: string): string;
|
|
17
24
|
/** Returns the read-form property name for a lookup's resolved GUID value. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataverseUtils.d.ts","sourceRoot":"","sources":["../../src/shared/dataverseUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,C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,MAAM,CAExE;AAED,8EAA8E;AAC9E,wBAAgB,+BAA+B,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAElF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAoBzE;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAErF;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CAAC,cAAc,EAAE,UAAU,GAAG,MAAM,EAAE,CAa1F;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAK/D;AAED,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,eAAe,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AACF,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wIAAwI;AACxI,wBAAiB,0BAA0B,CACzC,cAAc,EAAE,UAAU,EAC1B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GACrC,SAAS,CAAC,aAAa,GAAG,YAAY,CAAC,CAkBzC"}
|
|
@@ -42,6 +42,46 @@ export function isLookupRelatedProperty(propName, lookupColumns) {
|
|
|
42
42
|
}
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Dataverse attribute types that are always system-managed: the platform owns their values and
|
|
47
|
+
* rejects create/update requests that attempt to set them. `OwnerType` is the record owner (a
|
|
48
|
+
* polymorphic lookup that must be assigned, never written as a plain value) and `EntityNameType`
|
|
49
|
+
* is its derived owner-type discriminator (e.g. `owneridtype`).
|
|
50
|
+
*/
|
|
51
|
+
const systemManagedDataverseTypes = new Set(['ownertype', 'entitynametype']);
|
|
52
|
+
/** Returns true if the property is a Dataverse owner (`OwnerType`) column. */
|
|
53
|
+
function isDataverseOwnerProperty(propValue) {
|
|
54
|
+
const dvType = propValue['x-ms-dataverse-type'];
|
|
55
|
+
return typeof dvType === 'string' && dvType.toLowerCase() === 'ownertype';
|
|
56
|
+
}
|
|
57
|
+
/** Collects the names of all owner (`OwnerType`) columns in a properties node. */
|
|
58
|
+
function getDataverseOwnerColumnNames(propertiesNode) {
|
|
59
|
+
const owners = new Set();
|
|
60
|
+
for (const [propName, propValue] of Object.entries(propertiesNode)) {
|
|
61
|
+
if (isJsonObject(propValue) && isDataverseOwnerProperty(propValue)) {
|
|
62
|
+
owners.add(propName);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return owners;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns true if the property is a system-managed Dataverse column that cannot be written on
|
|
69
|
+
* create or update, and therefore must be excluded from the write (Base) interface. Covers the
|
|
70
|
+
* system-managed attribute types (`OwnerType`, `EntityNameType`) as well as the derived,
|
|
71
|
+
* denormalized name columns of an owner column (e.g. `owneridname`, `owneridyominame`).
|
|
72
|
+
*/
|
|
73
|
+
export function isDataverseSystemManagedProperty(propName, propValue, ownerColumnNames) {
|
|
74
|
+
const dvType = propValue['x-ms-dataverse-type'];
|
|
75
|
+
if (typeof dvType === 'string' && systemManagedDataverseTypes.has(dvType.toLowerCase())) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
for (const owner of ownerColumnNames) {
|
|
79
|
+
if (propName === `${owner}name` || propName === `${owner}yominame`) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
45
85
|
/** Returns the write-form property name for a lookup column, used when creating or updating Dataverse records. */
|
|
46
86
|
export function generateODataBindPropertyName(schemaName) {
|
|
47
87
|
return `${schemaName}@odata.bind`;
|
|
@@ -118,9 +158,11 @@ export function hasOptionsetData(propValue) {
|
|
|
118
158
|
}
|
|
119
159
|
/** Yields each property in a Dataverse entity's properties node, tagged by its role and mutability, for use in interface generation. */
|
|
120
160
|
export function* iterateDataverseProperties(propertiesNode, lookupColumns) {
|
|
161
|
+
const ownerColumnNames = getDataverseOwnerColumnNames(propertiesNode);
|
|
121
162
|
for (const [propName, propValue] of Object.entries(propertiesNode)) {
|
|
122
163
|
if (isJsonObject(propValue)) {
|
|
123
|
-
const readOnly = !!propValue['x-ms-read-only']
|
|
164
|
+
const readOnly = !!propValue['x-ms-read-only'] ||
|
|
165
|
+
isDataverseSystemManagedProperty(propName, propValue, ownerColumnNames);
|
|
124
166
|
if (lookupColumns.has(propName)) {
|
|
125
167
|
const schemaNameRaw = propValue['x-ms-schema-name'];
|
|
126
168
|
const schemaName = typeof schemaNameRaw === 'string' ? schemaNameRaw : propName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataverseUtils.js","sourceRoot":"","sources":["../../src/shared/dataverseUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5D,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,IAAa;IAC7C,OAAO,CACL,YAAY,CAAC,IAAI,CAAC;QAClB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;QACzB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,KAAK,IAAI,CACpD,CAAC;AACJ,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,IAAI,YAA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E,CAAC;gBAC5D,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;YACjE,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/managed-apps-codegen",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "AST-based TypeScript code generation for Microsoft Managed Apps",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"clean": "bun ../../scripts/clean.ts dist .turbo tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@microsoft/managed-apps-common": "0.18.
|
|
49
|
+
"@microsoft/managed-apps-common": "0.18.1",
|
|
49
50
|
"prettier": "3.8.1",
|
|
50
51
|
"ts-morph": "27.0.2"
|
|
51
52
|
},
|