@todesktop/shared 7.188.36 → 7.188.38

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/lib/base.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ExtraFileReference, FilePath, IAppBuilderLib, Release } from './desktopify';
1
+ import { ExtraFileReference, FilePath, IAppBuilderLib, PlatformName, Release } from './desktopify';
2
2
  export interface Schemable {
3
3
  schemaVersion?: number;
4
4
  }
@@ -218,6 +218,10 @@ export declare type ReleaseRedirectionRule = {
218
218
  buildId: string;
219
219
  ipList: string[];
220
220
  rule: 'buildByIp';
221
+ } | {
222
+ buildId: string;
223
+ platforms: PlatformName[];
224
+ rule: 'buildByPlatform';
221
225
  };
222
226
  export interface BaseApp extends Schemable {
223
227
  id: string;
package/lib/hsm.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
3
+ * This function returns the key name that is used for certificate files that have a `.p12` postfix.
4
+ *
5
+ * @param appId the application id
6
+ * @param artifact the mac artifact type
7
+ * @returns the name of the secret that is required for downloading the cert from HSM.
8
+ */
9
+ export declare const getMacCertificateNameFromHSM: (appId: string, artifact: 'mac' | 'mas' | 'mas-dev') => string;
10
+ /**
11
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
12
+ * This function returns the key name that is used for key files that have a `.p8` postfix.
13
+ *
14
+ * @param appId the application id
15
+ * @param artifact the mac artifact type
16
+ * @returns the name of the secret that is required for downloading the cert from HSM.
17
+ */
18
+ export declare const getMacAPIKeyNameFromHSM: (appId: string, artifact: 'mac' | 'mas' | 'mas-dev') => string;
package/lib/hsm.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMacAPIKeyNameFromHSM = exports.getMacCertificateNameFromHSM = void 0;
4
+ /**
5
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
6
+ * This function returns the key name that is used for certificate files that have a `.p12` postfix.
7
+ *
8
+ * @param appId the application id
9
+ * @param artifact the mac artifact type
10
+ * @returns the name of the secret that is required for downloading the cert from HSM.
11
+ */
12
+ exports.getMacCertificateNameFromHSM = (appId, artifact) => {
13
+ return `todesktop-${appId}-${artifact}-cert`;
14
+ };
15
+ /**
16
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
17
+ * This function returns the key name that is used for key files that have a `.p8` postfix.
18
+ *
19
+ * @param appId the application id
20
+ * @param artifact the mac artifact type
21
+ * @returns the name of the secret that is required for downloading the cert from HSM.
22
+ */
23
+ exports.getMacAPIKeyNameFromHSM = (appId, artifact) => {
24
+ return `todesktop-${appId}-${artifact}-api-key`;
25
+ };
package/lib/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './getSiteInfo';
5
5
  export * from './plans';
6
6
  export * from './base';
7
7
  export * from './plugin';
8
+ export * from './hsm';
8
9
  export * from './desktopify2';
9
10
  declare const schemaVersion: string;
10
11
  export { schemaVersion };
package/lib/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./getSiteInfo"), exports);
19
19
  __exportStar(require("./plans"), exports);
20
20
  __exportStar(require("./base"), exports);
21
21
  __exportStar(require("./plugin"), exports);
22
+ __exportStar(require("./hsm"), exports);
22
23
  __exportStar(require("./desktopify2"), exports);
23
24
  const schemaVersion = package_json_1.version;
24
25
  exports.schemaVersion = schemaVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.188.36",
3
+ "version": "7.188.38",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/base.ts CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  ExtraFileReference,
3
3
  FilePath,
4
4
  IAppBuilderLib,
5
+ PlatformName,
5
6
  Release,
6
7
  } from './desktopify';
7
8
  export interface Schemable {
@@ -248,6 +249,11 @@ export type ReleaseRedirectionRule =
248
249
  buildId: string;
249
250
  ipList: string[];
250
251
  rule: 'buildByIp';
252
+ }
253
+ | {
254
+ buildId: string;
255
+ platforms: PlatformName[];
256
+ rule: 'buildByPlatform';
251
257
  };
252
258
 
253
259
  export interface BaseApp extends Schemable {
package/src/hsm.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
3
+ * This function returns the key name that is used for certificate files that have a `.p12` postfix.
4
+ *
5
+ * @param appId the application id
6
+ * @param artifact the mac artifact type
7
+ * @returns the name of the secret that is required for downloading the cert from HSM.
8
+ */
9
+ export const getMacCertificateNameFromHSM = (
10
+ appId: string,
11
+ artifact: 'mac' | 'mas' | 'mas-dev'
12
+ ) => {
13
+ return `todesktop-${appId}-${artifact}-cert`;
14
+ };
15
+
16
+ /**
17
+ * Files that are uploaded to HSM have a unique secretName that depends on the appId and artifact.
18
+ * This function returns the key name that is used for key files that have a `.p8` postfix.
19
+ *
20
+ * @param appId the application id
21
+ * @param artifact the mac artifact type
22
+ * @returns the name of the secret that is required for downloading the cert from HSM.
23
+ */
24
+ export const getMacAPIKeyNameFromHSM = (
25
+ appId: string,
26
+ artifact: 'mac' | 'mas' | 'mas-dev'
27
+ ) => {
28
+ return `todesktop-${appId}-${artifact}-api-key`;
29
+ };
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from './getSiteInfo';
7
7
  export * from './plans';
8
8
  export * from './base';
9
9
  export * from './plugin';
10
+ export * from './hsm';
10
11
 
11
12
  export * from './desktopify2';
12
13