@gadgetinc/ggt 0.4.10 → 1.0.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 (142) hide show
  1. package/README.md +165 -93
  2. package/lib/__generated__/graphql.js +66 -1
  3. package/lib/__generated__/graphql.js.map +1 -1
  4. package/lib/commands/deploy.js +328 -230
  5. package/lib/commands/deploy.js.map +1 -1
  6. package/lib/commands/dev.js +445 -0
  7. package/lib/commands/dev.js.map +1 -0
  8. package/lib/commands/list.js +27 -19
  9. package/lib/commands/list.js.map +1 -1
  10. package/lib/commands/login.js +15 -11
  11. package/lib/commands/login.js.map +1 -1
  12. package/lib/commands/logout.js +5 -5
  13. package/lib/commands/logout.js.map +1 -1
  14. package/lib/commands/open.js +200 -0
  15. package/lib/commands/open.js.map +1 -0
  16. package/lib/commands/pull.js +128 -0
  17. package/lib/commands/pull.js.map +1 -0
  18. package/lib/commands/push.js +126 -0
  19. package/lib/commands/push.js.map +1 -0
  20. package/lib/commands/root.js +46 -28
  21. package/lib/commands/root.js.map +1 -1
  22. package/lib/commands/status.js +61 -0
  23. package/lib/commands/status.js.map +1 -0
  24. package/lib/commands/version.js +6 -6
  25. package/lib/commands/version.js.map +1 -1
  26. package/lib/commands/whoami.js +6 -6
  27. package/lib/commands/whoami.js.map +1 -1
  28. package/lib/ggt.js +33 -8
  29. package/lib/ggt.js.map +1 -1
  30. package/lib/main.js +5 -0
  31. package/lib/main.js.map +1 -0
  32. package/lib/services/app/api/api.js +191 -0
  33. package/lib/services/app/api/api.js.map +1 -0
  34. package/lib/services/app/api/operation.js +12 -0
  35. package/lib/services/app/api/operation.js.map +1 -0
  36. package/lib/services/app/app.js +44 -10
  37. package/lib/services/app/app.js.map +1 -1
  38. package/lib/services/app/{edit/client.js → client.js} +29 -19
  39. package/lib/services/app/client.js.map +1 -0
  40. package/lib/services/app/edit/edit.js +67 -31
  41. package/lib/services/app/edit/edit.js.map +1 -1
  42. package/lib/services/app/edit/operation.js +4 -3
  43. package/lib/services/app/edit/operation.js.map +1 -1
  44. package/lib/services/app/{edit/error.js → error.js} +6 -6
  45. package/lib/services/app/error.js.map +1 -0
  46. package/lib/services/command/arg.js +4 -4
  47. package/lib/services/command/arg.js.map +1 -1
  48. package/lib/services/command/command.js +9 -7
  49. package/lib/services/command/command.js.map +1 -1
  50. package/lib/services/command/context.js +82 -20
  51. package/lib/services/command/context.js.map +1 -1
  52. package/lib/services/config/config.js +4 -7
  53. package/lib/services/config/config.js.map +1 -1
  54. package/lib/services/config/env.js +1 -1
  55. package/lib/services/config/env.js.map +1 -1
  56. package/lib/services/filesync/changes.js +76 -37
  57. package/lib/services/filesync/changes.js.map +1 -1
  58. package/lib/services/filesync/conflicts.js +10 -9
  59. package/lib/services/filesync/conflicts.js.map +1 -1
  60. package/lib/services/filesync/directory.js +16 -1
  61. package/lib/services/filesync/directory.js.map +1 -1
  62. package/lib/services/filesync/error.js +96 -27
  63. package/lib/services/filesync/error.js.map +1 -1
  64. package/lib/services/filesync/filesync.js +448 -490
  65. package/lib/services/filesync/filesync.js.map +1 -1
  66. package/lib/services/filesync/hashes.js +8 -5
  67. package/lib/services/filesync/hashes.js.map +1 -1
  68. package/lib/services/filesync/strategy.js +59 -0
  69. package/lib/services/filesync/strategy.js.map +1 -0
  70. package/lib/services/filesync/sync-json.js +475 -0
  71. package/lib/services/filesync/sync-json.js.map +1 -0
  72. package/lib/services/http/auth.js +30 -1
  73. package/lib/services/http/auth.js.map +1 -1
  74. package/lib/services/http/http.js +5 -0
  75. package/lib/services/http/http.js.map +1 -1
  76. package/lib/services/output/confirm.js +149 -0
  77. package/lib/services/output/confirm.js.map +1 -0
  78. package/lib/services/output/footer.js +22 -0
  79. package/lib/services/output/footer.js.map +1 -0
  80. package/lib/services/output/log/format/pretty.js +2 -1
  81. package/lib/services/output/log/format/pretty.js.map +1 -1
  82. package/lib/services/output/log/logger.js +13 -5
  83. package/lib/services/output/log/logger.js.map +1 -1
  84. package/lib/services/output/log/structured.js +2 -2
  85. package/lib/services/output/log/structured.js.map +1 -1
  86. package/lib/services/output/output.js +197 -0
  87. package/lib/services/output/output.js.map +1 -0
  88. package/lib/services/output/print.js +31 -0
  89. package/lib/services/output/print.js.map +1 -0
  90. package/lib/services/output/problems.js +84 -0
  91. package/lib/services/output/problems.js.map +1 -0
  92. package/lib/services/output/prompt.js +173 -40
  93. package/lib/services/output/prompt.js.map +1 -1
  94. package/lib/services/output/report.js +63 -19
  95. package/lib/services/output/report.js.map +1 -1
  96. package/lib/services/output/select.js +198 -0
  97. package/lib/services/output/select.js.map +1 -0
  98. package/lib/services/output/spinner.js +141 -0
  99. package/lib/services/output/spinner.js.map +1 -0
  100. package/lib/services/output/sprint.js +38 -15
  101. package/lib/services/output/sprint.js.map +1 -1
  102. package/lib/services/output/symbols.js +23 -0
  103. package/lib/services/output/symbols.js.map +1 -0
  104. package/lib/services/output/table.js +98 -0
  105. package/lib/services/output/table.js.map +1 -0
  106. package/lib/services/output/timestamp.js +12 -0
  107. package/lib/services/output/timestamp.js.map +1 -0
  108. package/lib/services/output/update.js +29 -9
  109. package/lib/services/output/update.js.map +1 -1
  110. package/lib/services/user/session.js +4 -0
  111. package/lib/services/user/session.js.map +1 -1
  112. package/lib/services/user/user.js +15 -10
  113. package/lib/services/user/user.js.map +1 -1
  114. package/lib/services/util/assert.js +11 -0
  115. package/lib/services/util/assert.js.map +1 -0
  116. package/lib/services/util/boolean.js +2 -2
  117. package/lib/services/util/boolean.js.map +1 -1
  118. package/lib/services/util/function.js +45 -7
  119. package/lib/services/util/function.js.map +1 -1
  120. package/lib/services/util/is.js +23 -2
  121. package/lib/services/util/is.js.map +1 -1
  122. package/lib/services/util/json.js +16 -13
  123. package/lib/services/util/json.js.map +1 -1
  124. package/lib/services/util/object.js +2 -2
  125. package/lib/services/util/object.js.map +1 -1
  126. package/lib/services/util/promise.js +5 -2
  127. package/lib/services/util/promise.js.map +1 -1
  128. package/lib/services/util/types.js.map +1 -1
  129. package/npm-shrinkwrap.json +3415 -2973
  130. package/package.json +47 -40
  131. package/bin/dev.cmd +0 -3
  132. package/bin/dev.js +0 -14
  133. package/bin/run.cmd +0 -3
  134. package/bin/run.js +0 -5
  135. package/lib/commands/sync.js +0 -284
  136. package/lib/commands/sync.js.map +0 -1
  137. package/lib/services/app/edit/client.js.map +0 -1
  138. package/lib/services/app/edit/error.js.map +0 -1
  139. package/lib/services/output/log/printer.js +0 -120
  140. package/lib/services/output/log/printer.js.map +0 -1
  141. package/lib/services/output/stream.js +0 -54
  142. package/lib/services/output/stream.js.map +0 -1
