Implement signin flow
This commit is contained in:
parent
2e352f383e
commit
0208302907
19 changed files with 652 additions and 300 deletions
|
@ -40,7 +40,6 @@
|
||||||
"react-native-svg": "^12.4.0",
|
"react-native-svg": "^12.4.0",
|
||||||
"react-native-url-polyfill": "^1.3.0",
|
"react-native-url-polyfill": "^1.3.0",
|
||||||
"react-native-web": "^0.17.7",
|
"react-native-web": "^0.17.7",
|
||||||
"rn-fetch-blob": "^0.12.0",
|
|
||||||
"ucans": "0.9.1"
|
"ucans": "0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -8,13 +8,15 @@ import * as storage from './lib/storage'
|
||||||
import {ShellModel} from './models/shell'
|
import {ShellModel} from './models/shell'
|
||||||
|
|
||||||
const ROOT_STATE_STORAGE_KEY = 'root'
|
const ROOT_STATE_STORAGE_KEY = 'root'
|
||||||
|
const DEFAULT_SERVICE = 'http://localhost:2583'
|
||||||
|
|
||||||
export async function setupState() {
|
export async function setupState() {
|
||||||
let rootStore: RootStoreModel
|
let rootStore: RootStoreModel
|
||||||
let data: any
|
let data: any
|
||||||
|
|
||||||
const api = AdxApi.service(`http://localhost:2583`)
|
libapi.doPolyfill()
|
||||||
await libapi.setup(api)
|
|
||||||
|
const api = AdxApi.service(DEFAULT_SERVICE)
|
||||||
rootStore = new RootStoreModel(api)
|
rootStore = new RootStoreModel(api)
|
||||||
try {
|
try {
|
||||||
data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
|
data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {}
|
||||||
|
@ -29,17 +31,7 @@ export async function setupState() {
|
||||||
storage.save(ROOT_STATE_STORAGE_KEY, snapshot)
|
storage.save(ROOT_STATE_STORAGE_KEY, snapshot)
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO
|
await rootStore.session.setup()
|
||||||
rootStore.session.setAuthed(true)
|
|
||||||
// if (env.authStore) {
|
|
||||||
// const isAuthed = await auth.isAuthed(env.authStore)
|
|
||||||
// rootStore.session.setAuthed(isAuthed)
|
|
||||||
|
|
||||||
// // handle redirect from auth
|
|
||||||
// if (await auth.initialLoadUcanCheck(env.authStore)) {
|
|
||||||
// rootStore.session.setAuthed(true)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
await rootStore.me.load()
|
await rootStore.me.load()
|
||||||
console.log(rootStore.me)
|
console.log(rootStore.me)
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
* models live. They are made available to every model via dependency injection.
|
* models live. They are made available to every model via dependency injection.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import RNFetchBlob from 'rn-fetch-blob'
|
|
||||||
// import {ReactNativeStore} from './auth'
|
// import {ReactNativeStore} from './auth'
|
||||||
import AdxApi, {ServiceClient} from '../../third-party/api'
|
import AdxApi from '../../third-party/api'
|
||||||
|
import {ServiceClient} from '../../third-party/api/src/index'
|
||||||
import {AdxUri} from '../../third-party/uri'
|
import {AdxUri} from '../../third-party/uri'
|
||||||
import * as storage from './storage'
|
import * as storage from './storage'
|
||||||
|
|
||||||
export async function setup(adx: ServiceClient) {
|
export function doPolyfill() {
|
||||||
AdxApi.xrpc.fetch = fetchHandler
|
AdxApi.xrpc.fetch = fetchHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,32 +121,31 @@ async function fetchHandler(
|
||||||
reqHeaders: Record<string, string>,
|
reqHeaders: Record<string, string>,
|
||||||
reqBody: any,
|
reqBody: any,
|
||||||
): Promise<FetchHandlerResponse> {
|
): Promise<FetchHandlerResponse> {
|
||||||
reqHeaders['Authorization'] = 'did:test:alice' // DEBUG
|
|
||||||
|
|
||||||
const reqMimeType = reqHeaders['Content-Type'] || reqHeaders['content-type']
|
const reqMimeType = reqHeaders['Content-Type'] || reqHeaders['content-type']
|
||||||
if (reqMimeType && reqMimeType.startsWith('application/json')) {
|
if (reqMimeType && reqMimeType.startsWith('application/json')) {
|
||||||
reqBody = JSON.stringify(reqBody)
|
reqBody = JSON.stringify(reqBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await RNFetchBlob.fetch(
|
const res = await fetch(reqUri, {
|
||||||
/** @ts-ignore method coersion, it's fine -prf */
|
method: reqMethod,
|
||||||
reqMethod,
|
headers: reqHeaders,
|
||||||
reqUri,
|
body: reqBody,
|
||||||
reqHeaders,
|
})
|
||||||
reqBody,
|
|
||||||
)
|
|
||||||
|
|
||||||
const resStatus = res.info().status
|
const resStatus = res.status
|
||||||
const resHeaders = (res.info().headers || {}) as Record<string, string>
|
const resHeaders: Record<string, string> = {}
|
||||||
|
res.headers.forEach((value: string, key: string) => {
|
||||||
|
resHeaders[key] = value
|
||||||
|
})
|
||||||
const resMimeType = resHeaders['Content-Type'] || resHeaders['content-type']
|
const resMimeType = resHeaders['Content-Type'] || resHeaders['content-type']
|
||||||
let resBody
|
let resBody
|
||||||
if (resMimeType) {
|
if (resMimeType) {
|
||||||
if (resMimeType.startsWith('application/json')) {
|
if (resMimeType.startsWith('application/json')) {
|
||||||
resBody = res.json()
|
resBody = await res.json()
|
||||||
} else if (resMimeType.startsWith('text/')) {
|
} else if (resMimeType.startsWith('text/')) {
|
||||||
resBody = res.text()
|
resBody = await res.text()
|
||||||
} else {
|
} else {
|
||||||
resBody = res.base64()
|
throw new Error('TODO: non-textual response body')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -14,9 +14,8 @@ export class MeModel {
|
||||||
async load() {
|
async load() {
|
||||||
const sess = this.rootStore.session
|
const sess = this.rootStore.session
|
||||||
if (sess.isAuthed) {
|
if (sess.isAuthed) {
|
||||||
// TODO
|
this.did = sess.userdid || ''
|
||||||
this.did = 'did:test:alice'
|
this.name = sess.username
|
||||||
this.name = 'alice.todo'
|
|
||||||
const profile = await this.rootStore.api.todo.social.getProfile({
|
const profile = await this.rootStore.api.todo.social.getProfile({
|
||||||
user: this.did,
|
user: this.did,
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
import {makeAutoObservable} from 'mobx'
|
import {makeAutoObservable} from 'mobx'
|
||||||
import AdxApi from '../../third-party/api'
|
import AdxApi from '../../third-party/api'
|
||||||
import {ServiceClient} from '../../third-party/api/src/index'
|
import type {ServiceClient} from '../../third-party/api/src/index'
|
||||||
import {createContext, useContext} from 'react'
|
import {createContext, useContext} from 'react'
|
||||||
import {isObj, hasProp} from '../lib/type-guards'
|
import {isObj, hasProp} from '../lib/type-guards'
|
||||||
import {SessionModel} from './session'
|
import {SessionModel} from './session'
|
||||||
|
@ -13,7 +13,7 @@ import {ShellModel} from './shell'
|
||||||
import {MeModel} from './me'
|
import {MeModel} from './me'
|
||||||
|
|
||||||
export class RootStoreModel {
|
export class RootStoreModel {
|
||||||
session = new SessionModel()
|
session = new SessionModel(this)
|
||||||
nav = new NavigationModel()
|
nav = new NavigationModel()
|
||||||
shell = new ShellModel()
|
shell = new ShellModel()
|
||||||
me = new MeModel(this)
|
me = new MeModel(this)
|
||||||
|
|
|
@ -1,109 +1,133 @@
|
||||||
import {makeAutoObservable} from 'mobx'
|
import {makeAutoObservable} from 'mobx'
|
||||||
|
import AdxApi from '../../third-party/api'
|
||||||
import {isObj, hasProp} from '../lib/type-guards'
|
import {isObj, hasProp} from '../lib/type-guards'
|
||||||
// import {UserConfig} from '../../api'
|
import {RootStoreModel} from './root-store'
|
||||||
// import * as auth from '../lib/auth'
|
|
||||||
|
interface SessionData {
|
||||||
|
service: string
|
||||||
|
token: string
|
||||||
|
username: string
|
||||||
|
userdid: string
|
||||||
|
}
|
||||||
|
|
||||||
export class SessionModel {
|
export class SessionModel {
|
||||||
isAuthed = false
|
data: SessionData | null = null
|
||||||
|
|
||||||
constructor() {
|
constructor(public rootStore: RootStoreModel) {
|
||||||
makeAutoObservable(this, {
|
makeAutoObservable(this, {
|
||||||
|
rootStore: false,
|
||||||
serialize: false,
|
serialize: false,
|
||||||
hydrate: false,
|
hydrate: false,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isAuthed() {
|
||||||
|
return this.data !== null
|
||||||
|
}
|
||||||
|
|
||||||
serialize(): unknown {
|
serialize(): unknown {
|
||||||
return {
|
return this.data
|
||||||
isAuthed: this.isAuthed,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hydrate(v: unknown) {
|
hydrate(v: unknown) {
|
||||||
if (isObj(v)) {
|
if (isObj(v)) {
|
||||||
if (hasProp(v, 'isAuthed') && typeof v.isAuthed === 'boolean') {
|
const data: SessionData = {
|
||||||
this.isAuthed = v.isAuthed
|
service: '',
|
||||||
|
token: '',
|
||||||
|
username: '',
|
||||||
|
userdid: '',
|
||||||
|
}
|
||||||
|
if (hasProp(v, 'service') && typeof v.service === 'string') {
|
||||||
|
data.service = v.service
|
||||||
|
}
|
||||||
|
if (hasProp(v, 'token') && typeof v.token === 'string') {
|
||||||
|
data.token = v.token
|
||||||
|
}
|
||||||
|
if (hasProp(v, 'username') && typeof v.username === 'string') {
|
||||||
|
data.username = v.username
|
||||||
|
}
|
||||||
|
if (hasProp(v, 'userdid') && typeof v.userdid === 'string') {
|
||||||
|
data.userdid = v.userdid
|
||||||
|
}
|
||||||
|
if (data.service && data.token && data.username && data.userdid) {
|
||||||
|
this.data = data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setAuthed(v: boolean) {
|
clear() {
|
||||||
this.isAuthed = v
|
console.log('clear()')
|
||||||
|
this.data = null
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(data: SessionData) {
|
||||||
|
this.data = data
|
||||||
|
}
|
||||||
|
|
||||||
|
private configureApi(): boolean {
|
||||||
|
if (!this.data) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const serviceUri = new URL(this.data.service)
|
||||||
|
this.rootStore.api.xrpc.uri = serviceUri
|
||||||
|
} catch (e) {
|
||||||
|
console.error(
|
||||||
|
`Invalid service URL: ${this.data.service}. Resetting session.`,
|
||||||
|
)
|
||||||
|
console.error(e)
|
||||||
|
this.clear()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rootStore.api.setHeader('Authorization', `Bearer ${this.data.token}`)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
async setup(): Promise<void> {
|
||||||
|
if (!this.configureApi()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const sess = await this.rootStore.api.todo.adx.getSession({})
|
||||||
|
if (sess.success && this.data && this.data.userdid === sess.data.did) {
|
||||||
|
return // success
|
||||||
|
}
|
||||||
|
} catch (e: any) {}
|
||||||
|
|
||||||
|
this.clear() // invalid session cached
|
||||||
|
}
|
||||||
|
|
||||||
|
async login({
|
||||||
|
service,
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
}: {
|
||||||
|
service: string
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
}) {
|
||||||
|
const api = AdxApi.service(service)
|
||||||
|
const res = await api.todo.adx.createSession({}, {username, password})
|
||||||
|
if (res.data.jwt) {
|
||||||
|
this.setState({
|
||||||
|
service: service,
|
||||||
|
token: res.data.jwt,
|
||||||
|
username: res.data.name,
|
||||||
|
userdid: res.data.did,
|
||||||
|
})
|
||||||
|
this.configureApi()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async logout() {
|
||||||
|
if (this.isAuthed) {
|
||||||
|
this.rootStore.api.todo.adx.deleteSession({}).catch((e: any) => {
|
||||||
|
console.error('(Minor issue) Failed to delete session on the server', e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*login: flow(function* () {
|
|
||||||
/*self.uiIsProcessing = true
|
|
||||||
self.uiError = undefined
|
|
||||||
try {
|
|
||||||
if (!self.env.authStore) {
|
|
||||||
throw new Error('Auth store not initialized')
|
|
||||||
}
|
|
||||||
const res = yield auth.requestAppUcan(self.env.authStore)
|
|
||||||
self.isAuthed = res
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return res
|
|
||||||
} catch (e: any) {
|
|
||||||
console.error('Failed to request app ucan', e)
|
|
||||||
self.uiError = e.toString()
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
logout: flow(function* () {
|
|
||||||
self.uiIsProcessing = true
|
|
||||||
self.uiError = undefined
|
|
||||||
try {
|
|
||||||
if (!self.env.authStore) {
|
|
||||||
throw new Error('Auth store not initialized')
|
|
||||||
}
|
|
||||||
const res = yield auth.logout(self.env.authStore)
|
|
||||||
self.isAuthed = false
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return res
|
|
||||||
} catch (e: any) {
|
|
||||||
console.error('Failed to log out', e)
|
|
||||||
self.uiError = e.toString()
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
loadAccount: flow(function* () {
|
|
||||||
self.uiIsProcessing = true
|
|
||||||
self.uiError = undefined
|
|
||||||
try {
|
|
||||||
// const cfg = yield UserConfig.hydrate({
|
|
||||||
// serverUrl: self.serverUrl,
|
|
||||||
// secretKeyStr: self.secretKeyStr,
|
|
||||||
// rootAuthToken: self.rootAuthToken,
|
|
||||||
// })
|
|
||||||
// self.env.api.setUserCfg(cfg)
|
|
||||||
self.isAuthed = true
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return true
|
|
||||||
} catch (e: any) {
|
|
||||||
console.error('Failed to create test account', e)
|
|
||||||
self.uiError = e.toString()
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
createTestAccount: flow(function* (_serverUrl: string) {
|
|
||||||
self.uiIsProcessing = true
|
|
||||||
self.uiError = undefined
|
|
||||||
try {
|
|
||||||
// const cfg = yield UserConfig.createTest(serverUrl)
|
|
||||||
// const state = yield cfg.serialize()
|
|
||||||
// self.serverUrl = state.serverUrl
|
|
||||||
// self.secretKeyStr = state.secretKeyStr
|
|
||||||
// self.rootAuthToken = state.rootAuthToken
|
|
||||||
self.isAuthed = true
|
|
||||||
// self.env.api.setUserCfg(cfg)
|
|
||||||
} catch (e: any) {
|
|
||||||
console.error('Failed to create test account', e)
|
|
||||||
self.uiError = e.toString()
|
|
||||||
}
|
|
||||||
self.uiIsProcessing = false
|
|
||||||
}),
|
|
||||||
}))*/
|
|
||||||
|
|
214
src/third-party/api/index.js
vendored
214
src/third-party/api/index.js
vendored
|
@ -10178,9 +10178,13 @@ var Client = class {
|
||||||
};
|
};
|
||||||
var ServiceClient = class {
|
var ServiceClient = class {
|
||||||
constructor(baseClient, serviceUri) {
|
constructor(baseClient, serviceUri) {
|
||||||
|
this.headers = {};
|
||||||
this.baseClient = baseClient;
|
this.baseClient = baseClient;
|
||||||
this.uri = typeof serviceUri === "string" ? new URL(serviceUri) : serviceUri;
|
this.uri = typeof serviceUri === "string" ? new URL(serviceUri) : serviceUri;
|
||||||
}
|
}
|
||||||
|
setHeader(key, value) {
|
||||||
|
this.headers[key] = value;
|
||||||
|
}
|
||||||
async call(methodNsid, params, data, opts) {
|
async call(methodNsid, params, data, opts) {
|
||||||
const schema = this.baseClient.schemas.get(methodNsid);
|
const schema = this.baseClient.schemas.get(methodNsid);
|
||||||
if (!schema) {
|
if (!schema) {
|
||||||
|
@ -10188,7 +10192,13 @@ var ServiceClient = class {
|
||||||
}
|
}
|
||||||
const httpMethod = getMethodSchemaHTTPMethod(schema);
|
const httpMethod = getMethodSchemaHTTPMethod(schema);
|
||||||
const httpUri = constructMethodCallUri(schema, this.uri, params);
|
const httpUri = constructMethodCallUri(schema, this.uri, params);
|
||||||
const httpHeaders = constructMethodCallHeaders(schema, data, opts);
|
const httpHeaders = constructMethodCallHeaders(schema, data, {
|
||||||
|
headers: {
|
||||||
|
...this.headers,
|
||||||
|
...opts?.headers
|
||||||
|
},
|
||||||
|
encoding: opts?.encoding
|
||||||
|
});
|
||||||
const res = await this.baseClient.fetch(
|
const res = await this.baseClient.fetch(
|
||||||
httpUri,
|
httpUri,
|
||||||
httpMethod,
|
httpMethod,
|
||||||
|
@ -10243,13 +10253,28 @@ var methodSchemas = [
|
||||||
encoding: "application/json",
|
encoding: "application/json",
|
||||||
schema: {
|
schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["username", "did"],
|
required: ["username", "did", "password"],
|
||||||
properties: {
|
properties: {
|
||||||
username: {
|
username: {
|
||||||
type: "string"
|
type: "string"
|
||||||
},
|
},
|
||||||
did: {
|
did: {
|
||||||
type: "string"
|
type: "string"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
type: "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
encoding: "application/json",
|
||||||
|
schema: {
|
||||||
|
type: "object",
|
||||||
|
required: ["jwt"],
|
||||||
|
properties: {
|
||||||
|
jwt: {
|
||||||
|
type: "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10262,12 +10287,31 @@ var methodSchemas = [
|
||||||
description: "Create an authentication session.",
|
description: "Create an authentication session.",
|
||||||
parameters: {},
|
parameters: {},
|
||||||
input: {
|
input: {
|
||||||
encoding: "",
|
encoding: "application/json",
|
||||||
schema: {}
|
schema: {
|
||||||
|
type: "object",
|
||||||
|
required: ["username", "password"],
|
||||||
|
properties: {
|
||||||
|
username: {
|
||||||
|
type: "string"
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
type: "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
encoding: "",
|
encoding: "application/json",
|
||||||
schema: {}
|
schema: {
|
||||||
|
type: "object",
|
||||||
|
required: ["jwt"],
|
||||||
|
properties: {
|
||||||
|
jwt: {
|
||||||
|
type: "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -10326,8 +10370,19 @@ var methodSchemas = [
|
||||||
schema: {}
|
schema: {}
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
encoding: "",
|
encoding: "application/json",
|
||||||
schema: {}
|
schema: {
|
||||||
|
type: "object",
|
||||||
|
required: ["name", "did"],
|
||||||
|
properties: {
|
||||||
|
name: {
|
||||||
|
type: "string"
|
||||||
|
},
|
||||||
|
did: {
|
||||||
|
type: "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -11518,6 +11573,9 @@ var ServiceClient2 = class {
|
||||||
this.xrpc = xrpcService;
|
this.xrpc = xrpcService;
|
||||||
this.todo = new TodoNS(this);
|
this.todo = new TodoNS(this);
|
||||||
}
|
}
|
||||||
|
setHeader(key, value) {
|
||||||
|
this.xrpc.setHeader(key, value);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var TodoNS = class {
|
var TodoNS = class {
|
||||||
constructor(service) {
|
constructor(service) {
|
||||||
|
@ -11686,31 +11744,33 @@ var BadgeRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.badge";
|
record.$type = "todo.social.badge";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.badge", ...params },
|
{ type: "todo.social.badge", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.badge";
|
record.$type = "todo.social.badge";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.badge", ...params },
|
{ type: "todo.social.badge", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.badge",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.badge", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var FollowRecord = class {
|
var FollowRecord = class {
|
||||||
|
@ -11731,31 +11791,33 @@ var FollowRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.follow";
|
record.$type = "todo.social.follow";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.follow", ...params },
|
{ type: "todo.social.follow", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.follow";
|
record.$type = "todo.social.follow";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.follow", ...params },
|
{ type: "todo.social.follow", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.follow",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.follow", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var LikeRecord = class {
|
var LikeRecord = class {
|
||||||
|
@ -11776,31 +11838,33 @@ var LikeRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.like";
|
record.$type = "todo.social.like";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.like", ...params },
|
{ type: "todo.social.like", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.like";
|
record.$type = "todo.social.like";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.like", ...params },
|
{ type: "todo.social.like", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.like",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.like", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var MediaEmbedRecord = class {
|
var MediaEmbedRecord = class {
|
||||||
|
@ -11821,31 +11885,33 @@ var MediaEmbedRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.mediaEmbed";
|
record.$type = "todo.social.mediaEmbed";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.mediaEmbed", ...params },
|
{ type: "todo.social.mediaEmbed", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.mediaEmbed";
|
record.$type = "todo.social.mediaEmbed";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.mediaEmbed", ...params },
|
{ type: "todo.social.mediaEmbed", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.mediaEmbed",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.mediaEmbed", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var PostRecord = class {
|
var PostRecord = class {
|
||||||
|
@ -11866,31 +11932,33 @@ var PostRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.post";
|
record.$type = "todo.social.post";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.post", ...params },
|
{ type: "todo.social.post", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.post";
|
record.$type = "todo.social.post";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.post", ...params },
|
{ type: "todo.social.post", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.post",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.post", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var ProfileRecord = class {
|
var ProfileRecord = class {
|
||||||
|
@ -11911,31 +11979,33 @@ var ProfileRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.profile";
|
record.$type = "todo.social.profile";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.profile", ...params },
|
{ type: "todo.social.profile", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.profile";
|
record.$type = "todo.social.profile";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.profile", ...params },
|
{ type: "todo.social.profile", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.profile",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.profile", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var RepostRecord = class {
|
var RepostRecord = class {
|
||||||
|
@ -11956,31 +12026,33 @@ var RepostRecord = class {
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async create(params, record) {
|
async create(params, record, headers) {
|
||||||
record.$type = "todo.social.repost";
|
record.$type = "todo.social.repost";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoCreateRecord",
|
"todo.adx.repoCreateRecord",
|
||||||
{ type: "todo.social.repost", ...params },
|
{ type: "todo.social.repost", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async put(params, record) {
|
async put(params, record, headers) {
|
||||||
record.$type = "todo.social.repost";
|
record.$type = "todo.social.repost";
|
||||||
const res = await this._service.xrpc.call(
|
const res = await this._service.xrpc.call(
|
||||||
"todo.adx.repoPutRecord",
|
"todo.adx.repoPutRecord",
|
||||||
{ type: "todo.social.repost", ...params },
|
{ type: "todo.social.repost", ...params },
|
||||||
record,
|
record,
|
||||||
{ encoding: "application/json" }
|
{ encoding: "application/json", headers }
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
async delete(params) {
|
async delete(params, headers) {
|
||||||
await this._service.xrpc.call("todo.adx.repoDeleteRecord", {
|
await this._service.xrpc.call(
|
||||||
type: "todo.social.repost",
|
"todo.adx.repoDeleteRecord",
|
||||||
...params
|
{ type: "todo.social.repost", ...params },
|
||||||
});
|
void 0,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
4
src/third-party/api/index.js.map
vendored
4
src/third-party/api/index.js.map
vendored
File diff suppressed because one or more lines are too long
43
src/third-party/api/src/index.d.ts
vendored
43
src/third-party/api/src/index.d.ts
vendored
|
@ -43,6 +43,7 @@ export declare class ServiceClient {
|
||||||
xrpc: XrpcServiceClient;
|
xrpc: XrpcServiceClient;
|
||||||
todo: TodoNS;
|
todo: TodoNS;
|
||||||
constructor(baseClient: Client, xrpcService: XrpcServiceClient);
|
constructor(baseClient: Client, xrpcService: XrpcServiceClient);
|
||||||
|
setHeader(key: string, value: string): void;
|
||||||
}
|
}
|
||||||
export declare class TodoNS {
|
export declare class TodoNS {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -103,13 +104,13 @@ export declare class BadgeRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialBadge.Record;
|
value: TodoSocialBadge.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialBadge.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialBadge.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialBadge.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialBadge.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class FollowRecord {
|
export declare class FollowRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -124,13 +125,13 @@ export declare class FollowRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialFollow.Record;
|
value: TodoSocialFollow.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialFollow.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialFollow.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialFollow.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialFollow.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class LikeRecord {
|
export declare class LikeRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -145,13 +146,13 @@ export declare class LikeRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialLike.Record;
|
value: TodoSocialLike.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialLike.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialLike.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialLike.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialLike.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class MediaEmbedRecord {
|
export declare class MediaEmbedRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -166,13 +167,13 @@ export declare class MediaEmbedRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialMediaEmbed.Record;
|
value: TodoSocialMediaEmbed.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialMediaEmbed.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialMediaEmbed.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialMediaEmbed.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialMediaEmbed.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class PostRecord {
|
export declare class PostRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -187,13 +188,13 @@ export declare class PostRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialPost.Record;
|
value: TodoSocialPost.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialPost.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialPost.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialPost.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialPost.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class ProfileRecord {
|
export declare class ProfileRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -208,13 +209,13 @@ export declare class ProfileRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialProfile.Record;
|
value: TodoSocialProfile.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialProfile.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialProfile.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialProfile.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialProfile.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
export declare class RepostRecord {
|
export declare class RepostRecord {
|
||||||
_service: ServiceClient;
|
_service: ServiceClient;
|
||||||
|
@ -229,11 +230,11 @@ export declare class RepostRecord {
|
||||||
uri: string;
|
uri: string;
|
||||||
value: TodoSocialRepost.Record;
|
value: TodoSocialRepost.Record;
|
||||||
}>;
|
}>;
|
||||||
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialRepost.Record): Promise<{
|
create(params: Omit<TodoAdxRepoCreateRecord.QueryParams, 'type'>, record: TodoSocialRepost.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialRepost.Record): Promise<{
|
put(params: Omit<TodoAdxRepoPutRecord.QueryParams, 'type'>, record: TodoSocialRepost.Record, headers?: Record<string, string>): Promise<{
|
||||||
uri: string;
|
uri: string;
|
||||||
}>;
|
}>;
|
||||||
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>): Promise<void>;
|
delete(params: Omit<TodoAdxRepoDeleteRecord.QueryParams, 'type'>, headers?: Record<string, string>): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,14 @@ export interface CallOptions {
|
||||||
export interface InputSchema {
|
export interface InputSchema {
|
||||||
username: string;
|
username: string;
|
||||||
did: string;
|
did: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
export interface OutputSchema {
|
||||||
|
jwt: string;
|
||||||
}
|
}
|
||||||
export interface Response {
|
export interface Response {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
error: boolean;
|
error: boolean;
|
||||||
headers: Headers;
|
headers: Headers;
|
||||||
|
data: OutputSchema;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,14 @@ export interface QueryParams {
|
||||||
}
|
}
|
||||||
export interface CallOptions {
|
export interface CallOptions {
|
||||||
headers?: Headers;
|
headers?: Headers;
|
||||||
encoding: '';
|
encoding: 'application/json';
|
||||||
}
|
}
|
||||||
export interface InputSchema {
|
export interface InputSchema {
|
||||||
[k: string]: unknown;
|
username: string;
|
||||||
|
password: string;
|
||||||
}
|
}
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
[k: string]: unknown;
|
jwt: string;
|
||||||
}
|
}
|
||||||
export interface Response {
|
export interface Response {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
|
|
@ -9,7 +9,8 @@ export interface InputSchema {
|
||||||
[k: string]: unknown;
|
[k: string]: unknown;
|
||||||
}
|
}
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
[k: string]: unknown;
|
name: string;
|
||||||
|
did: string;
|
||||||
}
|
}
|
||||||
export interface Response {
|
export interface Response {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -102,24 +102,32 @@ export const s = StyleSheet.create({
|
||||||
p2: {padding: 2},
|
p2: {padding: 2},
|
||||||
p5: {padding: 5},
|
p5: {padding: 5},
|
||||||
p10: {padding: 10},
|
p10: {padding: 10},
|
||||||
|
p20: {padding: 20},
|
||||||
pr2: {paddingRight: 2},
|
pr2: {paddingRight: 2},
|
||||||
pr5: {paddingRight: 5},
|
pr5: {paddingRight: 5},
|
||||||
pr10: {paddingRight: 10},
|
pr10: {paddingRight: 10},
|
||||||
|
pr20: {paddingRight: 20},
|
||||||
pl2: {paddingLeft: 2},
|
pl2: {paddingLeft: 2},
|
||||||
pl5: {paddingLeft: 5},
|
pl5: {paddingLeft: 5},
|
||||||
pl10: {paddingLeft: 10},
|
pl10: {paddingLeft: 10},
|
||||||
|
pl20: {paddingLeft: 20},
|
||||||
pt2: {paddingTop: 2},
|
pt2: {paddingTop: 2},
|
||||||
pt5: {paddingTop: 5},
|
pt5: {paddingTop: 5},
|
||||||
pt10: {paddingTop: 10},
|
pt10: {paddingTop: 10},
|
||||||
|
pt20: {paddingTop: 20},
|
||||||
pb2: {paddingBottom: 2},
|
pb2: {paddingBottom: 2},
|
||||||
pb5: {paddingBottom: 5},
|
pb5: {paddingBottom: 5},
|
||||||
pb10: {paddingBottom: 10},
|
pb10: {paddingBottom: 10},
|
||||||
|
pb20: {paddingBottom: 20},
|
||||||
|
|
||||||
// flex
|
// flex
|
||||||
flexRow: {flexDirection: 'row'},
|
flexRow: {flexDirection: 'row'},
|
||||||
flexCol: {flexDirection: 'column'},
|
flexCol: {flexDirection: 'column'},
|
||||||
flex1: {flex: 1},
|
flex1: {flex: 1},
|
||||||
|
|
||||||
|
// position
|
||||||
|
absolute: {position: 'absolute'},
|
||||||
|
|
||||||
// dimensions
|
// dimensions
|
||||||
w100pct: {width: '100%'},
|
w100pct: {width: '100%'},
|
||||||
h100pct: {height: '100%'},
|
h100pct: {height: '100%'},
|
||||||
|
|
|
@ -3,8 +3,6 @@ import {IconProp} from '@fortawesome/fontawesome-svg-core'
|
||||||
import {Home} from './screens/Home'
|
import {Home} from './screens/Home'
|
||||||
import {Search} from './screens/Search'
|
import {Search} from './screens/Search'
|
||||||
import {Notifications} from './screens/Notifications'
|
import {Notifications} from './screens/Notifications'
|
||||||
import {Login} from './screens/Login'
|
|
||||||
import {Signup} from './screens/Signup'
|
|
||||||
import {NotFound} from './screens/NotFound'
|
import {NotFound} from './screens/NotFound'
|
||||||
import {PostThread} from './screens/PostThread'
|
import {PostThread} from './screens/PostThread'
|
||||||
import {PostLikedBy} from './screens/PostLikedBy'
|
import {PostLikedBy} from './screens/PostLikedBy'
|
||||||
|
@ -47,8 +45,6 @@ export const routes: Route[] = [
|
||||||
'retweet',
|
'retweet',
|
||||||
r('/profile/(?<name>[^/]+)/post/(?<recordKey>[^/]+)/reposted-by'),
|
r('/profile/(?<name>[^/]+)/post/(?<recordKey>[^/]+)/reposted-by'),
|
||||||
],
|
],
|
||||||
[Login, ['far', 'user'], r('/login')],
|
|
||||||
[Signup, ['far', 'user'], r('/signup')],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export function match(url: string): MatchResult {
|
export function match(url: string): MatchResult {
|
||||||
|
|
|
@ -1,27 +1,287 @@
|
||||||
import React from 'react'
|
import React, {useState} from 'react'
|
||||||
import {Text, View} from 'react-native'
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
useWindowDimensions,
|
||||||
|
} from 'react-native'
|
||||||
|
import Svg, {Line} from 'react-native-svg'
|
||||||
|
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
import {observer} from 'mobx-react-lite'
|
import {observer} from 'mobx-react-lite'
|
||||||
// import {useStores} from '../../state'
|
import {s, colors} from '../lib/styles'
|
||||||
|
import {useStores} from '../../state'
|
||||||
|
|
||||||
|
enum ScreenState {
|
||||||
|
SigninOrCreateAccount,
|
||||||
|
Signin,
|
||||||
|
}
|
||||||
|
|
||||||
|
const SigninOrCreateAccount = ({
|
||||||
|
onPressSignin,
|
||||||
|
}: {
|
||||||
|
onPressSignin: () => void
|
||||||
|
}) => {
|
||||||
|
const winDim = useWindowDimensions()
|
||||||
|
const halfWidth = winDim.width / 2
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View style={styles.hero}>
|
||||||
|
<Text style={styles.title}>Bluesky</Text>
|
||||||
|
<Text style={styles.subtitle}>[ private beta ]</Text>
|
||||||
|
</View>
|
||||||
|
<View style={s.flex1}>
|
||||||
|
<TouchableOpacity style={styles.btn}>
|
||||||
|
<Text style={styles.btnLabel}>Create a new account</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<View style={styles.or}>
|
||||||
|
<Svg height="1" width={winDim.width} style={styles.orLine}>
|
||||||
|
<Line
|
||||||
|
x1="30"
|
||||||
|
y1="0"
|
||||||
|
x2={halfWidth - 20}
|
||||||
|
y2="0"
|
||||||
|
stroke="white"
|
||||||
|
strokeWidth="1"
|
||||||
|
/>
|
||||||
|
<Line
|
||||||
|
x1={halfWidth + 20}
|
||||||
|
y1="0"
|
||||||
|
x2={winDim.width - 30}
|
||||||
|
y2="0"
|
||||||
|
stroke="white"
|
||||||
|
strokeWidth="1"
|
||||||
|
/>
|
||||||
|
</Svg>
|
||||||
|
<Text style={styles.orLabel}>or</Text>
|
||||||
|
</View>
|
||||||
|
<TouchableOpacity style={styles.btn} onPress={onPressSignin}>
|
||||||
|
<Text style={styles.btnLabel}>Sign in</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const Signin = ({onPressBack}: {onPressBack: () => void}) => {
|
||||||
|
const store = useStores()
|
||||||
|
const [isProcessing, setIsProcessing] = useState<boolean>(false)
|
||||||
|
const [error, setError] = useState<string>('')
|
||||||
|
const [username, setUsername] = useState<string>('')
|
||||||
|
const [password, setPassword] = useState<string>('')
|
||||||
|
|
||||||
|
const onPressNext = async () => {
|
||||||
|
setError('')
|
||||||
|
setIsProcessing(true)
|
||||||
|
try {
|
||||||
|
await store.session.login({
|
||||||
|
service: 'http://localhost:2583/',
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
})
|
||||||
|
} catch (e: any) {
|
||||||
|
const errMsg = e.toString()
|
||||||
|
console.log(e)
|
||||||
|
if (errMsg.includes('Authentication Required')) {
|
||||||
|
setError('Invalid username or password')
|
||||||
|
} else if (errMsg.includes('Network request failed')) {
|
||||||
|
setError(
|
||||||
|
'Unable to contact your service. Please check your Internet connection.',
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
setError(errMsg.replace(/^Error:/, ''))
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setIsProcessing(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView behavior="padding" style={{flex: 1}}>
|
||||||
|
<View style={styles.hero}>
|
||||||
|
<Text style={styles.title}>Bluesky</Text>
|
||||||
|
<Text style={styles.subtitle}>[ private beta ]</Text>
|
||||||
|
</View>
|
||||||
|
<View style={s.flex1}>
|
||||||
|
<View style={styles.group}>
|
||||||
|
<View style={styles.groupTitle}>
|
||||||
|
<Text style={[s.white, s.f18]}>Sign in</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.groupContent}>
|
||||||
|
<View style={[s.mb5]}>
|
||||||
|
<TextInput
|
||||||
|
style={styles.textInput}
|
||||||
|
placeholder="Email or username"
|
||||||
|
autoCapitalize="none"
|
||||||
|
autoFocus
|
||||||
|
value={username}
|
||||||
|
onChangeText={setUsername}
|
||||||
|
editable={!isProcessing}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={[s.mb5]}>
|
||||||
|
<TextInput
|
||||||
|
style={styles.textInput}
|
||||||
|
placeholder="Password"
|
||||||
|
autoCapitalize="none"
|
||||||
|
secureTextEntry
|
||||||
|
value={password}
|
||||||
|
onChangeText={setPassword}
|
||||||
|
editable={!isProcessing}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
{error ? (
|
||||||
|
<View style={styles.error}>
|
||||||
|
<View style={styles.errorIcon}>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon="exclamation"
|
||||||
|
style={s.white}
|
||||||
|
size={10}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<View style={s.flex1}>
|
||||||
|
<Text style={[s.white, s.bold]}>{error}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
) : undefined}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[s.flexRow, s.pl20, s.pr20]}>
|
||||||
|
<TouchableOpacity onPress={onPressBack}>
|
||||||
|
<Text style={[s.white, s.f18, s.bold, s.pl5]}>Back</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<View style={s.flex1} />
|
||||||
|
<TouchableOpacity onPress={onPressNext}>
|
||||||
|
{isProcessing ? (
|
||||||
|
<ActivityIndicator color="#fff" />
|
||||||
|
) : (
|
||||||
|
<Text style={[s.white, s.f18, s.bold, s.pr5]}>Next</Text>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export const Login = observer(
|
export const Login = observer(
|
||||||
(/*{navigation}: RootTabsScreenProps<'Login'>*/) => {
|
(/*{navigation}: RootTabsScreenProps<'Login'>*/) => {
|
||||||
// const store = useStores()
|
// const store = useStores()
|
||||||
|
const [screenState, setScreenState] = useState<ScreenState>(
|
||||||
|
ScreenState.SigninOrCreateAccount,
|
||||||
|
)
|
||||||
|
const onPressSignin = () => {
|
||||||
|
setScreenState(ScreenState.Signin)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
<View style={styles.outer}>
|
||||||
<Text style={{fontSize: 20, fontWeight: 'bold'}}>Sign In</Text>
|
{screenState === ScreenState.SigninOrCreateAccount ? (
|
||||||
{/*store.session.uiError && <Text>{store.session.uiError}</Text>}
|
<SigninOrCreateAccount onPressSignin={onPressSignin} />
|
||||||
{!store.session.uiIsProcessing ? (
|
) : undefined}
|
||||||
<>
|
{screenState === ScreenState.Signin ? (
|
||||||
<Button title="Login" onPress={() => store.session.login()} />
|
<Signin
|
||||||
<Button
|
onPressBack={() =>
|
||||||
title="Sign Up"
|
setScreenState(ScreenState.SigninOrCreateAccount)
|
||||||
onPress={() => navigation.navigate('Signup')}
|
}
|
||||||
/>
|
/>
|
||||||
</>
|
) : undefined}
|
||||||
) : (
|
|
||||||
<ActivityIndicator />
|
|
||||||
)*/}
|
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
outer: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
hero: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: colors.white,
|
||||||
|
fontSize: 68,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
},
|
||||||
|
subtitle: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: colors.white,
|
||||||
|
fontSize: 18,
|
||||||
|
},
|
||||||
|
btn: {
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: colors.white,
|
||||||
|
borderRadius: 10,
|
||||||
|
paddingVertical: 16,
|
||||||
|
marginBottom: 20,
|
||||||
|
marginHorizontal: 20,
|
||||||
|
},
|
||||||
|
btnLabel: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: colors.white,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
},
|
||||||
|
or: {
|
||||||
|
marginBottom: 20,
|
||||||
|
},
|
||||||
|
orLine: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 10,
|
||||||
|
},
|
||||||
|
orLabel: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
group: {
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: colors.white,
|
||||||
|
borderRadius: 10,
|
||||||
|
marginBottom: 20,
|
||||||
|
marginHorizontal: 20,
|
||||||
|
},
|
||||||
|
groupTitle: {
|
||||||
|
paddingVertical: 8,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: colors.blue1,
|
||||||
|
},
|
||||||
|
groupContent: {
|
||||||
|
paddingVertical: 8,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
},
|
||||||
|
textInput: {
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: colors.white,
|
||||||
|
paddingHorizontal: 8,
|
||||||
|
paddingVertical: 8,
|
||||||
|
borderRadius: 4,
|
||||||
|
fontSize: 18,
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginTop: 5,
|
||||||
|
backgroundColor: colors.purple3,
|
||||||
|
paddingHorizontal: 8,
|
||||||
|
paddingVertical: 5,
|
||||||
|
borderRadius: 4,
|
||||||
|
},
|
||||||
|
errorIcon: {
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: colors.white,
|
||||||
|
color: colors.white,
|
||||||
|
borderRadius: 30,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
marginRight: 5,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
import React from 'react'
|
|
||||||
import {Text, View} from 'react-native'
|
|
||||||
import {observer} from 'mobx-react-lite'
|
|
||||||
// import {useStores} from '../../state'
|
|
||||||
|
|
||||||
export const Signup = observer(
|
|
||||||
(/*{navigation}: RootTabsScreenProps<'Signup'>*/) => {
|
|
||||||
// const store = useStores()
|
|
||||||
return (
|
|
||||||
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
|
||||||
<Text style={{fontSize: 20, fontWeight: 'bold'}}>Create Account</Text>
|
|
||||||
{/*store.session.uiError ?? <Text>{store.session.uiError}</Text>}
|
|
||||||
{!store.session.uiIsProcessing ? (
|
|
||||||
<>
|
|
||||||
<Button
|
|
||||||
title="Create new account"
|
|
||||||
onPress={() => store.session.login()}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
title="Log in to an existing account"
|
|
||||||
onPress={() => navigation.navigate('Login')}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<ActivityIndicator />
|
|
||||||
)*/}
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, {useState, useRef, useEffect} from 'react'
|
import React, {useState, useEffect} from 'react'
|
||||||
import {observer} from 'mobx-react-lite'
|
import {observer} from 'mobx-react-lite'
|
||||||
import {
|
import {
|
||||||
useWindowDimensions,
|
useWindowDimensions,
|
||||||
|
@ -11,6 +11,8 @@ import {
|
||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {ScreenContainer, Screen} from 'react-native-screens'
|
import {ScreenContainer, Screen} from 'react-native-screens'
|
||||||
|
import LinearGradient from 'react-native-linear-gradient'
|
||||||
|
// import Svg, {Polygon} from 'react-native-svg'
|
||||||
import {GestureDetector, Gesture} from 'react-native-gesture-handler'
|
import {GestureDetector, Gesture} from 'react-native-gesture-handler'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
|
@ -25,12 +27,13 @@ import {useStores} from '../../../state'
|
||||||
import {NavigationModel} from '../../../state/models/navigation'
|
import {NavigationModel} from '../../../state/models/navigation'
|
||||||
import {TabsSelectorModel} from '../../../state/models/shell'
|
import {TabsSelectorModel} from '../../../state/models/shell'
|
||||||
import {match, MatchResult} from '../../routes'
|
import {match, MatchResult} from '../../routes'
|
||||||
|
import {Login} from '../../screens/Login'
|
||||||
import {Modal} from '../../com/modals/Modal'
|
import {Modal} from '../../com/modals/Modal'
|
||||||
import {LocationNavigator} from './location-navigator'
|
import {LocationNavigator} from './location-navigator'
|
||||||
import {createBackMenu, createForwardMenu} from './history-menu'
|
import {createBackMenu, createForwardMenu} from './history-menu'
|
||||||
import {createAccountsMenu} from './accounts-menu'
|
import {createAccountsMenu} from './accounts-menu'
|
||||||
import {createLocationMenu} from './location-menu'
|
import {createLocationMenu} from './location-menu'
|
||||||
import {s, colors} from '../../lib/styles'
|
import {s, colors, gradients} from '../../lib/styles'
|
||||||
import {AVIS} from '../../lib/assets'
|
import {AVIS} from '../../lib/assets'
|
||||||
|
|
||||||
const locationIconNeedsNudgeUp = (icon: IconProp) => icon === 'house'
|
const locationIconNeedsNudgeUp = (icon: IconProp) => icon === 'house'
|
||||||
|
@ -164,6 +167,53 @@ export const MobileShell: React.FC = observer(() => {
|
||||||
opacity: interpolate(swipeGestureInterp.value, [0, 1.0], [0.6, 0.0]),
|
opacity: interpolate(swipeGestureInterp.value, [0, 1.0], [0.6, 0.0]),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
console.log('authed?', store.session.isAuthed)
|
||||||
|
if (!store.session.isAuthed) {
|
||||||
|
return (
|
||||||
|
<LinearGradient
|
||||||
|
colors={['#007CFF', '#00BCFF']}
|
||||||
|
start={{x: 0, y: 0.8}}
|
||||||
|
end={{x: 1, y: 1}}
|
||||||
|
style={styles.outerContainer}>
|
||||||
|
{
|
||||||
|
undefined /* TODO want this? <Svg height={winDim.height} width={winDim.width} style={s.absolute}>
|
||||||
|
<Polygon
|
||||||
|
points={`
|
||||||
|
${winDim.width},0
|
||||||
|
${winDim.width - 250},0
|
||||||
|
0,${winDim.height - 140}
|
||||||
|
0,${winDim.height}
|
||||||
|
${winDim.width},${winDim.height}`}
|
||||||
|
fill="#fff"
|
||||||
|
fillOpacity="0.04"
|
||||||
|
/>
|
||||||
|
<Polygon
|
||||||
|
points={`
|
||||||
|
${winDim.width},0
|
||||||
|
${winDim.width - 100},0
|
||||||
|
0,${winDim.height - 60}
|
||||||
|
0,${winDim.height}
|
||||||
|
${winDim.width},${winDim.height}`}
|
||||||
|
fill="#fff"
|
||||||
|
fillOpacity="0.04"
|
||||||
|
/>
|
||||||
|
<Polygon
|
||||||
|
points={`
|
||||||
|
${winDim.width},100
|
||||||
|
0,${winDim.height}
|
||||||
|
${winDim.width},${winDim.height}`}
|
||||||
|
fill="#fff"
|
||||||
|
fillOpacity="0.04"
|
||||||
|
/>
|
||||||
|
</Svg>*/
|
||||||
|
}
|
||||||
|
<SafeAreaView style={styles.innerContainer}>
|
||||||
|
<Login />
|
||||||
|
</SafeAreaView>
|
||||||
|
</LinearGradient>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.outerContainer}>
|
<View style={styles.outerContainer}>
|
||||||
<View style={styles.topBar}>
|
<View style={styles.topBar}>
|
||||||
|
|
25
yarn.lock
25
yarn.lock
|
@ -3640,11 +3640,6 @@ balanced-match@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||||
|
|
||||||
base-64@0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
|
|
||||||
integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==
|
|
||||||
|
|
||||||
base64-js@^1.1.2, base64-js@^1.3.1, base64-js@^1.5.1:
|
base64-js@^1.1.2, base64-js@^1.3.1, base64-js@^1.5.1:
|
||||||
version "1.5.1"
|
version "1.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||||
|
@ -6110,18 +6105,6 @@ glob-to-regexp@^0.4.1:
|
||||||
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
|
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
|
||||||
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
|
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
|
||||||
|
|
||||||
glob@7.0.6:
|
|
||||||
version "7.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a"
|
|
||||||
integrity sha512-f8c0rE8JiCxpa52kWPAOa3ZaYEnzofDzCQLCn3Vdk0Z5OVLq3BsRFJI4S4ykpeVW6QMGBUkMeUpoEgWnMTnw5Q==
|
|
||||||
dependencies:
|
|
||||||
fs.realpath "^1.0.0"
|
|
||||||
inflight "^1.0.4"
|
|
||||||
inherits "2"
|
|
||||||
minimatch "^3.0.2"
|
|
||||||
once "^1.3.0"
|
|
||||||
path-is-absolute "^1.0.0"
|
|
||||||
|
|
||||||
glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
|
glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
|
||||||
version "7.2.3"
|
version "7.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||||
|
@ -10780,14 +10763,6 @@ rimraf@~2.6.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
glob "^7.1.3"
|
glob "^7.1.3"
|
||||||
|
|
||||||
rn-fetch-blob@^0.12.0:
|
|
||||||
version "0.12.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/rn-fetch-blob/-/rn-fetch-blob-0.12.0.tgz#ec610d2f9b3f1065556b58ab9c106eeb256f3cba"
|
|
||||||
integrity sha512-+QnR7AsJ14zqpVVUbzbtAjq0iI8c9tCg49tIoKO2ezjzRunN7YL6zFSFSWZm6d+mE/l9r+OeDM3jmb2tBb2WbA==
|
|
||||||
dependencies:
|
|
||||||
base-64 "0.1.0"
|
|
||||||
glob "7.0.6"
|
|
||||||
|
|
||||||
rollup-plugin-terser@^7.0.0:
|
rollup-plugin-terser@^7.0.0:
|
||||||
version "7.0.2"
|
version "7.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d"
|
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue