@devtion/devcli 0.0.0-004e6ad

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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +120 -0
  3. package/dist/.env +55 -0
  4. package/dist/index.js +3635 -0
  5. package/dist/public/mini-semaphore.wasm +0 -0
  6. package/dist/public/mini-semaphore.zkey +0 -0
  7. package/dist/types/commands/auth.d.ts +25 -0
  8. package/dist/types/commands/authBandada.d.ts +2 -0
  9. package/dist/types/commands/authSIWE.d.ts +7 -0
  10. package/dist/types/commands/ceremony/index.d.ts +3 -0
  11. package/dist/types/commands/ceremony/listParticipants.d.ts +2 -0
  12. package/dist/types/commands/clean.d.ts +6 -0
  13. package/dist/types/commands/contribute.d.ts +139 -0
  14. package/dist/types/commands/finalize.d.ts +52 -0
  15. package/dist/types/commands/index.d.ts +11 -0
  16. package/dist/types/commands/listCeremonies.d.ts +5 -0
  17. package/dist/types/commands/logout.d.ts +6 -0
  18. package/dist/types/commands/observe.d.ts +22 -0
  19. package/dist/types/commands/setup.d.ts +86 -0
  20. package/dist/types/commands/validate.d.ts +8 -0
  21. package/dist/types/index.d.ts +2 -0
  22. package/dist/types/lib/bandada.d.ts +6 -0
  23. package/dist/types/lib/errors.d.ts +60 -0
  24. package/dist/types/lib/files.d.ts +65 -0
  25. package/dist/types/lib/localConfigs.d.ts +148 -0
  26. package/dist/types/lib/prompts.d.ts +104 -0
  27. package/dist/types/lib/services.d.ts +31 -0
  28. package/dist/types/lib/theme.d.ts +42 -0
  29. package/dist/types/lib/utils.d.ts +159 -0
  30. package/dist/types/types/index.d.ts +134 -0
  31. package/package.json +108 -0
  32. package/src/commands/auth.ts +214 -0
  33. package/src/commands/authBandada.ts +120 -0
  34. package/src/commands/authSIWE.ts +185 -0
  35. package/src/commands/ceremony/index.ts +20 -0
  36. package/src/commands/ceremony/listParticipants.ts +56 -0
  37. package/src/commands/clean.ts +49 -0
  38. package/src/commands/contribute.ts +1116 -0
  39. package/src/commands/finalize.ts +395 -0
  40. package/src/commands/index.ts +11 -0
  41. package/src/commands/listCeremonies.ts +31 -0
  42. package/src/commands/logout.ts +69 -0
  43. package/src/commands/observe.ts +197 -0
  44. package/src/commands/setup.ts +912 -0
  45. package/src/commands/validate.ts +28 -0
  46. package/src/index.ts +88 -0
  47. package/src/lib/bandada.ts +51 -0
  48. package/src/lib/errors.ts +77 -0
  49. package/src/lib/files.ts +102 -0
  50. package/src/lib/localConfigs.ts +240 -0
  51. package/src/lib/prompts.ts +745 -0
  52. package/src/lib/services.ts +214 -0
  53. package/src/lib/theme.ts +45 -0
  54. package/src/lib/utils.ts +813 -0
  55. package/src/types/conf.d.ts +16 -0
  56. package/src/types/index.ts +145 -0
