@holochain/client 0.5.0 → 0.8.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.
- package/lib/api/admin/types.d.ts +5 -5
- package/lib/api/app/websocket.d.ts +1 -1
- package/lib/api/app/websocket.js +4 -4
- package/lib/api/app/websocket.js.map +1 -1
- package/lib/environments/launcher.js +2 -1
- package/lib/environments/launcher.js.map +1 -1
- package/lib/hdk/countersigning.d.ts +39 -0
- package/lib/hdk/countersigning.js +2 -0
- package/lib/hdk/countersigning.js.map +1 -0
- package/lib/hdk/dht-ops.js +14 -0
- package/lib/hdk/dht-ops.js.map +1 -1
- package/lib/hdk/entry.d.ts +2 -1
- package/lib/hdk/record.d.ts +2 -3
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +1 -1
- package/package.json +3 -1
- package/lib/bundle.d.ts +0 -6
- package/lib/bundle.js +0 -32
- package/lib/bundle.js.map +0 -1
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare type DumpFullStateResponse = FullStateDump;
|
|
|
77
77
|
export declare type GenerateAgentPubKeyRequest = void;
|
|
78
78
|
export declare type GenerateAgentPubKeyResponse = AgentPubKey;
|
|
79
79
|
export declare type RegisterDnaRequest = {
|
|
80
|
-
|
|
80
|
+
network_seed?: string;
|
|
81
81
|
properties?: DnaProperties;
|
|
82
82
|
} & DnaSource;
|
|
83
83
|
export declare type RegisterDnaResponse = HoloHash;
|
|
@@ -133,7 +133,7 @@ export declare type DnaVersionFlexible = {
|
|
|
133
133
|
export declare type AppRoleDnaManifest = {
|
|
134
134
|
location?: Location;
|
|
135
135
|
properties?: DnaProperties;
|
|
136
|
-
|
|
136
|
+
network_seed?: NetworkSeed;
|
|
137
137
|
version?: DnaVersionFlexible;
|
|
138
138
|
};
|
|
139
139
|
export declare type AppRoleManifest = {
|
|
@@ -156,14 +156,14 @@ export declare type AppBundleSource = {
|
|
|
156
156
|
} | {
|
|
157
157
|
path: string;
|
|
158
158
|
};
|
|
159
|
-
export declare type
|
|
159
|
+
export declare type NetworkSeed = string;
|
|
160
160
|
export declare type InstallAppBundleRequest = {
|
|
161
161
|
agent_key: AgentPubKey;
|
|
162
162
|
installed_app_id?: InstalledAppId;
|
|
163
163
|
membrane_proofs: {
|
|
164
164
|
[key: string]: MembraneProof;
|
|
165
165
|
};
|
|
166
|
-
|
|
166
|
+
network_seed?: NetworkSeed;
|
|
167
167
|
} & AppBundleSource;
|
|
168
168
|
export declare type InstallAppBundleResponse = InstalledAppInfo;
|
|
169
169
|
export declare type ListDnasRequest = void;
|
|
@@ -236,7 +236,7 @@ export declare type ZomeManifest = {
|
|
|
236
236
|
export declare type DnaManifest = {
|
|
237
237
|
manifest_version: string;
|
|
238
238
|
name: string;
|
|
239
|
-
|
|
239
|
+
network_seed?: NetworkSeed;
|
|
240
240
|
properties?: DnaProperties;
|
|
241
241
|
zomes: Array<ZomeManifest>;
|
|
242
242
|
};
|
|
@@ -5,7 +5,7 @@ import { AppApi, AppInfoRequest, AppInfoResponse, AppSignalCb, CallZomeRequestGe
|
|
|
5
5
|
export declare class AppWebsocket implements AppApi {
|
|
6
6
|
client: WsClient;
|
|
7
7
|
defaultTimeout: number;
|
|
8
|
-
|
|
8
|
+
overrideInstalledAppId?: InstalledAppId;
|
|
9
9
|
constructor(client: WsClient, defaultTimeout?: number, overrideInstalledAppId?: InstalledAppId);
|
|
10
10
|
static connect(url: string, defaultTimeout?: number, signalCb?: AppSignalCb): Promise<AppWebsocket>;
|
|
11
11
|
_requester: <ReqO, ReqI, ResI, ResO>(tag: string, transformer?: Transformer<ReqO, ReqI, ResI, ResO> | undefined) => (req: ReqO, timeout?: number | undefined) => Promise<ResO>;
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -39,7 +39,7 @@ export class AppWebsocket {
|
|
|
39
39
|
return new AppWebsocket(wsClient, defaultTimeout, env ? env.INSTALLED_APP_ID : undefined);
|
|
40
40
|
}
|
|
41
41
|
_requester = (tag, transformer) => requesterTransformer((req, timeout) => promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(catchError), tag, transformer);
|
|
42
|
-
appInfo = this._requester("app_info", appInfoTransform(this
|
|
42
|
+
appInfo = this._requester("app_info", appInfoTransform(this));
|
|
43
43
|
callZome = this._requester("zome_call", callZomeTransform);
|
|
44
44
|
}
|
|
45
45
|
const callZomeTransform = {
|
|
@@ -53,11 +53,11 @@ const callZomeTransform = {
|
|
|
53
53
|
return decode(res);
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
-
const appInfoTransform = (
|
|
56
|
+
const appInfoTransform = (appWs) => ({
|
|
57
57
|
input: (req) => {
|
|
58
|
-
if (overrideInstalledAppId) {
|
|
58
|
+
if (appWs.overrideInstalledAppId) {
|
|
59
59
|
return {
|
|
60
|
-
installed_app_id: overrideInstalledAppId,
|
|
60
|
+
installed_app_id: appWs.overrideInstalledAppId,
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
return req;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/app/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EAEd,oBAAoB,GAErB,MAAM,cAAc,CAAC;AAUtB,MAAM,OAAO,YAAY;IACvB,MAAM,CAAW;IACjB,cAAc,CAAS;
|
|
1
|
+
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/app/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,E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Ac,CAC/B,CAAC,IAAI,CAAC,UAAU,CAAC,EACpB,GAAG,EACH,WAAW,CACZ,CAAC;IAEJ,OAAO,GAA+C,IAAI,CAAC,UAAU,CACnE,UAAU,EACV,gBAAgB,CAAC,IAAI,CAAC,CACvB,CAAC;IACF,QAAQ,GAGJ,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;CACrD;AAED,MAAM,iBAAiB,GAKnB;IACF,KAAK,EAAE,CACL,GAAgC,EACI,EAAE;QACtC,OAAO;YACL,GAAG,GAAG;YACN,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC7B,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,CACN,GAAwC,EACV,EAAE;QAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACvB,KAAmB,EAMnB,EAAE,CAAC,CAAC;IACJ,KAAK,EAAE,CAAC,GAAmB,EAAkB,EAAE;QAC7C,IAAI,KAAK,CAAC,sBAAsB,EAAE;YAChC,OAAO;gBACL,gBAAgB,EAAE,KAAK,CAAC,sBAAsB;aAC/C,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,EAAE,CAAC,GAAoB,EAAmB,EAAE;QAChD,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fetch from "cross-fetch";
|
|
2
|
-
// This is
|
|
2
|
+
// This is based on
|
|
3
|
+
// https://github.com/holochain/launcher/blob/213aae208c58f2496811d80859723b71f6750426/crates/holochain_web_app_manager/src/caddy/utils.rs#L49
|
|
3
4
|
export const LAUNCHER_ENV_URL = "/.launcher-env.json";
|
|
4
5
|
async function fetchLauncherEnvironment() {
|
|
5
6
|
const env = await fetch(LAUNCHER_ENV_URL);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/environments/launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/environments/launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,mBAAmB;AACnB,8IAA8I;AAC9I,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAQtD,KAAK,UAAU,wBAAwB;IAGrC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE1C,IAAI,GAAG,CAAC,EAAE,EAAE;QACV,MAAM,mBAAmB,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,mBAAmB,CAAC;KAC5B;SAAM;QACL,yCAAyC;QACzC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;YACtB,OAAO,CAAC,IAAI,CACV,uSAAuS,CACxS,CAAC;YACF,OAAO,SAAS,CAAC;SAClB;aAAM;YACL,MAAM,IAAI,KAAK,CACb,mDAAmD,GAAG,CAAC,UAAU,EAAE,CACpE,CAAC;SACH;KACF;AACH,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAChD,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,WAAW;IAC9B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;AAE3C,IAAI,OAAqB,CAAC;AAE1B,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE;IACxB,OAAO,GAAG,wBAAwB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CAC3D;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAG1C,IAAI,SAAS,EAAE;QACb,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ActionHash, AgentPubKey, EntryHash, Signature, Timestamp } from "../types";
|
|
2
|
+
import { EntryType } from "./entry";
|
|
3
|
+
export interface CounterSigningSessionData {
|
|
4
|
+
preflight_request: PreflightRequest;
|
|
5
|
+
responses: Array<[CountersigningAgentState, Signature]>;
|
|
6
|
+
}
|
|
7
|
+
export interface PreflightRequest {
|
|
8
|
+
app_entry_hash: EntryHash;
|
|
9
|
+
signing_agents: CounterSigningAgents;
|
|
10
|
+
enzyme_index: number | undefined;
|
|
11
|
+
session_times: CounterSigningSessionTimes;
|
|
12
|
+
action_base: ActionBase;
|
|
13
|
+
preflight_bytes: PreflightBytes;
|
|
14
|
+
}
|
|
15
|
+
export interface CounterSigningSessionTimes {
|
|
16
|
+
start: Timestamp;
|
|
17
|
+
end: Timestamp;
|
|
18
|
+
}
|
|
19
|
+
export declare type ActionBase = {
|
|
20
|
+
Create: CreateBase;
|
|
21
|
+
} | {
|
|
22
|
+
Update: UpdateBase;
|
|
23
|
+
};
|
|
24
|
+
export interface CreateBase {
|
|
25
|
+
entry_type: EntryType;
|
|
26
|
+
}
|
|
27
|
+
export interface UpdateBase {
|
|
28
|
+
original_action_address: ActionHash;
|
|
29
|
+
original_entry_address: EntryHash;
|
|
30
|
+
entry_type: EntryType;
|
|
31
|
+
}
|
|
32
|
+
export declare type CounterSigningAgents = Array<[AgentPubKey, Array<Role>]>;
|
|
33
|
+
export declare type PreflightBytes = Uint8Array;
|
|
34
|
+
export declare type Role = number;
|
|
35
|
+
export interface CountersigningAgentState {
|
|
36
|
+
agent_index: number;
|
|
37
|
+
chain_top: ActionHash;
|
|
38
|
+
action_seq: number;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countersigning.js","sourceRoot":"","sources":["../../src/hdk/countersigning.ts"],"names":[],"mappings":""}
|
package/lib/hdk/dht-ops.js
CHANGED
|
@@ -15,7 +15,21 @@ export function getDhtOpType(op) {
|
|
|
15
15
|
return Object.keys(op)[0];
|
|
16
16
|
}
|
|
17
17
|
export function getDhtOpAction(op) {
|
|
18
|
+
const opType = getDhtOpType(op);
|
|
18
19
|
const action = Object.values(op)[0][1];
|
|
20
|
+
if (opType === DhtOpType.RegisterAddLink) {
|
|
21
|
+
return {
|
|
22
|
+
type: "CreateLink",
|
|
23
|
+
...action,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (opType === DhtOpType.RegisterUpdatedContent ||
|
|
27
|
+
opType === DhtOpType.RegisterUpdatedRecord) {
|
|
28
|
+
return {
|
|
29
|
+
type: "Update",
|
|
30
|
+
...action,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
19
33
|
if (action.author)
|
|
20
34
|
return action;
|
|
21
35
|
else {
|
package/lib/hdk/dht-ops.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dht-ops.js","sourceRoot":"","sources":["../../src/hdk/dht-ops.ts"],"names":[],"mappings":"AAWA,iFAAiF;AAEjF,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,sCAAyB,CAAA;IACzB,4DAA+C,CAAA;IAC/C,8DAAiD,CAAA;IACjD,4DAA+C,CAAA;IAC/C,oDAAuC,CAAA;IACvC,sEAAyD,CAAA;IACzD,gDAAmC,CAAA;IACnC,sDAAyC,CAAA;AAC3C,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB;AAqBD,MAAM,UAAU,YAAY,CAAC,EAAS;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAc,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAS;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvC,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO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AAO;YACL,IAAI,EAAE,YAAY;YAClB,GAAG,MAAM;SACV,CAAC;KACH;IACD,IACE,MAAM,KAAK,SAAS,CAAC,sBAAsB;QAC3C,MAAM,KAAK,SAAS,CAAC,qBAAqB,EAC1C;QACA,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,GAAG,MAAM;SACV,CAAC;KACH;IAED,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;SAC5B;QACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,GAAG,MAAM,CAAC,UAAU,CAAC;SACtB,CAAC;KACH;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAS;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAS;IACzC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
package/lib/hdk/entry.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CapClaim, ZomeCallCapGrant } from "./capabilities.js";
|
|
2
2
|
import { AgentPubKey } from "../types.js";
|
|
3
|
+
import { CounterSigningSessionData } from "./countersigning.js";
|
|
3
4
|
export declare type EntryVisibility = "Public" | "Private";
|
|
4
5
|
export declare type AppEntryType = {
|
|
5
6
|
id: number;
|
|
@@ -13,4 +14,4 @@ export interface EntryContent<E extends string, C> {
|
|
|
13
14
|
entry_type: E;
|
|
14
15
|
entry: C;
|
|
15
16
|
}
|
|
16
|
-
export declare type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App",
|
|
17
|
+
export declare type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
|
package/lib/hdk/record.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SignedActionHashed } from "./action.js";
|
|
2
|
+
import { Entry } from "./entry.js";
|
|
2
3
|
export declare type Record = {
|
|
3
4
|
signed_action: SignedActionHashed;
|
|
4
5
|
entry: RecordEntry;
|
|
5
6
|
};
|
|
6
7
|
export declare type RecordEntry = {
|
|
7
|
-
Present:
|
|
8
|
-
entry: Uint8Array;
|
|
9
|
-
};
|
|
8
|
+
Present: Entry;
|
|
10
9
|
} | {
|
|
11
10
|
Hidden: void;
|
|
12
11
|
} | {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare type KitsuneAgent = Uint8Array;
|
|
|
8
8
|
export declare type KitsuneSpace = Uint8Array;
|
|
9
9
|
export declare type InstalledAppId = string;
|
|
10
10
|
export declare type Signature = Uint8Array;
|
|
11
|
-
export declare type CellId = [
|
|
11
|
+
export declare type CellId = [DnaHash, AgentPubKey];
|
|
12
12
|
export declare type DnaProperties = any;
|
|
13
13
|
export declare type RoleId = string;
|
|
14
14
|
export declare type InstalledCell = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A JavaScript client for the Holochain Conductor API",
|
|
5
5
|
"author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
|
|
6
6
|
"license": "CAL-1.0",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": "^14.13.1 || >=16.0.0 || >=18.0.0"
|
|
22
22
|
},
|
|
23
|
+
"main": "lib/index.js",
|
|
24
|
+
"module": "lib/index.js",
|
|
23
25
|
"type": "module",
|
|
24
26
|
"exports": {
|
|
25
27
|
".": "./lib/index.js"
|
package/lib/bundle.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AppBundleSource } from "./api/index.js";
|
|
2
|
-
import { DnaProperties } from "./types.js";
|
|
3
|
-
export declare type HappProperties = {
|
|
4
|
-
[role_id: string]: DnaProperties;
|
|
5
|
-
};
|
|
6
|
-
export declare const appBundleWithProperties: (source: AppBundleSource, properties: HappProperties) => Promise<AppBundleSource>;
|
package/lib/bundle.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { decode } from "@msgpack/msgpack";
|
|
2
|
-
const readAppBundleFromPath = async (path) => {
|
|
3
|
-
const isBrowser = typeof window !== "undefined";
|
|
4
|
-
if (isBrowser) {
|
|
5
|
-
throw new Error("Cannot read app bundle from path in browser context");
|
|
6
|
-
}
|
|
7
|
-
const { promises: { readFile }, } = await import("node:fs");
|
|
8
|
-
const { gunzip } = await import("node:zlib");
|
|
9
|
-
const compressed = await readFile(path);
|
|
10
|
-
const encoded = await new Promise((resolve, reject) => gunzip(compressed, (err, bytes) => err === null ? resolve(bytes) : reject(err)));
|
|
11
|
-
return decode(encoded);
|
|
12
|
-
};
|
|
13
|
-
/// Adds properties to app bundle. Requires node if passed a path.
|
|
14
|
-
export const appBundleWithProperties = async (source, properties) => {
|
|
15
|
-
const originalBundle = "path" in source ? await readAppBundleFromPath(source.path) : source.bundle;
|
|
16
|
-
return {
|
|
17
|
-
bundle: {
|
|
18
|
-
...originalBundle,
|
|
19
|
-
manifest: {
|
|
20
|
-
...originalBundle.manifest,
|
|
21
|
-
roles: originalBundle.manifest.roles.map((roleManifest) => ({
|
|
22
|
-
...roleManifest,
|
|
23
|
-
dna: {
|
|
24
|
-
...roleManifest.dna,
|
|
25
|
-
properties: properties[roleManifest.id],
|
|
26
|
-
},
|
|
27
|
-
})),
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=bundle.js.map
|
package/lib/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAM1C,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAAY,EAAsB,EAAE;IACvE,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;IAChD,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KACxE;IACD,MAAM,EACJ,QAAQ,EAAE,EAAE,QAAQ,EAAE,GACvB,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;IAE7C,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,OAAO,GAAe,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAChE,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAChC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,C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