@attlaz/client 1.123.0 → 1.125.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.
@@ -12,5 +12,10 @@ export declare class SourcesAccountEndpoint extends Endpoint {
12
12
  getCodeSourceById(codeSourceId: string): Promise<CodeSource | null>;
13
13
  getRepositories(codeSourceAccountId: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepository>>;
14
14
  getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepositoryBranch>>;
15
+ /**
16
+ * Create an unconnected code source account. Connecting it — attaching a provider token — is a
17
+ * separate step against the created account.
18
+ */
19
+ createCodeSourceAccount(workspaceId: string, type: string): Promise<CodeSourceAccount>;
15
20
  saveCodeSource(codeSource: CodeSource): Promise<CodeSource>;
16
21
  }
@@ -66,6 +66,29 @@ export class SourcesAccountEndpoint extends Endpoint {
66
66
  const rawBranches = await this.requestCollection(queryString, SourcesAccountRepositoryBranch.parse);
67
67
  return rawBranches;
68
68
  }
69
+ /**
70
+ * Create an unconnected code source account. Connecting it — attaching a provider token — is a
71
+ * separate step against the created account.
72
+ */
73
+ async createCodeSourceAccount(workspaceId, type) {
74
+ try {
75
+ const result = await this.requestObject('/codesourceaccounts/', {
76
+ workspace: workspaceId,
77
+ type: type,
78
+ }, CodeSourceAccount.parse, 'POST');
79
+ const createdCodeSourceAccount = result.getData();
80
+ if (createdCodeSourceAccount === null) {
81
+ throw new Error('Unable to create code source account: wrong response from API');
82
+ }
83
+ return createdCodeSourceAccount;
84
+ }
85
+ catch (ex) {
86
+ if (this.httpClient.isDebugEnabled()) {
87
+ console.error('Failed to create code source account: ', ex);
88
+ }
89
+ throw ex;
90
+ }
91
+ }
69
92
  async saveCodeSource(codeSource) {
70
93
  try {
71
94
  const url = '/codesources/';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.122.0";
1
+ export declare const VERSION = "1.125.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.122.0";
1
+ export const VERSION = "1.125.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.123.0",
3
+ "version": "1.125.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -38,33 +38,32 @@
38
38
  "scripts": {
39
39
  "prebuild": "npm run setversion",
40
40
  "prepublishOnly": "npm run typecheck && npm test",
41
- "prepare": "npm run clean && tsc --project tsconfig.build.json && npm run setversion",
42
- "build": "npm run clean && tsc -p tsconfig.build.json",
41
+ "prepare": "npm run clean && npm run tsc -- --project tsconfig.build.json && npm run setversion",
42
+ "build": "npm run clean && npm run tsc -- -p tsconfig.build.json",
43
43
  "setversion": "node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
44
44
  "clean": "rimraf dist",
45
45
  "scan": "docker run -v .:/path zricethezav/gitleaks:latest detect --source=\"/path\" ",
46
46
  "test": "vitest run --mode unit",
47
- "typecheck": "tsc --project tsconfig.json --noEmit",
47
+ "typecheck": "npm run tsc -- --project tsconfig.json --noEmit",
48
48
  "test-integration": "vitest run --mode integration",
49
- "test-live": "vitest --mode unit"
49
+ "test-live": "vitest --mode unit",
50
+ "tsc": "node node_modules/@typescript/native/bin/tsc",
51
+ "typecheck:ts6": "tsc6 --project tsconfig.json --noEmit"
50
52
  },
51
53
  "publishConfig": {
52
54
  "access": "public",
53
55
  "registry": "https://registry.npmjs.org"
54
56
  },
55
57
  "devDependencies": {
56
- "@types/node": "^26.4.0",
57
- "@typescript-eslint/eslint-plugin": "^8.59.3",
58
- "@typescript-eslint/parser": "^8.59.3",
59
- "eslint": "^9.39.5",
60
- "eslint-config-attlaz-base": "^1.8.0",
58
+ "@types/node": "^26.5.0",
59
+ "@typescript/native": "npm:typescript@^7.0.2",
60
+ "eslint": "^10.10.0",
61
+ "eslint-config-attlaz-base": "^1.9.1",
61
62
  "eslint-import-resolver-typescript": "^4.4.5",
62
- "eslint-plugin-import": "^2.32.0",
63
- "eslint-plugin-jsdoc": "^62.9.0",
64
- "eslint-plugin-prefer-arrow": "^1.2.3",
65
- "eslint-plugin-promise": "^7.3.0",
63
+ "eslint-plugin-barrel-files": "^3.0.1",
64
+ "eslint-plugin-import-x": "^4.17.1",
66
65
  "rimraf": "^6.1.3",
67
- "typescript": "^6.0.3",
66
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
68
67
  "vitest": "^4.1.11"
69
68
  },
70
69
  "directories": {