@bloque/sdk-orgs 0.0.2

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.
@@ -0,0 +1,7 @@
1
+ import type { HttpClient } from '@bloque/sdk-core';
2
+ import type { CreateOrgParams, Organization } from './types';
3
+ export declare class OrgsClient {
4
+ private readonly httpClient;
5
+ constructor(httpClient: HttpClient);
6
+ create(params: CreateOrgParams): Promise<Organization>;
7
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ OrgsClient: ()=>OrgsClient
28
+ });
29
+ class OrgsClient {
30
+ httpClient;
31
+ constructor(httpClient){
32
+ this.httpClient = httpClient;
33
+ }
34
+ async create(params) {
35
+ const response = await this.httpClient.request({
36
+ method: 'POST',
37
+ path: '/api/orgs',
38
+ body: params
39
+ });
40
+ return response.result.organization;
41
+ }
42
+ }
43
+ exports.OrgsClient = __webpack_exports__.OrgsClient;
44
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
45
+ "OrgsClient"
46
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
47
+ Object.defineProperty(exports, '__esModule', {
48
+ value: true
49
+ });
@@ -0,0 +1,2 @@
1
+ export * from './client';
2
+ export * from './types';
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ class OrgsClient {
2
+ httpClient;
3
+ constructor(httpClient){
4
+ this.httpClient = httpClient;
5
+ }
6
+ async create(params) {
7
+ const response = await this.httpClient.request({
8
+ method: 'POST',
9
+ path: '/api/orgs',
10
+ body: params
11
+ });
12
+ return response.result.organization;
13
+ }
14
+ }
15
+ export { OrgsClient };
@@ -0,0 +1,42 @@
1
+ export type OrgType = 'business' | 'individual';
2
+ export type OrgStatus = 'awaiting_compliance_verification' | 'active' | 'suspended' | 'closed';
3
+ export interface Place {
4
+ country_code: string;
5
+ state: string;
6
+ address_line1: string;
7
+ postal_code: string;
8
+ city: string;
9
+ is_primary: boolean;
10
+ }
11
+ export interface OrgProfile {
12
+ legal_name: string;
13
+ tax_id: string;
14
+ incorporation_date: string;
15
+ business_type: string;
16
+ incorporation_country_code: string;
17
+ incorporation_state?: string;
18
+ address_line1: string;
19
+ address_line2?: string;
20
+ postal_code: string;
21
+ city: string;
22
+ logo_url?: string;
23
+ places?: Place[];
24
+ }
25
+ export interface CreateOrgParams {
26
+ org_type: OrgType;
27
+ profile: OrgProfile;
28
+ metadata?: Record<string, unknown>;
29
+ }
30
+ export interface Organization {
31
+ urn: string;
32
+ org_type: OrgType;
33
+ profile: OrgProfile;
34
+ metadata?: Record<string, unknown>;
35
+ status: OrgStatus;
36
+ }
37
+ export interface CreateOrgResponse {
38
+ result: {
39
+ organization: Organization;
40
+ };
41
+ req_id: string;
42
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@bloque/sdk-orgs",
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "keywords": [
6
+ "bloque",
7
+ "sdk",
8
+ "api"
9
+ ],
10
+ "license": "MIT",
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "provenance": true
14
+ },
15
+ "homepage": "git+https://github.com/bloque-app/sdk.git#readme",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/bloque-app/sdk.git",
19
+ "directory": "packages/sdk"
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js",
25
+ "require": "./dist/index.cjs"
26
+ }
27
+ },
28
+ "main": "./dist/index.cjs",
29
+ "types": "./dist/index.d.ts",
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "engines": {
34
+ "node": ">=22"
35
+ },
36
+ "scripts": {
37
+ "build": "rslib build",
38
+ "dev": "rslib build --watch",
39
+ "clean": "rm -rf node_modules && rm -rf dist",
40
+ "check": "biome check --write",
41
+ "typecheck": "tsgo --noEmit"
42
+ },
43
+ "dependencies": {
44
+ "@bloque/sdk-core": "workspace:*"
45
+ },
46
+ "devDependencies": {
47
+ "@rslib/core": "catalog:",
48
+ "@types/node": "catalog:",
49
+ "@typescript/native-preview": "catalog:",
50
+ "typescript": "catalog:"
51
+ }
52
+ }