@gitbeaker/core 42.3.0 → 42.4.1

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/index.d.mts CHANGED
@@ -26,6 +26,16 @@ type AllOrNone<T extends Record<string, any>> = T | Partial<Record<keyof T, neve
26
26
  type MappedOmit<T, K extends keyof T> = {
27
27
  [P in keyof T as P extends K ? never : P]: T[P];
28
28
  };
29
+ /**
30
+ * A special class to mark path segments that should not be URL-encoded.
31
+ * Used for paths that already contain special characters like '/' that should be preserved.
32
+ * For example, in API paths like 'repository/commits', the slash should not be encoded to '%2F'.
33
+ */
34
+ declare class RawPathSegment {
35
+ readonly value: string;
36
+ constructor(value: string);
37
+ toString(): string;
38
+ }
29
39
 
30
40
  interface IsForm {
31
41
  isForm?: boolean;
@@ -2210,8 +2220,8 @@ interface DiscussionSchema extends Record<string, unknown> {
2210
2220
  }
2211
2221
  type DiscussionNotePositionOptions = Camelize<DiscussionNotePositionSchema>;
2212
2222
  declare class ResourceDiscussions<C extends boolean = false> extends BaseResource<C> {
2213
- protected resource2Type: string;
2214
- constructor(resourceType: string, resource2Type: string, options: BaseResourceOptions<C>);
2223
+ protected resource2Type: string | RawPathSegment;
2224
+ constructor(resourceType: string, resource2Type: string | RawPathSegment, options: BaseResourceOptions<C>);
2215
2225
  addNote<E extends boolean = false>(resourceId: string | number, resource2Id: string | number, discussionId: string | number, noteId: number, body: string, options?: {
2216
2226
  createdAt?: string;
2217
2227
  } & Sudo & ShowExpanded<E>): Promise<GitlabAPIResponse<DiscussionNoteSchema, C, E, void>>;
@@ -5180,8 +5190,14 @@ interface EnvironmentSchema extends Record<string, unknown> {
5180
5190
  updated_at: string;
5181
5191
  enable_advanced_logs_querying: boolean;
5182
5192
  logs_api_path: string;
5193
+ flux_resource_path?: string;
5194
+ kubernetes_namespace?: string;
5183
5195
  last_deployment: DeploymentSchema;
5184
5196
  deployable: DeployableSchema;
5197
+ project?: SimpleProjectSchema;
5198
+ auto_stop_at: string | null;
5199
+ description: string | null;
5200
+ auto_stop_setting: string;
5185
5201
  }
5186
5202
  type CondensedEnvironmentSchema = MappedOmit<EnvironmentSchema, 'last_deployment' | 'deployable'>;
5187
5203
  type ReviewAppSchema = MappedOmit<CondensedEnvironmentSchema, 'state'>;
package/dist/index.d.ts CHANGED
@@ -26,6 +26,16 @@ type AllOrNone<T extends Record<string, any>> = T | Partial<Record<keyof T, neve
26
26
  type MappedOmit<T, K extends keyof T> = {
27
27
  [P in keyof T as P extends K ? never : P]: T[P];
28
28
  };
29
+ /**
30
+ * A special class to mark path segments that should not be URL-encoded.
31
+ * Used for paths that already contain special characters like '/' that should be preserved.
32
+ * For example, in API paths like 'repository/commits', the slash should not be encoded to '%2F'.
33
+ */
34
+ declare class RawPathSegment {
35
+ readonly value: string;
36
+ constructor(value: string);
37
+ toString(): string;
38
+ }
29
39
 
30
40
  interface IsForm {
31
41
  isForm?: boolean;
@@ -2210,8 +2220,8 @@ interface DiscussionSchema extends Record<string, unknown> {
2210
2220
  }
2211
2221
  type DiscussionNotePositionOptions = Camelize<DiscussionNotePositionSchema>;
2212
2222
  declare class ResourceDiscussions<C extends boolean = false> extends BaseResource<C> {
2213
- protected resource2Type: string;
2214
- constructor(resourceType: string, resource2Type: string, options: BaseResourceOptions<C>);
2223
+ protected resource2Type: string | RawPathSegment;
2224
+ constructor(resourceType: string, resource2Type: string | RawPathSegment, options: BaseResourceOptions<C>);
2215
2225
  addNote<E extends boolean = false>(resourceId: string | number, resource2Id: string | number, discussionId: string | number, noteId: number, body: string, options?: {
2216
2226
  createdAt?: string;
2217
2227
  } & Sudo & ShowExpanded<E>): Promise<GitlabAPIResponse<DiscussionNoteSchema, C, E, void>>;
@@ -5180,8 +5190,14 @@ interface EnvironmentSchema extends Record<string, unknown> {
5180
5190
  updated_at: string;
5181
5191
  enable_advanced_logs_querying: boolean;
5182
5192
  logs_api_path: string;
5193
+ flux_resource_path?: string;
5194
+ kubernetes_namespace?: string;
5183
5195
  last_deployment: DeploymentSchema;
5184
5196
  deployable: DeployableSchema;
5197
+ project?: SimpleProjectSchema;
5198
+ auto_stop_at: string | null;
5199
+ description: string | null;
5200
+ auto_stop_setting: string;
5185
5201
  }
5186
5202
  type CondensedEnvironmentSchema = MappedOmit<EnvironmentSchema, 'last_deployment' | 'deployable'>;
5187
5203
  type ReviewAppSchema = MappedOmit<CondensedEnvironmentSchema, 'state'>;
package/dist/index.js CHANGED
@@ -18,11 +18,20 @@ function appendFormFromObject(object) {
18
18
  });
19
19
  return form;
20
20
  }
21
+ var RawPathSegment = class {
22
+ value;
23
+ constructor(value) {
24
+ this.value = value;
25
+ }
26
+ toString() {
27
+ return this.value;
28
+ }
29
+ };
21
30
  function endpoint(strings, ...values) {
22
- return values.reduce(
23
- (string, value, index) => string + encodeURIComponent(value) + strings[index + 1],
24
- strings[0]
25
- );
31
+ return values.reduce((result, value, index) => {
32
+ const encodedValue = value instanceof RawPathSegment ? value.value : encodeURIComponent(String(value));
33
+ return result + encodedValue + strings[index + 1];
34
+ }, strings[0]);
26
35
  }
27
36
  function parseLinkHeader(linkString) {
28
37
  const output = {};
@@ -2634,7 +2643,7 @@ var Branches = class extends requesterUtils.BaseResource {
2634
2643
  // src/resources/CommitDiscussions.ts
2635
2644
  var CommitDiscussions = class extends ResourceDiscussions {
2636
2645
  constructor(options) {
2637
- super("projects", "repository/commits", options);
2646
+ super("projects", new RawPathSegment("repository/commits"), options);
2638
2647
  }
2639
2648
  };
2640
2649
  var Commits = class extends requesterUtils.BaseResource {
package/dist/index.mjs CHANGED
@@ -12,11 +12,20 @@ function appendFormFromObject(object) {
12
12
  });
13
13
  return form;
14
14
  }
15
+ var RawPathSegment = class {
16
+ value;
17
+ constructor(value) {
18
+ this.value = value;
19
+ }
20
+ toString() {
21
+ return this.value;
22
+ }
23
+ };
15
24
  function endpoint(strings, ...values) {
16
- return values.reduce(
17
- (string, value, index) => string + encodeURIComponent(value) + strings[index + 1],
18
- strings[0]
19
- );
25
+ return values.reduce((result, value, index) => {
26
+ const encodedValue = value instanceof RawPathSegment ? value.value : encodeURIComponent(String(value));
27
+ return result + encodedValue + strings[index + 1];
28
+ }, strings[0]);
20
29
  }
21
30
  function parseLinkHeader(linkString) {
22
31
  const output = {};
@@ -2628,7 +2637,7 @@ var Branches = class extends BaseResource {
2628
2637
  // src/resources/CommitDiscussions.ts
2629
2638
  var CommitDiscussions = class extends ResourceDiscussions {
2630
2639
  constructor(options) {
2631
- super("projects", "repository/commits", options);
2640
+ super("projects", new RawPathSegment("repository/commits"), options);
2632
2641
  }
2633
2642
  };
2634
2643
  var Commits = class extends BaseResource {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitbeaker/core",
3
- "version": "42.3.0",
3
+ "version": "42.4.1",
4
4
  "description": "Core API implementation of the GitLab API",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -52,7 +52,7 @@
52
52
  "lint:fix": "yarn lint --fix"
53
53
  },
54
54
  "dependencies": {
55
- "@gitbeaker/requester-utils": "^42.3.0",
55
+ "@gitbeaker/requester-utils": "^42.4.1",
56
56
  "qs": "^6.12.2",
57
57
  "xcase": "^2.0.1"
58
58
  },
@@ -63,5 +63,5 @@
63
63
  "tsx": "^4.16.2",
64
64
  "typescript": "^5.5.3"
65
65
  },
66
- "gitHead": "96753b28be73cef0a9abe230e3650f4ceb1f9168"
66
+ "gitHead": "30dbcfbc2144c64c277e5845178f04d295ba2be5"
67
67
  }