@oxy.so/core 4.6.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/OxyServices.js +12 -0
- package/dist/cjs/api/organizations.js +94 -0
- package/dist/cjs/api/safety.js +26 -0
- package/dist/cjs/i18n/locales/en-US.js +61 -0
- package/dist/cjs/i18n/locales/es-ES.js +61 -0
- package/dist/esm/OxyServices.js +12 -0
- package/dist/esm/api/organizations.js +90 -0
- package/dist/esm/api/safety.js +22 -0
- package/dist/esm/i18n/locales/en-US.js +61 -0
- package/dist/esm/i18n/locales/es-ES.js +61 -0
- package/dist/types/OxyServices.d.ts +6 -0
- package/dist/types/api/accounts.d.ts +3 -0
- package/dist/types/api/organizations.d.ts +246 -0
- package/dist/types/api/safety.d.ts +14 -0
- package/dist/types/i18n/locales/en-US.d.ts +61 -0
- package/dist/types/i18n/locales/es-ES.d.ts +61 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/server/requesterAssertion.d.ts +2 -2
- package/package.json +3 -3
- package/src/OxyServices.ts +14 -0
- package/src/api/accounts.ts +3 -0
- package/src/api/organizations.ts +180 -0
- package/src/api/safety.ts +33 -0
- package/src/i18n/locales/en-US.ts +68 -0
- package/src/i18n/locales/es-ES.ts +68 -0
- package/src/index.ts +11 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
profileAccessInputSchema,
|
|
3
|
+
profileAccessDecisionSchema,
|
|
4
|
+
type ProfileAccessInput,
|
|
5
|
+
} from '@oxy.so/contracts';
|
|
6
|
+
import type { OxyContext } from '../client/context';
|
|
7
|
+
|
|
8
|
+
export class SafetyApi {
|
|
9
|
+
constructor(private readonly ctx: OxyContext) {}
|
|
10
|
+
/** Server callers must explicitly supply the incoming user bearer or null for anonymous access. */
|
|
11
|
+
async profileAccess(input: ProfileAccessInput, options?: { accessToken: string | null }) {
|
|
12
|
+
if (this.ctx.service && options === undefined)
|
|
13
|
+
throw new Error('Server profile access requires an explicit requester bearer or null');
|
|
14
|
+
return profileAccessDecisionSchema.parse(
|
|
15
|
+
await this.ctx.request(
|
|
16
|
+
'GET',
|
|
17
|
+
'/safety/profile-access',
|
|
18
|
+
profileAccessInputSchema.parse(input),
|
|
19
|
+
{
|
|
20
|
+
cache: false,
|
|
21
|
+
...(options
|
|
22
|
+
? {
|
|
23
|
+
skipAuth: true,
|
|
24
|
+
headers: options.accessToken
|
|
25
|
+
? { Authorization: `Bearer ${options.accessToken}` }
|
|
26
|
+
: {},
|
|
27
|
+
}
|
|
28
|
+
: {}),
|
|
29
|
+
},
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,4 +1,72 @@
|
|
|
1
1
|
const dict = {
|
|
2
|
+
organizationDirectory: {
|
|
3
|
+
invalidName: 'Use a plain-text organization name (up to 300 characters).',
|
|
4
|
+
review: {
|
|
5
|
+
title: 'Review organization access requests',
|
|
6
|
+
forbidden: 'This action requires current staff authorization.',
|
|
7
|
+
empty: 'No requests are waiting for review.',
|
|
8
|
+
hint: 'Review the supporting evidence independently. Approval grants management access to the existing organization account.',
|
|
9
|
+
independent: 'Another reviewer must decide your own request.',
|
|
10
|
+
evidence: 'Review evidence reference',
|
|
11
|
+
approved: 'Approve access',
|
|
12
|
+
rejected: 'Reject request',
|
|
13
|
+
conflict:
|
|
14
|
+
'This request or organization changed. Refresh the queue before making another decision.',
|
|
15
|
+
failed: 'The review could not be saved. Your decision has not been confirmed.',
|
|
16
|
+
},
|
|
17
|
+
title: 'Organization directory',
|
|
18
|
+
search: 'Find your organization',
|
|
19
|
+
searchHint:
|
|
20
|
+
'Find an existing organization before creating an account. Its identity is shared across Oxy apps.',
|
|
21
|
+
empty: 'No organizations found.',
|
|
22
|
+
retry: 'Try again',
|
|
23
|
+
loadMore: 'Show more',
|
|
24
|
+
failed: 'Could not load the organization directory.',
|
|
25
|
+
unclaimed: 'Unclaimed',
|
|
26
|
+
claimed: 'Managed organization',
|
|
27
|
+
inactive: 'Inactive',
|
|
28
|
+
newAccount: 'Create a new organization account',
|
|
29
|
+
newAccountHint:
|
|
30
|
+
'Create and manage a new organization. Choose an existing entry if your organization is already listed.',
|
|
31
|
+
addDirectory: 'Add to directory',
|
|
32
|
+
directoryHint:
|
|
33
|
+
'This creates a shared, unclaimed entry. It does not give you access to manage the organization.',
|
|
34
|
+
added: 'Organization added to the directory',
|
|
35
|
+
back: 'Back to search',
|
|
36
|
+
type: 'Organization type',
|
|
37
|
+
types: {
|
|
38
|
+
business: 'Business',
|
|
39
|
+
nonprofit: 'Nonprofit',
|
|
40
|
+
public_body: 'Public body',
|
|
41
|
+
community: 'Community',
|
|
42
|
+
other: 'Other',
|
|
43
|
+
},
|
|
44
|
+
name: 'Organization name',
|
|
45
|
+
legalName: 'Legal name',
|
|
46
|
+
website: 'Website',
|
|
47
|
+
country: 'Country code',
|
|
48
|
+
save: 'Save organization',
|
|
49
|
+
saved: 'Organization updated',
|
|
50
|
+
invalid:
|
|
51
|
+
'Check the organization details. Use a complete website URL and a two-letter country code.',
|
|
52
|
+
saveFailed: 'Could not save the organization. Try again.',
|
|
53
|
+
claim: 'Request management access',
|
|
54
|
+
claimHint:
|
|
55
|
+
'Oxy reviews evidence of your authority. A request does not grant access or verify your role.',
|
|
56
|
+
evidence: 'Supporting evidence reference',
|
|
57
|
+
evidenceHint:
|
|
58
|
+
'Provide a reference to your private verification case or supporting records. Only you and reviewers can read it.',
|
|
59
|
+
claimSent: 'Request submitted for review',
|
|
60
|
+
claimFailed: 'Could not submit your request. Try again.',
|
|
61
|
+
claimedHint: 'This organization already has managers. Contact a manager to request access.',
|
|
62
|
+
requests: 'Organization access requests',
|
|
63
|
+
pending: 'Pending review',
|
|
64
|
+
approved: 'Approved',
|
|
65
|
+
rejected: 'Rejected',
|
|
66
|
+
requestError: 'Could not load your access requests.',
|
|
67
|
+
view: 'Organization details',
|
|
68
|
+
readonly: 'You do not have permission to edit this organization.',
|
|
69
|
+
},
|
|
2
70
|
signin: {
|
|
3
71
|
title: 'Sign in',
|
|
4
72
|
subtitle: 'Use your Oxy account',
|
|
@@ -1,4 +1,72 @@
|
|
|
1
1
|
const dict = {
|
|
2
|
+
organizationDirectory: {
|
|
3
|
+
invalidName: 'Usa un nombre de organización en texto plano (hasta 300 caracteres).',
|
|
4
|
+
review: {
|
|
5
|
+
title: 'Revisar solicitudes de acceso a organizaciones',
|
|
6
|
+
forbidden: 'Esta acción requiere autorización vigente del personal de Oxy.',
|
|
7
|
+
empty: 'No hay solicitudes pendientes de revisión.',
|
|
8
|
+
hint: 'Revisa la documentación de forma independiente. La aprobación concede acceso de administración a la cuenta existente.',
|
|
9
|
+
independent: 'Otro revisor debe decidir sobre tu propia solicitud.',
|
|
10
|
+
evidence: 'Referencia de la documentación de revisión',
|
|
11
|
+
approved: 'Aprobar acceso',
|
|
12
|
+
rejected: 'Rechazar solicitud',
|
|
13
|
+
conflict:
|
|
14
|
+
'La solicitud o la organización ha cambiado. Actualiza la lista antes de tomar otra decisión.',
|
|
15
|
+
failed: 'No se pudo guardar la revisión. Tu decisión no se ha confirmado.',
|
|
16
|
+
},
|
|
17
|
+
title: 'Directorio de organizaciones',
|
|
18
|
+
search: 'Busca tu organización',
|
|
19
|
+
searchHint:
|
|
20
|
+
'Busca una organización existente antes de crear una cuenta. Su identidad se comparte entre las aplicaciones de Oxy.',
|
|
21
|
+
empty: 'No se encontraron organizaciones.',
|
|
22
|
+
retry: 'Reintentar',
|
|
23
|
+
loadMore: 'Mostrar más',
|
|
24
|
+
failed: 'No se pudo cargar el directorio de organizaciones.',
|
|
25
|
+
unclaimed: 'Sin reclamar',
|
|
26
|
+
claimed: 'Organización administrada',
|
|
27
|
+
inactive: 'Inactiva',
|
|
28
|
+
newAccount: 'Crear una nueva cuenta de organización',
|
|
29
|
+
newAccountHint:
|
|
30
|
+
'Crea y administra una organización nueva. Si ya aparece en el directorio, elige la entrada existente.',
|
|
31
|
+
addDirectory: 'Añadir al directorio',
|
|
32
|
+
directoryHint:
|
|
33
|
+
'Esto crea una entrada compartida sin reclamar. No te da acceso para administrar la organización.',
|
|
34
|
+
added: 'Organización añadida al directorio',
|
|
35
|
+
back: 'Volver a la búsqueda',
|
|
36
|
+
type: 'Tipo de organización',
|
|
37
|
+
types: {
|
|
38
|
+
business: 'Empresa',
|
|
39
|
+
nonprofit: 'Sin ánimo de lucro',
|
|
40
|
+
public_body: 'Organismo público',
|
|
41
|
+
community: 'Comunidad',
|
|
42
|
+
other: 'Otro',
|
|
43
|
+
},
|
|
44
|
+
name: 'Nombre de la organización',
|
|
45
|
+
legalName: 'Nombre legal',
|
|
46
|
+
website: 'Sitio web',
|
|
47
|
+
country: 'Código de país',
|
|
48
|
+
save: 'Guardar organización',
|
|
49
|
+
saved: 'Organización actualizada',
|
|
50
|
+
invalid: 'Revisa los datos. Usa una URL completa y un código de país de dos letras.',
|
|
51
|
+
saveFailed: 'No se pudo guardar la organización. Inténtalo de nuevo.',
|
|
52
|
+
claim: 'Solicitar acceso de administración',
|
|
53
|
+
claimHint:
|
|
54
|
+
'Oxy revisará las pruebas de tu autorización. Una solicitud no concede acceso ni verifica tu cargo.',
|
|
55
|
+
evidence: 'Referencia de la documentación',
|
|
56
|
+
evidenceHint:
|
|
57
|
+
'Indica una referencia a tu expediente privado de verificación o documentación acreditativa. Solo tú y los revisores podéis verla.',
|
|
58
|
+
claimSent: 'Solicitud enviada para revisión',
|
|
59
|
+
claimFailed: 'No se pudo enviar la solicitud. Inténtalo de nuevo.',
|
|
60
|
+
claimedHint:
|
|
61
|
+
'Esta organización ya tiene administradores. Contacta con uno para solicitar acceso.',
|
|
62
|
+
requests: 'Solicitudes de acceso a organizaciones',
|
|
63
|
+
pending: 'Pendiente de revisión',
|
|
64
|
+
approved: 'Aprobada',
|
|
65
|
+
rejected: 'Rechazada',
|
|
66
|
+
requestError: 'No se pudieron cargar tus solicitudes.',
|
|
67
|
+
view: 'Datos de la organización',
|
|
68
|
+
readonly: 'No tienes permiso para editar esta organización.',
|
|
69
|
+
},
|
|
2
70
|
signin: {
|
|
3
71
|
title: 'Iniciar sesión',
|
|
4
72
|
subtitle: 'Usa tu cuenta de Oxy',
|
package/src/index.ts
CHANGED
|
@@ -605,3 +605,14 @@ export type { PkcePair, BuildOAuthAuthorizeUrlParams, OxyAuthScreen } from './ut
|
|
|
605
605
|
// Constants
|
|
606
606
|
// ---------------------------------------------------------------------------
|
|
607
607
|
export { packageInfo } from './constants/version';
|
|
608
|
+
|
|
609
|
+
export type {
|
|
610
|
+
Organization,
|
|
611
|
+
OrganizationType,
|
|
612
|
+
CreateOrganization,
|
|
613
|
+
UpdateOrganization,
|
|
614
|
+
OrganizationSearch,
|
|
615
|
+
OrganizationClaim,
|
|
616
|
+
} from '@oxy.so/contracts';
|
|
617
|
+
|
|
618
|
+
export type { ProfileAccessInput, ProfileAccessDecision } from '@oxy.so/contracts';
|