@@ -0,0 +1,16 @@
1
+ declare module "conf" {
2
+ export interface ConfOptions {
3
+ projectName: string
4
+ schema: object
5
+ }
6
+
7
+ export class Conf {
8
+ constructor(options: ConfOptions)
9
+ get(key: string): any
10
+ set(key: string, value: any): void
11
+ delete(key: string): void
12
+ has(key: string): boolean
13
+ }
14
+
15
+ export default Conf
16
+ }
@@ -0,0 +1,145 @@
1
+ import { User as FirebaseAuthUser } from "firebase/auth"
2
+
3
+ /**
4
+ * Different custom progress bar types.
5
+ * @enum {string}
6
+ */
7
+ export enum ProgressBarType {
8
+ DOWNLOAD = "DOWNLOAD",
9
+ UPLOAD = "UPLOAD"
10
+ }
11
+
12
+ /**
13
+ * Define the current authenticated user in the Firebase app.
14
+ * @typedef {Object} AuthUser
15
+ * @property {FirebaseAuthUser} user - the instance of the Firebase authenticated user.
16
+ * @property {string} token - the access token.
17
+ * @property {string} providerUserId - the unique identifier of the user tied to its account from a third party provider (e.g., Github).
18
+ */
19
+ export type AuthUser = {
20
+ user: FirebaseAuthUser
21
+ token: string
22
+ providerUserId: string
23
+ }
24
+
25
+ /**
26
+ * Define a custom object for time management tasks.
27
+ * @typedef {Object} Timing
28
+ * @property {number} seconds
29
+ * @property {number} minutes
30
+ * @property {number} hours
31
+ * @property {number} days
32
+ */
33
+ export type Timing = {
34
+ seconds: number
35
+ minutes: number
36
+ hours: number
37
+ days: number
38
+ }
39
+
40
+ /**
41
+ * Define a custom object containing contribution verification data.
42
+ * @typedef {Object} VerifyContributionComputation
43
+ * @property {boolean} valid - true if the contribution is valid; otherwise false.
44
+ * @property {number} verificationComputationTime - the time spent for completing the verification task only.
45
+ * @property {number} verifyCloudFunctionTime - the time spent for the execution of the verify contribution cloud function.
46
+ * @property {number} fullContributionTime - the time spent while contributing (from download to upload).
47
+ */
48
+ export type VerifyContributionComputation = {
49
+ valid: boolean
50
+ verificationComputationTime: number
51
+ verifyCloudFunctionTime: number
52
+ fullContributionTime: number
53
+ }
54
+
55
+ /**
56
+ * Define a custom object containing a Github Gist file data.
57
+ * @typedef {Object} GithubGistFile
58
+ * @property {string} filename - the name of the file.
59
+ * @property {string} type - the type of the content of the file (e.g., text/plain).
60
+ * @property {string} language - the type of file (e.g, Text, Markdown).
61
+ * @property {string} raw_url - the url to file content.
62
+ * @property {number} size - the size of the file (in bytes).
63
+ */
64
+ export type GithubGistFile = {
65
+ filename: string
66
+ type: string
67
+ language: string
68
+ raw_url: string
69
+ size: number
70
+ }
71
+
72
+ /**
73
+ * Define the return object of the function that verifies the Bandada membership and proof.
74
+ * @typedef {Object} VerifiedBandadaResponse
75
+ * @property {boolean} valid - true if the proof is valid and the user is a member of the group; otherwise false.
76
+ * @property {string} message - a message describing the result of the verification.
77
+ * @property {string} token - the custom access token.
78
+ */
79
+ export type VerifiedBandadaResponse = {
80
+ valid: boolean
81
+ message: string
82
+ token: string
83
+ }
84
+
85
+ /**
86
+ * Define the return object of the device code uri request.
87
+ * @typedef {Object} OAuthDeviceCodeResponse
88
+ * @property {string} device_code - the device code.
89
+ * @property {string} user_code - the user code.
90
+ * @property {string} verification_uri - the verification uri.
91
+ * @property {number} expires_in - the expiration time in seconds.
92
+ * @property {number} interval - the interval time in seconds.
93
+ * @property {string} verification_uri_complete - the complete verification uri.
94
+ * @property {string} error - in case there was an error, show the code
95
+ * @property {string} error_description - error details.
96
+ * @property {string} error_uri - error uri.
97
+ */
98
+ export type OAuthDeviceCodeResponse = {
99
+ device_code: string
100
+ user_code: string
101
+ verification_uri: string
102
+ expires_in: number
103
+ interval: number
104
+ verification_uri_complete: string
105
+ // error response should contain
106
+ error?: string
107
+ error_description?: string
108
+ error_uri?: string
109
+ }
110
+
111
+ /**
112
+ * Define the return object of the polling endpoint
113
+ * @typedef {Object} OAuthTokenResponse
114
+ * @property {string} access_token - the resulting device flow token
115
+ * @property {string} token_type - token type
116
+ * @property {number} expires_in - when does the token expires
117
+ * @property {string} scope - the scope requested by the initial device flow endpoint
118
+ * @property {string} refresh_token - refresh token
119
+ * @property {string} id_token - id token
120
+ * @property {string} error - in case there was an error, show the code
121
+ * @property {string} error_description - error details
122
+ */
123
+ export type OAuthTokenResponse = {
124
+ access_token: string
125
+ token_type: string
126
+ expires_in: number
127
+ scope: string
128
+ refresh_token: string
129
+ id_token: string
130
+ // error response should contain
131
+ error?: string
132
+ error_description?: string
133
+ }
134
+
135
+ /**
136
+ * @typedef {Object} CheckNonceOfSIWEAddressResponse
137
+ * @property {boolean} valid - if the checking was valid or not
138
+ * @property {string} message - more information about the validity
139
+ * @property {string} token - token to sign into Firebase
140
+ */
141
+ export type CheckNonceOfSIWEAddressResponse = {
142
+ valid: boolean
143
+ message: string
144
+ token: string
145
+ }