@towns-labs/sdk 2.0.4 → 2.0.6

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 (91) hide show
  1. package/dist/createApp.d.ts.map +1 -1
  2. package/dist/createApp.js +7 -1
  3. package/dist/createApp.js.map +1 -1
  4. package/dist/id.d.ts +1 -0
  5. package/dist/id.d.ts.map +1 -1
  6. package/dist/id.js +3 -0
  7. package/dist/id.js.map +1 -1
  8. package/dist/sync-agent/dms/models/dm.d.ts +2 -4
  9. package/dist/sync-agent/dms/models/dm.d.ts.map +1 -1
  10. package/dist/sync-agent/dms/models/dm.js +2 -30
  11. package/dist/sync-agent/dms/models/dm.js.map +1 -1
  12. package/dist/sync-agent/gdms/models/gdm.d.ts +2 -4
  13. package/dist/sync-agent/gdms/models/gdm.d.ts.map +1 -1
  14. package/dist/sync-agent/gdms/models/gdm.js +2 -30
  15. package/dist/sync-agent/gdms/models/gdm.js.map +1 -1
  16. package/dist/sync-agent/river-connection/riverConnection.d.ts +1 -3
  17. package/dist/sync-agent/river-connection/riverConnection.d.ts.map +1 -1
  18. package/dist/sync-agent/river-connection/riverConnection.js +5 -3
  19. package/dist/sync-agent/river-connection/riverConnection.js.map +1 -1
  20. package/dist/sync-agent/spaces/models/channel.d.ts +3 -6
  21. package/dist/sync-agent/spaces/models/channel.d.ts.map +1 -1
  22. package/dist/sync-agent/spaces/models/channel.js +4 -76
  23. package/dist/sync-agent/spaces/models/channel.js.map +1 -1
  24. package/dist/sync-agent/spaces/models/space.d.ts +6 -6
  25. package/dist/sync-agent/spaces/models/space.d.ts.map +1 -1
  26. package/dist/sync-agent/spaces/models/space.js +8 -30
  27. package/dist/sync-agent/spaces/models/space.js.map +1 -1
  28. package/dist/sync-agent/spaces/spaces.d.ts +3 -4
  29. package/dist/sync-agent/spaces/spaces.d.ts.map +1 -1
  30. package/dist/sync-agent/spaces/spaces.js +6 -25
  31. package/dist/sync-agent/spaces/spaces.js.map +1 -1
  32. package/dist/sync-agent/syncAgent.d.ts.map +1 -1
  33. package/dist/sync-agent/syncAgent.js +2 -7
  34. package/dist/sync-agent/syncAgent.js.map +1 -1
  35. package/dist/townsEnv.d.ts +6 -1
  36. package/dist/townsEnv.d.ts.map +1 -1
  37. package/dist/townsEnv.js +29 -5
  38. package/dist/townsEnv.js.map +1 -1
  39. package/package.json +10 -10
  40. package/dist/createBot.d.ts +0 -159
  41. package/dist/createBot.d.ts.map +0 -1
  42. package/dist/createBot.js +0 -206
  43. package/dist/createBot.js.map +0 -1
  44. package/dist/makeRiverRpcClient.d.ts +0 -6
  45. package/dist/makeRiverRpcClient.d.ts.map +0 -1
  46. package/dist/makeRiverRpcClient.js +0 -9
  47. package/dist/makeRiverRpcClient.js.map +0 -1
  48. package/dist/streamStateView_ChannelMetadata.d.ts +0 -22
  49. package/dist/streamStateView_ChannelMetadata.d.ts.map +0 -1
  50. package/dist/streamStateView_ChannelMetadata.js +0 -77
  51. package/dist/streamStateView_ChannelMetadata.js.map +0 -1
  52. package/dist/sync-agent/entitlements/entitlements.d.ts +0 -10
  53. package/dist/sync-agent/entitlements/entitlements.d.ts.map +0 -1
  54. package/dist/sync-agent/entitlements/entitlements.js +0 -20
  55. package/dist/sync-agent/entitlements/entitlements.js.map +0 -1
  56. package/dist/sync-agent/river-connection/models/riverChain.d.ts +0 -24
  57. package/dist/sync-agent/river-connection/models/riverChain.d.ts.map +0 -1
  58. package/dist/sync-agent/river-connection/models/riverChain.js +0 -66
  59. package/dist/sync-agent/river-connection/models/riverChain.js.map +0 -1
  60. package/dist/tests/multi/appRegistryService.test.d.ts +0 -2
  61. package/dist/tests/multi/appRegistryService.test.d.ts.map +0 -1
  62. package/dist/tests/multi/appRegistryService.test.js +0 -41
  63. package/dist/tests/multi/appRegistryService.test.js.map +0 -1
  64. package/dist/tests/multi/botEntitlements.test.d.ts +0 -5
  65. package/dist/tests/multi/botEntitlements.test.d.ts.map +0 -1
  66. package/dist/tests/multi/botEntitlements.test.js +0 -178
  67. package/dist/tests/multi/botEntitlements.test.js.map +0 -1
  68. package/dist/tests/multi/botMembership.test.d.ts +0 -5
  69. package/dist/tests/multi/botMembership.test.d.ts.map +0 -1
  70. package/dist/tests/multi/botMembership.test.js +0 -295
  71. package/dist/tests/multi/botMembership.test.js.map +0 -1
  72. package/dist/tests/multi/botStreamCreation.test.d.ts +0 -5
  73. package/dist/tests/multi/botStreamCreation.test.d.ts.map +0 -1
  74. package/dist/tests/multi/botStreamCreation.test.js +0 -60
  75. package/dist/tests/multi/botStreamCreation.test.js.map +0 -1
  76. package/dist/tests/multi/channelScrubbing.test.d.ts +0 -5
  77. package/dist/tests/multi/channelScrubbing.test.d.ts.map +0 -1
  78. package/dist/tests/multi/channelScrubbing.test.js +0 -102
  79. package/dist/tests/multi/channelScrubbing.test.js.map +0 -1
  80. package/dist/tests/multi_ne/nodeSelection.test.d.ts +0 -5
  81. package/dist/tests/multi_ne/nodeSelection.test.d.ts.map +0 -1
  82. package/dist/tests/multi_ne/nodeSelection.test.js +0 -41
  83. package/dist/tests/multi_ne/nodeSelection.test.js.map +0 -1
  84. package/dist/tests/multi_ne/trading.solana.test.d.ts +0 -2
  85. package/dist/tests/multi_ne/trading.solana.test.d.ts.map +0 -1
  86. package/dist/tests/multi_ne/trading.solana.test.js +0 -229
  87. package/dist/tests/multi_ne/trading.solana.test.js.map +0 -1
  88. package/dist/tests/multi_ne/trading.test.d.ts +0 -2
  89. package/dist/tests/multi_ne/trading.test.d.ts.map +0 -1
  90. package/dist/tests/multi_ne/trading.test.js +0 -243
  91. package/dist/tests/multi_ne/trading.test.js.map +0 -1
