npm/api: correct metadata resource interface

Fixes urbit/landscape#1035
Fixes urbit/landscape#1024
This commit is contained in:
Matilde Park 2021-07-07 12:24:52 -04:00
parent 9980a60f7d
commit 2412564aa7
10 changed files with 34841 additions and 37188 deletions

3946
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
module.exports = {
extends: '@urbit/eslint-config',
extends: '@urbit',
env: {
'jest': true
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
module.exports = {
extends: "@urbit"
};
extends: '@urbit'
};

View File

@ -1,4 +1,4 @@
import { AppName, Path, Poke, uxToHex, PatpNoSig } from "../lib";
import { AppName, Path, Poke, uxToHex, PatpNoSig } from '../lib';
import { Association, Metadata, MetadataUpdate, MetadataUpdateAdd, MetadataUpdateRemove } from './types';
export const METADATA_UPDATE_VERSION = 1;
@ -18,13 +18,13 @@ export const add = (
description: string,
dateCreated: string,
color: string,
moduleName: string,
moduleName: string
): Poke<MetadataUpdateAdd> => metadataAction({
add: {
group,
resource: {
resource,
app: appName
'app-name': appName
},
metadata: {
title,
@ -52,7 +52,7 @@ export const remove = (
group,
resource: {
resource,
app: appName
'app-name': appName
}
}
});
@ -70,11 +70,11 @@ export const update = (
group: association.group,
resource: {
resource: association.resource,
app: association.app
'app-name': association['app-name']
},
metadata
}
});
}
};
export { update as metadataUpdate };

View File

@ -1,4 +1,4 @@
import { AppName, Path, Patp } from "../lib";
import { AppName, Path, Patp } from '../lib';
export type MetadataUpdate =
MetadataUpdateInitial
@ -31,13 +31,13 @@ export type MetadataUpdateRemove = {
export interface MdResource {
resource: string;
app: AppName;
'app-name': AppName;
}
export interface MetadataUpdatePreview {
group: string;
channels: Associations;
"channel-count": number;
'channel-count': number;
members: number;
metadata: Metadata;
}

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,10 @@
},
"devDependencies": {
"@types/node": "^15.12.5",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"babel-eslint": "^10.1.0",
"eslint-plugin-react": "^7.24.0",
"onchange": "^7.1.0",
"typescript": "^4.3.2"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff