@extension.dev/deploy 0.1.0 → 0.2.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.
@@ -0,0 +1,75 @@
1
+ import { verifyChromeCredentials } from "./chrome";
2
+ import { verifyFirefoxCredentials } from "./firefox";
3
+ import { verifyEdgeCredentials } from "./edge";
4
+ export type InitStoreKey = "chrome" | "firefox" | "edge";
5
+ export interface InitIO {
6
+ prompt(question: string, opts?: {
7
+ secret?: boolean;
8
+ default?: string;
9
+ }): Promise<string>;
10
+ confirm(question: string, defaultValue?: boolean): Promise<boolean>;
11
+ multiselect(question: string, choices: readonly {
12
+ value: InitStoreKey;
13
+ label: string;
14
+ }[]): Promise<InitStoreKey[]>;
15
+ log(message: string): void;
16
+ }
17
+ export interface InitDeps {
18
+ io: InitIO;
19
+ cwd: string;
20
+ writeFile: (filePath: string, content: string) => Promise<void>;
21
+ fileExists: (filePath: string) => Promise<boolean>;
22
+ fetchImpl?: typeof fetch;
23
+ verifyChrome?: typeof verifyChromeCredentials;
24
+ verifyFirefox?: typeof verifyFirefoxCredentials;
25
+ verifyEdge?: typeof verifyEdgeCredentials;
26
+ }
27
+ export interface InitOptions {
28
+ /** Skip the interactive store picker. */
29
+ stores?: InitStoreKey[];
30
+ /** Skip running verifyCredentials for each store after collecting creds. */
31
+ skipVerify?: boolean;
32
+ /** Overwrite .env.submit without prompting. */
33
+ force?: boolean;
34
+ /** Destination file (default ".env.submit"). Relative to cwd if not absolute. */
35
+ outputPath?: string;
36
+ }
37
+ export interface StoreVerifyRecord {
38
+ ok: boolean;
39
+ message: string;
40
+ }
41
+ export interface InitResult {
42
+ stores: InitStoreKey[];
43
+ envPath: string;
44
+ envContent: string;
45
+ verified: Partial<Record<InitStoreKey, StoreVerifyRecord>>;
46
+ wrote: boolean;
47
+ }
48
+ export declare function runInit(deps: InitDeps, options?: InitOptions): Promise<InitResult>;
49
+ export interface ChromeCredentials {
50
+ extensionId: string;
51
+ clientId: string;
52
+ clientSecret: string;
53
+ refreshToken: string;
54
+ }
55
+ export declare function collectChromeCredentials(deps: InitDeps): Promise<ChromeCredentials>;
56
+ export declare function buildChromeAuthUrl(clientId: string): string;
57
+ export declare function exchangeChromeAuthCode(input: {
58
+ clientId: string;
59
+ clientSecret: string;
60
+ authCode: string;
61
+ fetchImpl?: typeof fetch;
62
+ }): Promise<string>;
63
+ export interface FirefoxCredentials {
64
+ addonId: string;
65
+ jwtIssuer: string;
66
+ jwtSecret: string;
67
+ }
68
+ export declare function collectFirefoxCredentials(deps: InitDeps): Promise<FirefoxCredentials>;
69
+ export interface EdgeCredentials {
70
+ productId: string;
71
+ clientId: string;
72
+ apiKey: string;
73
+ }
74
+ export declare function collectEdgeCredentials(deps: InitDeps): Promise<EdgeCredentials>;
75
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EAExB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EAEtB,MAAM,QAAQ,CAAC;AAEhB,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,MAAM;IACrB,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,KAAK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,OAAO,CAAC,UAAU,CAAC,CAqIrB;AAID,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,iBAAiB,CAAC,CAiC5B;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CAiClB;AA4BD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,kBAAkB,CAAC,CAsB7B;AAID,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,eAAe,CAAC,CAkB1B"}
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "ci",
14
14
  "automation"
15
15
  ],
16
- "version": "0.1.0",
16
+ "version": "0.2.0",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/extensiondev/deploy.git"
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "bin": {
38
- "extension-deploy": "./bin/extension-deploy.cjs"
38
+ "extension-deploy": "bin/extension-deploy.cjs"
39
39
  },
40
40
  "main": "./dist/module.js",
41
41
  "types": "./dist/module.d.ts",