@@ -1,77 +0,0 @@
1
- import { bin_toHexString, dlog, check } from '@towns-labs/utils';
2
- import { toDecryptedContent } from './encryptedContentTypes';
3
- // channel metadata is only used by gdms, could be moved back into the _GDMChannel helper
4
- export class StreamStateView_ChannelMetadata {
5
- gdmStreamsView;
6
- log = dlog('csb:streams:channel_metadata');
7
- streamId;
8
- // named channelProperties for backwards compatibility
9
- get channelProperties() {
10
- return this.gdmStreamModel.metadata;
11
- }
12
- get metadataEventId() {
13
- return this.gdmStreamModel.metadataEventId;
14
- }
15
- get gdmStreamModel() {
16
- return this.gdmStreamsView.get(this.streamId);
17
- }
18
- constructor(streamId, gdmStreamsView) {
19
- this.gdmStreamsView = gdmStreamsView;
20
- this.streamId = streamId;
21
- }
22
- applySnapshot(encryptedChannelProperties, cleartexts, encryptionEmitter) {
23
- if (!encryptedChannelProperties.data) {
24
- return;
25
- }
26
- const eventId = bin_toHexString(encryptedChannelProperties.eventHash);
27
- const cleartext = cleartexts?.[eventId];
28
- this.gdmStreamsView.setLatestMetadataEventId(this.streamId, eventId);
29
- this.decryptPayload(encryptedChannelProperties.data, eventId, cleartext, encryptionEmitter);
30
- }
31
- appendEvent(event, cleartext, emitter) {
32
- check(event.remoteEvent.event.payload.case === 'gdmChannelPayload');
33
- check(event.remoteEvent.event.payload.value.content.case === 'channelProperties');
34
- const payload = event.remoteEvent.event.payload.value.content.value;
35
- this.gdmStreamsView.setLatestMetadataEventId(this.streamId, event.hashStr);
36
- this.decryptPayload(payload, event.hashStr, cleartext, emitter);
37
- }
38
- prependEvent(_event, _cleartext, _emitter) {
39
- // conveyed in snapshot
40
- }
41
- onDecryptedContent(eventId, content, stateEmitter) {
42
- this.handleDecryptedContent(eventId, content, stateEmitter);
43
- }
44
- decryptPayload(payload, eventId, cleartext, encryptionEmitter) {
45
- if (cleartext) {
46
- const decryptedContent = toDecryptedContent('channelProperties', payload.version, cleartext);
47
- this.handleDecryptedContent(eventId, decryptedContent, encryptionEmitter);
48
- }
49
- else {
50
- encryptionEmitter?.emit('newEncryptedContent', this.streamId, eventId, {
51
- kind: 'channelProperties',
52
- content: payload,
53
- });
54
- }
55
- }
56
- handleDecryptedContent(eventId, content, emitter) {
57
- if (content.kind === 'channelProperties') {
58
- if (!this.gdmStreamModel.metadataEventId ||
59
- !this.gdmStreamModel.metadata ||
60
- this.gdmStreamModel.latestMetadataEventId === eventId) {
61
- this.gdmStreamsView.setMetadata(this.streamId, content.content, eventId);
62
- emitter?.emit('streamChannelPropertiesUpdated', this.streamId);
63
- }
64
- else {
65
- this.log('channelProperties eventId mismatch', {
66
- eventId,
67
- content,
68
- gdmStreamModel: this.gdmStreamModel,
69
- });
70
- }
71
- }
72
- else {
73
- check(false);
74
- }
75
- }
76
- }
77
- //# sourceMappingURL=streamStateView_ChannelMetadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamStateView_ChannelMetadata.js","sourceRoot":"","sources":["../src/streamStateView_ChannelMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAoB,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAK9E,yFAAyF;AACzF,MAAM,OAAO,+BAA+B;IAmB5B;IAlBZ,GAAG,GAAG,IAAI,CAAC,8BAA8B,CAAC,CAAA;IACjC,QAAQ,CAAQ;IAEzB,sDAAsD;IACtD,IAAI,iBAAiB;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAA;IACvC,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAA;IAC9C,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;IAED,YACI,QAAgB,EACR,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAEtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;IAED,aAAa,CACT,0BAAgD,EAChD,UAA2D,EAC3D,iBAAmE;QAEnE,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;YACnC,OAAM;QACV,CAAC;QAED,MAAM,OAAO,GAAG,eAAe,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAA;QACr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,OAAO,EACf,SAAS,CACZ,CAAA;YACD,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;QAC7E,CAAC;aAAM,CAAC;YACJ,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE;gBACnE,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,OAAO;aACnB,CAAC,CAAA;QACN,CAAC;IACL,CAAC;IAEO,sBAAsB,CAC1B,OAAe,EACf,OAAyB,EACzB,OAA+C;QAE/C,IAAI,OAAO,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YACvC,IACI,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe;gBACpC,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ;gBAC7B,IAAI,CAAC,cAAc,CAAC,qBAAqB,KAAK,OAAO,EACvD,CAAC;gBACC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;gBACxE,OAAO,EAAE,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAClE,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,GAAG,CAAC,oCAAoC,EAAE;oBAC3C,OAAO;oBACP,OAAO;oBACP,cAAc,EAAE,IAAI,CAAC,cAAc;iBACtC,CAAC,CAAA;YACN,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC;IACL,CAAC;CACJ"}
@@ -1,10 +0,0 @@
1
- import { EntitlementsDelegate } from '../../decryptionExtensions';
2
- import { Permission, SpaceDapp } from '@towns-labs/web3';
3
- import { TownsConfig } from '../../townsEnv';
4
- export declare class Entitlements implements EntitlementsDelegate {
5
- private config;
6
- private spaceDapp;
7
- constructor(config: TownsConfig, spaceDapp: SpaceDapp);
8
- isEntitled(spaceId: string | undefined, channelId: string | undefined, user: string, permission: Permission): Promise<boolean>;
9
- }
10
- //# sourceMappingURL=entitlements.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entitlements.d.ts","sourceRoot":"","sources":["../../../src/sync-agent/entitlements/entitlements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBAAa,YAAa,YAAW,oBAAoB;IAEjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;gBADT,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS;IAG1B,UAAU,CACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU;CAU7B"}
@@ -1,20 +0,0 @@
1
- export class Entitlements {
2
- config;
3
- spaceDapp;
4
- constructor(config, spaceDapp) {
5
- this.config = config;
6
- this.spaceDapp = spaceDapp;
7
- }
8
- async isEntitled(spaceId, channelId, user, permission) {
9
- if (channelId && spaceId) {
10
- return this.spaceDapp.isEntitledToChannel(spaceId, channelId, user, permission);
11
- }
12
- else if (spaceId) {
13
- return this.spaceDapp.isEntitledToSpace(spaceId, user, permission);
14
- }
15
- else {
16
- return true;
17
- }
18
- }
19
- }
20
- //# sourceMappingURL=entitlements.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entitlements.js","sourceRoot":"","sources":["../../../src/sync-agent/entitlements/entitlements.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,YAAY;IAET;IACA;IAFZ,YACY,MAAmB,EACnB,SAAoB;QADpB,WAAM,GAAN,MAAM,CAAa;QACnB,cAAS,GAAT,SAAS,CAAW;IAC7B,CAAC;IAEJ,KAAK,CAAC,UAAU,CACZ,OAA2B,EAC3B,SAA6B,EAC7B,IAAY,EACZ,UAAsB;QAEtB,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAA;QACnF,CAAC;aAAM,IAAI,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAA;QACtE,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAA;QACf,CAAC;IACL,CAAC;CACJ"}
@@ -1,24 +0,0 @@
1
- import { RiverRegistry } from '@towns-protocol/web3';
2
- import { PersistedObservable } from '../../../observable/persistedObservable';
3
- import { Store } from '../../../store/store';
4
- export interface RiverChainModel {
5
- id: '0';
6
- urls: {
7
- value: string;
8
- fetchedAtMs?: number;
9
- };
10
- }
11
- export declare class RiverChain extends PersistedObservable<RiverChainModel> {
12
- private riverRegistryDapp;
13
- private userId;
14
- private log;
15
- private sessionStartMs;
16
- private stopped;
17
- constructor(store: Store, riverRegistryDapp: RiverRegistry, userId: string, logId: string);
18
- protected onLoaded(): void;
19
- stop(): void;
20
- urls(): Promise<string>;
21
- fetchUrls(): Promise<string>;
22
- private withInfiniteRetries;
23
- }
24
- //# sourceMappingURL=riverChain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"riverChain.d.ts","sourceRoot":"","sources":["../../../../src/sync-agent/river-connection/models/riverChain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAuB,MAAM,yCAAyC,CAAA;AAClG,OAAO,EAAgB,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,GAAG,CAAA;IAEP,IAAI,EAAE;QACF,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACvB,CAAA;CACJ;AAGD,qBAGa,UAAW,SAAQ,mBAAmB,CAAC,eAAe,CAAC;IAO5D,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,MAAM;IAPlB,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,OAAO,CAAQ;gBAGnB,KAAK,EAAE,KAAK,EACJ,iBAAiB,EAAE,aAAa,EAChC,MAAM,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM;cASE,QAAQ;IAK3B,IAAI;IAIE,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAQvB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAOlC,OAAO,CAAC,mBAAmB;CAY9B"}
@@ -1,66 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { PersistedObservable, persistedObservable } from '../../../observable/persistedObservable';
8
- import { LoadPriority } from '../../../store/store';
9
- import { dlogger } from '@towns-protocol/utils';
10
- // Define a class that will manage the data model, decorate it to give it store properties
11
- let RiverChain = class RiverChain extends PersistedObservable {
12
- riverRegistryDapp;
13
- userId;
14
- log;
15
- sessionStartMs = Date.now();
16
- stopped = false;
17
- // The constructor is where we set up the class, we pass in the store and any other dependencies
18
- constructor(store, riverRegistryDapp, userId, logId) {
19
- // pass a default value to the parent class, this is what will be used if the data is not loaded
20
- // set the load priority to high, this will load first
21
- super({ id: '0', urls: { value: '' } }, store, LoadPriority.high);
22
- this.riverRegistryDapp = riverRegistryDapp;
23
- this.userId = userId;
24
- this.log = dlogger(`csb:agent:riverChain:${logId}`);
25
- }
26
- // implement start function then wire it up from parent
27
- onLoaded() {
28
- this.log.info('riverChain onLoaded');
29
- this.withInfiniteRetries(() => this.fetchUrls());
30
- }
31
- stop() {
32
- this.stopped = true;
33
- }
34
- async urls() {
35
- // urls is returning the cached data if it exists, otherwise waiting for the data to be fetched
36
- // if the cached data returns a stale node url, the startup will fail
37
- // nodes almost never exit the network, so this is a very rare case
38
- await this.when((x) => x.data.urls.fetchedAtMs !== undefined, { timeoutMs: 15000 });
39
- return this.data.urls.value;
40
- }
41
- async fetchUrls() {
42
- const now = Date.now();
43
- const urls = await this.riverRegistryDapp.getOperationalNodeUrls(); // here we are fetching the node urls
44
- this.setData({ urls: { value: urls, fetchedAtMs: now } }); // if the data is new, update our own state
45
- return urls;
46
- }
47
- withInfiniteRetries(fn, delayMs = 5000) {
48
- if (this.stopped) {
49
- return;
50
- }
51
- fn().catch((e) => {
52
- this.log.error(e);
53
- this.log.info(`retrying in ${delayMs / 1000} seconds`);
54
- setTimeout(() => {
55
- this.withInfiniteRetries(fn, delayMs);
56
- }, delayMs);
57
- });
58
- }
59
- };
60
- RiverChain = __decorate([
61
- persistedObservable({
62
- tableName: 'riverChain', // this is the name of the table in the database
63
- })
64
- ], RiverChain);
65
- export { RiverChain };
66
- //# sourceMappingURL=riverChain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"riverChain.js","sourceRoot":"","sources":["../../../../src/sync-agent/river-connection/models/riverChain.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClG,OAAO,EAAE,YAAY,EAAS,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAkB,MAAM,uBAAuB,CAAA;AAc/D,0FAA0F;AAInF,IAAM,UAA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,CAAC,sBAAsB,EAAE,CAAA,CAAC,qCAAqC;QACxG,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA,CAAC,2CAA2C;QACrG,OAAO,IAAI,CAAA;IACf,CAAC;IAEO,mBAAmB,CAAI,EAAoB,EAAE,UAAkB,IAAI;QACvE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAM;QACV,CAAC;QACD,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACjB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,OAAO,GAAG,IAAI,UAAU,CAAC,CAAA;YACtD,UAAU,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,mBAAmB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;YACzC,CAAC,EAAE,OAAO,CAAC,CAAA;QACf,CAAC,CAAC,CAAA;IACN,CAAC;CACJ,CAAA;AAtDY,UAAU;IAHtB,mBAAmB,CAAC;QACjB,SAAS,EAAE,YAAY,EAAE,gDAAgD;KAC5E,CAAC;GACW,UAAU,CAsDtB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=appRegistryService.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appRegistryService.test.d.ts","sourceRoot":"","sources":["../../../src/tests/multi/appRegistryService.test.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- import { makeSignerContext } from '../../signerContext';
2
- import { AppRegistryService } from '../../appRegistryService';
3
- import { ethers } from 'ethers';
4
- import { townsEnv } from '../../townsEnv';
5
- import { bin_fromHexString } from '@towns-labs/utils';
6
- import { setupWalletsAndContexts, createSpaceAndDefaultChannel, everyoneMembershipStruct, } from '../testUtils';
7
- const appRegistryUrl = townsEnv().getAppRegistryUrl(process.env.RIVER_ENV);
8
- describe('appRegistryService test', () => {
9
- test('authenticate with primary key', async () => {
10
- const wallet = ethers.Wallet.createRandom();
11
- const { finishResponse } = await AppRegistryService.authenticateWithSigner(wallet.address, wallet, appRegistryUrl);
12
- expect(finishResponse.sessionToken).toBeDefined();
13
- });
14
- test('authenticate with delegate key', async () => {
15
- const wallet = ethers.Wallet.createRandom();
16
- const delegateWallet = ethers.Wallet.createRandom();
17
- const signerContext = await makeSignerContext(wallet, delegateWallet, { days: 1 });
18
- const { finishResponse } = await AppRegistryService.authenticate(signerContext, appRegistryUrl);
19
- expect(finishResponse.sessionToken).toBeDefined();
20
- });
21
- test('cannot register a non-app user stream', async () => {
22
- // Set up wallets and contexts for space creation
23
- const { bob, bobProvider, bobSpaceDapp } = await setupWalletsAndContexts();
24
- // Create a space so that bob's user stream can be initialized.
25
- const everyoneMembership = await everyoneMembershipStruct(bobSpaceDapp, bob);
26
- await createSpaceAndDefaultChannel(bob, bobSpaceDapp, bobProvider.wallet, 'test space', everyoneMembership);
27
- // Authentication should work for any user
28
- const { appRegistryRpcClient } = await AppRegistryService.authenticateWithSigner(bob.userId, bob.wallet, // Use wallet directly as signer
29
- appRegistryUrl);
30
- expect(appRegistryRpcClient).toBeDefined();
31
- // However, trying to register should fail because the user's address
32
- // is not a registered app contract address
33
- await expect(appRegistryRpcClient.register({
34
- appId: bin_fromHexString(bob.wallet.address), // Regular user address, not an app contract
35
- appOwnerId: bin_fromHexString(bob.userId),
36
- })).rejects.toThrow();
37
- // Cleanup
38
- await bob.stopSync();
39
- });
40
- });
41
- //# sourceMappingURL=appRegistryService.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appRegistryService.test.js","sourceRoot":"","sources":["../../../src/tests/multi/appRegistryService.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,O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EAAE;QACrD,iDAAiD;QACjD,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,MAAM,uBAAuB,EAAE,CAAA;QAE1E,+DAA+D;QAC/D,MAAM,kBAAkB,GAAG,MAAM,wBAAwB,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;QAC5E,MAAM,4BAA4B,CAC9B,GAAG,EACH,YAAY,EACZ,WAAW,CAAC,MAAM,EAClB,YAAY,EACZ,kBAAkB,CACrB,CAAA;QAED,0CAA0C;QAC1C,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,kBAAkB,CAAC,sBAAsB,CAC5E,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,MAAM,EAAE,gCAAgC;QAC5C,cAAc,CACjB,CAAA;QACD,MAAM,CAAC,oBAAoB,CAAC,CAAC,WAAW,EAAE,CAAA;QAE1C,qEAAqE;QACrE,2CAA2C;QAC3C,MAAM,MAAM,CACR,oBAAoB,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,4CAA4C;YAC1F,UAAU,EAAE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC;SAC5C,CAAC,CACL,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;QAEnB,UAAU;QACV,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * @group with-entitlements
3
- */
4
- export {};
5
- //# sourceMappingURL=botEntitlements.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"botEntitlements.test.d.ts","sourceRoot":"","sources":["../../../src/tests/multi/botEntitlements.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,178 +0,0 @@
1
- /**
2
- * @group with-entitlements
3
- */
4
- import { AppRegistryDapp, Permission, SpaceAddressFromSpaceId } from '@towns-protocol/web3';
5
- import { createSpaceAndDefaultChannel, everyoneMembershipStruct, setupWalletsAndContexts, waitFor, createChannel, } from '../testUtils';
6
- import { townsEnv } from '../../townsEnv';
7
- import { ethers } from 'ethers';
8
- import { MembershipOp } from '@towns-protocol/proto';
9
- import { make_MemberPayload_KeySolicitation } from '../../types';
10
- describe('bot entitlements tests', () => {
11
- test('bot has READ permissions to channels when granted by isAppEntitled', async () => {
12
- const { bob: bot, bobsWallet: botWallet, bobProvider: botProvider, carol: spaceOwner, carolProvider: spaceOwnerProvider, carolSpaceDapp: spaceOwnerSpaceDapp, } = await setupWalletsAndContexts();
13
- const appRegistryDapp = new AppRegistryDapp(townsEnv().makeBaseChainConfig().chainConfig, spaceOwnerProvider);
14
- // Create bot app contract with READ permission only
15
- const tx = await appRegistryDapp.createApp(botProvider.signer, 'read-only-bot', [Permission.Read], // Only READ permission, no WRITE
16
- botWallet.address, ethers.utils.parseEther('0.01').toBigInt(), 31536000n);
17
- const receipt = await tx.wait();
18
- const { app: foundAppAddress } = appRegistryDapp.getCreateAppEvent(receipt, botWallet.address);
19
- expect(foundAppAddress).toBeDefined();
20
- // Create bot user streams
21
- await expect(bot.initializeUser({ appAddress: foundAppAddress })).resolves.toBeDefined();
22
- bot.startSync();
23
- // Create a town with channels (everyone can join)
24
- const everyoneMembership = await everyoneMembershipStruct(spaceOwnerSpaceDapp, spaceOwner);
25
- const { spaceId } = await createSpaceAndDefaultChannel(spaceOwner, spaceOwnerSpaceDapp, spaceOwnerProvider.wallet, "space owner's town", everyoneMembership);
26
- // Install the bot to the space (as space owner)
27
- const installTx = await appRegistryDapp.installApp(spaceOwnerProvider.signer, foundAppAddress, SpaceAddressFromSpaceId(spaceId), ethers.utils.parseEther('0.02').toBigInt());
28
- const installReceipt = await installTx.wait();
29
- expect(installReceipt.status).toBe(1);
30
- // This channel has no roles attached, so the bot can only gain READ permissions through
31
- // isAppEntitled.
32
- const { channelId: restrictedChannelId, error: channelError } = await createChannel(spaceOwnerSpaceDapp, spaceOwnerProvider, spaceId, 'channel-without-roles', [], spaceOwnerProvider.wallet);
33
- expect(channelError).toBeUndefined();
34
- expect(restrictedChannelId).toBeDefined();
35
- // Create the channel stream
36
- const { streamId: returnedChannelId } = await spaceOwner.createChannel(spaceId, 'channel-without-roles', '', restrictedChannelId);
37
- expect(returnedChannelId).toEqual(restrictedChannelId);
38
- // Have space owner add bot to space and channel
39
- await expect(spaceOwner.joinUser(spaceId, bot.userId)).resolves.toBeDefined();
40
- await expect(spaceOwner.joinUser(restrictedChannelId, bot.userId)).resolves.toBeDefined();
41
- // Validate bot is a member of both space and channel
42
- const botUserStreamView = bot.stream(bot.userStreamId).view;
43
- await waitFor(() => {
44
- expect(botUserStreamView.userContent.isMember(spaceId, MembershipOp.SO_JOIN)).toBe(true);
45
- expect(botUserStreamView.userContent.isMember(restrictedChannelId, MembershipOp.SO_JOIN)).toBe(true);
46
- });
47
- // Force miniblocks with snapshots for both space and channel streams
48
- // The test will now fail if app address is not properly propogated through member snapshots.
49
- const spaceStream = spaceOwner.stream(spaceId);
50
- const channelStream = spaceOwner.stream(restrictedChannelId);
51
- await waitFor(async () => {
52
- const response = await spaceOwner.debugForceMakeMiniblock(spaceId, {
53
- forceSnapshot: true,
54
- lastKnownMiniblockNum: spaceStream.view.miniblockInfo.max,
55
- });
56
- expect(response).toBeDefined();
57
- });
58
- await waitFor(async () => {
59
- const response = await spaceOwner.debugForceMakeMiniblock(restrictedChannelId, {
60
- forceSnapshot: true,
61
- lastKnownMiniblockNum: channelStream.view.miniblockInfo.max,
62
- });
63
- expect(response).toBeDefined();
64
- });
65
- // Bot should be able to post a key solicitation because it has READ permission through isAppEntitled
66
- // Key solicitations require READ permission, not WRITE permission
67
- const payload = make_MemberPayload_KeySolicitation({
68
- deviceKey: 'bot-device-key',
69
- sessionIds: ['aaa'],
70
- fallbackKey: 'bot-fallback-key',
71
- isNewDevice: true,
72
- });
73
- // This should succeed because the bot has READ permission via app entitlements
74
- await bot.makeEventAndAddToStream(restrictedChannelId, payload);
75
- // Cleanup
76
- await bot.stopSync();
77
- await spaceOwner.stopSync();
78
- });
79
- test('bot has write permissions to channels when granted by isAppEntitled', async () => {
80
- const { alice: spaceOwner, aliceProvider: spaceOwnerProvider, aliceSpaceDapp: spaceOwnerSpaceDapp, bob: botWithoutWrite, bobsWallet: botWithoutWriteWallet, bobProvider: botWithoutWriteProvider, carol: botWithWrite, carolsWallet: botWithWriteWallet, carolProvider: botWithWriteProvider, } = await setupWalletsAndContexts();
81
- const appRegistryDapp = new AppRegistryDapp(townsEnv().makeBaseChainConfig().chainConfig, spaceOwnerProvider);
82
- // Create first bot app contract with READ permission only (no WRITE)
83
- const tx1 = await appRegistryDapp.createApp(botWithoutWriteProvider.signer, 'read-only-bot', [Permission.Read], // Only READ permission, no WRITE
84
- botWithoutWriteWallet.address, ethers.utils.parseEther('0.01').toBigInt(), 31536000n);
85
- const receipt1 = await tx1.wait();
86
- const { app: readOnlyBotAddress } = appRegistryDapp.getCreateAppEvent(receipt1, botWithoutWriteWallet.address);
87
- expect(readOnlyBotAddress).toBeDefined();
88
- // Create second bot app contract with both READ and WRITE permissions
89
- const tx2 = await appRegistryDapp.createApp(botWithWriteProvider.signer, 'read-write-bot', [Permission.Read, Permission.Write], // Both READ and WRITE permissions
90
- botWithWriteWallet.address, ethers.utils.parseEther('0.01').toBigInt(), 31536000n);
91
- const receipt2 = await tx2.wait();
92
- const { app: readWriteBotAddress } = appRegistryDapp.getCreateAppEvent(receipt2, botWithWriteWallet.address);
93
- expect(readWriteBotAddress).toBeDefined();
94
- // Create bot user streams for both bots
95
- await expect(botWithoutWrite.initializeUser({ appAddress: readOnlyBotAddress })).resolves.toBeDefined();
96
- await expect(botWithWrite.initializeUser({ appAddress: readWriteBotAddress })).resolves.toBeDefined();
97
- botWithoutWrite.startSync();
98
- botWithWrite.startSync();
99
- // Create a town with channels (everyone can join)
100
- const everyoneMembership = await everyoneMembershipStruct(spaceOwnerSpaceDapp, spaceOwner);
101
- const { spaceId, defaultChannelId } = await createSpaceAndDefaultChannel(spaceOwner, spaceOwnerSpaceDapp, spaceOwnerProvider.wallet, "space owner's town", everyoneMembership);
102
- // Install both bots to the space (as space owner)
103
- const installTx1 = await appRegistryDapp.installApp(spaceOwnerProvider.signer, readOnlyBotAddress, SpaceAddressFromSpaceId(spaceId), ethers.utils.parseEther('0.02').toBigInt());
104
- const installReceipt1 = await installTx1.wait();
105
- expect(installReceipt1.status).toBe(1);
106
- const installTx2 = await appRegistryDapp.installApp(spaceOwnerProvider.signer, readWriteBotAddress, SpaceAddressFromSpaceId(spaceId), ethers.utils.parseEther('0.02').toBigInt());
107
- const installReceipt2 = await installTx2.wait();
108
- expect(installReceipt2.status).toBe(1);
109
- // Verify both bots are installed
110
- const space = spaceOwnerSpaceDapp.getSpace(spaceId);
111
- const installedApps = await space.AppAccount.read.getInstalledApps();
112
- expect(installedApps).toContain(readOnlyBotAddress);
113
- expect(installedApps).toContain(readWriteBotAddress);
114
- // Have space owner add both bots to space and default channel
115
- await expect(spaceOwner.joinUser(spaceId, botWithoutWrite.userId)).resolves.toBeDefined();
116
- await expect(spaceOwner.joinUser(defaultChannelId, botWithoutWrite.userId)).resolves.toBeDefined();
117
- await expect(spaceOwner.joinUser(spaceId, botWithWrite.userId)).resolves.toBeDefined();
118
- await expect(spaceOwner.joinUser(defaultChannelId, botWithWrite.userId)).resolves.toBeDefined();
119
- // Validate both bots are members of space and default channel
120
- const botWithoutWriteUserStreamView = botWithoutWrite.stream(botWithoutWrite.userStreamId).view;
121
- const botWithWriteUserStreamView = botWithWrite.stream(botWithWrite.userStreamId).view;
122
- await waitFor(() => {
123
- expect(botWithoutWriteUserStreamView.userContent.isMember(spaceId, MembershipOp.SO_JOIN)).toBe(true);
124
- expect(botWithoutWriteUserStreamView.userContent.isMember(defaultChannelId, MembershipOp.SO_JOIN)).toBe(true);
125
- expect(botWithWriteUserStreamView.userContent.isMember(spaceId, MembershipOp.SO_JOIN)).toBe(true);
126
- expect(botWithWriteUserStreamView.userContent.isMember(defaultChannelId, MembershipOp.SO_JOIN)).toBe(true);
127
- });
128
- // Bot without WRITE permission should NOT be able to post a message
129
- await expect(botWithoutWrite.sendMessage(defaultChannelId, 'Message from read-only bot')).rejects.toThrow(/PERMISSION_DENIED/);
130
- // Bot with WRITE permission should be able to post a message
131
- await expect(botWithWrite.sendMessage(defaultChannelId, 'Message from read-write bot')).resolves.not.toThrow();
132
- // Cleanup
133
- await botWithoutWrite.stopSync();
134
- await botWithWrite.stopSync();
135
- await spaceOwner.stopSync();
136
- });
137
- // TODO: flaky test
138
- test.skip('bot does not have write permissions to channels when not granted by isAppEntitled', async () => {
139
- const { alice: spaceOwner, aliceProvider: spaceOwnerProvider, aliceSpaceDapp: spaceOwnerSpaceDapp, bob: bot, bobsWallet: botWallet, bobProvider: botProvider, } = await setupWalletsAndContexts();
140
- const appRegistryDapp = new AppRegistryDapp(townsEnv().makeBaseChainConfig().chainConfig, spaceOwnerProvider);
141
- // Create bot app contract with READ permission only (no WRITE)
142
- const tx = await appRegistryDapp.createApp(botProvider.signer, 'read-only-bot-no-write', [Permission.Read], // Only READ permission, no WRITE
143
- botWallet.address, ethers.utils.parseEther('0.01').toBigInt(), 31536000n);
144
- const receipt = await tx.wait();
145
- const { app: foundAppAddress } = appRegistryDapp.getCreateAppEvent(receipt, botWallet.address);
146
- expect(foundAppAddress).toBeDefined();
147
- // Create bot user streams
148
- await expect(bot.initializeUser({ appAddress: foundAppAddress })).resolves.toBeDefined();
149
- bot.startSync();
150
- // Create a town with channels where everyone can join and has write permissions
151
- const everyoneMembership = await everyoneMembershipStruct(spaceOwnerSpaceDapp, spaceOwner);
152
- const { spaceId, defaultChannelId } = await createSpaceAndDefaultChannel(spaceOwner, spaceOwnerSpaceDapp, spaceOwnerProvider.wallet, "space owner's town", everyoneMembership);
153
- // Install the bot to the space (as space owner)
154
- const installTx = await appRegistryDapp.installApp(spaceOwnerProvider.signer, foundAppAddress, SpaceAddressFromSpaceId(spaceId), ethers.utils.parseEther('0.02').toBigInt());
155
- const installReceipt = await installTx.wait();
156
- expect(installReceipt.status).toBe(1);
157
- // Verify bot is installed
158
- const space = spaceOwnerSpaceDapp.getSpace(spaceId);
159
- const installedApps = await space.AppAccount.read.getInstalledApps();
160
- expect(installedApps).toContain(foundAppAddress);
161
- // Have space owner add bot to space and default channel
162
- await expect(spaceOwner.joinUser(spaceId, bot.userId)).resolves.toBeDefined();
163
- await expect(spaceOwner.joinUser(defaultChannelId, bot.userId)).resolves.toBeDefined();
164
- // Validate bot is a member of both space and channel
165
- const botUserStreamView = bot.stream(bot.userStreamId).view;
166
- await waitFor(() => {
167
- expect(botUserStreamView.userContent.isMember(spaceId, MembershipOp.SO_JOIN)).toBe(true);
168
- expect(botUserStreamView.userContent.isMember(defaultChannelId, MembershipOp.SO_JOIN)).toBe(true);
169
- });
170
- // Bot should NOT be able to post a message because it lacks WRITE permission through isAppEntitled
171
- // Even though the space grants write permissions to all users, the bot's app contract only has READ permission
172
- await expect(bot.sendMessage(defaultChannelId, 'Message from read-only bot')).rejects.toThrow(/PERMISSION_DENIED/);
173
- // Cleanup
174
- await bot.stopSync();
175
- await spaceOwner.stopSync();
176
- });
177
- });
178
- //# sourceMappingURL=botEntitlements.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"botEntitlements.test.js","sourceRoot":"","sources":["../../../src/tests/multi/botEntitlements.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAW,eAAe,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACpG,OAAO,EACH,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,EACvB,OAAO,EACP,aAAa,GAChB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD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,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAA;QAC7E,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAA;QAEtF,qDAAqD;QACrD,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,YAAa,CAAE,CAAC,IAAI,CAAA;QAC7D,MAAM,OAAO,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxF,MAAM,CACF,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,OAAO,CAAC,CACjF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,mGAAmG;QACnG,+GAA+G;QAC/G,MAAM,MAAM,CACR,GAAG,CAAC,WAAW,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,CAClE,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;QAEtC,UAAU;QACV,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAA;QACpB,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * @group with-entitlements
3
- */
4
- export {};
5
- //# sourceMappingURL=botMembership.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"botMembership.test.d.ts","sourceRoot":"","sources":["../../../src/tests/multi/botMembership.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}