@lunora/codegen 1.0.0-alpha.404 → 1.0.0-alpha.405
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.md +201 -104
- package/README.md +3 -3
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/ALL_NOTIFY_CHANNELS-DPxI0EHQ.mjs +1 -0
- package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-DvMqIcXC.mjs → SCHEMA_SNAPSHOT_FILENAME-CKRhpYzL.mjs} +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/ALL_NOTIFY_CHANNELS-CtrsBtZX.mjs +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,108 +1,205 @@
|
|
|
1
|
-
# Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
106
203
|
|
|
107
204
|
<!-- DEPENDENCIES -->
|
|
108
205
|
<!-- /DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<div align="center">
|
|
16
16
|
|
|
17
17
|
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
-
[![
|
|
18
|
+
[![Apache-2.0 licence][license-badge]][license]
|
|
19
19
|
[![npm version][npm-version-badge]][npm-version]
|
|
20
20
|
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
21
21
|
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
@@ -110,11 +110,11 @@ This is an open source project and will always remain free to use. If you think
|
|
|
110
110
|
|
|
111
111
|
## License
|
|
112
112
|
|
|
113
|
-
The Lunora codegen package is open-sourced software licensed under the [
|
|
113
|
+
The Lunora codegen package is open-sourced software licensed under the [Apache-2.0][license].
|
|
114
114
|
|
|
115
115
|
<!-- badges -->
|
|
116
116
|
|
|
117
|
-
[license-badge]: https://img.shields.io/badge/license-
|
|
117
|
+
[license-badge]: https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=for-the-badge
|
|
118
118
|
[license]: https://github.com/anolilab/lunora/blob/alpha/LICENSE.md
|
|
119
119
|
[npm-version-badge]: https://img.shields.io/npm/v/@lunora/codegen?style=for-the-badge
|
|
120
120
|
[npm-version]: https://www.npmjs.com/package/@lunora/codegen
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as i,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{formatAdvisories as d,lintSchema as f,toAdvisorContext as m}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,sortedUniqueNames as S}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-BuNEmlCO.mjs";import{COMPANION_BINDING as u,COMPANION_SERVICE_NAME as N}from"./packem_shared/COMPANION_BINDING-Da_v9XpC.mjs";import{CodegenDiagnosticError as g,diagnosticAt as C}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as I,discoverAgents as _}from"./packem_shared/AGENTS_FILENAME-D0Y0_UgB.mjs";import{isTestPath as L,listLunoraSourceFiles as M}from"./packem_shared/isTestPath-DRIdZaij.mjs";import{default as F}from"./packem_shared/discoverAuthApiCalls-ENLGem4M.mjs";import{CONTAINERS_FILENAME as P,discoverContainers as D}from"./packem_shared/CONTAINERS_FILENAME-J-e3Vanb.mjs";import{default as b}from"./packem_shared/discoverCrons-DWVXmktw.mjs";import{ENV_FILENAME as U}from"./packem_shared/ENV_FILENAME-COPIfgzp.mjs";import{capabilitiesUsedBy as H,createTargetScope as j,foldCapabilitySignals as V,mayReadCapabilityContext as k,sourceCapabilitySignals as W}from"./packem_shared/capabilitiesUsedBy-BwhaHK08.mjs";import{FLAGS_FILENAME as K,discoverFlags as Q}from"./packem_shared/FLAGS_FILENAME-6RzszxVW.mjs";import{d as q}from"./packem_shared/index-jtzAVdUp.mjs";import{default as J}from"./packem_shared/discoverHttpRoutes-CAoEemno.mjs";import{default as Z}from"./packem_shared/discoverHyperdriveCalls-BaRayTZe.mjs";import{default as ee}from"./packem_shared/discoverInserts-DmSa4WKU.mjs";import{d as oe}from"./packem_shared/index-mFEIaT45.mjs";import{default as ie}from"./packem_shared/discoverMigrations-Duh6HVG3.mjs";import{MUTATORS_FILENAME as se,discoverMutators as de}from"./packem_shared/MUTATORS_FILENAME-C3OImAxC.mjs";import{default as me}from"./packem_shared/discoverNondeterministicCalls-BoF6ob-B.mjs";import{ALL_NOTIFY_CHANNELS as ne,NOTIFY_FILENAME as ce,discoverNotifyCalls as le,discoverNotifyChannels as Se,discoverNotifyConfig as xe}from"./packem_shared/ALL_NOTIFY_CHANNELS-
|
|
1
|
+
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as i,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{formatAdvisories as d,lintSchema as f,toAdvisorContext as m}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as c,errorPlatformDiagnosticNames as l,sortedUniqueNames as S}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-BuNEmlCO.mjs";import{COMPANION_BINDING as u,COMPANION_SERVICE_NAME as N}from"./packem_shared/COMPANION_BINDING-Da_v9XpC.mjs";import{CodegenDiagnosticError as g,diagnosticAt as C}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as I,discoverAgents as _}from"./packem_shared/AGENTS_FILENAME-D0Y0_UgB.mjs";import{isTestPath as L,listLunoraSourceFiles as M}from"./packem_shared/isTestPath-DRIdZaij.mjs";import{default as F}from"./packem_shared/discoverAuthApiCalls-ENLGem4M.mjs";import{CONTAINERS_FILENAME as P,discoverContainers as D}from"./packem_shared/CONTAINERS_FILENAME-J-e3Vanb.mjs";import{default as b}from"./packem_shared/discoverCrons-DWVXmktw.mjs";import{ENV_FILENAME as U}from"./packem_shared/ENV_FILENAME-COPIfgzp.mjs";import{capabilitiesUsedBy as H,createTargetScope as j,foldCapabilitySignals as V,mayReadCapabilityContext as k,sourceCapabilitySignals as W}from"./packem_shared/capabilitiesUsedBy-BwhaHK08.mjs";import{FLAGS_FILENAME as K,discoverFlags as Q}from"./packem_shared/FLAGS_FILENAME-6RzszxVW.mjs";import{d as q}from"./packem_shared/index-jtzAVdUp.mjs";import{default as J}from"./packem_shared/discoverHttpRoutes-CAoEemno.mjs";import{default as Z}from"./packem_shared/discoverHyperdriveCalls-BaRayTZe.mjs";import{default as ee}from"./packem_shared/discoverInserts-DmSa4WKU.mjs";import{d as oe}from"./packem_shared/index-mFEIaT45.mjs";import{default as ie}from"./packem_shared/discoverMigrations-Duh6HVG3.mjs";import{MUTATORS_FILENAME as se,discoverMutators as de}from"./packem_shared/MUTATORS_FILENAME-C3OImAxC.mjs";import{default as me}from"./packem_shared/discoverNondeterministicCalls-BoF6ob-B.mjs";import{ALL_NOTIFY_CHANNELS as ne,NOTIFY_FILENAME as ce,discoverNotifyCalls as le,discoverNotifyChannels as Se,discoverNotifyConfig as xe}from"./packem_shared/ALL_NOTIFY_CHANNELS-DPxI0EHQ.mjs";import{default as Ae}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as Ne}from"./packem_shared/discoverQueries-spxu-wHR.mjs";import{QUEUES_FILENAME as ge,discoverQueues as Ce}from"./packem_shared/QUEUES_FILENAME-Ba-sK5Ek.mjs";import{default as Ie}from"./packem_shared/discoverR2sqlCalls-CZjqFVi_.mjs";import{default as Re}from"./packem_shared/discoverRlsProcedures-mjiA0I4S.mjs";import{default as Me}from"./packem_shared/discoverRlsMetadata-Cc0zA-gZ.mjs";import{discoverSandboxUsage as Fe}from"./packem_shared/discoverSandboxUsage-Ccy9n7G1.mjs";import{default as Pe}from"./packem_shared/discoverSchema-ynieYB0n.mjs";import{companionServiceBinding as ye,readBoundServiceBindings as be,readDevServiceBindings as Ge,readServiceBindings as Ue,resolveServiceBindings as Be}from"./packem_shared/companionServiceBinding-BZjm486n.mjs";import{SHAPES_FILENAME as je,discoverShapes as Ve}from"./packem_shared/SHAPES_FILENAME-CH0KrAdb.mjs";import{default as We}from"./packem_shared/discoverStorageRulesMetadata-CtE5trUR.mjs";import{WORKFLOWS_FILENAME as Ke,discoverWorkflows as Qe}from"./packem_shared/WORKFLOWS_FILENAME-DfVfBum_.mjs";import{emitApp as qe}from"./packem_shared/emitApp-C3IUdkkt.mjs";import{isD1GlobalTable as Je,isHyperdriveGlobalTable as Xe}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as $e,emitOpenApi as er,emitOpenApiModule as rr}from"./packem_shared/buildOpenApiDocument-B8KEeeRr.mjs";import{OPENRPC_VERSION as tr,buildOpenRpcDocument as ir,emitOpenRpc as ar,emitOpenRpcModule as sr}from"./packem_shared/OPENRPC_VERSION-UNYmA7Ty.mjs";import{DEFAULT_TARGET as fr,platformMatrixIds as mr,readProjectTarget as pr,resolveCodegenTarget as nr}from"./packem_shared/DEFAULT_TARGET-CVYzxQ0y.mjs";import{b as lr,r as Sr,c as xr,d as Er}from"./packem_shared/project-config-file-DR7xrrNB.mjs";import{PROJECT_CONFIG_FILENAMES as ur,findCodegenConfigFile as Nr,findProjectConfigFile as vr,projectConfigCandidatePaths as gr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{SCHEMA_SNAPSHOT_FILENAME as Or,runCodegen as Ir}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-CKRhpYzL.mjs";import{SchemaSnapshotParseError as Rr,buildSchemaSnapshot as Lr,evaluateSchemaDrift as Mr,indexReferencesOf as Tr,parseSchemaSnapshot as Fr}from"./packem_shared/SchemaSnapshotParseError-DnAuFdpl.mjs";import{default as Pr}from"./packem_shared/fingerprintSchemaSources-C8H1wOcH.mjs";import{schemaFromIr as yr}from"./packem_shared/schemaFromIr-CByOxuZb.mjs";import{LUNORA_ERROR_CODES as Gr,validatorIrToJsonSchema as Ur}from"./packem_shared/LUNORA_ERROR_CODES-D7AVT7qF.mjs";import{SDK_LANGUAGES as Hr,SDK_TARGETS as jr,generateSdk as Vr}from"./sdk/index.mjs";import{redact as Wr,secretKindOf as zr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as Qr}from"./packem_shared/emitDrizzleSchema-BzOChEYW.mjs";import{e as qr}from"./packem_shared/server-CRFaUMKQ.mjs";import{e as Jr}from"./packem_shared/shard-Csztu3jG.mjs";import{G as Zr}from"./packem_shared/shared-Cn7dMQ_u.mjs";import{MESSAGE_SOLUTIONS as eo,findSolutionByMessage as ro}from"@lunora/errors";import{createCodegenProject as to,findTsconfig as io,refreshCodegenProject as ao,tsconfigFingerprint as so}from"./packem_shared/createCodegenProject-Cfr1xHPC.mjs";import{t as mo,u as po,v as no}from"./packem_shared/shard-runtime-D0xuE0pX.mjs";import{emitApi as lo,emitCollections as So,emitInternalApi as xo}from"./packem_shared/emitApi-lwadq5G7.mjs";import{emitCrons as Ao,emitScheduler as uo,emitVectors as No,emitWranglerCronTriggers as vo}from"./packem_shared/emitCrons-CCRKs482.mjs";import{emitDataModel as Co}from"./packem_shared/emitDataModel-BvCZS4Yq.mjs";import{emitFunctions as Io}from"./packem_shared/emitFunctions-ppMX7E3X.mjs";import{isTypedSchema as Ro}from"./packem_shared/isTypedSchema-CDv3pJB6.mjs";const e="0.0.0";export{I as AGENTS_FILENAME,ne as ALL_NOTIFY_CHANNELS,E as CAPABILITY_PROBES,u as COMPANION_BINDING,N as COMPANION_SERVICE_NAME,P as CONTAINERS_FILENAME,g as CodegenDiagnosticError,fr as DEFAULT_TARGET,U as ENV_FILENAME,K as FLAGS_FILENAME,Zr as GENERATED_HEADER,Gr as LUNORA_ERROR_CODES,eo as LUNORA_SOLUTION_RULES,se as MUTATORS_FILENAME,ce as NOTIFY_FILENAME,tr as OPENRPC_VERSION,ur as PROJECT_CONFIG_FILENAMES,ge as QUEUES_FILENAME,Or as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Hr as SDK_LANGUAGES,jr as SDK_TARGETS,je as SHAPES_FILENAME,Rr as SchemaSnapshotParseError,e as VERSION,Ke as WORKFLOWS_FILENAME,$e as buildOpenApiDocument,ir as buildOpenRpcDocument,Lr as buildSchemaSnapshot,H as capabilitiesUsedBy,ye as companionServiceBinding,to as createCodegenProject,j as createTargetScope,n as describeErrorLevelFindings,C as diagnosticAt,i as diffSchemaSnapshots,_ as discoverAgents,F as discoverAuthApiCalls,D as discoverContainers,b as discoverCrons,Q as discoverFlags,q as discoverFunctions,J as discoverHttpRoutes,Z as discoverHyperdriveCalls,ee as discoverInserts,oe as discoverMaskProcedures,ie as discoverMigrations,de as discoverMutators,me as discoverNondeterministicCalls,le as discoverNotifyCalls,Se as discoverNotifyChannels,xe as discoverNotifyConfig,Ne as discoverQueries,Ce as discoverQueues,Ie as discoverR2sqlCalls,Me as discoverRlsMetadata,Re as discoverRlsProcedures,Fe as discoverSandboxUsage,Pe as discoverSchema,Ve as discoverShapes,We as discoverStorageRulesMetadata,Qe as discoverWorkflows,mo as emitAgents,lo as emitApi,qe as emitApp,So as emitCollections,po as emitContainers,Ao as emitCrons,Co as emitDataModel,Qr as emitDrizzleSchema,Io as emitFunctions,xo as emitInternalApi,er as emitOpenApi,rr as emitOpenApiModule,ar as emitOpenRpc,sr as emitOpenRpcModule,uo as emitScheduler,qr as emitServer,Jr as emitShard,No as emitVectors,no as emitWorkflows,vo as emitWranglerCronTriggers,c as errorAdvisoryNames,l as errorPlatformDiagnosticNames,Mr as evaluateSchemaDrift,Nr as findCodegenConfigFile,ro as findLunoraSolution,vr as findProjectConfigFile,io as findTsconfig,Pr as fingerprintSchemaSources,V as foldCapabilitySignals,d as formatAdvisories,Vr as generateSdk,Tr as indexReferencesOf,Je as isD1GlobalTable,Xe as isHyperdriveGlobalTable,L as isTestPath,Ro as isTypedSchema,f as lintSchema,M as listLunoraSourceFiles,lr as loadProjectConfig,k as mayReadCapabilityContext,Fr as parseSchemaSnapshot,mr as platformMatrixIds,gr as projectConfigCandidatePaths,be as readBoundServiceBindings,Ge as readDevServiceBindings,Ae as readPackageDependencies,Sr as readProjectConfigLiterals,xr as readProjectLazyFunctions,Er as readProjectSecurityHeaders,pr as readProjectTarget,Ue as readServiceBindings,Wr as redact,ao as refreshCodegenProject,nr as resolveCodegenTarget,Be as resolveServiceBindings,Ir as runCodegen,yr as schemaFromIr,zr as secretKindOf,a as serializeSchemaSnapshot,S as sortedUniqueNames,W as sourceCapabilitySignals,m as toAdvisorContext,so as tsconfigFingerprint,Ur as validatorIrToJsonSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as I}from"node:fs";import{join as D}from"node:path";import{SyntaxKind as l,Node as r,VariableDeclarationKind as L}from"ts-morph";import{listLunoraSourceFiles as E,lunoraRelativePath as C,descendantsOfKind as v,findObjectProperty as d,defaultExportExpression as k,propertyInitializer as m,handlerOf as w,unwrapExpression as u}from"./isTestPath-DRIdZaij.mjs";import{j as M,h as _}from"./attribution-BhGR_h0Z.mjs";import{a as p}from"./context-root-DnvrQxae.mjs";import{c as j}from"./classify-procedure-call-BZ164dkJ.mjs";import{s as R}from"./property-name-7cBlgK_O.mjs";const z="notify.ts",W=new Set(["chat","inApp","send","webhook"]),S=new Set(["broadcast","send","sendToCondition","sendToTopic"]),H=e=>{const s=e.getInitializer();if(!s||!r.isCallExpression(s))return;const t=j(s);if(!t)return;const i=w(s,t.receiver);return i?{exportName:_(e)??e.getName(),handler:i,kind:t.kind}:void 0},P=e=>{const s=[];for(const t of M(e)){const i=H(t);i&&s.push(i)}return s},b=e=>p(e,["notify"])?"notify":p(e,["push"])||p(e,["notify","push"])?"push":void 0,U=e=>{if(!r.isPropertyAccessExpression(e))return;const s=e.getName(),t=b(e.getExpression());if(t==="notify"&&W.has(s))return`ctx.notify.${s}`;if(t==="push"&&S.has(s))return`ctx.push.${s}`},V=e=>r.isPropertyAccessExpression(e)?b(e.getExpression())==="push"&&S.has(e.getName()):!1,de=(e,s)=>{const t=[];for(const i of E(s)){const n=e.getSourceFile(i)??e.addSourceFileAtPath(i),c=C(s,i);for(const o of P(n))if(!(o.kind!=="query"&&o.kind!=="mutation"))for(const a of v(o.handler,l.PropertyAccessExpression)){const f=U(a);f!==void 0&&t.push({callee:f,exportName:o.exportName,file:c,kind:o.kind,line:a.getStartLineNumber()})}}return t},B=(e,s)=>{const t=new Set;for(const i of E(s)){const n=e.getSourceFile(i)??e.addSourceFileAtPath(i);for(const c of P(n))for(const o of v(c.handler,l.PropertyAccessExpression))V(o)&&t.add(o.getName())}return t},y={fcm:"env",hasWebPush:!0},K=new Set(["@lunora/notify"]),O=(e,s)=>{const t=e.getSymbol();if(!t)return e.getText()===s;for(const i of t.getDeclarations())if(r.isImportSpecifier(i))return K.has(i.getImportDeclaration().getModuleSpecifierValue())?i.getNameNode().getText()===s:!1;return!1},A=(e,s=new Set)=>{const t=k(e);if(!t)return;if(!r.isIdentifier(t))return t;const i=t.getSymbol();if(!i?.isAlias())return t;const n=i.getAliasedSymbol();if(!n)return t;const c=n.getDeclarations().find(a=>r.isExportAssignment(a));if(!c)return t;const o=c.getSourceFile();if(!s.has(o.getFilePath()))return A(o,s.add(o.getFilePath()))},Y=new Set(["%=","&&=","&=","**=","+=","-=","/=","<<=","=",">>=",">>>=","??=","^=","|=","||="]),x=e=>{const s=e.getSymbol();return s?.getAliasedSymbol()?.getDeclarations()[0]??s?.getDeclarations()[0]},N=e=>{if(r.isIdentifier(e))return e;if(r.isPropertyAccessExpression(e)||r.isElementAccessExpression(e))return N(e.getExpression())},g=(e,s)=>{const t=N(e);return t!==void 0&&x(t)===s},$=(e,s)=>{const t=e.getExpression();if(!r.isPropertyAccessExpression(t))return!1;const i=t.getName(),n=t.getExpression(),c=r.isIdentifier(n)?n.getText():"";if(!((i==="assign"||i==="defineProperty"||i==="defineProperties")&&c==="Object"||i==="set"&&c==="Reflect"))return!1;const a=e.getArguments()[0];return a!==void 0&&r.isIdentifier(a)&&x(a)===s},q=(e,s)=>{if(r.isBinaryExpression(e))return Y.has(e.getOperatorToken().getText())&&g(e.getLeft(),s);if(r.isDeleteExpression(e))return g(e.getExpression(),s);if(r.isPrefixUnaryExpression(e)||r.isPostfixUnaryExpression(e)){const t=e.getOperatorToken();return(t===l.PlusPlusToken||t===l.MinusMinusToken)&&g(e.getOperand(),s)}return r.isCallExpression(e)?$(e,s):!1},G=(e,s)=>{const t=x(e);return t===void 0?!0:s.some(i=>i.getDescendants().some(n=>q(n,t)))},J=e=>{if(r.isObjectLiteralExpression(e))return e;if(!r.isIdentifier(e))return;const s=e.getSymbol(),t=s?.getAliasedSymbol()?.getDeclarations()??s?.getDeclarations()??[];for(const i of t){if(!r.isVariableDeclaration(i))continue;const n=i.getInitializer();if(!n||!r.isObjectLiteralExpression(n))continue;const c=i.getParent();if(!r.isVariableDeclarationList(c)||c.getDeclarationKind()!==L.Const)continue;const o=[i.getSourceFile(),e.getSourceFile()].filter((a,f,T)=>T.findIndex(F=>F.getFilePath()===a.getFilePath())===f);if(!G(e,o))return n}},Q=e=>r.isArrowFunction(e)||r.isFunctionExpression(e)||r.isMethodDeclaration(e),X=e=>{const s=e.getBody();if(!r.isBlock(s))return s;const[t,...i]=s.getStatements();return i.length===0&&r.isReturnStatement(t)?t.getExpression():void 0},Z=e=>{const s=u(e),t=u(s!==void 0&&Q(s)?X(s):s);if(t!==void 0&&r.isCallExpression(t)){const i=t.getExpression(),n=u(t.getArguments()[1]);return r.isIdentifier(i)&&O(i,"fcmFromEnv")&&n!==void 0&&r.isObjectLiteralExpression(n)?n:void 0}return t!==void 0&&r.isObjectLiteralExpression(t)?t:void 0},h=(e,s)=>{const t=d(e,s),i=e.getProperties();return t!==void 0&&!i.slice(i.indexOf(t)+1).some(n=>{if(r.isSpreadAssignment(n))return!0;const c=R(n.getNameNode());return c===void 0||c===s})},ee=e=>{const s=d(e,"getAccessToken");if(s===void 0||!h(e,"getAccessToken"))return!1;if(r.isShorthandPropertyAssignment(s)||r.isMethodDeclaration(s))return!0;const t=u(m(e,"getAccessToken"));return t!==void 0&&(r.isArrowFunction(t)||r.isFunctionExpression(t)||r.isCallExpression(t)||r.isPropertyAccessExpression(t)||r.isIdentifier(t)&&t.getText()!=="undefined")},te=e=>{const s=u(m(e,"projectId"));return h(e,"projectId")&&s!==void 0&&(r.isStringLiteral(s)||r.isNoSubstitutionTemplateLiteral(s))&&s.getLiteralText()!==""},se=(e,s)=>{const t=d(e,"fcm");if(t===void 0)return"absent";if(!s||!h(e,"fcm"))return"env";const i=r.isMethodDeclaration(t)?t:m(e,"fcm"),n=i===void 0?void 0:Z(i);return n===void 0||!ee(n)?"env":te(n)?"ownCredentials":"ownToken"},ie=(e,s)=>{const t=D(s,z);if(!I(t))return;const i=e.getSourceFile(t)??e.addSourceFileAtPath(t),n=A(i);if(!n||!r.isCallExpression(n))return y;const c=n.getExpression(),o=r.isIdentifier(c)&&O(c,"defineNotify")?n.getArguments()[0]:void 0,a=o===void 0?void 0:J(o);return!a||a.getProperties().some(f=>r.isSpreadAssignment(f))?y:{fcm:se(a,r.isObjectLiteralExpression(o)),hasWebPush:d(a,"webPush")!==void 0}},pe=(e,s)=>{const t=ie(e,s);if(t===void 0)return;const i=B(e,s);return{hasFcm:t.fcm!=="absent",hasWebPush:t.hasWebPush,usesFcmOnlySend:i.has("sendToTopic")||i.has("sendToCondition"),usesPush:i.size>0}};export{y as ALL_NOTIFY_CHANNELS,z as NOTIFY_FILENAME,de as discoverNotifyCalls,ie as discoverNotifyChannels,pe as discoverNotifyConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as z,readFileSync as Xe,mkdirSync as jt,writeFileSync as Or,rmSync as fe,readdirSync as Ht}from"node:fs";import{dirname as Ze,join as v,basename as kr,relative as Gt}from"node:path";import{performance as St}from"node:perf_hooks";import{runAdvisor as Rr}from"@lunora/advisor";import{LunoraError as R}from"@lunora/errors";import{serializeSchemaSnapshot as Fr}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{toAdvisorContext as Lr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Yt,ts as Dr,VariableDeclarationKind as Qt}from"ts-morph";import{listLunoraSourceFiles as y,lunoraRelativePath as I,descendantsOfKind as E,bindingKeyName as pe,collectCallRows as O,findObjectProperty as q,collectSecurityCallRows as _r,propertyInitializer as L,listSecurityScanFiles as et,objectLiteralFromCallbackBody as _n,limitNameOf as Mn,optionsObjectLiteral as zn,handlerOf as Mr,collectNodeRows as ae,chainRootOf as tt,outermostValueWrapper as T,isWriteTarget as st,isSameNode as N,unwrapExpression as h,isConstDeclaration as ce,memberAccessOf as Jt,returningFunctionOf as kt,walkChain as zr,RUN_METHODS as $n,functionReferenceSegments as $r,isTestPath as Kr,isFunctionLike as le,functionKeyOf as Kn,withSourceListMemo as Br}from"./isTestPath-DRIdZaij.mjs";import{j as Z,h as Y,d as D,b as Xt,c as S,a as Zt,w as es,k as Vr,l as Ur,f as Wr,m as qr,g as Rt,i as jr}from"./attribution-BhGR_h0Z.mjs";import{b as Bs,r as At,a as J,e as Hr,m as Bn,c as nt,f as ts,E as Vn,C as Un,d as Gr,g as Yr,i as Qr}from"./context-root-DnvrQxae.mjs";import{a as C,i as Wn,c as ie,d as qn,e as Jr,f as Xr,g as jn}from"./classify-procedure-call-BZ164dkJ.mjs";import{a as A,s as Zr}from"./property-name-7cBlgK_O.mjs";import{b as eo,a as Hn}from"./module-specifiers-BctA0m_p.mjs";import{r as it,s as to}from"./parse-validator-BisfC8bR.mjs";import so from"./discoverAuthApiCalls-ENLGem4M.mjs";import{i as $,r as Gn}from"./database-calls-BRI5W-Mp.mjs";import{i as Ft,p as Yn,w as no,d as io}from"./index-jtzAVdUp.mjs";import ro from"./discoverHyperdriveCalls-BaRayTZe.mjs";import{diagnosticAt as Ee}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as ss,a as qe,s as Qn,d as oo}from"./index-mFEIaT45.mjs";import{MUTATORS_FILENAME as ao,isDefineMutatorCallee as co,mutatorServerImplOf as lo,discoverMutators as uo}from"./MUTATORS_FILENAME-C3OImAxC.mjs";import fo from"./discoverNondeterministicCalls-BoF6ob-B.mjs";import{discoverNotifyConfig as po,discoverNotifyCalls as go}from"./ALL_NOTIFY_CHANNELS-
|
|
1
|
+
import{existsSync as z,readFileSync as Xe,mkdirSync as jt,writeFileSync as Or,rmSync as fe,readdirSync as Ht}from"node:fs";import{dirname as Ze,join as v,basename as kr,relative as Gt}from"node:path";import{performance as St}from"node:perf_hooks";import{runAdvisor as Rr}from"@lunora/advisor";import{LunoraError as R}from"@lunora/errors";import{serializeSchemaSnapshot as Fr}from"./SCHEMA_SNAPSHOT_VERSION-DTLoSaNn.mjs";import{toAdvisorContext as Lr}from"./formatAdvisories-BCVASH7N.mjs";import{Node as r,SyntaxKind as d,Project as Yt,ts as Dr,VariableDeclarationKind as Qt}from"ts-morph";import{listLunoraSourceFiles as y,lunoraRelativePath as I,descendantsOfKind as E,bindingKeyName as pe,collectCallRows as O,findObjectProperty as q,collectSecurityCallRows as _r,propertyInitializer as L,listSecurityScanFiles as et,objectLiteralFromCallbackBody as _n,limitNameOf as Mn,optionsObjectLiteral as zn,handlerOf as Mr,collectNodeRows as ae,chainRootOf as tt,outermostValueWrapper as T,isWriteTarget as st,isSameNode as N,unwrapExpression as h,isConstDeclaration as ce,memberAccessOf as Jt,returningFunctionOf as kt,walkChain as zr,RUN_METHODS as $n,functionReferenceSegments as $r,isTestPath as Kr,isFunctionLike as le,functionKeyOf as Kn,withSourceListMemo as Br}from"./isTestPath-DRIdZaij.mjs";import{j as Z,h as Y,d as D,b as Xt,c as S,a as Zt,w as es,k as Vr,l as Ur,f as Wr,m as qr,g as Rt,i as jr}from"./attribution-BhGR_h0Z.mjs";import{b as Bs,r as At,a as J,e as Hr,m as Bn,c as nt,f as ts,E as Vn,C as Un,d as Gr,g as Yr,i as Qr}from"./context-root-DnvrQxae.mjs";import{a as C,i as Wn,c as ie,d as qn,e as Jr,f as Xr,g as jn}from"./classify-procedure-call-BZ164dkJ.mjs";import{a as A,s as Zr}from"./property-name-7cBlgK_O.mjs";import{b as eo,a as Hn}from"./module-specifiers-BctA0m_p.mjs";import{r as it,s as to}from"./parse-validator-BisfC8bR.mjs";import so from"./discoverAuthApiCalls-ENLGem4M.mjs";import{i as $,r as Gn}from"./database-calls-BRI5W-Mp.mjs";import{i as Ft,p as Yn,w as no,d as io}from"./index-jtzAVdUp.mjs";import ro from"./discoverHyperdriveCalls-BaRayTZe.mjs";import{diagnosticAt as Ee}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{m as ss,a as qe,s as Qn,d as oo}from"./index-mFEIaT45.mjs";import{MUTATORS_FILENAME as ao,isDefineMutatorCallee as co,mutatorServerImplOf as lo,discoverMutators as uo}from"./MUTATORS_FILENAME-C3OImAxC.mjs";import fo from"./discoverNondeterministicCalls-BoF6ob-B.mjs";import{discoverNotifyConfig as po,discoverNotifyCalls as go}from"./ALL_NOTIFY_CHANNELS-DPxI0EHQ.mjs";import mo from"./discoverR2sqlCalls-CZjqFVi_.mjs";import ho from"./discoverRlsProcedures-mjiA0I4S.mjs";import{s as ns,n as vo}from"./dispatch-namespace-DwTjD7BU.mjs";import{secretKindOf as Eo,redact as xo,isHeuristicSecretKind as So,isSecretishName as Ao}from"./redact-Cy14LEnc.mjs";import{r as Jn,p as yo,c as bo,a as No,e as Po,d as wo}from"./project-config-file-DR7xrrNB.mjs";import{a as _e,d as Io,r as Co}from"./modules-Qpm_zqz4.mjs";import{WORKFLOWS_FILENAME as To,discoverWorkflows as Oo}from"./WORKFLOWS_FILENAME-DfVfBum_.mjs";import{r as ko}from"./json-data-Chfs2Cz5.mjs";import{a as Ro,I as Fo,g as Lo,G as Xn,d as Do,i as _o}from"./shared-Cn7dMQ_u.mjs";import{createCodegenProject as Mo}from"./createCodegenProject-Cfr1xHPC.mjs";import{findTsconfig as lx,refreshCodegenProject as dx,tsconfigFingerprint as ux}from"./createCodegenProject-Cfr1xHPC.mjs";import{wranglerString as zo,wranglerValue as $o,companionName as Ko,COMPANION_FILES as Bo}from"./COMPANION_BINDING-Da_v9XpC.mjs";import{CAPABILITIES as Vo,usedCapabilities as Uo}from"./CAPABILITY_PROBES-BuNEmlCO.mjs";import{isD1GlobalTable as Zn,isHyperdriveGlobalTable as ei}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Wo}from"./AGENTS_FILENAME-D0Y0_UgB.mjs";import{discoverContainers as qo}from"./CONTAINERS_FILENAME-J-e3Vanb.mjs";import jo from"./discoverCrons-DWVXmktw.mjs";import{discoverEnv as Ho}from"./ENV_FILENAME-COPIfgzp.mjs";import{contextPropertiesRead as Go,createTargetScope as Yo,fileWiresRequestSecretTool as Qo,discoverFeatureUsage as Jo}from"./capabilitiesUsedBy-BwhaHK08.mjs";import ti from"./readPackageDependencies-RHhGiz0k.mjs";import{PROJECT_CONFIG_FILENAMES as Xo,findProjectConfigFile as si,findCodegenConfigFile as Zo}from"./PROJECT_CONFIG_FILENAMES-CLfsyvjA.mjs";import{discoverQueueDeclarations as ea}from"./QUEUES_FILENAME-Ba-sK5Ek.mjs";import{discoverSandboxUsage as ta}from"./discoverSandboxUsage-Ccy9n7G1.mjs";import{resolveServiceBindings as sa}from"./companionServiceBinding-BZjm486n.mjs";import na from"./discoverStorageRulesMetadata-CtE5trUR.mjs";import{resolveCodegenTarget as Me,gatePlatformFeatures as ia,readTargetDiagnostics as ra,vectorizeDimensionDiagnostics as oa,liveStreamsDeliveryAuthorizationDiagnostic as aa,socketRoutesDeliveryAuthorizationDiagnostic as ca,studioPlatformFor as la,platformFeatureAvailable as da,gateAdminTokenRevocation as ua}from"./DEFAULT_TARGET-CVYzxQ0y.mjs";import{i as fa}from"./schema-BgM8A3XV.mjs";import{b as ni,e as pa}from"./shard-Csztu3jG.mjs";import{e as ga,a as ma}from"./server-CRFaUMKQ.mjs";import{emitDataModel as ha}from"./emitDataModel-BvCZS4Yq.mjs";import{i as va,b as Ea,e as xa,d as Sa,f as Aa,c as ya}from"./unwrap-handler-return-DUzluwPj.mjs";import ba from"./discoverHttpRoutes-CAoEemno.mjs";import Na from"./discoverInserts-DmSa4WKU.mjs";import{e as ii}from"./exported-procedure-chains-h8Y7xDjq.mjs";import Pa from"./discoverMigrations-Duh6HVG3.mjs";import Vs from"./discoverQueries-spxu-wHR.mjs";import wa from"./discoverRlsMetadata-Cc0zA-gZ.mjs";import Ia from"./discoverSchema-ynieYB0n.mjs";import{discoverShapes as Ca}from"./SHAPES_FILENAME-CH0KrAdb.mjs";import{i as Ta}from"./reserved-words-CW1QFbTd.mjs";import{emitAuthModule as Oa,emitApp as ka}from"./emitApp-C3IUdkkt.mjs";import{readJsonSync as Ra}from"@visulima/fs";import{indexReferencesOf as Fa,buildSchemaSnapshot as La}from"./SchemaSnapshotParseError-DnAuFdpl.mjs";import{buildOpenApiDocument as Da,emitOpenApiModule as _a}from"./buildOpenApiDocument-B8KEeeRr.mjs";import{buildOpenRpcDocument as Ma,emitOpenRpcModule as za}from"./OPENRPC_VERSION-UNYmA7Ty.mjs";import{w as $a,u as Ka,v as Ba,t as Va,x as Ua}from"./shard-runtime-D0xuE0pX.mjs";import{emitCollections as Wa,emitSeed as qa,emitApi as ja,emitInternalApi as Ha}from"./emitApi-lwadq5G7.mjs";import{emitCrons as Ga,emitScheduler as Ya,emitAdminRevocations as Qa,emitShardRegistry as Ja,emitDurableObjects as Xa,emitVectors as Za,emitWranglerCronTriggers as ec}from"./emitCrons-CCRKs482.mjs";import tc from"./emitDrizzleSchema-BzOChEYW.mjs";import{LAZY_FUNCTION_DIRECTORY as ri,emitFunctions as sc,emitLazyFunctionModules as nc}from"./emitFunctions-ppMX7E3X.mjs";const ic=(e,t=!1)=>{if(e.length===0)return"";const s=Do(t),n=e.map(c=>{if(Ro(c.exportName,"live stream export name"),!Fo.test(c.filePath))throw new Error(`@lunora/codegen: live stream file path is not safe to import: ${JSON.stringify(c.filePath)}`);return`import type { ${c.exportName} as ${c.exportName}Stream } from "../${c.filePath}.js";`}),i=e.map(c=>{const l=c.topics.map(u=>{Lo(u.name,"live topic name");const f=`(typeof ${c.exportName}Stream)["topics"]["${u.name}"]`,p=`LiveTopicRef<LiveTopicPayload<${f}>>`,m=JSON.stringify(c.id);if(u.fields.length===0)return` ${u.name}: (): ${p} => ({ __lunoraLive: ${m}, topic: ${JSON.stringify(u.name)} }),`;const x=u.fields.map(_=>`\${encodeURIComponent(key.${_})}`).join(":");return` ${u.name}: (key: LiveTopicKey<${f}>): ${p} => ({
|
|
2
2
|
__lunoraLive: ${m},
|
|
3
3
|
topic: \`${u.name}:${x}\`,
|
|
4
4
|
}),`});return` ${c.exportName}: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/codegen",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.405",
|
|
4
4
|
"description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://lunora.sh",
|
|
16
16
|
"bugs": "https://github.com/anolilab/lunora/issues",
|
|
17
|
-
"license": "
|
|
17
|
+
"license": "Apache-2.0",
|
|
18
18
|
"author": {
|
|
19
19
|
"name": "Daniel Bannert",
|
|
20
20
|
"email": "d.bannert@anolilab.de"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as T}from"node:fs";import{join as D}from"node:path";import{SyntaxKind as l,Node as r,VariableDeclarationKind as L}from"ts-morph";import{listLunoraSourceFiles as E,lunoraRelativePath as k,descendantsOfKind as v,findObjectProperty as d,defaultExportExpression as C,propertyInitializer as m,handlerOf as w,unwrapExpression as u}from"./isTestPath-DRIdZaij.mjs";import{j as M,h as j}from"./attribution-BhGR_h0Z.mjs";import{a as p}from"./context-root-DnvrQxae.mjs";import{c as _}from"./classify-procedure-call-BZ164dkJ.mjs";import{s as R}from"./property-name-7cBlgK_O.mjs";const W="notify.ts",z=new Set(["chat","inApp","send","webhook"]),S=new Set(["broadcast","send"]),H=e=>{const s=e.getInitializer();if(!s||!r.isCallExpression(s))return;const t=_(s);if(!t)return;const i=w(s,t.receiver);return i?{exportName:j(e)??e.getName(),handler:i,kind:t.kind}:void 0},P=e=>{const s=[];for(const t of M(e)){const i=H(t);i&&s.push(i)}return s},b=e=>p(e,["notify"])?"notify":p(e,["push"])||p(e,["notify","push"])?"push":void 0,U=e=>{if(!r.isPropertyAccessExpression(e))return;const s=e.getName(),t=b(e.getExpression());if(t==="notify"&&z.has(s))return`ctx.notify.${s}`;if(t==="push"&&S.has(s))return`ctx.push.${s}`},V=e=>r.isPropertyAccessExpression(e)?b(e.getExpression())==="push"&&S.has(e.getName()):!1,de=(e,s)=>{const t=[];for(const i of E(s)){const n=e.getSourceFile(i)??e.addSourceFileAtPath(i),o=k(s,i);for(const c of P(n))if(!(c.kind!=="query"&&c.kind!=="mutation"))for(const a of v(c.handler,l.PropertyAccessExpression)){const f=U(a);f!==void 0&&t.push({callee:f,exportName:c.exportName,file:o,kind:c.kind,line:a.getStartLineNumber()})}}return t},B=(e,s)=>{for(const t of E(s)){const i=e.getSourceFile(t)??e.addSourceFileAtPath(t);for(const n of P(i))for(const o of v(n.handler,l.PropertyAccessExpression))if(V(o))return!0}return!1},y={fcm:"env",hasWebPush:!0},K=new Set(["@lunora/notify"]),O=(e,s)=>{const t=e.getSymbol();if(!t)return e.getText()===s;for(const i of t.getDeclarations())if(r.isImportSpecifier(i))return K.has(i.getImportDeclaration().getModuleSpecifierValue())?i.getNameNode().getText()===s:!1;return!1},A=(e,s=new Set)=>{const t=C(e);if(!t)return;if(!r.isIdentifier(t))return t;const i=t.getSymbol();if(!i?.isAlias())return t;const n=i.getAliasedSymbol();if(!n)return t;const o=n.getDeclarations().find(a=>r.isExportAssignment(a));if(!o)return t;const c=o.getSourceFile();if(!s.has(c.getFilePath()))return A(c,s.add(c.getFilePath()))},Y=new Set(["%=","&&=","&=","**=","+=","-=","/=","<<=","=",">>=",">>>=","??=","^=","|=","||="]),x=e=>{const s=e.getSymbol();return s?.getAliasedSymbol()?.getDeclarations()[0]??s?.getDeclarations()[0]},N=e=>{if(r.isIdentifier(e))return e;if(r.isPropertyAccessExpression(e)||r.isElementAccessExpression(e))return N(e.getExpression())},g=(e,s)=>{const t=N(e);return t!==void 0&&x(t)===s},$=(e,s)=>{const t=e.getExpression();if(!r.isPropertyAccessExpression(t))return!1;const i=t.getName(),n=t.getExpression(),o=r.isIdentifier(n)?n.getText():"";if(!((i==="assign"||i==="defineProperty"||i==="defineProperties")&&o==="Object"||i==="set"&&o==="Reflect"))return!1;const a=e.getArguments()[0];return a!==void 0&&r.isIdentifier(a)&&x(a)===s},q=(e,s)=>{if(r.isBinaryExpression(e))return Y.has(e.getOperatorToken().getText())&&g(e.getLeft(),s);if(r.isDeleteExpression(e))return g(e.getExpression(),s);if(r.isPrefixUnaryExpression(e)||r.isPostfixUnaryExpression(e)){const t=e.getOperatorToken();return(t===l.PlusPlusToken||t===l.MinusMinusToken)&&g(e.getOperand(),s)}return r.isCallExpression(e)?$(e,s):!1},G=(e,s)=>{const t=x(e);return t===void 0?!0:s.some(i=>i.getDescendants().some(n=>q(n,t)))},J=e=>{if(r.isObjectLiteralExpression(e))return e;if(!r.isIdentifier(e))return;const s=e.getSymbol(),t=s?.getAliasedSymbol()?.getDeclarations()??s?.getDeclarations()??[];for(const i of t){if(!r.isVariableDeclaration(i))continue;const n=i.getInitializer();if(!n||!r.isObjectLiteralExpression(n))continue;const o=i.getParent();if(!r.isVariableDeclarationList(o)||o.getDeclarationKind()!==L.Const)continue;const c=[i.getSourceFile(),e.getSourceFile()].filter((a,f,F)=>F.findIndex(I=>I.getFilePath()===a.getFilePath())===f);if(!G(e,c))return n}},Q=e=>r.isArrowFunction(e)||r.isFunctionExpression(e)||r.isMethodDeclaration(e),X=e=>{const s=e.getBody();if(!r.isBlock(s))return s;const[t,...i]=s.getStatements();return i.length===0&&r.isReturnStatement(t)?t.getExpression():void 0},Z=e=>{const s=u(e),t=u(s!==void 0&&Q(s)?X(s):s);if(t!==void 0&&r.isCallExpression(t)){const i=t.getExpression(),n=u(t.getArguments()[1]);return r.isIdentifier(i)&&O(i,"fcmFromEnv")&&n!==void 0&&r.isObjectLiteralExpression(n)?n:void 0}return t!==void 0&&r.isObjectLiteralExpression(t)?t:void 0},h=(e,s)=>{const t=d(e,s),i=e.getProperties();return t!==void 0&&!i.slice(i.indexOf(t)+1).some(n=>{if(r.isSpreadAssignment(n))return!0;const o=R(n.getNameNode());return o===void 0||o===s})},ee=e=>{const s=d(e,"getAccessToken");if(s===void 0||!h(e,"getAccessToken"))return!1;if(r.isShorthandPropertyAssignment(s)||r.isMethodDeclaration(s))return!0;const t=u(m(e,"getAccessToken"));return t!==void 0&&(r.isArrowFunction(t)||r.isFunctionExpression(t)||r.isCallExpression(t)||r.isPropertyAccessExpression(t)||r.isIdentifier(t)&&t.getText()!=="undefined")},te=e=>{const s=u(m(e,"projectId"));return h(e,"projectId")&&s!==void 0&&(r.isStringLiteral(s)||r.isNoSubstitutionTemplateLiteral(s))&&s.getLiteralText()!==""},se=(e,s)=>{const t=d(e,"fcm");if(t===void 0)return"absent";if(!s||!h(e,"fcm"))return"env";const i=r.isMethodDeclaration(t)?t:m(e,"fcm"),n=i===void 0?void 0:Z(i);return n===void 0||!ee(n)?"env":te(n)?"ownCredentials":"ownToken"},re=(e,s)=>{const t=D(s,W);if(!T(t))return;const i=e.getSourceFile(t)??e.addSourceFileAtPath(t),n=A(i);if(!n||!r.isCallExpression(n))return y;const o=n.getExpression(),c=r.isIdentifier(o)&&O(o,"defineNotify")?n.getArguments()[0]:void 0,a=c===void 0?void 0:J(c);return!a||a.getProperties().some(f=>r.isSpreadAssignment(f))?y:{fcm:se(a,r.isObjectLiteralExpression(c)),hasWebPush:d(a,"webPush")!==void 0}},pe=(e,s)=>{const t=re(e,s);return t===void 0?void 0:{hasFcm:t.fcm!=="absent",hasWebPush:t.hasWebPush,usesPush:B(e,s)}};export{y as ALL_NOTIFY_CHANNELS,W as NOTIFY_FILENAME,de as discoverNotifyCalls,re as discoverNotifyChannels,pe as discoverNotifyConfig};
|