@peterhauge/apiops-cli 0.2.1-alpha.0 → 0.4.0-alpha.0

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 (167) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/README.md +173 -169
  3. package/dist/cli/extract-command.d.ts +2 -2
  4. package/dist/cli/extract-command.d.ts.map +1 -1
  5. package/dist/cli/extract-command.js +3 -5
  6. package/dist/cli/extract-command.js.map +1 -1
  7. package/dist/cli/index.js +2 -3
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/init-command.d.ts +1 -1
  10. package/dist/cli/init-command.js +6 -6
  11. package/dist/cli/init-command.js.map +1 -1
  12. package/dist/cli/publish-command.d.ts +2 -2
  13. package/dist/cli/publish-command.js +3 -3
  14. package/dist/clients/apim-client.d.ts +16 -5
  15. package/dist/clients/apim-client.d.ts.map +1 -1
  16. package/dist/clients/apim-client.js +22 -7
  17. package/dist/clients/apim-client.js.map +1 -1
  18. package/dist/clients/artifact-store.d.ts +4 -4
  19. package/dist/clients/artifact-store.d.ts.map +1 -1
  20. package/dist/clients/artifact-store.js +10 -4
  21. package/dist/clients/artifact-store.js.map +1 -1
  22. package/dist/clients/iapim-client.d.ts +14 -2
  23. package/dist/clients/iapim-client.d.ts.map +1 -1
  24. package/dist/clients/iapim-client.js +1 -1
  25. package/dist/clients/iartifact-store.d.ts +10 -5
  26. package/dist/clients/iartifact-store.d.ts.map +1 -1
  27. package/dist/clients/iartifact-store.js +1 -1
  28. package/dist/lib/cloud-config.d.ts +1 -1
  29. package/dist/lib/cloud-config.js +1 -1
  30. package/dist/lib/config-loader.d.ts +2 -7
  31. package/dist/lib/config-loader.d.ts.map +1 -1
  32. package/dist/lib/config-loader.js +3 -22
  33. package/dist/lib/config-loader.js.map +1 -1
  34. package/dist/lib/dependency-graph.d.ts +1 -1
  35. package/dist/lib/dependency-graph.js +1 -1
  36. package/dist/lib/exit-codes.d.ts +1 -1
  37. package/dist/lib/exit-codes.js +1 -1
  38. package/dist/lib/logger.js +1 -1
  39. package/dist/lib/parallel-runner.d.ts +2 -2
  40. package/dist/lib/parallel-runner.js +2 -2
  41. package/dist/lib/render-template.d.ts +10 -0
  42. package/dist/lib/render-template.d.ts.map +1 -0
  43. package/dist/lib/render-template.js +14 -0
  44. package/dist/lib/render-template.js.map +1 -0
  45. package/dist/lib/resource-path.d.ts +1 -1
  46. package/dist/lib/resource-path.js +1 -1
  47. package/dist/lib/resource-uri.d.ts +1 -1
  48. package/dist/lib/resource-uri.js +1 -1
  49. package/dist/lib/workspace-link.d.ts +31 -3
  50. package/dist/lib/workspace-link.d.ts.map +1 -1
  51. package/dist/lib/workspace-link.js +49 -3
  52. package/dist/lib/workspace-link.js.map +1 -1
  53. package/dist/models/config.d.ts +2 -4
  54. package/dist/models/config.d.ts.map +1 -1
  55. package/dist/models/config.js +1 -1
  56. package/dist/models/resource-types.d.ts +1 -1
  57. package/dist/models/resource-types.d.ts.map +1 -1
  58. package/dist/models/resource-types.js +5 -3
  59. package/dist/models/resource-types.js.map +1 -1
  60. package/dist/models/types.d.ts +22 -1
  61. package/dist/models/types.d.ts.map +1 -1
  62. package/dist/models/types.js +1 -1
  63. package/dist/services/api-extractor.d.ts +1 -1
  64. package/dist/services/api-extractor.d.ts.map +1 -1
  65. package/dist/services/api-extractor.js +39 -133
  66. package/dist/services/api-extractor.js.map +1 -1
  67. package/dist/services/api-publisher.d.ts +1 -1
  68. package/dist/services/api-publisher.d.ts.map +1 -1
  69. package/dist/services/api-publisher.js +50 -18
  70. package/dist/services/api-publisher.js.map +1 -1
  71. package/dist/services/delete-unmatched-service.d.ts +1 -1
  72. package/dist/services/delete-unmatched-service.js +1 -1
  73. package/dist/services/dry-run-reporter.d.ts +1 -1
  74. package/dist/services/dry-run-reporter.js +1 -1
  75. package/dist/services/extract-service.d.ts +1 -1
  76. package/dist/services/extract-service.d.ts.map +1 -1
  77. package/dist/services/extract-service.js +5 -3
  78. package/dist/services/extract-service.js.map +1 -1
  79. package/dist/services/filter-service.d.ts +19 -1
  80. package/dist/services/filter-service.d.ts.map +1 -1
  81. package/dist/services/filter-service.js +40 -2
  82. package/dist/services/filter-service.js.map +1 -1
  83. package/dist/services/git-diff-service.d.ts +1 -1
  84. package/dist/services/git-diff-service.js +1 -1
  85. package/dist/services/identity-guide-service.d.ts +4 -5
  86. package/dist/services/identity-guide-service.d.ts.map +1 -1
  87. package/dist/services/identity-guide-service.js +7 -41
  88. package/dist/services/identity-guide-service.js.map +1 -1
  89. package/dist/services/init-service.d.ts +1 -1
  90. package/dist/services/init-service.d.ts.map +1 -1
  91. package/dist/services/init-service.js +62 -29
  92. package/dist/services/init-service.js.map +1 -1
  93. package/dist/services/override-merger.d.ts +1 -1
  94. package/dist/services/override-merger.js +1 -1
  95. package/dist/services/product-extractor.d.ts +1 -1
  96. package/dist/services/product-extractor.d.ts.map +1 -1
  97. package/dist/services/product-extractor.js +31 -28
  98. package/dist/services/product-extractor.js.map +1 -1
  99. package/dist/services/product-publisher.d.ts.map +1 -1
  100. package/dist/services/product-publisher.js +25 -9
  101. package/dist/services/product-publisher.js.map +1 -1
  102. package/dist/services/prompt-service.d.ts +1 -1
  103. package/dist/services/prompt-service.js +1 -1
  104. package/dist/services/publish-service.d.ts +1 -1
  105. package/dist/services/publish-service.d.ts.map +1 -1
  106. package/dist/services/publish-service.js +31 -1
  107. package/dist/services/publish-service.js.map +1 -1
  108. package/dist/services/resource-extractor.d.ts +1 -1
  109. package/dist/services/resource-extractor.js +1 -1
  110. package/dist/services/resource-publisher.d.ts +14 -1
  111. package/dist/services/resource-publisher.d.ts.map +1 -1
  112. package/dist/services/resource-publisher.js +45 -10
  113. package/dist/services/resource-publisher.js.map +1 -1
  114. package/dist/services/secret-redaction-guard.d.ts +40 -0
  115. package/dist/services/secret-redaction-guard.d.ts.map +1 -0
  116. package/dist/services/secret-redaction-guard.js +92 -0
  117. package/dist/services/secret-redaction-guard.js.map +1 -0
  118. package/dist/services/secret-redactor.d.ts +19 -1
  119. package/dist/services/secret-redactor.d.ts.map +1 -1
  120. package/dist/services/secret-redactor.js +173 -1
  121. package/dist/services/secret-redactor.js.map +1 -1
  122. package/dist/services/transitive-resolver.d.ts +1 -1
  123. package/dist/services/transitive-resolver.js +1 -1
  124. package/dist/services/workspace-extractor.d.ts +7 -1
  125. package/dist/services/workspace-extractor.d.ts.map +1 -1
  126. package/dist/services/workspace-extractor.js +75 -10
  127. package/dist/services/workspace-extractor.js.map +1 -1
  128. package/dist/templates/azure-devops/extract-pipeline.d.ts +1 -1
  129. package/dist/templates/azure-devops/extract-pipeline.js +142 -142
  130. package/dist/templates/azure-devops/publish-pipeline.d.ts +1 -1
  131. package/dist/templates/azure-devops/publish-pipeline.d.ts.map +1 -1
  132. package/dist/templates/azure-devops/publish-pipeline.js +151 -117
  133. package/dist/templates/azure-devops/publish-pipeline.js.map +1 -1
  134. package/dist/templates/configs/filter-config.d.ts +1 -1
  135. package/dist/templates/configs/filter-config.d.ts.map +1 -1
  136. package/dist/templates/configs/filter-config.js +7 -110
  137. package/dist/templates/configs/filter-config.js.map +1 -1
  138. package/dist/templates/configs/override-config.d.ts +1 -1
  139. package/dist/templates/configs/override-config.d.ts.map +1 -1
  140. package/dist/templates/configs/override-config.js +8 -92
  141. package/dist/templates/configs/override-config.js.map +1 -1
  142. package/dist/templates/configs/schema-ref.d.ts +18 -0
  143. package/dist/templates/configs/schema-ref.d.ts.map +1 -0
  144. package/dist/templates/configs/schema-ref.js +26 -0
  145. package/dist/templates/configs/schema-ref.js.map +1 -0
  146. package/dist/templates/copilot/configure-filter-prompt.d.ts +10 -0
  147. package/dist/templates/copilot/configure-filter-prompt.d.ts.map +1 -0
  148. package/dist/templates/copilot/configure-filter-prompt.js +14 -0
  149. package/dist/templates/copilot/configure-filter-prompt.js.map +1 -0
  150. package/dist/templates/copilot/configure-overrides-prompt.d.ts +7 -0
  151. package/dist/templates/copilot/configure-overrides-prompt.d.ts.map +1 -0
  152. package/dist/templates/copilot/configure-overrides-prompt.js +12 -0
  153. package/dist/templates/copilot/configure-overrides-prompt.js.map +1 -0
  154. package/dist/templates/copilot/identity-setup-prompt.d.ts.map +1 -1
  155. package/dist/templates/copilot/identity-setup-prompt.js +19 -24
  156. package/dist/templates/copilot/identity-setup-prompt.js.map +1 -1
  157. package/dist/templates/generated/embedded-markdown.d.ts +8 -5
  158. package/dist/templates/generated/embedded-markdown.d.ts.map +1 -1
  159. package/dist/templates/generated/embedded-markdown.js +8 -5
  160. package/dist/templates/generated/embedded-markdown.js.map +1 -1
  161. package/dist/templates/github-actions/extract-workflow.d.ts +1 -1
  162. package/dist/templates/github-actions/extract-workflow.js +119 -119
  163. package/dist/templates/github-actions/publish-workflow.d.ts +3 -2
  164. package/dist/templates/github-actions/publish-workflow.d.ts.map +1 -1
  165. package/dist/templates/github-actions/publish-workflow.js +180 -112
  166. package/dist/templates/github-actions/publish-workflow.js.map +1 -1
  167. package/package.json +72 -69
