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 = { module.exports = {
extends: '@urbit/eslint-config', extends: '@urbit',
env: { env: {
'jest': true 'jest': true
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
module.exports = { 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'; import { Association, Metadata, MetadataUpdate, MetadataUpdateAdd, MetadataUpdateRemove } from './types';
export const METADATA_UPDATE_VERSION = 1; export const METADATA_UPDATE_VERSION = 1;
@ -18,13 +18,13 @@ export const add = (
description: string, description: string,
dateCreated: string, dateCreated: string,
color: string, color: string,
moduleName: string, moduleName: string
): Poke<MetadataUpdateAdd> => metadataAction({ ): Poke<MetadataUpdateAdd> => metadataAction({
add: { add: {
group, group,
resource: { resource: {
resource, resource,
app: appName 'app-name': appName
}, },
metadata: { metadata: {
title, title,
@ -52,7 +52,7 @@ export const remove = (
group, group,
resource: { resource: {
resource, resource,
app: appName 'app-name': appName
} }
} }
}); });
@ -70,11 +70,11 @@ export const update = (
group: association.group, group: association.group,
resource: { resource: {
resource: association.resource, resource: association.resource,
app: association.app 'app-name': association['app-name']
}, },
metadata metadata
} }
}); });
} };
export { update as metadataUpdate }; 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 = export type MetadataUpdate =
MetadataUpdateInitial MetadataUpdateInitial
@ -31,13 +31,13 @@ export type MetadataUpdateRemove = {
export interface MdResource { export interface MdResource {
resource: string; resource: string;
app: AppName; 'app-name': AppName;
} }
export interface MetadataUpdatePreview { export interface MetadataUpdatePreview {
group: string; group: string;
channels: Associations; channels: Associations;
"channel-count": number; 'channel-count': number;
members: number; members: number;
metadata: Metadata; metadata: Metadata;
} }

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,10 @@
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.12.5", "@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", "onchange": "^7.1.0",
"typescript": "^4.3.2" "typescript": "^4.3.2"
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff