@bitgo/public-types 6.75.0 → 6.77.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.
@@ -10,3 +10,4 @@ export * from "./enterprise";
10
10
  export * from "./webauthn";
11
11
  export * from "./defi";
12
12
  export * from "./safe";
13
+ export * from "./key";
@@ -26,4 +26,5 @@ __exportStar(require("./enterprise"), exports);
26
26
  __exportStar(require("./webauthn"), exports);
27
27
  __exportStar(require("./defi"), exports);
28
28
  __exportStar(require("./safe"), exports);
29
+ __exportStar(require("./key"), exports);
29
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB;AACvB,wCAAsB"}
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/key/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
@@ -0,0 +1,17 @@
1
+ import * as t from "io-ts";
2
+ export declare const KeyBulkUpdateBody: t.TypeC<{
3
+ updates: t.ArrayC<t.IntersectionC<[t.TypeC<{
4
+ keyId: t.StringC;
5
+ encryptedPrv: t.StringC;
6
+ }>, t.PartialC<{
7
+ expectedOldEncryptedPrv: t.StringC;
8
+ }>]>>;
9
+ }>;
10
+ export type KeyBulkUpdateBody = t.TypeOf<typeof KeyBulkUpdateBody>;
11
+ export declare const KeyBulkUpdateResponse: t.TypeC<{
12
+ updates: t.ArrayC<t.TypeC<{
13
+ keyId: t.StringC;
14
+ updated: t.BooleanC;
15
+ }>>;
16
+ }>;
17
+ export type KeyBulkUpdateResponse = t.TypeOf<typeof KeyBulkUpdateResponse>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.KeyBulkUpdateResponse = exports.KeyBulkUpdateBody = void 0;
27
+ const t = __importStar(require("io-ts"));
28
+ const KeyBulkUpdate = t.intersection([
29
+ t.type({ keyId: t.string, encryptedPrv: t.string }),
30
+ t.partial({ expectedOldEncryptedPrv: t.string }),
31
+ ], "KeyBulkUpdate");
32
+ exports.KeyBulkUpdateBody = t.type({ updates: t.array(KeyBulkUpdate) }, "KeyBulkUpdateBody");
33
+ exports.KeyBulkUpdateResponse = t.type({ updates: t.array(t.type({ keyId: t.string, updated: t.boolean })) }, "KeyBulkUpdateResponse");
34
+ //# sourceMappingURL=requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/key/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,MAAM,aAAa,GAAG,CAAC,CAAC,YAAY,CAClC;IACE,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,CAAC,CAAC,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CACjD,EACD,eAAe,CAChB,CAAC;AAQW,QAAA,iBAAiB,GAAG,CAAC,CAAC,IAAI,CACrC,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,EACnC,mBAAmB,CACpB,CAAC;AAQW,QAAA,qBAAqB,GAAG,CAAC,CAAC,IAAI,CACzC,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EACrE,uBAAuB,CACxB,CAAC"}
@@ -3,6 +3,10 @@ export declare const InitializeSafeBody: t.TypeC<{
3
3
  label: t.StringC;
4
4
  }>;
5
5
  export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
6
+ export declare const UpdateSafeBody: t.TypeC<{
7
+ label: t.StringC;
8
+ }>;
9
+ export type UpdateSafeBody = t.TypeOf<typeof UpdateSafeBody>;
6
10
  export declare const InitializeSafeResponse: t.IntersectionC<[t.TypeC<{
7
11
  id: t.StringC;
8
12
  status: t.LiteralC<"initializing">;
@@ -23,11 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.FreezeSafeBody = exports.FinalizeSafeBody = exports.InitializeSafeResponse = exports.InitializeSafeBody = void 0;
26
+ exports.FreezeSafeBody = exports.FinalizeSafeBody = exports.InitializeSafeResponse = exports.UpdateSafeBody = exports.InitializeSafeBody = void 0;
27
27
  const t = __importStar(require("io-ts"));
28
28
  const io_ts_types_1 = require("io-ts-types");
29
29
  const rootKeys_1 = require("./rootKeys");
30
30
  exports.InitializeSafeBody = t.type({ label: t.string }, "InitializeSafeBody");
31
+ exports.UpdateSafeBody = t.type({ label: t.string }, "UpdateSafeBody");
31
32
  exports.InitializeSafeResponse = t.intersection([
32
33
  t.type({ id: t.string, status: t.literal("initializing") }),
33
34
  t.partial({ enabledRootSlots: t.array(rootKeys_1.RootKeyType) }),
@@ -1 +1 @@
1
- {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/safe/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgD;AAChD,yCAAuD;AAM1C,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CACtC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EACnB,oBAAoB,CACrB,CAAC;AAcW,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAW,CAAC,EAAE,CAAC;CACtD,EACD,wBAAwB,CACzB,CAAC;AAQW,QAAA,gBAAgB,GAAG,CAAC,CAAC,IAAI,CACpC,EAAE,QAAQ,EAAE,uBAAY,EAAE,EAC1B,kBAAkB,CACnB,CAAC;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,OAAO,CACrC,EAAE,OAAO,EAAE,+BAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAChD,gBAAgB,CACjB,CAAC"}
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/safe/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgD;AAChD,yCAAuD;AAM1C,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CACtC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EACnB,oBAAoB,CACrB,CAAC;AAKW,QAAA,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAc/D,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAW,CAAC,EAAE,CAAC;CACtD,EACD,wBAAwB,CACzB,CAAC;AAQW,QAAA,gBAAgB,GAAG,CAAC,CAAC,IAAI,CACpC,EAAE,QAAQ,EAAE,uBAAY,EAAE,EAC1B,kBAAkB,CACnB,CAAC;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,OAAO,CACrC,EAAE,OAAO,EAAE,+BAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAChD,gBAAgB,CACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgo/public-types",
3
- "version": "6.75.0",
3
+ "version": "6.77.0",
4
4
  "description": "Collection of types exposed externally as part of the BitGo public API",
5
5
  "license": "UNLICENSED",
6
6
  "author": "",
@@ -10,3 +10,4 @@ export * from "./enterprise";
10
10
  export * from "./webauthn";
11
11
  export * from "./defi";
12
12
  export * from "./safe";
13
+ export * from "./key";
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,33 @@
1
+ import * as t from "io-ts";
2
+
3
+ const KeyBulkUpdate = t.intersection(
4
+ [
5
+ t.type({ keyId: t.string, encryptedPrv: t.string }),
6
+ t.partial({ expectedOldEncryptedPrv: t.string }),
7
+ ],
8
+ "KeyBulkUpdate",
9
+ );
10
+
11
+ /**
12
+ * Request body for PUT /api/v2/key/bulk. Each update carries the client's re-encrypted,
13
+ * opaque key envelope; plaintext passphrases are never sent to the server. When present,
14
+ * `expectedOldEncryptedPrv` is used as a per-key compare-and-swap value so a stale rotation
15
+ * is rejected instead of silently mixing old and new envelopes.
16
+ */
17
+ export const KeyBulkUpdateBody = t.type(
18
+ { updates: t.array(KeyBulkUpdate) },
19
+ "KeyBulkUpdateBody",
20
+ );
21
+ /** @experimental */
22
+ export type KeyBulkUpdateBody = t.TypeOf<typeof KeyBulkUpdateBody>;
23
+
24
+ /**
25
+ * Response for PUT /api/v2/key/bulk. Each item reports whether the corresponding key envelope
26
+ * was updated; the full key document is intentionally not part of this wire contract.
27
+ */
28
+ export const KeyBulkUpdateResponse = t.type(
29
+ { updates: t.array(t.type({ keyId: t.string, updated: t.boolean })) },
30
+ "KeyBulkUpdateResponse",
31
+ );
32
+ /** @experimental */
33
+ export type KeyBulkUpdateResponse = t.TypeOf<typeof KeyBulkUpdateResponse>;
@@ -13,6 +13,11 @@ export const InitializeSafeBody = t.type(
13
13
  /** @experimental */
14
14
  export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
15
15
 
16
+ /** PUT /enterprise/:eId/safes/:safeId */
17
+ export const UpdateSafeBody = t.type({ label: t.string }, "UpdateSafeBody");
18
+ /** @experimental */
19
+ export type UpdateSafeBody = t.TypeOf<typeof UpdateSafeBody>;
20
+
16
21
  /**
17
22
  * Response for POST /enterprise/:eId/safes — Phase 1 creates metadata only, so the response
18
23
  * carries just the new safe's id and its always-`initializing` status (not a full `SafeData`),