Skip to content

Commit 9ca35c9

Browse files
committed
revert changes to resourceName script & re-compile
1 parent 79a7482 commit 9ca35c9

4 files changed

Lines changed: 5131 additions & 867 deletions

File tree

scripts/resourceName.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,13 @@ function buildResourceNameBuilder(stream: fs.WriteStream, text: Text): void {
102102
export async function compileResourceNameFunctions(): Promise<void> {
103103
const service = new CampaignServiceClient();
104104

105-
const pathTemplatesRaw = service.pathTemplates;
105+
// @ts-expect-error
106+
const pathTemplatesRaw: { [path: string]: Omit<PathTemplate, "path"> } =
107+
service.pathTemplates;
106108

107109
const pathTemplates = Object.entries(pathTemplatesRaw).map(
108-
([path, template]) => {
109-
// Extract bindings from segments (public property)
110-
const bindings: { [key: string]: string } = {};
111-
template.segments.forEach((segment) => {
112-
const match = segment.match(/\{([^=}]+)(?:=([^}]+))?\}/);
113-
if (match) {
114-
bindings[match[1]] = match[2] || "*";
115-
}
116-
});
117-
118-
// Use inspect() to get the template string
119-
const data = template.inspect();
120-
121-
return {
122-
path,
123-
bindings,
124-
data,
125-
};
110+
([path, template]: [string, Omit<PathTemplate, "path">]) => {
111+
return { path, ...template };
126112
}
127113
);
128114

0 commit comments

Comments
 (0)