contensis-cli 1.0.0-beta.95 → 1.0.0-beta.97
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/dist/commands/dev.js +2 -6
- package/dist/commands/dev.js.map +2 -2
- package/dist/commands/import.js +18 -0
- package/dist/commands/import.js.map +2 -2
- package/dist/localisation/en-GB.js +28 -11
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/DevInit-to-CIWorkflow.js +251 -136
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +3 -3
- package/dist/models/DevService.d.js.map +1 -1
- package/dist/services/ContensisCliService.js +64 -0
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/services/ContensisDevService.js +65 -18
- package/dist/services/ContensisDevService.js.map +2 -2
- package/dist/services/ContensisRoleService.js +31 -4
- package/dist/services/ContensisRoleService.js.map +3 -3
- package/dist/util/diff.js +3 -1
- package/dist/util/diff.js.map +2 -2
- package/dist/util/git.js +4 -2
- package/dist/util/git.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -1
- package/src/commands/dev.ts +7 -7
- package/src/commands/import.ts +25 -0
- package/src/localisation/en-GB.ts +43 -9
- package/src/mappers/DevInit-to-CIWorkflow.ts +386 -196
- package/src/models/DevService.d.ts +14 -0
- package/src/services/ContensisCliService.ts +84 -0
- package/src/services/ContensisDevService.ts +80 -21
- package/src/services/ContensisRoleService.ts +33 -1
- package/src/util/diff.ts +4 -1
- package/src/util/git.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -155,12 +155,21 @@ export const LogMessages = {
|
|
|
155
155
|
`[${projectId}] Unable to get content models ${Logger.highlightText(id)}`,
|
|
156
156
|
},
|
|
157
157
|
nodes: {
|
|
158
|
+
imported: (env: string, commit: boolean, count: number) =>
|
|
159
|
+
`[${env}] ${commit ? `Imported` : `Will import`} ${count} nodes`,
|
|
160
|
+
failedImport: (env: string) => `[${env}] Unable to import nodes`,
|
|
161
|
+
removed: (env: string, commit: boolean) =>
|
|
162
|
+
`[${env}] ${commit ? `Deleted` : `Will delete`} nodes`,
|
|
163
|
+
failedRemove: (env: string) => `[${env}] Unable to delete nodes`,
|
|
164
|
+
notFound: (env: string) => `[${env}] Nodes were not found `,
|
|
165
|
+
commitTip: () => `Add --commit flag to commit the previewed changes`,
|
|
158
166
|
failedGet: (projectId: string) =>
|
|
159
167
|
`[${projectId}] Cannot retrieve nodes from Site view`,
|
|
160
168
|
get: (projectId: string, root: string, depth: number) =>
|
|
161
169
|
`[${projectId}] Site view nodes at: ${Logger.highlightText(root)}${
|
|
162
170
|
depth ? ` to a depth of ${depth}` : ``
|
|
163
171
|
}\n`,
|
|
172
|
+
noChange: (env: string) => `[${env}] No changes to be made`,
|
|
164
173
|
},
|
|
165
174
|
contenttypes: {
|
|
166
175
|
list: (projectId: string) =>
|
|
@@ -446,12 +455,16 @@ Connect to Contensis instance: ${Logger.standardText(env)}
|
|
|
446
455
|
` - ${
|
|
447
456
|
!existing ? 'Create deployment API key' : 'Deployment API key found'
|
|
448
457
|
}: ${Logger[!existing ? 'highlightText' : 'standardText'](name)}`,
|
|
449
|
-
ciIntro: (git: GitHelper) =>
|
|
458
|
+
ciIntro: (git: GitHelper, location: 'git' | 'env') =>
|
|
450
459
|
`We will create API keys with permissions to use this project with Contensis, and add a job to your CI that will deploy a container build.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
460
|
+
${
|
|
461
|
+
location === 'git'
|
|
462
|
+
? `We will ask you to add secrets/variables to your git repository to give your workflow permission to push a Block to Contensis.
|
|
463
|
+
${Logger.infoText(`You could visit ${git.secretsUri} to check that you can see repository settings,
|
|
464
|
+
a page not found generally indicates you need to ask the repo owner for permission to add repository secrets,
|
|
465
|
+
or ask the repo owner to add these secrets for you.`)}`
|
|
466
|
+
: ''
|
|
467
|
+
}`,
|
|
455
468
|
ciDetails: (filename: string) =>
|
|
456
469
|
`Add push-block job to CI file: ${Logger.highlightText(filename)}\n`,
|
|
457
470
|
ciMultipleChoices: () =>
|
|
@@ -470,14 +483,18 @@ We will ask you to add secrets/variables to your git repository to give your wor
|
|
|
470
483
|
`Do one of these variables point to your tagged app image?\n${Logger.infoText(
|
|
471
484
|
`we have included a default choice - ensure your build image is tagged exactly the same as this`
|
|
472
485
|
)}`,
|
|
473
|
-
ciEnterOwnAppImagePrompt: () =>
|
|
486
|
+
ciEnterOwnAppImagePrompt: (git: GitHelper) =>
|
|
474
487
|
`Tell us the registry uri your app image is tagged and pushed with (⏎ accept default) \n${Logger.infoText(
|
|
475
|
-
`Tip:
|
|
488
|
+
`Tip: ${
|
|
489
|
+
git.type === 'github'
|
|
490
|
+
? `GitHub context variables available\nhttps://docs.github.com/en/actions/learn-github-actions/variables#using-contexts-to-access-variable-values`
|
|
491
|
+
: `GitLab CI/CD variables available\nhttps://docs.gitlab.com/ee/ci/variables/`
|
|
492
|
+
}`
|
|
476
493
|
)}\n`,
|
|
477
494
|
confirm: () =>
|
|
478
495
|
`Confirm these details are correct so we can make changes to your project`,
|
|
479
496
|
accessTokenPrompt: () =>
|
|
480
|
-
`
|
|
497
|
+
` To continue setting up we need permission to fetch your Delivery API token. (Press (Y + ⏎) to continue or (N + ⏎) to exit the set up process)`,
|
|
481
498
|
createDevKey: (keyName: string, existing: boolean) =>
|
|
482
499
|
`${
|
|
483
500
|
!existing ? 'Created' : 'Checked permissions for'
|
|
@@ -525,6 +542,21 @@ We will ask you to add secrets/variables to your git repository to give your wor
|
|
|
525
542
|
} ${Logger.highlightText(`CONTENSIS_SHARED_SECRET`)}\n ${
|
|
526
543
|
git.type === 'github' ? `Secret:` : `Value:`
|
|
527
544
|
} ${Logger.standardText(secret)}`,
|
|
545
|
+
accessTokenFetch: () => `Please wait, fecthing Delivery API token ⏳`,
|
|
546
|
+
accessTokenSuccess: (token: string) =>
|
|
547
|
+
`Successfully fetched Delivery API token 👉 ${Logger.infoText(token)}`,
|
|
548
|
+
accessTokenFailed: () =>
|
|
549
|
+
`Something went wrong! If the problem persists, please contact our support team 🛟`,
|
|
550
|
+
accessTokenPermission: () =>
|
|
551
|
+
`We need permission to fetch your Delivery API token, please try again ⚠️`,
|
|
552
|
+
clientDetailsLocation: () =>
|
|
553
|
+
`Which option would you like to use for storing your client ID and secret`,
|
|
554
|
+
clientDetailsInGit: (git: GitHelper) =>
|
|
555
|
+
`${
|
|
556
|
+
git.type === 'github' ? 'GitHub' : 'GitLab'
|
|
557
|
+
} variables (recommended for public repositories)`,
|
|
558
|
+
clientDetailsInEnv: () =>
|
|
559
|
+
`.env file (recommended for private repositories)`,
|
|
528
560
|
success: () => `Contensis developer environment initialisation complete`,
|
|
529
561
|
partialSuccess: () =>
|
|
530
562
|
`Contensis developer environment initialisation completed with errors`,
|
|
@@ -532,7 +564,9 @@ We will ask you to add secrets/variables to your git repository to give your wor
|
|
|
532
564
|
dryRun: () =>
|
|
533
565
|
`Contensis developer environment initialisation dry run completed`,
|
|
534
566
|
noChanges: () =>
|
|
535
|
-
`No changes were made to your project, run the command again without the
|
|
567
|
+
`No changes were made to your project, run the command again without the ${Logger.highlightText(
|
|
568
|
+
'--dry-run'
|
|
569
|
+
)} flag to update your project with these changes`,
|
|
536
570
|
startProjectTip: () =>
|
|
537
571
|
`Start up your project in the normal way for development`,
|
|
538
572
|
},
|