@xrift/sdk 0.1.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/README.md +127 -0
- package/dist/cjs/api/auth.cjs +32 -0
- package/dist/cjs/api/auth.cjs.map +1 -0
- package/dist/cjs/api/auth.d.cts +13 -0
- package/dist/cjs/api/auth.d.cts.map +1 -0
- package/dist/cjs/api/http-client.cjs +117 -0
- package/dist/cjs/api/http-client.cjs.map +1 -0
- package/dist/cjs/api/http-client.d.cts +25 -0
- package/dist/cjs/api/http-client.d.cts.map +1 -0
- package/dist/cjs/api/items.cjs +88 -0
- package/dist/cjs/api/items.cjs.map +1 -0
- package/dist/cjs/api/items.d.cts +15 -0
- package/dist/cjs/api/items.d.cts.map +1 -0
- package/dist/cjs/api/worlds.cjs +94 -0
- package/dist/cjs/api/worlds.cjs.map +1 -0
- package/dist/cjs/api/worlds.d.cts +15 -0
- package/dist/cjs/api/worlds.d.cts.map +1 -0
- package/dist/cjs/client.cjs +21 -0
- package/dist/cjs/client.cjs.map +1 -0
- package/dist/cjs/client.d.cts +13 -0
- package/dist/cjs/client.d.cts.map +1 -0
- package/dist/cjs/constants.cjs +10 -0
- package/dist/cjs/constants.cjs.map +1 -0
- package/dist/cjs/constants.d.cts +5 -0
- package/dist/cjs/constants.d.cts.map +1 -0
- package/dist/cjs/errors.cjs +38 -0
- package/dist/cjs/errors.cjs.map +1 -0
- package/dist/cjs/errors.d.cts +16 -0
- package/dist/cjs/errors.d.cts.map +1 -0
- package/dist/cjs/hash.cjs +96 -0
- package/dist/cjs/hash.cjs.map +1 -0
- package/dist/cjs/hash.d.cts +11 -0
- package/dist/cjs/hash.d.cts.map +1 -0
- package/dist/cjs/index.cjs +19 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +7 -0
- package/dist/cjs/index.d.cts.map +1 -0
- package/dist/cjs/types/auth.cjs +3 -0
- package/dist/cjs/types/auth.cjs.map +1 -0
- package/dist/cjs/types/auth.d.cts +20 -0
- package/dist/cjs/types/auth.d.cts.map +1 -0
- package/dist/cjs/types/common.cjs +3 -0
- package/dist/cjs/types/common.cjs.map +1 -0
- package/dist/cjs/types/common.d.cts +30 -0
- package/dist/cjs/types/common.d.cts.map +1 -0
- package/dist/cjs/types/index.cjs +3 -0
- package/dist/cjs/types/index.cjs.map +1 -0
- package/dist/cjs/types/index.d.cts +4 -0
- package/dist/cjs/types/index.d.cts.map +1 -0
- package/dist/cjs/types/items.cjs +3 -0
- package/dist/cjs/types/items.cjs.map +1 -0
- package/dist/cjs/types/items.d.cts +62 -0
- package/dist/cjs/types/items.d.cts.map +1 -0
- package/dist/cjs/types/worlds.cjs +3 -0
- package/dist/cjs/types/worlds.cjs.map +1 -0
- package/dist/cjs/types/worlds.d.cts +72 -0
- package/dist/cjs/types/worlds.d.cts.map +1 -0
- package/dist/cjs/utils/mime.cjs +34 -0
- package/dist/cjs/utils/mime.cjs.map +1 -0
- package/dist/cjs/utils/mime.d.cts +2 -0
- package/dist/cjs/utils/mime.d.cts.map +1 -0
- package/dist/esm/api/auth.d.ts +13 -0
- package/dist/esm/api/auth.d.ts.map +1 -0
- package/dist/esm/api/auth.js +26 -0
- package/dist/esm/api/auth.js.map +1 -0
- package/dist/esm/api/http-client.d.ts +25 -0
- package/dist/esm/api/http-client.d.ts.map +1 -0
- package/dist/esm/api/http-client.js +113 -0
- package/dist/esm/api/http-client.js.map +1 -0
- package/dist/esm/api/items.d.ts +15 -0
- package/dist/esm/api/items.d.ts.map +1 -0
- package/dist/esm/api/items.js +84 -0
- package/dist/esm/api/items.js.map +1 -0
- package/dist/esm/api/worlds.d.ts +15 -0
- package/dist/esm/api/worlds.d.ts.map +1 -0
- package/dist/esm/api/worlds.js +90 -0
- package/dist/esm/api/worlds.js.map +1 -0
- package/dist/esm/client.d.ts +13 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +17 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.d.ts +5 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +7 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/errors.d.ts +16 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +31 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/hash.d.ts +11 -0
- package/dist/esm/hash.d.ts.map +1 -0
- package/dist/esm/hash.js +60 -0
- package/dist/esm/hash.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/auth.d.ts +20 -0
- package/dist/esm/types/auth.d.ts.map +1 -0
- package/dist/esm/types/auth.js +2 -0
- package/dist/esm/types/auth.js.map +1 -0
- package/dist/esm/types/common.d.ts +30 -0
- package/dist/esm/types/common.d.ts.map +1 -0
- package/dist/esm/types/common.js +2 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/index.d.ts +4 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/items.d.ts +62 -0
- package/dist/esm/types/items.d.ts.map +1 -0
- package/dist/esm/types/items.js +2 -0
- package/dist/esm/types/items.js.map +1 -0
- package/dist/esm/types/worlds.d.ts +72 -0
- package/dist/esm/types/worlds.d.ts.map +1 -0
- package/dist/esm/types/worlds.js +2 -0
- package/dist/esm/types/worlds.js.map +1 -0
- package/dist/esm/utils/mime.d.ts +2 -0
- package/dist/esm/utils/mime.d.ts.map +1 -0
- package/dist/esm/utils/mime.js +31 -0
- package/dist/esm/utils/mime.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XriftNetworkError = exports.XriftAuthError = exports.XriftApiError = exports.XriftSdkError = void 0;
|
|
4
|
+
class XriftSdkError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'XriftSdkError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.XriftSdkError = XriftSdkError;
|
|
11
|
+
class XriftApiError extends XriftSdkError {
|
|
12
|
+
statusCode;
|
|
13
|
+
responseBody;
|
|
14
|
+
constructor(message, statusCode, responseBody) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = 'XriftApiError';
|
|
17
|
+
this.statusCode = statusCode;
|
|
18
|
+
this.responseBody = responseBody;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.XriftApiError = XriftApiError;
|
|
22
|
+
class XriftAuthError extends XriftApiError {
|
|
23
|
+
constructor(message = 'Authentication failed', responseBody) {
|
|
24
|
+
super(message, 401, responseBody);
|
|
25
|
+
this.name = 'XriftAuthError';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.XriftAuthError = XriftAuthError;
|
|
29
|
+
class XriftNetworkError extends XriftSdkError {
|
|
30
|
+
cause;
|
|
31
|
+
constructor(message = 'Network request failed', cause) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = 'XriftNetworkError';
|
|
34
|
+
this.cause = cause;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.XriftNetworkError = XriftNetworkError;
|
|
38
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AALD,sCAKC;AAED,MAAa,aAAc,SAAQ,aAAa;IACrC,UAAU,CAAS;IACnB,YAAY,CAAW;IAEhC,YAAY,OAAe,EAAE,UAAkB,EAAE,YAAsB;QACrE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,sCAUC;AAED,MAAa,cAAe,SAAQ,aAAa;IAC/C,YAAY,UAAkB,uBAAuB,EAAE,YAAsB;QAC3E,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAED,MAAa,iBAAkB,SAAQ,aAAa;IACzC,KAAK,CAAS;IAEvB,YAAY,UAAkB,wBAAwB,EAAE,KAAa;QACnE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AARD,8CAQC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class XriftSdkError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class XriftApiError extends XriftSdkError {
|
|
5
|
+
readonly statusCode: number;
|
|
6
|
+
readonly responseBody?: unknown;
|
|
7
|
+
constructor(message: string, statusCode: number, responseBody?: unknown);
|
|
8
|
+
}
|
|
9
|
+
export declare class XriftAuthError extends XriftApiError {
|
|
10
|
+
constructor(message?: string, responseBody?: unknown);
|
|
11
|
+
}
|
|
12
|
+
export declare class XriftNetworkError extends XriftSdkError {
|
|
13
|
+
readonly cause?: Error;
|
|
14
|
+
constructor(message?: string, cause?: Error);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,aAAc,SAAQ,aAAa;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;gBAEpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO;CAMxE;AAED,qBAAa,cAAe,SAAQ,aAAa;gBACnC,OAAO,GAAE,MAAgC,EAAE,YAAY,CAAC,EAAE,OAAO;CAI9E;AAED,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEX,OAAO,GAAE,MAAiC,EAAE,KAAK,CAAC,EAAE,KAAK;CAKtE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.calculateContentHash = calculateContentHash;
|
|
37
|
+
/**
|
|
38
|
+
* ユニバーサル SHA-256 ハッシュ計算 (先頭12文字)
|
|
39
|
+
* - Node.js: node:crypto (動的 import)
|
|
40
|
+
* - ブラウザ: Web Crypto API (crypto.subtle)
|
|
41
|
+
*/
|
|
42
|
+
async function calculateContentHash(files, configValues) {
|
|
43
|
+
// ファイルをパスでソートして順序を確定
|
|
44
|
+
const sortedFiles = [...files].sort((a, b) => a.remotePath.localeCompare(b.remotePath));
|
|
45
|
+
// 全データを結合
|
|
46
|
+
const chunks = [];
|
|
47
|
+
for (const file of sortedFiles) {
|
|
48
|
+
chunks.push(toUint8Array(file.data));
|
|
49
|
+
}
|
|
50
|
+
// 設定値をハッシュに含める(キーをソートして順序を安定化)
|
|
51
|
+
if (configValues) {
|
|
52
|
+
const configString = JSON.stringify(configValues, (_key, value) => {
|
|
53
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
54
|
+
const sorted = {};
|
|
55
|
+
for (const k of Object.keys(value).sort()) {
|
|
56
|
+
sorted[k] = value[k];
|
|
57
|
+
}
|
|
58
|
+
return sorted;
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
});
|
|
62
|
+
chunks.push(new TextEncoder().encode(configString));
|
|
63
|
+
}
|
|
64
|
+
const fullHash = await sha256Hex(chunks);
|
|
65
|
+
return fullHash.substring(0, 12);
|
|
66
|
+
}
|
|
67
|
+
function toUint8Array(data) {
|
|
68
|
+
if (data instanceof Uint8Array)
|
|
69
|
+
return data;
|
|
70
|
+
return new Uint8Array(data);
|
|
71
|
+
}
|
|
72
|
+
async function sha256Hex(chunks) {
|
|
73
|
+
// Node.js
|
|
74
|
+
if (typeof globalThis.process !== 'undefined' && globalThis.process.versions?.node) {
|
|
75
|
+
const { createHash } = await Promise.resolve().then(() => __importStar(require('node:crypto')));
|
|
76
|
+
const hash = createHash('sha256');
|
|
77
|
+
for (const chunk of chunks) {
|
|
78
|
+
hash.update(chunk);
|
|
79
|
+
}
|
|
80
|
+
return hash.digest('hex');
|
|
81
|
+
}
|
|
82
|
+
// ブラウザ (Web Crypto API)
|
|
83
|
+
const totalLength = chunks.reduce((sum, c) => sum + c.length, 0);
|
|
84
|
+
const merged = new Uint8Array(totalLength);
|
|
85
|
+
let offset = 0;
|
|
86
|
+
for (const chunk of chunks) {
|
|
87
|
+
merged.set(chunk, offset);
|
|
88
|
+
offset += chunk.length;
|
|
89
|
+
}
|
|
90
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', merged);
|
|
91
|
+
const hashArray = new Uint8Array(hashBuffer);
|
|
92
|
+
return Array.from(hashArray)
|
|
93
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
94
|
+
.join('');
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/hash.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,oDAgCC;AArCD;;;;GAIG;AACI,KAAK,UAAU,oBAAoB,CACxC,KAAoD,EACpD,YAAsC;IAEtC,qBAAqB;IACr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AAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileData } from './types/common.js';
|
|
2
|
+
/**
|
|
3
|
+
* ユニバーサル SHA-256 ハッシュ計算 (先頭12文字)
|
|
4
|
+
* - Node.js: node:crypto (動的 import)
|
|
5
|
+
* - ブラウザ: Web Crypto API (crypto.subtle)
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateContentHash(files: Array<{
|
|
8
|
+
remotePath: string;
|
|
9
|
+
data: FileData;
|
|
10
|
+
}>, configValues?: Record<string, unknown>): Promise<string>;
|
|
11
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EACpD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,MAAM,CAAC,CA6BjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XriftNetworkError = exports.XriftAuthError = exports.XriftApiError = exports.XriftSdkError = exports.getMimeType = exports.calculateContentHash = exports.XriftClient = void 0;
|
|
4
|
+
// Client
|
|
5
|
+
var client_js_1 = require("./client.js");
|
|
6
|
+
Object.defineProperty(exports, "XriftClient", { enumerable: true, get: function () { return client_js_1.XriftClient; } });
|
|
7
|
+
// Hash
|
|
8
|
+
var hash_js_1 = require("./hash.js");
|
|
9
|
+
Object.defineProperty(exports, "calculateContentHash", { enumerable: true, get: function () { return hash_js_1.calculateContentHash; } });
|
|
10
|
+
// MIME
|
|
11
|
+
var mime_js_1 = require("./utils/mime.js");
|
|
12
|
+
Object.defineProperty(exports, "getMimeType", { enumerable: true, get: function () { return mime_js_1.getMimeType; } });
|
|
13
|
+
// Errors
|
|
14
|
+
var errors_js_1 = require("./errors.js");
|
|
15
|
+
Object.defineProperty(exports, "XriftSdkError", { enumerable: true, get: function () { return errors_js_1.XriftSdkError; } });
|
|
16
|
+
Object.defineProperty(exports, "XriftApiError", { enumerable: true, get: function () { return errors_js_1.XriftApiError; } });
|
|
17
|
+
Object.defineProperty(exports, "XriftAuthError", { enumerable: true, get: function () { return errors_js_1.XriftAuthError; } });
|
|
18
|
+
Object.defineProperty(exports, "XriftNetworkError", { enumerable: true, get: function () { return errors_js_1.XriftNetworkError; } });
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,SAAS;AACT,yCAA0C;AAAjC,wGAAA,WAAW,OAAA;AAGpB,OAAO;AACP,qCAAiD;AAAxC,+GAAA,oBAAoB,OAAA;AAE7B,OAAO;AACP,2CAA8C;AAArC,sGAAA,WAAW,OAAA;AAEpB,SAAS;AACT,yCAKqB;AAJnB,0GAAA,aAAa,OAAA;AACb,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,8GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { XriftClient } from './client.js';
|
|
2
|
+
export type { XriftClientConfig } from './client.js';
|
|
3
|
+
export { calculateContentHash } from './hash.js';
|
|
4
|
+
export { getMimeType } from './utils/mime.js';
|
|
5
|
+
export { XriftSdkError, XriftApiError, XriftAuthError, XriftNetworkError, } from './errors.js';
|
|
6
|
+
export type { PhysicsConfig, CameraConfig, OutputBufferType, SignedUrlResponse, FileData, UploadFile, UploadProgress, WorldPermissions, CreateWorldRequest, CreateWorldResponse, WorldUploadUrlsRequest, WorldUploadUrlsResponse, CompleteWorldUploadRequest, CompleteWorldUploadResponse, WorldUploadOptions, WorldUploadResult, ItemPermissions, CreateItemRequest, CreateItemResponse, ItemUploadUrlsRequest, ItemUploadUrlsResponse, CompleteItemUploadRequest, CompleteItemUploadResponse, ItemUploadOptions, ItemUploadResult, } from './types/index.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/types/auth.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface VerifyTokenResponse {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
user?: {
|
|
4
|
+
id: string;
|
|
5
|
+
email: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface ExchangeTokenRequest {
|
|
10
|
+
code: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ExchangeTokenResponse {
|
|
13
|
+
token: string;
|
|
14
|
+
user?: {
|
|
15
|
+
id: string;
|
|
16
|
+
email: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/types/auth.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/types/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface PhysicsConfig {
|
|
2
|
+
gravity?: number;
|
|
3
|
+
allowInfiniteJump?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface CameraConfig {
|
|
6
|
+
near?: number;
|
|
7
|
+
far?: number;
|
|
8
|
+
}
|
|
9
|
+
export type OutputBufferType = 'UnsignedByteType' | 'HalfFloatType' | 'FloatType';
|
|
10
|
+
export interface SignedUrlResponse {
|
|
11
|
+
path: string;
|
|
12
|
+
uploadUrl: string;
|
|
13
|
+
publicUrl: string;
|
|
14
|
+
expiresAt: string;
|
|
15
|
+
}
|
|
16
|
+
/** SDK 用のファイルデータ型 (ユニバーサル) */
|
|
17
|
+
export type FileData = ArrayBuffer | Uint8Array;
|
|
18
|
+
/** SDK に渡すアップロードファイル */
|
|
19
|
+
export interface UploadFile {
|
|
20
|
+
remotePath: string;
|
|
21
|
+
size: number;
|
|
22
|
+
contentType: string;
|
|
23
|
+
data: FileData;
|
|
24
|
+
}
|
|
25
|
+
export interface UploadProgress {
|
|
26
|
+
completed: number;
|
|
27
|
+
total: number;
|
|
28
|
+
currentFile: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,GAAG,WAAW,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8BAA8B;AAC9B,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhD,wBAAwB;AACxB,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { PhysicsConfig, CameraConfig, OutputBufferType, SignedUrlResponse, FileData, UploadFile, UploadProgress, } from './common.js';
|
|
2
|
+
export type { WorldPermissions, CreateWorldRequest, CreateWorldResponse, WorldUploadUrlsRequest, WorldUploadUrlsResponse, CompleteWorldUploadRequest, CompleteWorldUploadResponse, WorldUploadOptions, WorldUploadResult, } from './worlds.js';
|
|
3
|
+
export type { ItemPermissions, CreateItemRequest, CreateItemResponse, ItemUploadUrlsRequest, ItemUploadUrlsResponse, CompleteItemUploadRequest, CompleteItemUploadResponse, ItemUploadOptions, ItemUploadResult, } from './items.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../src/types/items.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SignedUrlResponse, UploadFile, UploadProgress } from './common.js';
|
|
2
|
+
export interface ItemPermissions {
|
|
3
|
+
allowedDomains?: string[];
|
|
4
|
+
allowedCodeRules?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface CreateItemRequest {
|
|
7
|
+
}
|
|
8
|
+
export interface CreateItemResponse {
|
|
9
|
+
id: string;
|
|
10
|
+
ownerId: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ItemUploadUrlsRequest {
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
thumbnailPath?: string;
|
|
18
|
+
contentHash: string;
|
|
19
|
+
fileSize: number;
|
|
20
|
+
files: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
contentType: string;
|
|
23
|
+
}>;
|
|
24
|
+
permissions?: ItemPermissions;
|
|
25
|
+
}
|
|
26
|
+
export interface ItemUploadUrlsResponse {
|
|
27
|
+
uploadUrls: SignedUrlResponse[];
|
|
28
|
+
versionId: string;
|
|
29
|
+
contentHash: string;
|
|
30
|
+
versionNumber: number;
|
|
31
|
+
}
|
|
32
|
+
export interface CompleteItemUploadRequest {
|
|
33
|
+
versionId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface CompleteItemUploadResponse {
|
|
36
|
+
versionId: string;
|
|
37
|
+
itemId: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
contentHash: string;
|
|
41
|
+
fileSize: number;
|
|
42
|
+
status: string;
|
|
43
|
+
versionNumber: number;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ItemUploadOptions {
|
|
48
|
+
itemId?: string;
|
|
49
|
+
name: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
thumbnailPath?: string;
|
|
52
|
+
permissions?: ItemPermissions;
|
|
53
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
54
|
+
}
|
|
55
|
+
export interface ItemUploadResult {
|
|
56
|
+
itemId: string;
|
|
57
|
+
versionId: string;
|
|
58
|
+
versionNumber: number;
|
|
59
|
+
contentHash: string;
|
|
60
|
+
files: UploadFile[];
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/types/items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;CAEjC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worlds.js","sourceRoot":"","sources":["../../../src/types/worlds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PhysicsConfig, CameraConfig, OutputBufferType, SignedUrlResponse, UploadFile, UploadProgress } from './common.js';
|
|
2
|
+
export interface WorldPermissions {
|
|
3
|
+
allowedDomains?: string[];
|
|
4
|
+
allowedCodeRules?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface CreateWorldRequest {
|
|
7
|
+
}
|
|
8
|
+
export interface CreateWorldResponse {
|
|
9
|
+
id: string;
|
|
10
|
+
ownerId: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorldUploadUrlsRequest {
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
thumbnailPath?: string;
|
|
18
|
+
physics?: PhysicsConfig;
|
|
19
|
+
camera?: CameraConfig;
|
|
20
|
+
permissions?: WorldPermissions;
|
|
21
|
+
outputBufferType?: OutputBufferType;
|
|
22
|
+
contentHash: string;
|
|
23
|
+
fileSize: number;
|
|
24
|
+
files: Array<{
|
|
25
|
+
path: string;
|
|
26
|
+
contentType: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export interface WorldUploadUrlsResponse {
|
|
30
|
+
uploadUrls: SignedUrlResponse[];
|
|
31
|
+
versionId: string;
|
|
32
|
+
contentHash: string;
|
|
33
|
+
versionNumber: number;
|
|
34
|
+
}
|
|
35
|
+
export interface CompleteWorldUploadRequest {
|
|
36
|
+
versionId: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CompleteWorldUploadResponse {
|
|
39
|
+
versionId: string;
|
|
40
|
+
worldId: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
contentHash: string;
|
|
44
|
+
fileSize: number;
|
|
45
|
+
status: string;
|
|
46
|
+
versionNumber: number;
|
|
47
|
+
owner: {
|
|
48
|
+
id: string;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
}
|
|
54
|
+
export interface WorldUploadOptions {
|
|
55
|
+
worldId?: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
thumbnailPath?: string;
|
|
59
|
+
physics?: PhysicsConfig;
|
|
60
|
+
camera?: CameraConfig;
|
|
61
|
+
permissions?: WorldPermissions;
|
|
62
|
+
outputBufferType?: OutputBufferType;
|
|
63
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
64
|
+
}
|
|
65
|
+
export interface WorldUploadResult {
|
|
66
|
+
worldId: string;
|
|
67
|
+
versionId: string;
|
|
68
|
+
versionNumber: number;
|
|
69
|
+
contentHash: string;
|
|
70
|
+
files: UploadFile[];
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=worlds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worlds.d.ts","sourceRoot":"","sources":["../../../src/types/worlds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;CAElC;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,WAAW,EAAE,MAA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AM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMimeType = getMimeType;
|
|
4
|
+
const MIME_TYPES = {
|
|
5
|
+
'.glb': 'model/gltf-binary',
|
|
6
|
+
'.gltf': 'model/gltf+json',
|
|
7
|
+
'.png': 'image/png',
|
|
8
|
+
'.jpg': 'image/jpeg',
|
|
9
|
+
'.jpeg': 'image/jpeg',
|
|
10
|
+
'.webp': 'image/webp',
|
|
11
|
+
'.json': 'application/json',
|
|
12
|
+
'.js': 'application/javascript',
|
|
13
|
+
'.mjs': 'application/javascript',
|
|
14
|
+
'.html': 'text/html',
|
|
15
|
+
'.css': 'text/css',
|
|
16
|
+
'.txt': 'text/plain',
|
|
17
|
+
'.bin': 'application/octet-stream',
|
|
18
|
+
'.wasm': 'application/wasm',
|
|
19
|
+
'.svg': 'image/svg+xml',
|
|
20
|
+
'.mp3': 'audio/mpeg',
|
|
21
|
+
'.ogg': 'audio/ogg',
|
|
22
|
+
'.wav': 'audio/wav',
|
|
23
|
+
'.mp4': 'video/mp4',
|
|
24
|
+
'.webm': 'video/webm',
|
|
25
|
+
'.ktx2': 'image/ktx2',
|
|
26
|
+
'.basis': 'application/octet-stream',
|
|
27
|
+
'.hdr': 'application/octet-stream',
|
|
28
|
+
'.exr': 'application/octet-stream',
|
|
29
|
+
};
|
|
30
|
+
function getMimeType(filePath) {
|
|
31
|
+
const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();
|
|
32
|
+
return MIME_TYPES[ext] || 'application/octet-stream';
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=mime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mime.js","sourceRoot":"","sources":["../../../src/utils/mime.ts"],"names":[],"mappings":";;AA2BA,kCAGC;AA9BD,MAAM,UAAU,GAA2B;IACzC,MAAM,EAAE,mBAAmB;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,0BAA0B;IACpC,MAAM,EAAE,0BAA0B;IAClC,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,SAAgB,WAAW,CAAC,QAAgB;IAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mime.d.ts","sourceRoot":"","sources":["../../../src/utils/mime.ts"],"names":[],"mappings":"AA2BA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpClient } from './http-client.js';
|
|
2
|
+
import type { VerifyTokenResponse, ExchangeTokenResponse } from '../types/auth.js';
|
|
3
|
+
export declare class AuthApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
verifyToken(): Promise<VerifyTokenResponse>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* トークン不要の認証操作 (スタンドアロン関数)
|
|
10
|
+
*/
|
|
11
|
+
export declare function exchangeCodeForToken(code: string, baseUrl?: string): Promise<ExchangeTokenResponse>;
|
|
12
|
+
export declare function verifyToken(token: string, baseUrl?: string): Promise<VerifyTokenResponse>;
|
|
13
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAIlD;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,CAAC,CAOhC;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,CAAC,CAI9B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpClient } from './http-client.js';
|
|
2
|
+
import { AUTH_VERIFY_PATH, AUTH_TOKEN_EXCHANGE_PATH } from '../constants.js';
|
|
3
|
+
export class AuthApi {
|
|
4
|
+
http;
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
async verifyToken() {
|
|
9
|
+
const response = await this.http.get(AUTH_VERIFY_PATH);
|
|
10
|
+
return response.data;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* トークン不要の認証操作 (スタンドアロン関数)
|
|
15
|
+
*/
|
|
16
|
+
export async function exchangeCodeForToken(code, baseUrl) {
|
|
17
|
+
const http = new HttpClient({ baseUrl });
|
|
18
|
+
const response = await http.post(AUTH_TOKEN_EXCHANGE_PATH, { code });
|
|
19
|
+
return response.data;
|
|
20
|
+
}
|
|
21
|
+
export async function verifyToken(token, baseUrl) {
|
|
22
|
+
const http = new HttpClient({ baseUrl, token });
|
|
23
|
+
const response = await http.get(AUTH_VERIFY_PATH);
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAG7E,MAAM,OAAO,OAAO;IACW;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,KAAK,CAAC,WAAW;QACf,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,gBAAgB,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,OAAgB;IAEhB,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAC9B,wBAAwB,EACxB,EAAE,IAAI,EAAE,CACT,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,OAAgB;IAEhB,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAsB,gBAAgB,CAAC,CAAC;IACvE,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface HttpClientConfig {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
token?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface HttpResponse<T> {
|
|
7
|
+
status: number;
|
|
8
|
+
data: T;
|
|
9
|
+
}
|
|
10
|
+
export declare class HttpClient {
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
private readonly token?;
|
|
13
|
+
private readonly timeout;
|
|
14
|
+
constructor(config?: HttpClientConfig);
|
|
15
|
+
get<T>(path: string): Promise<HttpResponse<T>>;
|
|
16
|
+
post<T>(path: string, body?: unknown): Promise<HttpResponse<T>>;
|
|
17
|
+
put(path: string, body: BodyInit | ArrayBuffer | Uint8Array, headers?: Record<string, string>): Promise<HttpResponse<unknown>>;
|
|
18
|
+
/**
|
|
19
|
+
* 外部 URL (署名付き URL 等) への PUT リクエスト
|
|
20
|
+
*/
|
|
21
|
+
putExternal(url: string, body: BodyInit | ArrayBuffer | Uint8Array, headers?: Record<string, string>): Promise<void>;
|
|
22
|
+
private request;
|
|
23
|
+
private handleErrorResponse;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../../src/api/http-client.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE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