@@ -1 +1 @@
1
- {"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../../src/templates/github-actions/publish-workflow.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAoH7E"}
1
+ {"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../../src/templates/github-actions/publish-workflow.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAqL7E"}
@@ -1,121 +1,189 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  /**
4
- * T044: GitHub Actions publish workflow template
5
- * Push-to-main trigger with commit ID choice, environment selection, and multi-env stages
4
+ * GitHub Actions publish workflow template
5
+ * Push-to-main trigger with commit ID choice and a single parameterized publish
6
+ * job driven by a workflow-level environment variable (TARGET_ENV)
6
7
  */
7
8
  export function generatePublishWorkflow(config) {
9
+ const defaultEnvironment = config.environments[0] ?? 'dev';
8
10
  const envChoices = config.environments.map((env) => ` - ${env}`).join('\n');
9
- const envJobs = config.environments.map((env, idx) => {
10
- const envUpper = env.toUpperCase();
11
- const autoDeployComment = idx === 0
12
- ? ` # To enable automatic deployment on push to main, uncomment the condition below:
13
- # if: github.event.inputs.ENVIRONMENT == '${env}' || github.event_name == 'push'`
14
- : ` # To enable automatic deployment on push to main, uncomment the condition below:
15
- # if: github.event.inputs.ENVIRONMENT == '${env}' || github.event_name == 'push'
16
- # And change needs to: needs: [get-commit, publish-${config.environments[idx - 1]}]`;
17
- return ` publish-${env}:
18
- ${autoDeployComment}
19
- if: github.event.inputs.ENVIRONMENT == '${env}'
20
- runs-on: ubuntu-latest
21
- environment: ${env}
22
- needs: get-commit
23
- steps:
24
- - name: Checkout repository
25
- uses: actions/checkout@v4
26
- with:
27
- fetch-depth: 2
28
-
29
- - name: Setup Node.js
30
- uses: actions/setup-node@v4
31
- with:
32
- node-version: '22'
33
-
34
- - name: Install dependencies
35
- run: npm install
36
-
37
- - name: Azure Login (Federated Credential)
38
- uses: azure/login@v2
39
- with:
40
- client-id: \${{ secrets.AZURE_CLIENT_ID }}
41
- tenant-id: \${{ secrets.AZURE_TENANT_ID }}
42
- subscription-id: \${{ secrets.AZURE_SUBSCRIPTION_ID }}
43
-
44
- - name: Substitute tokens in configuration.${env}.yaml
45
- uses: cschleiden/replace-tokens@v1.3
46
- with:
47
- tokenPrefix: '{#['
48
- tokenSuffix: ']#}'
49
- files: '["configuration.${env}.yaml"]'
50
- # Example token mapping for ${env} (uncomment and customize when needed):
51
- # env:
52
- # MY_SECRET: \${{ secrets.MY_SECRET_${envUpper} }}
53
- # ANOTHER_TOKEN: \${{ secrets.ANOTHER_TOKEN_${envUpper} }}
54
-
55
- - name: Publish to ${env} (incremental - last commit only)
56
- if: \${{ github.event.inputs.COMMIT_ID_CHOICE != 'publish-all-artifacts-in-repo' }}
57
- run: |
58
- npx apiops publish \\
59
- --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
60
- --resource-group \${{ secrets.APIM_RESOURCE_GROUP_${envUpper} }} \\
61
- --service-name \${{ secrets.APIM_SERVICE_NAME_${envUpper} }} \\
62
- --source ${config.artifactDir} \\
63
- --overrides configuration.${env}.yaml \\
64
- --commit-id \${{ needs.get-commit.outputs.commit_id }}
65
-
66
- - name: Publish to ${env} (all artifacts)
67
- if: \${{ github.event.inputs.COMMIT_ID_CHOICE == 'publish-all-artifacts-in-repo' }}
68
- run: |
69
- npx apiops publish \\
70
- --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
71
- --resource-group \${{ secrets.APIM_RESOURCE_GROUP_${envUpper} }} \\
72
- --service-name \${{ secrets.APIM_SERVICE_NAME_${envUpper} }} \\
73
- --source ${config.artifactDir} \\
74
- --overrides configuration.${env}.yaml
75
- `;
76
- }).join('\n');
77
- return `name: Run APIM Publisher
78
-
79
- on:
80
- push:
81
- branches:
82
- - main
83
- paths:
84
- - '${config.artifactDir}/**'
85
- - 'configuration.*.yaml'
86
- workflow_dispatch:
87
- inputs:
88
- COMMIT_ID_CHOICE:
89
- description: 'Choose "publish-all-artifacts-in-repo" only when you want to force republishing all artifacts (e.g. after build failure). Otherwise stick with the default behavior of "publish-artifacts-in-last-commit"'
90
- required: true
91
- type: choice
92
- default: publish-artifacts-in-last-commit
93
- options:
94
- - publish-artifacts-in-last-commit
95
- - publish-all-artifacts-in-repo
96
- ENVIRONMENT:
97
- description: 'Choose which environment to publish to'
98
- required: true
99
- type: choice
100
- default: ${config.environments[0]}
101
- options:
102
- ${envChoices}
103
-
104
- permissions:
105
- id-token: write
106
- contents: read
107
-
108
- jobs:
109
- get-commit:
110
- runs-on: ubuntu-latest
111
- outputs:
112
- commit_id: \${{ steps.commit.outputs.commit_id }}
113
- steps:
114
- - name: Set the Commit Id
115
- id: commit
116
- run: echo "commit_id=\${GITHUB_SHA}" >> $GITHUB_OUTPUT
117
-
118
- ${envJobs}
11
+ return `name: Run APIM Publisher
12
+
13
+ on:
14
+ push:
15
+ branches:
16
+ - main
17
+ paths:
18
+ - '${config.artifactDir}/**'
19
+ - 'configuration.*.yaml'
20
+ workflow_dispatch:
21
+ inputs:
22
+ COMMIT_ID_CHOICE:
23
+ description: 'Choose "publish-all-artifacts-in-repo" only when you want to force republishing all artifacts (e.g. after build failure). Otherwise stick with the default behavior of "publish-artifacts-in-last-commit"'
24
+ required: true
25
+ type: choice
26
+ default: publish-artifacts-in-last-commit
27
+ options:
28
+ - publish-artifacts-in-last-commit
29
+ - publish-all-artifacts-in-repo
30
+ ENVIRONMENT:
31
+ description: 'Choose which environment to publish to'
32
+ required: true
33
+ type: choice
34
+ default: ${defaultEnvironment}
35
+ options:
36
+ ${envChoices}
37
+
38
+ permissions:
39
+ id-token: write
40
+ contents: read
41
+
42
+ # A single workflow-level variable selects the target environment. On manual runs
43
+ # it comes from the ENVIRONMENT input; on push to main it defaults to '${defaultEnvironment}'.
44
+ env:
45
+ TARGET_ENV: \${{ github.event.inputs.ENVIRONMENT || '${defaultEnvironment}' }}
46
+
47
+ jobs:
48
+ get-commit:
49
+ runs-on: ubuntu-latest
50
+ outputs:
51
+ commit_id: \${{ steps.commit.outputs.commit_id }}
52
+ steps:
53
+ - name: Set the Commit Id
54
+ id: commit
55
+ run: echo "commit_id=\${GITHUB_SHA}" >> $GITHUB_OUTPUT
56
+
57
+ publish:
58
+ runs-on: ubuntu-latest
59
+ environment: \${{ github.event.inputs.ENVIRONMENT || '${defaultEnvironment}' }}
60
+ needs: get-commit
61
+ steps:
62
+ - name: Checkout repository
63
+ uses: actions/checkout@v5
64
+ with:
65
+ fetch-depth: 2
66
+
67
+ - name: Setup Node.js
68
+ uses: actions/setup-node@v5
69
+ with:
70
+ node-version: '22'
71
+
72
+ - name: Install dependencies
73
+ run: npm install
74
+
75
+ - name: Resolve target environment
76
+ id: env
77
+ run: |
78
+ echo "name=\${TARGET_ENV}" >> "$GITHUB_OUTPUT"
79
+ echo "upper=$(echo "\${TARGET_ENV}" | tr '[:lower:]' '[:upper:]')" >> "$GITHUB_OUTPUT"
80
+
81
+ - name: Azure Login (Federated Credential)
82
+ uses: azure/login@v3
83
+ with:
84
+ client-id: \${{ secrets.AZURE_CLIENT_ID }}
85
+ tenant-id: \${{ secrets.AZURE_TENANT_ID }}
86
+ subscription-id: \${{ secrets.AZURE_SUBSCRIPTION_ID }}
87
+
88
+ - name: Validate token source values
89
+ env:
90
+ AVAILABLE_SECRETS_JSON: \${{ toJSON(secrets) }}
91
+ run: |
92
+ missing=0
93
+ config_file="configuration.\${TARGET_ENV}.yaml"
94
+ tokens=$(grep -o '{#\\[[^]]*\\]#}' "$config_file" | sed -E 's/^\\{#\\[([^]]+)\\]#\\}$/\\1/' | sort -u || true)
95
+
96
+ if [ -z "$tokens" ]; then
97
+ echo "No tokens found in $config_file"
98
+ exit 0
99
+ fi
100
+
101
+ while IFS= read -r token; do
102
+ if [ -z "$token" ]; then
103
+ continue
104
+ fi
105
+
106
+ if ! echo "$token" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$'; then
107
+ echo "::error::Token '$token' is not a valid environment variable name. Use letters, numbers, and underscores only."
108
+ missing=1
109
+ continue
110
+ fi
111
+
112
+ value=$(jq -r --arg token "$token" '.[$token] // empty' <<< "$AVAILABLE_SECRETS_JSON")
113
+ if [ -z "$value" ]; then
114
+ echo "::error::Missing secret for token '$token'"
115
+ missing=1
116
+ continue
117
+ fi
118
+
119
+ printf '%s=%s\\n' "$token" "$value" >> "$GITHUB_ENV"
120
+ done <<< "$tokens"
121
+
122
+ if [ "$missing" -ne 0 ]; then
123
+ exit 1
124
+ fi
125
+
126
+ - name: Substitute tokens in configuration file
127
+ uses: cschleiden/replace-tokens@v1.4
128
+ with:
129
+ tokenPrefix: '{#['
130
+ tokenSuffix: ']#}'
131
+ files: '["configuration.\${{ env.TARGET_ENV }}.yaml"]'
132
+ # Token values are injected in the previous step based on token names.
133
+ # Ensure tokens in the configuration file match secret names exactly.
134
+
135
+ - name: Validate token substitution
136
+ run: |
137
+ config_file="configuration.\${TARGET_ENV}.yaml"
138
+ if grep -q '{#\\[' "$config_file"; then
139
+ echo "Unresolved tokens remain in $config_file"
140
+ grep -o '{#\\[[^]]*\\]#}' "$config_file" | sort -u
141
+ exit 1
142
+ fi
143
+
144
+ - name: Dry-run validation (incremental)
145
+ if: \${{ github.event.inputs.COMMIT_ID_CHOICE != 'publish-all-artifacts-in-repo' }}
146
+ run: |
147
+ npx apiops publish \\
148
+ --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
149
+ --resource-group \${{ secrets[format('APIM_RESOURCE_GROUP_{0}', steps.env.outputs.upper)] }} \\
150
+ --service-name \${{ secrets[format('APIM_SERVICE_NAME_{0}', steps.env.outputs.upper)] }} \\
151
+ --source ${config.artifactDir} \\
152
+ --overrides configuration.\${{ env.TARGET_ENV }}.yaml \\
153
+ --commit-id \${{ needs.get-commit.outputs.commit_id }} \\
154
+ --dry-run
155
+
156
+ - name: Dry-run validation (all artifacts)
157
+ if: \${{ github.event.inputs.COMMIT_ID_CHOICE == 'publish-all-artifacts-in-repo' }}
158
+ run: |
159
+ npx apiops publish \\
160
+ --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
161
+ --resource-group \${{ secrets[format('APIM_RESOURCE_GROUP_{0}', steps.env.outputs.upper)] }} \\
162
+ --service-name \${{ secrets[format('APIM_SERVICE_NAME_{0}', steps.env.outputs.upper)] }} \\
163
+ --source ${config.artifactDir} \\
164
+ --overrides configuration.\${{ env.TARGET_ENV }}.yaml \\
165
+ --dry-run
166
+
167
+ - name: Publish (incremental - last commit only)
168
+ if: \${{ github.event.inputs.COMMIT_ID_CHOICE != 'publish-all-artifacts-in-repo' }}
169
+ run: |
170
+ npx apiops publish \\
171
+ --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
172
+ --resource-group \${{ secrets[format('APIM_RESOURCE_GROUP_{0}', steps.env.outputs.upper)] }} \\
173
+ --service-name \${{ secrets[format('APIM_SERVICE_NAME_{0}', steps.env.outputs.upper)] }} \\
174
+ --source ${config.artifactDir} \\
175
+ --overrides configuration.\${{ env.TARGET_ENV }}.yaml \\
176
+ --commit-id \${{ needs.get-commit.outputs.commit_id }}
177
+
178
+ - name: Publish (all artifacts)
179
+ if: \${{ github.event.inputs.COMMIT_ID_CHOICE == 'publish-all-artifacts-in-repo' }}
180
+ run: |
181
+ npx apiops publish \\
182
+ --subscription-id \${{ secrets.AZURE_SUBSCRIPTION_ID }} \\
183
+ --resource-group \${{ secrets[format('APIM_RESOURCE_GROUP_{0}', steps.env.outputs.upper)] }} \\
184
+ --service-name \${{ secrets[format('APIM_SERVICE_NAME_{0}', steps.env.outputs.upper)] }} \\
185
+ --source ${config.artifactDir} \\
186
+ --overrides configuration.\${{ env.TARGET_ENV }}.yaml
119
187
  `;
120
188
  }
121
189
  //# sourceMappingURL=publish-workflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publish-workflow.js","sourceRoot":"","sources":["../../../src/templates/github-actions/publish-workflow.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC;;;GAGG;AAOH,MAAM,UAAU,uBAAuB,CAAC,MAA6B;IACnE,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAErF,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,iBAAiB,GAAG,GAAG,KAAK,CAAC;YACjC,CAAC,CAAC;gDACwC,GAAG,kCAAkC;YAC/E,CAAC,CAAC;gDACwC,GAAG;yDACM,MAAM,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;QAErF,OAAO,aAAa,GAAG;EACzB,iBAAiB;8CAC2B,GAAG;;mBAE9B,GAAG;;;;;;;;;;;;;;;;;;;;;;;mDAuB6B,GAAG;;;;;oCAKlB,GAAG;wCACC,GAAG;;kDAEO,QAAQ;0DACA,QAAQ;;2BAEvC,GAAG;;;;;gEAKkC,QAAQ;4DACZ,QAAQ;uBAC7C,MAAM,CAAC,WAAW;wCACD,GAAG;;;2BAGhB,GAAG;;;;;gEAKkC,QAAQ;4DACZ,QAAQ;uBAC7C,MAAM,CAAC,WAAW;wCACD,GAAG;CAC1C,CAAC;IACA,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;;;;;;;WAOE,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;mBAgBV,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;;EAEvC,UAAU;;;;;;;;;;;;;;;;EAgBV,OAAO;CACR,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"publish-workflow.js","sourceRoot":"","sources":["../../../src/templates/github-actions/publish-workflow.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC;;;;GAIG;AAOH,MAAM,UAAU,uBAAuB,CAAC,MAA6B;IACnE,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAErF,OAAO;;;;;;;WAOE,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;mBAgBV,kBAAkB;;EAEnC,UAAU;;;;;;;yEAO6D,kBAAkB;;yDAElC,kBAAkB;;;;;;;;;;;;;;4DAcf,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA4FvD,MAAM,CAAC,WAAW;;;;;;;;;;;;uBAYlB,MAAM,CAAC,WAAW;;;;;;;;;;;uBAWlB,MAAM,CAAC,WAAW;;;;;;;;;;;uBAWlB,MAAM,CAAC,WAAW;;CAExC,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,69 +1,72 @@
1
- {
2
- "name": "@peterhauge/apiops-cli",
3
- "version": "0.2.1-alpha.0",
4
- "description": "CLI tool for Azure API Management configuration-as-code",
5
- "type": "module",
6
- "private": false,
7
- "main": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "bin": {
10
- "apiops": "dist/cli/index.js"
11
- },
12
- "files": [
13
- "dist"
14
- ],
15
- "readme": "README.md",
16
- "scripts": {
17
- "prelint": "node scripts/embed-markdown-templates.mjs",
18
- "prebuild": "node scripts/embed-markdown-templates.mjs",
19
- "pretest": "node scripts/embed-markdown-templates.mjs",
20
- "build": "tsc",
21
- "test": "vitest run",
22
- "test:watch": "vitest",
23
- "lint": "eslint src tests",
24
- "start": "tsx src/cli/index.ts"
25
- },
26
- "engines": {
27
- "node": ">=22.0.0"
28
- },
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://github.com/Azure/apiops-cli.git"
32
- },
33
- "keywords": [
34
- "azure",
35
- "api-management",
36
- "apim",
37
- "cli",
38
- "gitops",
39
- "configuration-as-code"
40
- ],
41
- "author": "",
42
- "license": "MIT",
43
- "bugs": {
44
- "url": "https://github.com/Azure/apiops-cli/issues"
45
- },
46
- "homepage": "https://github.com/Azure/apiops-cli#readme",
47
- "dependencies": {
48
- "@azure/identity": "^4.13.1",
49
- "any-ascii": "^0.3.3",
50
- "commander": "^14.0.3",
51
- "he": "^1.2.0",
52
- "js-yaml": "^4.1.1",
53
- "simple-git": "^3.35.2"
54
- },
55
- "devDependencies": {
56
- "@eslint/js": "^10.0.1",
57
- "@types/he": "^1.2.3",
58
- "@types/js-yaml": "^4.0.9",
59
- "@types/node": "^25.5.2",
60
- "@typescript-eslint/eslint-plugin": "^8.58.1",
61
- "@typescript-eslint/parser": "^8.58.1",
62
- "@vitest/coverage-v8": "^4.1.4",
63
- "eslint": "^10.2.0",
64
- "tsx": "^4.21.0",
65
- "typescript": "^6.0.2",
66
- "typescript-eslint": "^8.58.1",
67
- "vitest": "^4.1.3"
68
- }
69
- }
1
+ {
2
+ "name": "@peterhauge/apiops-cli",
3
+ "version": "0.4.0-alpha.0",
4
+ "schemaVersion": "1",
5
+ "description": "CLI tool for Azure API Management configuration-as-code",
6
+ "type": "module",
7
+ "private": false,
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "bin": {
11
+ "apiops": "dist/cli/index.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "CHANGELOG.md"
16
+ ],
17
+ "readme": "README.md",
18
+ "scripts": {
19
+ "prelint": "node scripts/embed-markdown-templates.mjs && node scripts/generate-schemas.mjs",
20
+ "prebuild": "node scripts/embed-markdown-templates.mjs && node scripts/generate-schemas.mjs",
21
+ "pretest": "node scripts/embed-markdown-templates.mjs && node scripts/generate-schemas.mjs",
22
+ "build": "tsc",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "lint": "eslint src tests",
26
+ "start": "tsx src/cli/index.ts"
27
+ },
28
+ "engines": {
29
+ "node": ">=22.0.0"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/Azure/apiops-cli.git"
34
+ },
35
+ "keywords": [
36
+ "azure",
37
+ "api-management",
38
+ "apim",
39
+ "cli",
40
+ "gitops",
41
+ "configuration-as-code"
42
+ ],
43
+ "author": "",
44
+ "license": "MIT",
45
+ "bugs": {
46
+ "url": "https://github.com/Azure/apiops-cli/issues"
47
+ },
48
+ "homepage": "https://github.com/Azure/apiops-cli#readme",
49
+ "changelog": "https://github.com/Azure/apiops-cli/blob/main/CHANGELOG.md",
50
+ "dependencies": {
51
+ "@azure/identity": "^4.13.1",
52
+ "any-ascii": "^0.3.3",
53
+ "commander": "^14.0.3",
54
+ "he": "^1.2.0",
55
+ "js-yaml": "^4.1.1",
56
+ "simple-git": "^3.35.2"
57
+ },
58
+ "devDependencies": {
59
+ "@eslint/js": "^10.0.1",
60
+ "@types/he": "^1.2.3",
61
+ "@types/js-yaml": "^4.0.9",
62
+ "@types/node": "^25.5.2",
63
+ "@typescript-eslint/eslint-plugin": "^8.58.1",
64
+ "@typescript-eslint/parser": "^8.58.1",
65
+ "@vitest/coverage-v8": "^4.1.4",
66
+ "eslint": "^10.2.0",
67
+ "tsx": "^4.21.0",
68
+ "typescript": "^6.0.2",
69
+ "typescript-eslint": "^8.58.1",
70
+ "vitest": "^4.1.3"
71
+ }
72
+ }