@adminide-stack/core
TypeScript icon, indicating that this package has built-in type declarations

12.0.4-alpha.55 • Public • Published

To run tests

`npm link`
`npm link @xtermstack/xterm-core`
`yarn install`
`tsc`
`yarn test`

Usage Examples

Direct Resource URI Creation

The createDirectResourceUri function provides a streamlined way to create resource URIs without needing to first create a cdecode URI and then convert it:

import { createDirectResourceUri, ConfigCollectionName, ConfigFragmentName } from '@adminide-stack/core';

// Create a URI for a team resource
const teamUri = createDirectResourceUri(
    ConfigCollectionName.Teams,
    '60a3e1c5f30d3a001c9e8d5e', // team ID
    'my-organization', // organization name or ID
    {
        tenantId: 'default',
        fragment: ConfigFragmentName.Settings,
        useOrgNameParam: true, // use 'orgName' parameter (default: true)
    },
);

// Result: cde-resource://default/teams?_id=60a3e1c5f30d3a001c9e8d5e&orgName=my-organization#settings

// Create a URI for an organization resource (only needs ID)
const orgUri = createDirectResourceUri(
    ConfigCollectionName.Organizations,
    '60a3e1c5f30d3a001c9e8d5f', // organization ID
    null, // no organization parameter needed
    {
        tenantId: 'default',
        fragment: ConfigFragmentName.Settings,
    },
);

// Result: cde-resource://default/organizations?_id=60a3e1c5f30d3a001c9e8d5f#settings

This approach is more efficient than creating and converting cdecode URIs, and it ensures that the parameters are always in the correct order with _id first.

Readme

Keywords

none

Package Sidebar

Install

npm i @adminide-stack/core

Weekly Downloads

825

Version

12.0.4-alpha.55

License

UNLICENSED

Unpacked Size

365 kB

Total Files

205

Last publish

Collaborators

  • messenger-box
  • adminide-stack-user
  • admin-layout
  • pubngo-stack
  • cdmbase-developer
  • clockbook-app
  • max-oyedele
  • shubhankar1solanki
  • muflah
  • shubham1012
  • container-stack
  • raheelriax
  • ops-stack
  • nsharc4
  • shubhamxshah