Repository navigation
Add confirmed project-template submit command #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
490b525
feat(cli): submit saved project templates for approval
purpshell f939c7c
Merge commit '9e8991230570ff7b63e6de19f9a4196cc8d98d6c' into codex/cl…
purpshell 7410e00
style(cli): format template submit command
purpshell a57f081
fix(cli): honor explicit project on template submission
purpshell f75adb9
test(cli): exercise template submit with stored token profile
purpshell 614ffb1
Merge CLI dev with the published SDK pin
purpshell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Project-template submission command gate | ||
|
|
||
| `template submit` consumes `MessagingClient.templates.submit` from SDK PR #308 | ||
| plus its one-attempt follow-up. The API contract is | ||
| `POST /messaging/projects/{projectSlug}/templates/{id}/submit` at | ||
| `polymorfa/polymorfa` PR #377, commit | ||
| `0f559ed7f89227fa220d6a0275fcc40b8e319a55`. That route returns local | ||
| validation feedback before dispatching an invalid draft. The CLI makes one | ||
| attempt even with its older SDK pin, and requires `--yes` for the provider | ||
| effect. A lost response is not a rejection; inspect the Number's Meta catalog | ||
| before another attempt. | ||
|
|
||
| This command is implementation-only until the upstream API branches merge, | ||
| the SDK follow-up merges and publishes under an exact registry version, and | ||
| the CLI pins that version with a regenerated lockfile. No live Meta submission, | ||
| approval webhook, deployed path, or customer availability was established by | ||
| this change. Cloud onboarding beta authority and release controls remain | ||
| unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import {Args, Flags} from '@oclif/core' | ||
| import {PolymorfaConfigurationError} from '@polymorfa/sdk' | ||
| import {BaseCommand} from '../../base-command.js' | ||
| import {cloudResult} from '../../services/cloud.js' | ||
|
|
||
| export default class TemplateSubmit extends BaseCommand { | ||
| static override description = | ||
| 'Submit a saved project template for Meta approval (beta). Requires templates:manage. Makes one attempt; an accepted submission is not approval.' | ||
|
|
||
| static override args = { | ||
| template: Args.string({ | ||
| description: 'Saved project template ID.', | ||
| required: true, | ||
| }), | ||
| } | ||
|
|
||
| static override flags = { | ||
| 'project-slug': Flags.string({ | ||
| description: 'Project slug that owns the template.', | ||
| required: true, | ||
| }), | ||
| session: Flags.string({ | ||
| description: 'Official API Number ID in the same project.', | ||
| required: true, | ||
| }), | ||
| yes: Flags.boolean({ | ||
| description: 'Confirm one submission attempt to Meta.', | ||
| required: true, | ||
| }), | ||
| } | ||
|
|
||
| async run(): Promise<void> { | ||
| const {args, flags} = await this.parse(TemplateSubmit) | ||
| if (!flags.yes) | ||
| throw new PolymorfaConfigurationError( | ||
| 'Pass --yes to submit this project template for Meta approval.', | ||
| 'yes', | ||
| ) | ||
|
|
||
| const client = await this.messagingClient(flags, { | ||
| serverCredentialOnly: 'Project template submission', | ||
| ignoreProjectLink: true, | ||
| }) | ||
| const response = await client.templates.submit( | ||
| flags['project-slug'], | ||
| args.template, | ||
| {session: flags.session}, | ||
| {maxNetworkRetries: 0}, | ||
| ) | ||
| const result = cloudResult(response) | ||
| this.writeValue(result, JSON.stringify(result.data, null, 2), flags) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.