@@ -1,7 +1,10 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
- import { CLIError, IsBug } from "../output/report.js";
3
- import { sprint } from "../output/sprint.js";
4
- export class YarnNotFoundError extends CLIError {
2
+ import { ClientError } from "../app/error.js";
3
+ import { sprintProblems } from "../output/problems.js";
4
+ import { GGTError, IsBug } from "../output/report.js";
5
+ import { sprint, sprintln } from "../output/sprint.js";
6
+ import { isGraphQLErrors, isGraphQLResult, isObject, isString } from "../util/is.js";
7
+ export class YarnNotFoundError extends GGTError {
5
8
  render() {
6
9
  return sprint`
7
10
  Yarn must be installed to sync your application. You can install it by running:
@@ -16,52 +19,118 @@ export class YarnNotFoundError extends CLIError {
16
19
  _define_property(this, "isBug", IsBug.NO);
17
20
  }
18
21
  }
19
- export class InvalidSyncFileError extends CLIError {
22
+ export class UnknownDirectoryError extends GGTError {
20
23
  render() {
21
- return sprint`
22
- We failed to find a ".gadget/sync.json" file in this directory:
24
+ const cmd = this.ctx.command;
25
+ const dir = this.opts.directory.path;
26
+ switch(cmd){
27
+ case "open":
28
+ case "status":
29
+ return sprint`
30
+ A ".gadget/sync.json" file is missing in this directory:
23
31
 
24
- ${this.dir}
32
+ ${dir}
25
33
 
26
- If you're running 'ggt sync' for the first time, we recommend
27
- using a gadget specific directory like this:
34
+ In order to use "ggt ${cmd}", you must run it within a directory
35
+ that has already been initialized with "ggt dev".
36
+ `;
37
+ case "dev":
38
+ return sprint`
39
+ A ".gadget/sync.json" file is missing in this directory:
28
40
 
29
- ggt sync ~/gadget/${this.app} --app ${this.app}
41
+ ${dir}
30
42
 
31
- If you're certain you want to sync the contents of that directory
32
- to Gadget, run 'ggt sync' again with the {bold --force} flag:
43
+ If you're running "ggt dev" for the first time, we recommend
44
+ using a gadget specific directory like this:
33
45
 
34
- ggt sync ${this.dir} --app ${this.app} --force
35
- `;
46
+ ggt dev ~/gadget/${this.ctx.args["--app"] ?? "<name>"}
47
+
48
+ To use a non-empty directory without a ".gadget/sync.json" file,
49
+ run "ggt dev" again with the "--allow-unknown-directory" flag:
50
+
51
+ ggt dev ${dir} --allow-unknown-directory
52
+ `;
53
+ default:
54
+ return sprint`
55
+ A ".gadget/sync.json" file is missing in this directory:
56
+
57
+ ${dir}
58
+
59
+ If you're certain you want to use this directory, you can run
60
+ "ggt ${cmd}" again with the "--allow-unknown-directory" flag:
61
+
62
+ ggt ${cmd} --allow-unknown-directory
63
+ `;
64
+ }
36
65
  }
37
- constructor(dir, app){
38
- super("The .gadget/sync.json file was invalid or not found");
39
- _define_property(this, "dir", void 0);
40
- _define_property(this, "app", void 0);
66
+ constructor(ctx, opts){
67
+ super('The ".gadget/sync.json" file was invalid or not found');
68
+ _define_property(this, "ctx", void 0);
69
+ _define_property(this, "opts", void 0);
41
70
  _define_property(this, "isBug", void 0);
42
- this.dir = dir;
43
- this.app = app;
71
+ this.ctx = ctx;
72
+ this.opts = opts;
44
73
  this.isBug = IsBug.NO;
45
- this.app ??= "<name of app>";
46
74
  }
47
75
  }
48
- export class TooManySyncAttemptsError extends CLIError {
76
+ export class TooManyMergeAttemptsError extends GGTError {
49
77
  render() {
50
78
  return sprint`
51
- We synced your local files with Gadget ${this.attempts} times, but
52
- your local filesystem is still out of sync.
79
+ We merged your local files with your environment's files ${this.attempts} times,
80
+ but your local and environment's files still don't match.
53
81
 
54
- Make sure no one else is editing files in the Gadget editor
55
- and try again.
82
+ Make sure no one else is editing files on your environment, and try again.
56
83
  `;
57
84
  }
58
85
  constructor(attempts){
59
- super(`Failed to sync files after ${attempts} attempts.`);
86
+ super(`Failed to synchronize files after ${attempts} attempts.`);
60
87
  _define_property(this, "attempts", void 0);
61
88
  _define_property(this, "isBug", void 0);
62
89
  this.attempts = attempts;
63
90
  this.isBug = IsBug.MAYBE;
64
91
  }
65
92
  }
93
+ export class DeployDisallowedError extends GGTError {
94
+ render() {
95
+ let output = sprintln`{red Gadget has detected the following fatal errors with your files:}`;
96
+ output += sprintProblems({
97
+ ensureEmptyLineAbove: true,
98
+ problems: this.fatalErrors,
99
+ showFileTypes: false
100
+ });
101
+ output += sprintln({
102
+ ensureEmptyLineAbove: true
103
+ })`{red Please fix these errors and try again.}`;
104
+ return output;
105
+ }
106
+ constructor(fatalErrors){
107
+ super("This application is not allowed to be deployed due to fatal errors.");
108
+ _define_property(this, "fatalErrors", void 0);
109
+ _define_property(this, "isBug", void 0);
110
+ this.fatalErrors = fatalErrors;
111
+ this.isBug = IsBug.MAYBE;
112
+ }
113
+ }
114
+ export const isFilesVersionMismatchError = (error)=>{
115
+ if (error instanceof ClientError) {
116
+ error = error.cause;
117
+ }
118
+ if (isGraphQLResult(error)) {
119
+ error = error.errors;
120
+ }
121
+ if (isGraphQLErrors(error)) {
122
+ error = error[0];
123
+ }
124
+ return isObject(error) && "message" in error && isString(error.message) && error.message.includes("Files version mismatch");
125
+ };
126
+ export const swallowFilesVersionMismatch = (ctx, error)=>{
127
+ if (isFilesVersionMismatchError(error)) {
128
+ ctx.log.debug("swallowing files version mismatch", {
129
+ error
130
+ });
131
+ return;
132
+ }
133
+ throw error;
134
+ };
66
135
 
67
136
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/services/filesync/error.ts"],"sourcesContent":["import { CLIError, IsBug } from \"../output/report.js\";\nimport { sprint } from \"../output/sprint.js\";\n\nexport class YarnNotFoundError extends CLIError {\n isBug = IsBug.NO;\n\n constructor() {\n super(\"Yarn not found\");\n }\n\n protected render(): string {\n return sprint`\n Yarn must be installed to sync your application. You can install it by running:\n\n $ npm install --global yarn\n\n For more information, see: https://classic.yarnpkg.com/en/docs/install\n `;\n }\n}\n\nexport class InvalidSyncFileError extends CLIError {\n isBug = IsBug.NO;\n\n constructor(\n readonly dir: string,\n readonly app: string | undefined,\n ) {\n super(\"The .gadget/sync.json file was invalid or not found\");\n this.app ??= \"<name of app>\";\n }\n\n protected render(): string {\n return sprint`\n We failed to find a \".gadget/sync.json\" file in this directory:\n\n ${this.dir}\n\n If you're running 'ggt sync' for the first time, we recommend\n using a gadget specific directory like this:\n\n ggt sync ~/gadget/${this.app} --app ${this.app}\n\n If you're certain you want to sync the contents of that directory\n to Gadget, run 'ggt sync' again with the {bold --force} flag:\n\n ggt sync ${this.dir} --app ${this.app} --force\n `;\n }\n}\n\nexport class TooManySyncAttemptsError extends CLIError {\n isBug = IsBug.MAYBE;\n\n constructor(readonly attempts: number) {\n super(`Failed to sync files after ${attempts} attempts.`);\n }\n\n protected render(): string {\n return sprint`\n We synced your local files with Gadget ${this.attempts} times, but\n your local filesystem is still out of sync.\n\n Make sure no one else is editing files in the Gadget editor\n and try again.\n `;\n }\n}\n"],"names":["CLIError","IsBug","sprint","YarnNotFoundError","render","constructor","isBug","NO","InvalidSyncFileError","dir","app","TooManySyncAttemptsError","attempts","MAYBE"],"mappings":";AAAA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,sBAAsB;AACtD,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,OAAO,MAAMC,0BAA0BH;IAO3BI,SAAiB;QACzB,OAAOF,MAAM,CAAC;;;;;;IAMd,CAAC;IACH;IAZAG,aAAc;QACZ,KAAK,CAAC;QAHRC,uBAAAA,SAAQL,MAAMM,EAAE;IAIhB;AAWF;AAEA,OAAO,MAAMC,6BAA6BR;IAW9BI,SAAiB;QACzB,OAAOF,MAAM,CAAC;;;QAGV,EAAE,IAAI,CAACO,GAAG,CAAC;;;;;0BAKO,EAAE,IAAI,CAACC,GAAG,CAAC,OAAO,EAAE,IAAI,CAACA,GAAG,CAAC;;;;;iBAKtC,EAAE,IAAI,CAACD,GAAG,CAAC,OAAO,EAAE,IAAI,CAACC,GAAG,CAAC;IAC1C,CAAC;IACH;IAxBAL,YACE,AAASI,GAAW,EACpB,AAASC,GAAuB,CAChC;QACA,KAAK,CAAC;;;QANRJ,uBAAAA,SAAAA,KAAAA;aAGWG,MAAAA;aACAC,MAAAA;aAJXJ,QAAQL,MAAMM,EAAE;QAOd,IAAI,CAACG,GAAG,KAAK;IACf;AAmBF;AAEA,OAAO,MAAMC,iCAAiCX;IAOlCI,SAAiB;QACzB,OAAOF,MAAM,CAAC;+CAC6B,EAAE,IAAI,CAACU,QAAQ,CAAC;;;;;IAK3D,CAAC;IACH;IAZAP,YAAY,AAASO,QAAgB,CAAE;QACrC,KAAK,CAAC,CAAC,2BAA2B,EAAEA,SAAS,UAAU,CAAC;;QAH1DN,uBAAAA,SAAAA,KAAAA;aAEqBM,WAAAA;aAFrBN,QAAQL,MAAMY,KAAK;IAInB;AAWF"}
1
+ {"version":3,"sources":["../../../src/services/filesync/error.ts"],"sourcesContent":["import { ClientError } from \"../app/error.js\";\nimport type { Context } from \"../command/context.js\";\nimport { sprintProblems, type Problems } from \"../output/problems.js\";\nimport { GGTError, IsBug } from \"../output/report.js\";\nimport { sprint, sprintln } from \"../output/sprint.js\";\nimport { isGraphQLErrors, isGraphQLResult, isObject, isString } from \"../util/is.js\";\nimport type { Directory } from \"./directory.js\";\nimport type { SyncJsonArgs } from \"./sync-json.js\";\n\nexport class YarnNotFoundError extends GGTError {\n isBug = IsBug.NO;\n\n constructor() {\n super(\"Yarn not found\");\n }\n\n protected render(): string {\n return sprint`\n Yarn must be installed to sync your application. You can install it by running:\n\n $ npm install --global yarn\n\n For more information, see: https://classic.yarnpkg.com/en/docs/install\n `;\n }\n}\n\nexport class UnknownDirectoryError extends GGTError {\n isBug = IsBug.NO;\n\n constructor(\n readonly ctx: Context<SyncJsonArgs>,\n readonly opts: { directory: Directory },\n ) {\n super('The \".gadget/sync.json\" file was invalid or not found');\n }\n\n protected render(): string {\n const cmd = this.ctx.command;\n const dir = this.opts.directory.path;\n\n switch (cmd) {\n case \"open\":\n case \"status\":\n return sprint`\n A \".gadget/sync.json\" file is missing in this directory:\n\n ${dir}\n\n In order to use \"ggt ${cmd}\", you must run it within a directory\n that has already been initialized with \"ggt dev\".\n `;\n case \"dev\":\n return sprint`\n A \".gadget/sync.json\" file is missing in this directory:\n\n ${dir}\n\n If you're running \"ggt dev\" for the first time, we recommend\n using a gadget specific directory like this:\n\n ggt dev ~/gadget/${this.ctx.args[\"--app\"] ?? \"<name>\"}\n\n To use a non-empty directory without a \".gadget/sync.json\" file,\n run \"ggt dev\" again with the \"--allow-unknown-directory\" flag:\n\n ggt dev ${dir} --allow-unknown-directory\n `;\n default:\n return sprint`\n A \".gadget/sync.json\" file is missing in this directory:\n\n ${dir}\n\n If you're certain you want to use this directory, you can run\n \"ggt ${cmd}\" again with the \"--allow-unknown-directory\" flag:\n\n ggt ${cmd} --allow-unknown-directory\n `;\n }\n }\n}\n\nexport class TooManyMergeAttemptsError extends GGTError {\n isBug = IsBug.MAYBE;\n\n constructor(readonly attempts: number) {\n super(`Failed to synchronize files after ${attempts} attempts.`);\n }\n\n protected render(): string {\n return sprint`\n We merged your local files with your environment's files ${this.attempts} times,\n but your local and environment's files still don't match.\n\n Make sure no one else is editing files on your environment, and try again.\n `;\n }\n}\n\nexport class DeployDisallowedError extends GGTError {\n isBug = IsBug.MAYBE;\n\n constructor(readonly fatalErrors: Problems) {\n super(\"This application is not allowed to be deployed due to fatal errors.\");\n }\n\n protected render(): string {\n let output = sprintln`{red Gadget has detected the following fatal errors with your files:}`;\n output += sprintProblems({ ensureEmptyLineAbove: true, problems: this.fatalErrors, showFileTypes: false });\n output += sprintln({ ensureEmptyLineAbove: true })`{red Please fix these errors and try again.}`;\n return output;\n }\n}\n\nexport const isFilesVersionMismatchError = (error: unknown): boolean => {\n if (error instanceof ClientError) {\n error = error.cause;\n }\n if (isGraphQLResult(error)) {\n error = error.errors;\n }\n if (isGraphQLErrors(error)) {\n error = error[0];\n }\n return isObject(error) && \"message\" in error && isString(error.message) && error.message.includes(\"Files version mismatch\");\n};\n\nexport const swallowFilesVersionMismatch = (ctx: Context, error: unknown): void => {\n if (isFilesVersionMismatchError(error)) {\n ctx.log.debug(\"swallowing files version mismatch\", { error });\n return;\n }\n throw error;\n};\n"],"names":["ClientError","sprintProblems","GGTError","IsBug","sprint","sprintln","isGraphQLErrors","isGraphQLResult","isObject","isString","YarnNotFoundError","render","constructor","isBug","NO","UnknownDirectoryError","cmd","ctx","command","dir","opts","directory","path","args","TooManyMergeAttemptsError","attempts","MAYBE","DeployDisallowedError","output","ensureEmptyLineAbove","problems","fatalErrors","showFileTypes","isFilesVersionMismatchError","error","cause","errors","message","includes","swallowFilesVersionMismatch","log","debug"],"mappings":";AAAA,SAASA,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,cAAc,QAAuB,wBAAwB;AACtE,SAASC,QAAQ,EAAEC,KAAK,QAAQ,sBAAsB;AACtD,SAASC,MAAM,EAAEC,QAAQ,QAAQ,sBAAsB;AACvD,SAASC,eAAe,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,gBAAgB;AAIrF,OAAO,MAAMC,0BAA0BR;IAO3BS,SAAiB;QACzB,OAAOP,MAAM,CAAC;;;;;;IAMd,CAAC;IACH;IAZAQ,aAAc;QACZ,KAAK,CAAC;QAHRC,uBAAAA,SAAQV,MAAMW,EAAE;IAIhB;AAWF;AAEA,OAAO,MAAMC,8BAA8Bb;IAU/BS,SAAiB;QACzB,MAAMK,MAAM,IAAI,CAACC,GAAG,CAACC,OAAO;QAC5B,MAAMC,MAAM,IAAI,CAACC,IAAI,CAACC,SAAS,CAACC,IAAI;QAEpC,OAAQN;YACN,KAAK;YACL,KAAK;gBACH,OAAOZ,MAAM,CA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